![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Waveform. More...
#include <ecvWaveform.h>
Public Member Functions | |
| ccWaveform (uint8_t descriptorID=0) | |
| Default constructor. More... | |
| ~ccWaveform () override=default | |
| Destructor. More... | |
| uint8_t | descriptorID () const |
| Returns the associated descriptor (ID) More... | |
| void | setDescriptorID (uint8_t id) |
| Sets the associated descriptor (ID) More... | |
| void | setDataDescription (uint64_t dataOffset, uint32_t byteCount) |
| Describes the waveform data. More... | |
| uint32_t | getRawSample (uint32_t i, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const |
| Returns the (raw) value of a given sample. More... | |
| double | getSample (uint32_t i, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const |
| Returns the (real) value of a given sample (in volts) More... | |
| double | getRange (double &minVal, double &maxVal, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const |
| Returns the range of (real) samples. More... | |
| bool | decodeSamples (std::vector< double > &values, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const |
| Decodes the samples and store them in a vector. More... | |
| bool | toASCII (const QString &filename, const WaveformDescriptor &descriptor, const uint8_t *dataStorage) const |
| Exports (real) samples to an ASCII file. More... | |
| CCVector3 | getSamplePos (float i, const CCVector3 &P0, const WaveformDescriptor &descriptor) const |
| Returns the sample position in 3D. More... | |
| uint32_t | byteCount () const |
| Returns the number of allocated bytes. More... | |
| uint64_t | dataOffset () const |
| Returns the byte offset to waveform data. More... | |
| void | setDataOffset (uint64_t offset) |
| Sets the byte offset to waveform data. More... | |
| const uint8_t * | data (const uint8_t *dataStorage) const |
| Gives access to the internal data. More... | |
| void | setBeamDir (const CCVector3f &dir) |
| Sets the beam direction. More... | |
| const CCVector3f & | beamDir () const |
| Returns the beam direction. More... | |
| void | setEchoTime_ps (float time_ps) |
| Set the echo time (in picoseconds) More... | |
| float | echoTime_ps () const |
| Returns the echo time (in picoseconds) More... | |
| void | applyRigidTransformation (const ccGLMatrix &trans) |
| Applies a rigid transformation (on the beam direction) More... | |
| uint8_t | returnIndex () const |
| Returns the return index. More... | |
| void | setReturnIndex (uint8_t index) |
| Sets the return index. More... | |
| bool | isSerializable () const override |
| Returns whether object is serializable of not. More... | |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. 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. 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. More... | |
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. More... | |
| 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. More... | |
Additional Inherited Members | |
Public Types inherited from ccSerializableObject | |
| enum | DeserializationFlags { DF_POINT_COORDS_64_BITS, 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) More... | |
Waveform.
| ccWaveform::ccWaveform | ( | uint8_t | descriptorID = 0 | ) |
Default constructor.
|
overridedefault |
Destructor.
| void ccWaveform::applyRigidTransformation | ( | const ccGLMatrix & | trans | ) |
Applies a rigid transformation (on the beam direction)
References ccGLMatrixTpl< T >::applyRotation(), Vector3Tpl< float >::fromArray(), Vector3Tpl< PointCoordinateType >::fromArray(), m_beamDir, and Tuple3Tpl< Type >::u.
Referenced by define_ccWaveform().
|
inline |
Returns the beam direction.
Referenced by define_ccWaveform(), LasWaveformSaver::handlePoint(), and LASFWFFilter::saveToFile().
|
inline |
Returns the number of allocated bytes.
Referenced by ccPointCloud::append(), define_ccWaveform(), LasWaveformSaver::handlePoint(), LASFWFFilter::saveToFile(), setDataDescription(), and ccPointCloud::waveformProxy().
|
inline |
Gives access to the internal data.
Referenced by getRawSample().
|
inline |
Returns the byte offset to waveform data.
Referenced by ccPointCloud::append(), define_ccWaveform(), LasWaveformSaver::handlePoint(), LASFWFFilter::saveToFile(), setDataDescription(), and ccPointCloud::waveformProxy().
| bool ccWaveform::decodeSamples | ( | std::vector< double > & | values, |
| const WaveformDescriptor & | descriptor, | ||
| const uint8_t * | dataStorage | ||
| ) | const |
Decodes the samples and store them in a vector.
References getSample(), and WaveformDescriptor::numberOfSamples.
Referenced by toASCII().
|
inline |
Returns the associated descriptor (ID)
Referenced by ccPointCloud::append(), define_ccWaveform(), LasWaveformSaver::handlePoint(), ccPointCloud::partialClone(), ccPointCloud::SelectByIndex(), and ccPointCloud::waveformProxy().
|
inline |
Returns the echo time (in picoseconds)
Referenced by define_ccWaveform(), LasWaveformSaver::handlePoint(), and LASFWFFilter::saveToFile().
|
overridevirtual |
Loads data from binary stream.
| in | input file (already opened) |
| dataVersion | file version (for version-specific deserialization) |
| flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
| oldToNewIDMap | map to link old IDs with new IDs |
Note: When implementing, use dataVersion checks to handle differentversions:
Reimplemented from ccSerializableObject.
| double ccWaveform::getRange | ( | double & | minVal, |
| double & | maxVal, | ||
| const WaveformDescriptor & | descriptor, | ||
| const uint8_t * | dataStorage | ||
| ) | const |
Returns the range of (real) samples.
References getSample(), and WaveformDescriptor::numberOfSamples.
| uint32_t ccWaveform::getRawSample | ( | uint32_t | i, |
| const WaveformDescriptor & | descriptor, | ||
| const uint8_t * | dataStorage | ||
| ) | const |
Returns the (raw) value of a given sample.
References WaveformDescriptor::bitsPerSample, data(), and m_byteCount.
Referenced by define_ccWaveform(), and getSample().
| double ccWaveform::getSample | ( | uint32_t | i, |
| const WaveformDescriptor & | descriptor, | ||
| const uint8_t * | dataStorage | ||
| ) | const |
Returns the (real) value of a given sample (in volts)
References WaveformDescriptor::digitizerGain, WaveformDescriptor::digitizerOffset, and getRawSample().
Referenced by decodeSamples(), and getRange().
| CCVector3 ccWaveform::getSamplePos | ( | float | i, |
| const CCVector3 & | P0, | ||
| const WaveformDescriptor & | descriptor | ||
| ) | const |
Returns the sample position in 3D.
References Vector3Tpl< PointCoordinateType >::fromArray(), m_beamDir, m_echoTime_ps, WaveformDescriptor::samplingRate_ps, and Tuple3Tpl< Type >::u.
Referenced by define_ccWaveform().
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSerializableObject.
|
overridevirtual |
Returns the minimum file version required to save this instance.
To be overridden by subclasses to indicate their minimum required version. This enables the system to determine:
Implements ccSerializableObject.
References m_returnIndex.
|
inline |
Returns the return index.
Referenced by define_ccWaveform(), and LASFWFFilter::saveToFile().
|
inline |
Sets the beam direction.
Referenced by define_ccWaveform(), LASFWFFilter::loadFile(), and LasWaveformLoader::loadWaveform().
| void ccWaveform::setDataDescription | ( | uint64_t | dataOffset, |
| uint32_t | byteCount | ||
| ) |
Describes the waveform data.
References byteCount(), dataOffset(), m_byteCount, and m_dataOffset.
Referenced by ccPointCloud::append(), define_ccWaveform(), LASFWFFilter::loadFile(), and LasWaveformLoader::loadWaveform().
|
inline |
|
inline |
Sets the associated descriptor (ID)
Referenced by ccPointCloud::append(), define_ccWaveform(), LASFWFFilter::loadFile(), and LasWaveformLoader::loadWaveform().
|
inline |
Set the echo time (in picoseconds)
Referenced by define_ccWaveform(), LASFWFFilter::loadFile(), and LasWaveformLoader::loadWaveform().
|
inline |
Sets the return index.
Referenced by define_ccWaveform(), LASFWFFilter::loadFile(), and LasWaveformLoader::loadWaveform().
| bool ccWaveform::toASCII | ( | const QString & | filename, |
| const WaveformDescriptor & | descriptor, | ||
| const uint8_t * | dataStorage | ||
| ) | const |
Exports (real) samples to an ASCII file.
References decodeSamples(), filename, WaveformDescriptor::numberOfSamples, WaveformDescriptor::samplingRate_ps, ToASCII(), and CVLog::Warning().
Referenced by define_ccWaveform().
|
static |
Helper: exports a series of values as an ASCII file.
References QtCompat::endl(), filename, CVLog::Print(), and CVLog::Warning().
Referenced by define_ccWaveform(), and toASCII().
|
overridevirtual |
Saves data to binary stream.
| out | output file (already opened) |
| dataVersion | target file version (for forward/backward compatibility) |
Reimplemented from ccSerializableObject.
|
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)
Referenced by applyRigidTransformation(), and getSamplePos().
|
protected |
Waveform packet size in bytes.
Referenced by getRawSample(), and setDataDescription().
|
protected |
Byte offset to waveform data.
Referenced by setDataDescription().
|
protected |
Wave Packet descriptor index.
|
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.
Referenced by getSamplePos().
|
protected |
Return index.
Referenced by minimumFileVersion().