24 m_rigidTransformation(sensor.m_rigidTransformation),
25 m_activeIndex(sensor.m_activeIndex),
26 m_color(sensor.m_color),
27 m_scale(sensor.m_scale) {
44 }
catch (
const std::bad_alloc&) {
74 minIndex = maxIndex = 0;
94 "[ccSensor::getActiveAbsoluteTransformation] Failed to get a "
95 "valid transformation for active index!");
124 assert(out.isOpen() && (out.openMode() & QIODevice::WriteOnly));
125 if (dataVersion < 35) {
136 QDataStream outStream(&out);
148 uint32_t bufferUniqueID =
150 if (out.write((
const char*)&bufferUniqueID, 4) < 0)
return WriteError();
156 short minVersion = std::max(
static_cast<short>(35),
169 if (dataVersion < 34)
return false;
176 QDataStream inStream(&in);
189 uint32_t bufferUniqueID = 0;
190 if (in.read((
char*)&bufferUniqueID, 4) < 0)
return ReadError();
200 CVLog::Warning(
"[ccSensor::applyViewport] Unhandled sensor type!");
constexpr PointCoordinateType PC_ONE
'1' as a PointCoordinateType value
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
virtual void setVisible(bool state)
Sets entity visibility.
Vector3Tpl< T > getTranslationAsVec3D() const
Returns a copy of the translation as a CCVector3.
bool fromFile(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads data from binary stream.
bool toFile(QFile &out, short dataVersion) const override
Saves data to binary stream.
void setTranslation(const Vector3Tpl< float > &Tr)
Sets translation (float version)
short minimumFileVersion() const override
Returns the minimum file version required to save this instance.
virtual void toIdentity()
Sets matrix to identity.
Float version of ccGLMatrixTpl.
Hierarchical CLOUDVIEWER Object.
virtual short minimumFileVersion_MeOnly() const
virtual bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
Loads own object data.
int getIndex() const
Returns index relatively to its parent or -1 if no parent.
virtual bool toFile_MeOnly(QFile &out, short dataVersion) const
Save own object data.
QString getViewId() const
virtual void applyGLTransformation(const ccGLMatrix &trans)
Applies a GL transformation to the entity.
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
virtual unsigned getUniqueID() const
Returns object unique ID.
virtual void setEnabled(bool state)
Sets the "enabled" property.
Generic sensor interface.
short minimumFileVersion_MeOnly() const override
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
PointCoordinateType m_scale
Sensor graphic representation scale.
virtual void hideShowDrawings(CC_DRAW_CONTEXT &context)
ccSensor(QString name)
Default constructor.
virtual void applyGLTransformation(const ccGLMatrix &trans) override
Applies a GL transformation to the entity.
virtual bool applyViewport()
Apply sensor 'viewport' to a 3D view.
bool addPosition(ccGLMatrix &trans, double index)
Adds a new position (shortcut)
bool getActiveAbsoluteCenter(CCVector3 &vec) const
Gets currently active absolute position.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
virtual void clearDrawings()
ccIndexedTransformationBuffer * m_posBuffer
Positions buffer (optional)
ccGLMatrix m_rigidTransformation
Rigid transformation between this sensor and its associated positions.
double m_activeIndex
Active index (for displayed position, etc.)
bool getAbsoluteTransformation(ccIndexedTransformation &trans, double index) const
void getIndexBounds(double &minIndex, double &maxIndex) const
Gets index boundaries (shortcut)
bool getActiveAbsoluteTransformation(ccIndexedTransformation &trans) const
Gets currently active absolute transformation.
ecvColor::Rgb m_color
Color of the sensor.
bool getActiveAbsoluteRotation(ccGLMatrix &rotation) const
Gets currently active rotation matrix (without translation)
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
static bool ReadError()
Sends a custom error message (read error) and returns 'false'.
static bool WriteError()
Sends a custom error message (write error) and returns 'false'.
static void CoordsFromDataStream(QDataStream &stream, int flags, PointCoordinateType *out, unsigned count=1)
unsigned char ColorCompType
Default color components type (R,G and B)
constexpr Rgb green(0, MAX, 0)