qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
|
Hierarchical CloudCompare Object. More...
#include <ccHObject.h>
Public Types | |
enum | DEPENDENCY_FLAGS { DP_NONE = 0 , DP_NOTIFY_OTHER_ON_DELETE = 1 , DP_NOTIFY_OTHER_ON_UPDATE = 2 , DP_DELETE_OTHER = 8 , DP_PARENT_OF_OTHER = 24 } |
Dependency flags. More... | |
enum | SelectionBehavior { SELECTION_AA_BBOX , SELECTION_FIT_BBOX , SELECTION_IGNORED } |
Behavior when selected. | |
using | Container = std::vector< ccHObject * > |
Standard instances container (for children, etc.) | |
using | Shared = QSharedPointer< ccHObject > |
Shared pointer. | |
using | SharedContainer = std::vector< Shared > |
Shared instances container (for children, etc.) | |
using | GlobalBoundingBox = CCCoreLib::BoundingBoxTpl< double > |
Global (non-shifted) bounding-box. | |
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) | |
Public Member Functions | |
ccHObject (const QString &name=QString(), unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID) | |
Default constructor. More... | |
ccHObject (const ccHObject &object) | |
Copy constructor. | |
~ccHObject () override | |
Default destructor. | |
CC_CLASS_ENUM | getClassID () const override |
Returns class ID. More... | |
bool | isGroup () const |
Returns whether the instance is a group. | |
ccHObject * | getParent () const |
Returns parent object. More... | |
virtual QIcon | getIcon () const |
Returns the icon associated to this entity. More... | |
void | addDependency (ccHObject *otherObject, int flags, bool additive=true) |
Adds a new dependence (additive or not) More... | |
int | getDependencyFlagsWith (const ccHObject *otherObject) const |
Returns the dependency flags with a given object. More... | |
void | removeDependencyWith (ccHObject *otherObject) |
Removes any dependency flags with a given object. More... | |
void | removeDependencyFlag (ccHObject *otherObject, DEPENDENCY_FLAGS flag) |
Removes a given dependency flag. More... | |
virtual bool | addChild (ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1) |
Adds a child. More... | |
unsigned | getChildrenNumber () const |
Returns the number of children. More... | |
unsigned int | getChildCountRecursive () const |
Returns the total number of children under this object recursively. More... | |
ccHObject * | getChild (unsigned childPos) const |
Returns the ith child. More... | |
ccHObject * | find (unsigned uniqueID) const |
Finds an entity in this object hierarchy. More... | |
unsigned | filterChildren (Container &filteredChildren, bool recursive=false, CC_CLASS_ENUM filter=CC_TYPES::OBJECT, bool strict=false, ccGenericGLDisplay *inDisplay=nullptr) const |
Collects the children corresponding to a certain pattern. More... | |
void | detachChild (ccHObject *child) |
Detaches a specific child. More... | |
void | detachAllChildren () |
Removes a specific child. More... | |
void | removeChild (ccHObject *child) |
void | removeChild (int pos) |
Removes a specific child given its index. More... | |
void | removeAllChildren () |
Removes all children. | |
int | getChildIndex (const ccHObject *aChild) const |
Returns child index. | |
void | swapChildren (unsigned firstChildIndex, unsigned secondChildIndex) |
Swaps two children. | |
int | getIndex () const |
Returns index relatively to its parent or -1 if no parent. | |
void | transferChild (ccHObject *child, ccHObject &newParent) |
Transfer a given child to another parent. | |
void | transferChildren (ccHObject &newParent, bool forceFatherDependent=false) |
Transfer all children to another parent. | |
ccHObject * | getFirstChild () const |
Shortcut: returns first child. | |
ccHObject * | getLastChild () const |
Shortcut: returns last child. | |
bool | isAncestorOf (const ccHObject *anObject) const |
Returns true if the current object is an ancestor of the specified one. | |
virtual ccBBox | getOwnBB (bool withGLFeatures=false) |
Returns the entity's own bounding-box (with local/shifted coordinates) More... | |
virtual ccBBox | getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true) |
Returns the local bounding-box of this entity and it's children. More... | |
virtual GlobalBoundingBox | getOwnGlobalBB (bool withGLFeatures=false) |
Returns the entity's own global bounding-box (with global/non-shifted coordinates - if relevant) More... | |
virtual bool | getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner) |
Returns the entity's own global bounding-box (with global/non-shifted coordinates - if relevant) More... | |
virtual GlobalBoundingBox | getGlobalBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true) |
Returns the global bounding-box of this entity and it's children. More... | |
virtual ccBBox | getDisplayBB_recursive (bool relative, const ccGenericGLDisplay *display=nullptr) |
Returns the bounding-box of this entity and it's children WHEN DISPLAYED. More... | |
virtual ccBBox | getOwnFitBB (ccGLMatrix &trans) |
Returns best-fit bounding-box (if available) More... | |
virtual void | drawBB (CC_DRAW_CONTEXT &context, const ccColor::Rgb &col) |
Draws the entity (and its children) bounding-box. More... | |
void | draw (CC_DRAW_CONTEXT &context) override |
Draws entity and its children. More... | |
bool | getAbsoluteGLTransformation (ccGLMatrix &trans) const |
Returns the absolute transformation (i.e. the actual displayed GL transformation) of an entity. More... | |
virtual bool | isDisplayed () const |
Returns whether the object is actually displayed (visible) or not. | |
virtual bool | isDisplayedIn (const ccGenericGLDisplay *display) const |
Returns whether the object is actually displayed (visible) in a given display or not. | |
virtual bool | isBranchEnabled () const |
Returns whether the object and all its ancestors are enabled. | |
ccHObject_recursive_call1 (setSelected, bool, setSelected_recursive) ccHObject_recursive_call1(setDisplay | |
ccGenericGLDisplay setDisplay_recursive | ccHObject_recursive_call1 (removeFromDisplay, ccGenericGLDisplay *, removeFromDisplay_recursive) ccHObject_recursive_call0(prepareDisplayForRefresh |
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive | ccHObject_recursive_call1 (refreshDisplay, bool, refreshDisplay_recursive) ccHObject_recursive_call0(resetGLTransformationHistory |
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive | ccHObject_recursive_call0 (toggleActivation, toggleActivation_recursive) ccHObject_recursive_call0(toggleVisibility |
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive | ccHObject_recursive_call0 (toggleColors, toggleColors_recursive) ccHObject_recursive_call0(toggleNormals |
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive | ccHObject_recursive_call0 (toggleSF, toggleSF_recursive) ccHObject_recursive_call0(toggleShowName |
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive toggleShowName_recursive | ccHObject_recursive_call0 (toggleMaterials, toggleMaterials_recursive) inline virtual void transferDisplay(ccGenericGLDisplay *oldDisplay |
Transfers the entity from one display to the other. | |
void | applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr) |
Applies the active OpenGL transformation to the entity (recursive) More... | |
virtual void | notifyGeometryUpdate () |
Notifies all dependent entities that the geometry of this entity has changed. | |
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... | |
bool | fromFileNoChildren (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
Custom version of ccSerializableObject::fromFile. More... | |
virtual bool | isShareable () const |
Returns whether object is shareable or not. More... | |
virtual void | setSelectionBehavior (SelectionBehavior mode) |
Sets selection behavior (when displayed) More... | |
virtual SelectionBehavior | getSelectionBehavior () const |
Returns selection behavior. | |
virtual unsigned | getUniqueIDForDisplay () const |
Returns object unique ID used for display. More... | |
virtual const ccGLMatrix & | getGLTransformationHistory () const |
Returns the transformation 'history' matrix. More... | |
virtual void | setGLTransformationHistory (const ccGLMatrix &mat) |
Sets the transformation 'history' matrix (handle with care!) | |
virtual void | resetGLTransformationHistory () |
Resets the transformation 'history' matrix. | |
bool | pushDisplayState () override |
Pushes the current display state (overridden) More... | |
void | popDisplayState (bool apply=true) override |
Pops the last pushed display state (overridden) More... | |
Public Member Functions inherited from ccObject | |
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... | |
Public Member Functions inherited from ccDrawableObject | |
ccDrawableObject () | |
Default constructor. | |
ccDrawableObject (const ccDrawableObject &object) | |
Copy constructor. | |
virtual void | draw (CC_DRAW_CONTEXT &context)=0 |
Draws entity and its children. More... | |
virtual bool | isVisible () const |
Returns whether entity is visible or not. | |
virtual void | setVisible (bool state) |
Sets entity visibility. | |
virtual void | toggleVisibility () |
Toggles visibility. | |
virtual bool | isVisibilityLocked () const |
Returns whether visibility is locked or not. | |
virtual void | lockVisibility (bool state) |
Locks/unlocks visibility. More... | |
virtual bool | isSelected () const |
Returns whether entity is selected or not. | |
virtual void | setSelected (bool state) |
Selects/unselects entity. | |
virtual void | getDrawingParameters (glDrawParams ¶ms) const |
Returns main OpenGL parameters for this entity. More... | |
virtual bool | hasColors () const |
Returns whether colors are enabled or not. More... | |
virtual bool | colorsShown () const |
Returns whether colors are shown or not. | |
virtual void | showColors (bool state) |
Sets colors visibility. | |
virtual void | toggleColors () |
Toggles colors display state. | |
virtual bool | hasNormals () const |
Returns whether normals are enabled or not. More... | |
virtual bool | normalsShown () const |
Returns whether normals are shown or not. More... | |
virtual void | showNormals (bool state) |
Sets normals visibility. More... | |
virtual void | toggleNormals () |
Toggles normals display state. | |
virtual bool | hasDisplayedScalarField () const |
Returns whether an active scalar field is available or not. More... | |
virtual bool | hasScalarFields () const |
Returns whether one or more scalar fields are instantiated. More... | |
virtual void | showSF (bool state) |
Sets active scalarfield visibility. | |
virtual void | toggleSF () |
Toggles SF display state. | |
virtual bool | sfShown () const |
Returns whether active scalar field is visible. | |
virtual void | toggleMaterials () |
Toggles material display state. More... | |
virtual void | showNameIn3D (bool state) |
Sets whether name should be displayed in 3D or not. | |
virtual bool | nameShownIn3D () const |
Returns whether name is displayed in 3D or not. | |
virtual void | toggleShowName () |
Toggles name in 3D display state. | |
virtual bool | isColorOverridden () const |
Returns whether colors are currently overridden by a temporary (unique) color. More... | |
virtual const ccColor::Rgba & | getTempColor () const |
Returns current temporary (unique) color. | |
virtual void | setTempColor (const ccColor::Rgba &col, bool autoActivate=true) |
Sets current temporary (unique) More... | |
virtual void | setTempColor (const ccColor::Rgb &col, bool autoActivate=true) |
Sets current temporary (unique) More... | |
virtual void | enableTempColor (bool state) |
Set temporary color activation state. | |
virtual void | removeFromDisplay (const ccGenericGLDisplay *win) |
Unlinks entity from a GL display (only if it belongs to it of course) | |
virtual void | setDisplay (ccGenericGLDisplay *win) |
Sets associated GL display. | |
virtual ccGenericGLDisplay * | getDisplay () const |
Returns associated GL display. | |
virtual void | redrawDisplay () |
Redraws associated GL display. | |
virtual void | prepareDisplayForRefresh () |
Sets associated GL display 'refreshable' before global refresh. More... | |
virtual void | refreshDisplay (bool only2D=false) |
Refreshes associated GL display. More... | |
virtual void | setGLTransformation (const ccGLMatrix &trans) |
Associates entity with a GL transformation (rotation + translation) More... | |
virtual void | enableGLTransformation (bool state) |
Enables/disables associated GL transformation. More... | |
virtual bool | isGLTransEnabled () const |
Returns whether a GL transformation is enabled or not. | |
virtual const ccGLMatrix & | getGLTransformation () const |
Returns associated GL transformation. More... | |
virtual void | resetGLTransformation () |
Resets associated GL transformation. More... | |
virtual void | rotateGL (const ccGLMatrix &rotMat) |
Multiplies (left) current GL transformation by a rotation matrix. More... | |
virtual void | translateGL (const CCVector3 &trans) |
Translates current GL transformation by a rotation matrix. More... | |
virtual void | removeAllClipPlanes () |
Removes all clipping planes (if any) | |
virtual bool | addClipPlanes (const ccClipPlane &plane) |
Registers a new clipping plane. More... | |
virtual void | toggleClipPlanes (CC_DRAW_CONTEXT &context, bool enable) |
Enables or disables clipping planes (OpenGL) More... | |
virtual bool | pushDisplayState () |
Pushes the current display state. More... | |
virtual void | popDisplayState (bool apply=true) |
Pops the last pushed display state. More... | |
virtual void | applyDisplayState (const DisplayState &state) |
Applies a display state. | |
Static Public Member Functions | |
static ccHObject * | New (CC_CLASS_ENUM objectType, const char *name=nullptr) |
Static factory. More... | |
static ccHObject * | New (const QString &pluginId, const QString &classId, const char *name=nullptr) |
Static factory (version to be used by external plugin factories) More... | |
Static Public Member Functions inherited from ccObject | |
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... | |
Public Attributes | |
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive toggleShowName_recursive ccGenericGLDisplay * | newDisplay |
Protected Member Functions | |
virtual void | setParent (ccHObject *anObject) |
Sets parent object. | |
virtual void | drawMeOnly (CC_DRAW_CONTEXT &context) |
Draws the entity only (not its children) More... | |
virtual void | applyGLTransformation (const ccGLMatrix &trans) |
Applies a GL transformation to the entity. More... | |
virtual bool | toFile_MeOnly (QFile &out) const |
Save own object data. More... | |
virtual bool | fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
Loads own object data. More... | |
virtual void | drawNameIn3D (CC_DRAW_CONTEXT &context) |
Draws the entity name in 3D. More... | |
virtual void | onDeletionOf (const ccHObject *obj) |
This method is called when another object is deleted. More... | |
virtual void | onUpdateOf (ccHObject *obj) |
This method is called when another object (geometry) is updated. More... | |
Protected Member Functions inherited from ccObject | |
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 | |
ccHObject * | m_parent |
Parent. | |
Container | m_children |
Children. | |
SelectionBehavior | m_selectionBehavior |
Selection behavior. | |
std::map< ccHObject *, int > | m_dependencies |
Dependencies map. More... | |
ccGLMatrix | m_glTransHistory |
Cumulative GL transformation. More... | |
bool | m_isDeleting |
Flag to safely handle dependencies when the object is being deleted. | |
Protected Attributes inherited from ccObject | |
QString | m_name |
Object name. | |
unsigned | m_flags |
Object flags. | |
QVariantMap | m_metaData |
Associated meta-data. | |
Protected Attributes inherited from ccDrawableObject | |
bool | m_visible |
Specifies whether the object is visible or not. More... | |
bool | m_selected |
Specifies whether the object is selected or not. | |
bool | m_lockedVisibility |
Specifies whether the visibility can be changed by user or not. | |
bool | m_colorsDisplayed |
Specifies whether colors should be displayed. | |
bool | m_normalsDisplayed |
Specifies whether normals should be displayed. | |
bool | m_sfDisplayed |
Specifies whether scalar field should be displayed. | |
ccColor::Rgba | m_tempColor |
Temporary (unique) color. | |
bool | m_colorIsOverridden |
Temporary (unique) color activation state. | |
ccGLMatrix | m_glTrans |
Current GL transformation. More... | |
bool | m_glTransEnabled |
Current GL transformation activation state. More... | |
bool | m_showNameIn3D |
Whether name is displayed in 3D or not. | |
CCVector3d | m_nameIn3DPos |
Last 2D position of the '3D' name. | |
bool | m_nameIn3DPosIsValid |
Whether the last 2D position of the '3D' name is valid or not. | |
ccGenericGLDisplay * | m_currentDisplay |
Currently associated GL display. | |
ccClipPlaneSet | m_clipPlanes |
Active clipping planes (used for display only) | |
std::vector< DisplayState::Shared > | m_displayStateStack |
The stack of pushed display states. | |
Hierarchical CloudCompare Object.
Dependency flags.
Enumerator | |
---|---|
DP_NONE | no dependency |
DP_NOTIFY_OTHER_ON_DELETE | notify 'other' when deleted (will call ccHObject::onDeletionOf) |
DP_NOTIFY_OTHER_ON_UPDATE | notify 'other' when its geometry is modified (will call ccHObject::onUpdateOf) |
DP_DELETE_OTHER | delete 'other' before deleting itself |
DP_PARENT_OF_OTHER | same as DP_DELETE_OTHER + declares itself as parent of 'other' |
ccHObject::ccHObject | ( | const QString & | name = QString() , |
unsigned | uniqueID = ccUniqueIDGenerator::InvalidUniqueID |
||
) |
Default constructor.
name | object name (optional) |
uniqueID | unique ID (handle with care) |
|
virtual |
Adds a child.
child | child instance |
dependencyFlags | dependency flags |
insertIndex | insertion index (if <0, child is simply appended to the children list) |
void ccHObject::addDependency | ( | ccHObject * | otherObject, |
int | flags, | ||
bool | additive = true |
||
) |
Adds a new dependence (additive or not)
otherObject | other object |
flags | dependency flags (see DEPENDENCY_FLAGS) |
additive | whether we should 'add' the flag(s) if there's already a dependence with the other object or not |
|
protectedvirtual |
Applies a GL transformation to the entity.
this = rotMat*(this-rotCenter)+(rotCenter+trans)
trans | a ccGLMatrix structure |
Reimplemented in ccFacet, ccGenericPrimitive, ccMesh, ccPolyline, and ccSensor.
void ccHObject::applyGLTransformation_recursive | ( | const ccGLMatrix * | trans = nullptr | ) |
Applies the active OpenGL transformation to the entity (recursive)
The input ccGLMatrix should be left to 0, unless you want to apply a pre-transformation.
trans | a ccGLMatrix structure (reference to) |
void ccHObject::detachAllChildren | ( | ) |
Removes a specific child.
void ccHObject::detachChild | ( | ccHObject * | child | ) |
Detaches a specific child.
This method does not delete the child. Removes any dependency between the flag and this object
|
overridevirtual |
Draws entity and its children.
Implements ccDrawableObject.
|
virtual |
Draws the entity (and its children) bounding-box.
Reimplemented in ccPolyline.
|
inlineprotectedvirtual |
Draws the entity only (not its children)
Reimplemented in cc2DLabel, cc2DViewportLabel, ccCameraSensor, ccClipBox, ccCoordinateSystem, ccFacet, ccGBLSensor, ccGenericMesh, ccImage, ccIndexedTransformationBuffer, ccKdTree, ccMesh, ccMeshGroup, ccOctreeProxy, ccPlane, and ccPolyline.
|
protectedvirtual |
Draws the entity name in 3D.
Names is displayed at the center of the bounding box by default.
Reimplemented in ccSphere.
unsigned ccHObject::filterChildren | ( | Container & | filteredChildren, |
bool | recursive = false , |
||
CC_CLASS_ENUM | filter = CC_TYPES::OBJECT , |
||
bool | strict = false , |
||
ccGenericGLDisplay * | inDisplay = nullptr |
||
) | const |
Collects the children corresponding to a certain pattern.
filteredChildren | result container |
recursive | specifies if the search should be recursive |
filter | pattern for children selection |
strict | whether the search is strict on the type (i.e 'isA') or not (i.e. 'isKindOf') |
inDisplay | [optional] display in which the children are displayed |
ccHObject * ccHObject::find | ( | unsigned | uniqueID | ) | const |
Finds an entity in this object hierarchy.
uniqueID | child unique ID |
|
overridevirtual |
Loads data from binary stream.
in | input file (already opened) |
dataVersion | file version |
flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
oldToNewIDMap | map to link old IDs with new IDs |
Reimplemented from ccSerializableObject.
|
protectedvirtual |
Loads own object data.
Called by 'fromFile' (recursive scheme) To be overloaded (but still called;) by subclass.
in | input file |
dataVersion | file version |
flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
oldToNewIDMap | map to link old IDs with new IDs |
Reimplemented in cc2DLabel, cc2DViewportLabel, cc2DViewportObject, NormsIndexesTableType, 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, ccCone, ccCoordinateSystem, ccDish, ccExtru, ccFacet, ccGBLSensor, ccGenericMesh, ccGenericPointCloud, ccGenericPrimitive, ccImage, ccIndexedTransformationBuffer, ccMaterialSet, ccMesh, ccMeshGroup, ccPlane, ccPolyline, ccQuadric, ccSensor, ccSphere, ccSubMesh, and ccTorus.
bool ccHObject::fromFileNoChildren | ( | QFile & | in, |
short | dataVersion, | ||
int | flags, | ||
LoadedIDMap & | oldToNewIDMap | ||
) |
Custom version of ccSerializableObject::fromFile.
This is used to load only the object's part of a stream (and not its children)
in | input file (already opened) |
dataVersion | file version |
flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
oldToNewIDMap | map to convert old IDs to new ones |
bool ccHObject::getAbsoluteGLTransformation | ( | ccGLMatrix & | trans | ) | const |
Returns the absolute transformation (i.e. the actual displayed GL transformation) of an entity.
[out] | trans | absolute transformation |
|
virtual |
Returns the local bounding-box of this entity and it's children.
withGLFeatures | whether to take into account display-only elements (if any) |
onlyEnabledChildren | only consider the 'enabled' children |
|
inline |
Returns the ith child.
childPos | child position |
unsigned int ccHObject::getChildCountRecursive | ( | ) | const |
Returns the total number of children under this object recursively.
|
inline |
Returns the number of children.
|
inlineoverridevirtual |
Returns class ID.
Implements ccObject.
Reimplemented in ccArray< ccColor::Rgb, 3, ColorCompType >, ccArray< CompressedNormType, 1, CompressedNormType >, ccArray< CCVector3, 3, PointCoordinateType >, ccArray< ccColor::Rgba, 4, ColorCompType >, ccArray< TexCoords2D, 2, float >, ccImage, ccIndexedTransformationBuffer, ccKdTree, ccMaterialSet, ccMesh, ccMeshGroup, ccOctreeProxy, ccPlane, ccPolyline, ccQuadric, ccSensor, ccSphere, ccSubMesh, and ccTorus.
int ccHObject::getDependencyFlagsWith | ( | const ccHObject * | otherObject | ) | const |
Returns the dependency flags with a given object.
otherObject | other object |
|
virtual |
Returns the bounding-box of this entity and it's children WHEN DISPLAYED.
Children's GL transformation is taken into account (if enabled).
relative | whether the bounding-box is relative (i.e. in the entity's local coordinate system) or absolute (in which case the parent's GL transformation will be taken into account) |
display | if not null, this method will return the bounding-box of this entity (and its children) in the specified 3D view (i.e. potentially not visible) |
|
virtual |
Returns the global bounding-box of this entity and it's children.
withGLFeatures | whether to take into account display-only elements (if any) |
onlyEnabledChildren | only consider the 'enabled' children |
|
inlinevirtual |
Returns the transformation 'history' matrix.
Reimplemented in ccGenericPrimitive, and ccMesh.
|
virtual |
Returns the icon associated to this entity.
ccDBRoot will call this method: if an invalid icon is returned the default icon for that type will be used instead.
|
virtual |
Returns the entity's own bounding-box (with local/shifted coordinates)
Children bounding-boxes are ignored.
withGLFeatures | whether to take into account display-only elements (if any) |
Reimplemented in ccCameraSensor, ccClipBox, ccGBLSensor, ccGenericPointCloud, ccIndexedTransformationBuffer, ccKdTree, ccMesh, ccOctreeProxy, ccPolyline, and ccSubMesh.
|
inlinevirtual |
Returns best-fit bounding-box (if available)
[out] | trans | associated transformation (so that the bounding-box can be displayed in the right position!) |
Reimplemented in ccCameraSensor, ccGBLSensor, ccImage, ccPlane, and ccQuadric.
|
virtual |
Returns the entity's own global bounding-box (with global/non-shifted coordinates - if relevant)
Children bounding-boxes are ignored. May differ from the (local) bounding-box if the entity is shifted
withGLFeatures | whether to take into account display-only elements (if any) |
Reimplemented in ccShiftedObject.
|
virtual |
Returns the entity's own global bounding-box (with global/non-shifted coordinates - if relevant)
Children bounding-boxes are ignored. By default this method returns the local bounding-box! But it may differ from the (local) bounding-box if the entity is shifted.
[out] | minCorner | min global bounding-box corner |
[out] | maxCorner | max global bounding-box corner |
Reimplemented in ccShiftedObject.
|
inline |
Returns parent object.
|
inlinevirtual |
Returns object unique ID used for display.
Reimplemented in ccMesh, and ccPolyline.
|
overridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSerializableObject.
Reimplemented in ccArray< ccColor::Rgb, 3, ColorCompType >, ccArray< CompressedNormType, 1, CompressedNormType >, ccArray< CCVector3, 3, PointCoordinateType >, ccArray< ccColor::Rgba, 4, ColorCompType >, ccArray< TexCoords2D, 2, float >, ccImage, ccIndexedTransformationBuffer, ccMaterialSet, ccMesh, ccMeshGroup, ccPolyline, ccSensor, and ccSubMesh.
|
inlinevirtual |
Returns whether object is shareable or not.
If object is father dependent and 'shared', it won't be deleted but 'released' instead.
Reimplemented in 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 >, and ccMaterialSet.
|
static |
Static factory.
objectType | object type |
name | object name (optional) |
|
static |
Static factory (version to be used by external plugin factories)
Two strings are used as keys, one for the plugin name and one for the class name. Those strings will typically be saved as metadata of a custom object
|
protectedvirtual |
|
inlineprotectedvirtual |
|
overridevirtual |
Pops the last pushed display state (overridden)
Reimplemented from ccDrawableObject.
|
overridevirtual |
Pushes the current display state (overridden)
Reimplemented from ccDrawableObject.
void ccHObject::removeChild | ( | int | pos | ) |
Removes a specific child given its index.
void ccHObject::removeDependencyFlag | ( | ccHObject * | otherObject, |
DEPENDENCY_FLAGS | flag | ||
) |
Removes a given dependency flag.
otherObject | other object |
flag | dependency flag to remove (see DEPENDENCY_FLAGS) |
void ccHObject::removeDependencyWith | ( | ccHObject * | otherObject | ) |
Removes any dependency flags with a given object.
otherObject | other object |
|
inlinevirtual |
Sets selection behavior (when displayed)
|
overridevirtual |
Saves data to binary stream.
out | output file (already opened) |
Reimplemented from ccSerializableObject.
|
protectedvirtual |
Save own object data.
Called by 'toFile' (recursive scheme) To be overloaded (but still called;) by subclass.
Reimplemented in cc2DLabel, cc2DViewportLabel, cc2DViewportObject, 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, ccCone, ccCoordinateSystem, ccDish, ccExtru, ccFacet, ccGBLSensor, ccGenericMesh, ccGenericPointCloud, ccGenericPrimitive, ccImage, ccIndexedTransformationBuffer, ccMaterialSet, ccMesh, ccMeshGroup, ccPlane, ccPolyline, ccQuadric, ccSensor, ccSphere, ccSubMesh, and ccTorus.
|
protected |
Dependencies map.
First parameter: other object Second parameter: dependency flags (see DEPENDENCY_FLAGS)
|
protected |
Cumulative GL transformation.
History of all the applied transformations since the creation of the object as a single transformation.
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive toggleShowName_recursive ccGenericGLDisplay* ccHObject::newDisplay |