qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ccWaveform Class Reference

Waveform. More...

#include <ccWaveform.h>

Inheritance diagram for ccWaveform:
Inheritance graph
[legend]
Collaboration diagram for ccWaveform:
Collaboration graph
[legend]

Public Member Functions

 ccWaveform (uint8_t descriptorID=0)
 Default constructor.
 
 ~ccWaveform () override=default
 Destructor.
 
uint8_t descriptorID () const
 Returns the associated descriptor (ID) More...
 
void setDescriptorID (uint8_t id)
 Sets the associated descriptor (ID)
 
void setDataDescription (uint64_t dataOffset, uint32_t byteCount)
 Describes the waveform data.
 
uint32_t getRawSample (uint32_t i, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const
 Returns the (raw) value of a given sample.
 
double getSample (uint32_t i, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const
 Returns the (real) value of a given sample (in volts)
 
double getRange (double &minVal, double &maxVal, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const
 Returns the range of (real) samples.
 
bool decodeSamples (std::vector< double > &values, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const
 Decodes the samples and store them in a vector.
 
bool toASCII (const QString &filename, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const
 Exports (real) samples to an ASCII file.
 
CCVector3 getSamplePos (float i, const CCVector3 &P0, const WaveformDescriptor &descriptor) const
 Returns the sample position in 3D.
 
uint32_t byteCount () const
 Returns the number of allocated bytes.
 
uint64_t dataOffset () const
 Returns the byte offset to waveform data.
 
void setDataOffset (uint64_t offset)
 Sets the byte offset to waveform data.
 
const uint8_t * data (const uint8_t *dataStorage) const
 Gives access to the internal data.
 
void setBeamDir (const CCVector3f &dir)
 Sets the beam direction.
 
const CCVector3f & beamDir () const
 Returns the beam direction.
 
void setEchoTime_ps (float time_ps)
 Set the echo time (in picoseconds)
 
float echoTime_ps () const
 Returns the echo time (in picoseconds)
 
void applyRigidTransformation (const ccGLMatrix &trans)
 Applies a rigid transformation (on the beam direction)
 
uint8_t returnIndex () const
 Returns the return index.
 
void setReturnIndex (uint8_t index)
 Sets the return index.
 
bool isSerializable () const override
 Returns whether object is serializable of not. More...
 
bool toFile (QFile &out) const override
 Saves data to binary stream. More...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads data from binary stream. More...
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()=default
 Destructor.
 
virtual bool isSerializable () const
 Returns whether object is serializable of not. More...
 
virtual bool toFile (QFile &out) const
 Saves data to binary stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
 Loads data from binary stream. More...
 

Static Public Member Functions

static bool ToASCII (const QString &filename, std::vector< double > &values, uint32_t samplingRate_ps)
 Helper: exports a series of values as an ASCII file.
 
- Static Public Member Functions inherited from ccSerializableObject
static bool WriteError ()
 Sends a custom error message (write error) and returns 'false'. More...
 
static bool ReadError ()
 Sends a custom error message (read error) and returns 'false'. More...
 
static bool MemoryError ()
 Sends a custom error message (not enough memory) and returns 'false'. More...
 
static bool CorruptError ()
 Sends a custom error message (corrupted file) and returns 'false'. More...
 

Protected Attributes

uint32_t m_byteCount
 Waveform packet size in bytes. More...
 
uint64_t m_dataOffset
 Byte offset to waveform data.
 
CCVector3f m_beamDir
 Laser beam direction. More...
 
float m_echoTime_ps
 Return Point location (in picoseconds) More...
 
uint8_t m_descriptorID
 Wave Packet descriptor index. More...
 
uint8_t m_returnIndex
 Return index.
 

Additional Inherited Members

- Public Types inherited from ccSerializableObject
enum  DeserializationFlags { DF_POINT_COORDS_64_BITS = 1 , DF_SCALAR_VAL_32_BITS = 2 }
 Deserialization flags (bit-field) More...
 
typedef QMultiMap< unsigned, unsigned > LoadedIDMap
 Map of loaded unique IDs (old ID --> new ID)
 

Detailed Description

Waveform.

Warning
Waveforms do not own their data!

Member Function Documentation

◆ descriptorID()

uint8_t ccWaveform::descriptorID ( ) const
inline

Returns the associated descriptor (ID)

Warning
A value of zero indicates that there is no associated waveform data.

◆ fromFile()

bool ccWaveform::fromFile ( QFile &  in,
short  dataVersion,
int  flags,
LoadedIDMap oldToNewIDMap 
)
overridevirtual

Loads data from binary stream.

Parameters
ininput file (already opened)
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
oldToNewIDMapmap to link old IDs with new IDs
Returns
success

Reimplemented from ccSerializableObject.

◆ isSerializable()

bool ccWaveform::isSerializable ( ) const
inlineoverridevirtual

Returns whether object is serializable of not.

Reimplemented from ccSerializableObject.

◆ toFile()

bool ccWaveform::toFile ( QFile &  out) const
overridevirtual

Saves data to binary stream.

Parameters
outoutput file (already opened)
Returns
success

Reimplemented from ccSerializableObject.

Member Data Documentation

◆ m_beamDir

CCVector3f ccWaveform::m_beamDir
protected

Laser beam direction.

Parametric line equation for extrapolating points along the associated waveform: X = X0 + X(t) Y = Y0 + Y(t) Z = Z0 + Z(t)

◆ m_byteCount

uint32_t ccWaveform::m_byteCount
protected

Waveform packet size in bytes.

Warning
Not necessarily equal to the number of samples!

◆ m_descriptorID

uint8_t ccWaveform::m_descriptorID
protected

Wave Packet descriptor index.

Warning
A value of zero indicates that there is no associated waveform data.

◆ m_echoTime_ps

float ccWaveform::m_echoTime_ps
protected

Return Point location (in picoseconds)

The offset in picoseconds from the first digitized value to the location within the waveform packet that the associated return pulse was detected.


The documentation for this class was generated from the following files: