|
qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
|
Generic "CloudCompare Object" template. More...
#include <ccObject.h>


Public Member Functions | |
| ccObject (const QString &name=QString(), unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID) | |
| Default constructor. More... | |
| ccObject (const ccObject &object) | |
| Copy constructor. | |
| virtual CC_CLASS_ENUM | getClassID () const =0 |
| Returns class ID. More... | |
| virtual QString | getName () const |
| Returns object name. More... | |
| virtual void | setName (const QString &name) |
| Sets object name. | |
| virtual unsigned | getUniqueID () const |
| Returns object unique ID. | |
| virtual void | setUniqueID (unsigned ID) |
| Changes unique ID. More... | |
| virtual bool | isEnabled () const |
| Returns whether the object is enabled or not. More... | |
| virtual void | setEnabled (bool state) |
| Sets the "enabled" property. More... | |
| virtual void | toggleActivation () |
| Toggles the "enabled" property. | |
| virtual bool | isLocked () const |
| Returns whether the object is locked or not. More... | |
| virtual void | setLocked (bool state) |
| Sets the "enabled" property. More... | |
| bool | isLeaf () const |
| bool | isCustom () const |
| bool | isHierarchy () const |
| bool | isKindOf (CC_CLASS_ENUM type) const |
| bool | isA (CC_CLASS_ENUM type) const |
| QVariant | getMetaData (const QString &key) const |
| Returns a given associated meta data. More... | |
| bool | removeMetaData (const QString &key) |
| Removes a given associated meta-data. More... | |
| void | setMetaData (const QString &key, const QVariant &data) |
| Sets a meta-data element. More... | |
| void | setMetaData (const QVariantMap &dataset, bool overwrite=false) |
| Sets several meta-data elements at a time. More... | |
| bool | hasMetaData (const QString &key) const |
| Returns whether a meta-data element with the given key exists or not. More... | |
| const QVariantMap & | metaData () const |
| Returns meta-data map (const only) | |
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 unsigned | GetCurrentDBVersion () |
| Returns current database version. | |
| static void | SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator) |
| Sets the unique ID generator. | |
| static ccUniqueIDGenerator::Shared | GetUniqueIDGenerator () |
| Returns the unique ID generator. | |
| static unsigned | GetNextUniqueID () |
| Returns a new unassigned unique ID. More... | |
| static unsigned | GetLastUniqueID () |
| Returns last assigned unique ID. More... | |
| static CC_CLASS_ENUM | ReadClassIDFromFile (QFile &in, short dataVersion) |
| Helper: reads out class ID from a binary stream. 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 Member Functions | |
| virtual bool | getFlagState (CC_OBJECT_FLAG flag) const |
| Returns flag state. | |
| virtual void | setFlagState (CC_OBJECT_FLAG flag, bool state) |
| Sets flag state. More... | |
| bool | toFile (QFile &out) const override |
| Saves data to binary stream. More... | |
| bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Reimplemented from ccSerializableObject::fromFile. More... | |
Protected Attributes | |
| QString | m_name |
| Object name. | |
| unsigned | m_flags |
| Object flags. | |
| QVariantMap | m_metaData |
| Associated meta-data. | |
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) | |
Generic "CloudCompare Object" template.
| ccObject::ccObject | ( | const QString & | name = QString(), |
| unsigned | uniqueID = ccUniqueIDGenerator::InvalidUniqueID |
||
| ) |
Default constructor.
| name | object name (optional) |
| uniqueID | unique ID (handle with care! Will be auto generated if equal to ccUniqueIDGenerator::InvalidUniqueID) |
|
overrideprotectedvirtual |
Reimplemented from ccSerializableObject::fromFile.
Be sure to call ccObject::ReadClassIDFromFile (once) before calling this method, as the classID is voluntarily skipped (in order to let the user instantiate the object first)
Reimplemented from ccSerializableObject.
|
pure virtual |
Returns class ID.
Implemented in cc2DLabel, cc2DViewportLabel, cc2DViewportObject, NormsIndexesTableType, NormsTableType, ColorsTableType, RGBAColorsTableType, TextureCoordsContainer, ccArray< Type, N, ComponentType >, ccArray< ccColor::Rgb, 3, ColorCompType >, ccArray< CompressedNormType, 1, CompressedNormType >, ccArray< CCVector3, 3, PointCoordinateType >, ccArray< ccColor::Rgba, 4, ColorCompType >, ccArray< TexCoords2D, 2, float >, ccBox, ccCameraSensor, ccClipBox, ccCone, ccCoordinateSystem, ccCustomHObject, ccCustomLeafObject, ccCylinder, ccDish, ccExtru, ccFacet, ccGBLSensor, ccGenericPrimitive, ccHObject, ccImage, ccIndexedTransformationBuffer, ccKdTree, ccMaterialSet, ccMesh, ccMeshGroup, ccOctreeProxy, ccPlane, ccPolyline, ccQuadric, ccSensor, ccSphere, ccSubMesh, and ccTorus.
|
static |
Returns last assigned unique ID.
Unique IDs are handled with persistent settings in order to assure consistency between main app and plugins!
| QVariant ccObject::getMetaData | ( | const QString & | key | ) | const |
Returns a given associated meta data.
| key | meta data unique identifier (case sensitive) |
|
inlinevirtual |
Returns object name.
Reimplemented in cc2DLabel.
|
static |
Returns a new unassigned unique ID.
Unique IDs are handled with persistent settings in order to assure consistency between main app and plugins!
| bool ccObject::hasMetaData | ( | const QString & | key | ) | const |
Returns whether a meta-data element with the given key exists or not.
| key | meta-data unique identifier (case sensitive) |
|
inlinevirtual |
Returns whether the object is enabled or not.
Shortcut to access flag CC_ENABLED
|
inlinevirtual |
Returns whether the object is locked or not.
Shortcut to access flag CC_LOCKED
|
static |
Helper: reads out class ID from a binary stream.
Must be called before 'fromFile'!
| bool ccObject::removeMetaData | ( | const QString & | key | ) |
Removes a given associated meta-data.
| key | meta-data unique identifier (case sensitive) |
|
inlinevirtual |
Sets the "enabled" property.
Shortcut to modify flag CC_ENABLED
|
protectedvirtual |
Sets flag state.
| flag | object flag to set |
| state | flag state |
|
inlinevirtual |
Sets the "enabled" property.
Shortcut to modify flag CC_LOCKED
| void ccObject::setMetaData | ( | const QString & | key, |
| const QVariant & | data | ||
| ) |
Sets a meta-data element.
| key | meta-data unique identifier (case sensitive) |
| data | data |
| void ccObject::setMetaData | ( | const QVariantMap & | dataset, |
| bool | overwrite = false |
||
| ) |
Sets several meta-data elements at a time.
| dataset | meta-data set |
| overwrite | whether existing meta-data elements should be replaced by the input ones (with the same key) or not |
|
virtual |
Changes unique ID.
|
overrideprotectedvirtual |
Saves data to binary stream.
| out | output file (already opened) |
Reimplemented from ccSerializableObject.