qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ccObject Class Referenceabstract

Generic "CloudCompare Object" template. More...

#include <ccObject.h>

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

Public Member Functions

 ccObject (QString name=QString())
 Default constructor. More...
 
virtual CC_CLASS_ENUM getClassID () const =0
 Returns class ID.
 
virtual QString getName () const
 Returns object name.
 
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 bool isLocked () const
 Returns whether the object is locked or not. More...
 
virtual void setLocked (bool state)
 Sets the "enabled" property. More...
 
bool isGroup () const
 
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 (QString key) const
 Returns a given associated meta data. More...
 
bool removeMetaData (QString key)
 Removes a given associated meta data. More...
 
void setMetaData (QString key, QVariant data)
 Sets a meta data element. More...
 
bool hasMetaData (QString key)
 Says if a metadata 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 ()
 Desctructor.
 
virtual bool isSerializable () const
 Returns whether object is serializable of not.
 

Static Public Member Functions

static unsigned GetCurrentDBVersion ()
 Returns current database version.
 
static void ResetUniqueIDCounter ()
 Resets the object's unique ID counter. More...
 
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...
 
virtual bool toFile (QFile &out) const
 Saves data to binay stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags)
 Reimplemented from ccSerializableObject::fromFile. More...
 

Static Protected Member Functions

static void UpdateLastUniqueID (unsigned lastID)
 Sets last assigned unique ID. 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...
 

Detailed Description

Generic "CloudCompare Object" template.

Constructor & Destructor Documentation

ccObject::ccObject ( QString  name = QString())

Default constructor.

Parameters
nameobject name (optional)

Member Function Documentation

bool ccObject::fromFile ( QFile &  in,
short  dataVersion,
int  flags 
)
protectedvirtual

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.

Reimplemented in ccHObject, and ccCustomHObject.

unsigned ccObject::GetLastUniqueID ( )
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 ( QString  key) const

Returns a given associated meta data.

Parameters
keymeta data unique identifier (case sensitive!)
Returns
meta data (if any) or an invalid QVariant
unsigned ccObject::GetNextUniqueID ( )
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 ( QString  key)

Says if a metadata with the given key exists or not.

Parameters
keyis the key to look for
Returns
true, if exists
virtual bool ccObject::isEnabled ( ) const
inlinevirtual

Returns whether the object is enabled or not.

Shortcut to access flag CC_ENABLED

virtual bool ccObject::isLocked ( ) const
inlinevirtual

Returns whether the object is locked or not.

Shortcut to access flag CC_LOCKED

CC_CLASS_ENUM ccObject::ReadClassIDFromFile ( QFile &  in,
short  dataVersion 
)
static

Helper: reads out class ID from a binary stream.

Must be called before 'fromFile'!

bool ccObject::removeMetaData ( QString  key)

Removes a given associated meta data.

Parameters
keymeta data unique identifier (case sensitive!)
Returns
success
void ccObject::ResetUniqueIDCounter ( )
static

Resets the object's unique ID counter.

Warning: should be called only once, on program startup.

virtual void ccObject::setEnabled ( bool  state)
inlinevirtual

Sets the "enabled" property.

Shortcut to modify flag CC_ENABLED

void ccObject::setFlagState ( CC_OBJECT_FLAG  flag,
bool  state 
)
protectedvirtual

Sets flag state.

Parameters
flagobject flag to set
stateflag state
virtual void ccObject::setLocked ( bool  state)
inlinevirtual

Sets the "enabled" property.

Shortcut to modify flag CC_LOCKED

void ccObject::setMetaData ( QString  key,
QVariant  data 
)

Sets a meta data element.

Parameters
keymeta data unique identifier (case sensitive!)
datadata
void ccObject::setUniqueID ( unsigned  ID)
virtual

Changes unique ID.

WARNING: HANDLE WITH CARE! Updates persistent settings (last unique ID) if necessary.

bool ccObject::toFile ( QFile &  out) const
protectedvirtual

Saves data to binay stream.

Parameters
outoutput file (already opened)
Returns
success

Reimplemented from ccSerializableObject.

Reimplemented in ccHObject.

void ccObject::UpdateLastUniqueID ( unsigned  lastID)
staticprotected

Sets last assigned unique ID.

Unique IDs are handled with persistent settings in order to assure consistency between main app and plugins!


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