ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccHObject Class Reference

Hierarchical CLOUDVIEWER Object. More...

#include <ecvHObject.h>

Inheritance diagram for ccHObject:
Collaboration diagram for ccHObject:

Public Types

enum  DEPENDENCY_FLAGS {
  DP_NONE = 0 , DP_NOTIFY_OTHER_ON_DELETE = 1 , DP_NOTIFY_OTHER_ON_UPDATE , 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. More...
 
using Container = std::vector< ccHObject * >
 Standard instances container (for children, etc.) More...
 
using Shared = QSharedPointer< ccHObject >
 Shared pointer. More...
 
using SharedContainer = std::vector< Shared >
 Shared instances container (for children, etc.) More...
 
using GlobalBoundingBox = cloudViewer::BoundingBoxTpl< double >
 Global (non-shifted) bounding-box. More...
 
- 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...
 

Public Member Functions

 ccHObject (QString name=QString())
 Default constructor. More...
 
 ccHObject (const ccHObject &object)
 Copy constructor. More...
 
virtual ~ccHObject () override
 Default destructor. More...
 
virtual bool IsEmpty () const
 
virtual Eigen::Vector3d GetMinBound () const
 Returns min bounds for geometry coordinates. More...
 
virtual Eigen::Vector2d GetMin2DBound () const
 
virtual Eigen::Vector3d GetMaxBound () const
 Returns max bounds for geometry coordinates. More...
 
virtual Eigen::Vector2d GetMax2DBound () const
 
virtual Eigen::Vector3d GetCenter () const
 Returns the center of the geometry coordinates. More...
 
virtual ccBBox GetAxisAlignedBoundingBox () const
 Returns an axis-aligned bounding box of the geometry. More...
 
virtual ecvOrientedBBox GetOrientedBoundingBox () const
 
virtual ccHObjectTransform (const Eigen::Matrix4d &transformation)
 Apply transformation (4x4 matrix) to the geometry coordinates. More...
 
virtual ccHObjectTranslate (const Eigen::Vector3d &translation, bool relative=true)
 Apply translation to the geometry coordinates. More...
 
virtual ccHObjectScale (const double s, const Eigen::Vector3d &center)
 Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$. More...
 
virtual ccHObjectScale (const double s)
 
virtual ccHObjectRotate (const Eigen::Matrix3d &R, const Eigen::Vector3d &center)
 Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$. More...
 
virtual ccHObjectRotate (const Eigen::Matrix3d &R)
 
QString getViewId () const
 
CV_CLASS_ENUM getClassID () const override
 Returns class ID. More...
 
bool isGroup () const
 Returns whether the instance is a group. More...
 
ccHObjectgetParent () 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)
 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...
 
ccHObjectgetChild (unsigned childPos) const
 Returns the ith child. More...
 
ccHObjectfind (unsigned uniqueID)
 Finds an entity in this object hierarchy. More...
 
unsigned filterChildren (Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) 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 getTypeID_recursive (std::vector< removeInfo > &rmInfos, bool relative)
 
void getTypeID_recursive (std::vector< hideInfo > &hdInfos, bool relative)
 
void removeChild (ccHObject *child)
 
void removeChild (int pos)
 Removes a specific child given its index. More...
 
void removeAllChildren ()
 Removes all children. More...
 
int getChildIndex (const ccHObject *aChild) const
 Returns child index. More...
 
void swapChildren (unsigned firstChildIndex, unsigned secondChildIndex)
 Swaps two children. More...
 
int getIndex () const
 Returns index relatively to its parent or -1 if no parent. More...
 
void transferChild (ccHObject *child, ccHObject &newParent)
 Transfer a given child to another parent. More...
 
void transferChildren (ccHObject &newParent, bool forceFatherDependent=false)
 Transfer all children to another parent. More...
 
ccHObjectgetFirstChild () const
 Shortcut: returns first child. More...
 
ccHObjectgetLastChild () const
 Shortcut: returns last child. More...
 
bool isAncestorOf (const ccHObject *anObject) const
 Returns true if the current object is an ancestor of the specified one. More...
 
void removeFromRenderScreen (bool recursive=true)
 
void hideObject_recursive (bool recursive)
 
void hideBB (CC_DRAW_CONTEXT context)
 
void showBB (CC_DRAW_CONTEXT context)
 
virtual ccBBox getOwnBB (bool withGLFeatures=false)
 Returns the entity's own bounding-box. More...
 
void setRedrawFlagRecursive (bool redraw=false)
 
void setForceRedrawRecursive (bool redraw=false)
 
void setPointSizeRecursive (int pSize)
 
void setLineWidthRecursive (PointCoordinateType width)
 
virtual ccBBox getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true)
 Returns the bounding-box of this entity and it's children. More...
 
virtual GlobalBoundingBox getOwnGlobalBB (bool withGLFeatures=false)
 
virtual bool getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner)
 
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)
 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 ecvColor::Rgb &col)
 Draws the entity (and its children) bounding-box. More...
 
void draw (CC_DRAW_CONTEXT &context) override
 Draws entity and its children. More...
 
void updateNameIn3DRecursive ()
 
void setHideShowType (CC_DRAW_CONTEXT &context)
 
void setRemoveType (CC_DRAW_CONTEXT &context)
 
ENTITY_TYPE getEntityType () const
 
virtual void redrawDisplay (bool forceRedraw=true, bool only2D=false)
 Redraws associated display. More...
 
bool getAbsoluteGLTransformation (ccGLMatrix &trans) const
 
virtual bool isDisplayed () const
 Returns whether the object is actually displayed (visible) or not. More...
 
virtual bool isBranchEnabled () const
 Returns whether the object and all its ancestors are enabled. More...
 
virtual void redrawDisplay_recursive (bool p)
 
virtual void refreshDisplay_recursive (bool p)
 
virtual void setSelected_recursive (bool p)
 
virtual void toggleActivation_recursive ()
 
virtual void toggleVisibility_recursive ()
 
virtual void toggleColors_recursive ()
 
virtual void resetGLTransformationHistory_recursive ()
 
virtual void toggleNormals_recursive ()
 
virtual void toggleSF_recursive ()
 
virtual void toggleShowName_recursive ()
 
unsigned findMaxUniqueID_recursive () const
 Returns the max 'unique ID' of this entity and its siblings. More...
 
void applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr)
 Applies the active OpenGL transformation to the entity (recursive) More...
 
virtual void notifyGeometryUpdate ()
 
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...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads data from binary stream. More...
 
short minimumFileVersion () const override
 Returns the minimum file version required to save this instance. 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. More...
 
virtual unsigned getUniqueIDForDisplay () const
 Returns object unqiue ID used for display. More...
 
virtual const ccGLMatrixgetGLTransformationHistory () const
 Returns the transformation 'history' matrix. More...
 
virtual void setGLTransformationHistory (const ccGLMatrix &mat)
 Sets the transformation 'history' matrix (handle with care!) More...
 
virtual void resetGLTransformationHistory ()
 Resets the transformation 'history' matrix. More...
 
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 (QString name=QString())
 Default constructor. More...
 
 ccObject (const ccObject &object)
 Copy constructor. More...
 
virtual QString getName () const
 Returns object name. More...
 
virtual void setName (const QString &name)
 Sets object name. More...
 
virtual void setRemoveFlag (bool removeFlag)
 Sets removeFlag. More...
 
virtual bool getRemoveFlag ()
 Returns removeFlag. More...
 
virtual unsigned getUniqueID () const
 Returns object unique ID. More...
 
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. 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 isLeaf () const
 
bool isCustom () const
 
bool isHierarchy () const
 
bool isKindOf (CV_CLASS_ENUM type) const
 
bool isA (CV_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) More...
 
void setBaseName (const QString &baseName)
 
QString getBaseName () const
 
void setFullPath (const QString &fullPaht)
 
QString getFullPath () const
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()=default
 Destructor. More...
 
- Public Member Functions inherited from ccDrawableObject
 ccDrawableObject ()
 Default constructor. More...
 
 ccDrawableObject (const ccDrawableObject &object)
 Copy constructor. More...
 
virtual ~ccDrawableObject ()=default
 
virtual bool isVisible () const
 Returns whether entity is visible or not. More...
 
virtual void setVisible (bool state)
 Sets entity visibility. More...
 
virtual void toggleVisibility ()
 Toggles visibility. More...
 
virtual bool isRedraw () const
 Returns whether entity is to be redraw. More...
 
virtual void setRedraw (bool state)
 Sets entity redraw mode. More...
 
virtual void setForceRedraw (bool state)
 Sets force redraw. More...
 
virtual void setFixedId (bool state)
 
virtual bool isFixedId ()
 
virtual bool isVisibilityLocked () const
 Returns whether visibility is locked or not. More...
 
virtual void lockVisibility (bool state)
 Locks/unlocks visibility. More...
 
virtual bool isSelected () const
 Returns whether entity is selected or not. More...
 
virtual void setSelected (bool state)
 Selects/Unselects entity. More...
 
virtual void getDrawingParameters (glDrawParams &params) 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. More...
 
virtual void showColors (bool state)
 Sets colors visibility. More...
 
virtual void toggleColors ()
 Toggles colors display state. More...
 
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. More...
 
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. More...
 
virtual void toggleSF ()
 Toggles SF display state. More...
 
virtual bool sfShown () const
 Returns whether active scalar field is visible. More...
 
virtual void toggleMaterials ()
 Toggles material display state. More...
 
virtual void showNameIn3D (bool state)
 Sets whether name should be displayed in 3D. More...
 
virtual bool nameShownIn3D () const
 Returns whether name is displayed in 3D or not. More...
 
virtual void toggleShowName ()
 Toggles name in 3D display state. More...
 
virtual bool isColorOverridden () const
 
virtual const ecvColor::RgbgetTempColor () const
 Returns current temporary (unique) color. More...
 
virtual void setTempColor (const ecvColor::Rgb &col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void enableTempColor (bool state)
 Set temporary color activation state. More...
 
virtual float getOpacity () const
 
virtual void setOpacity (float opacity)
 Set opacity activation state. 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. More...
 
virtual const ccGLMatrixgetGLTransformation () 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) More...
 
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 void applyDisplayState (const DisplayState &state)
 Applies a display state. More...
 

Static Public Member Functions

static ccHObjectNew (CV_CLASS_ENUM objectType, const char *name=nullptr)
 Static factory. More...
 
static ccHObjectNew (const QString &pluginId, const QString &classId, const char *name=nullptr)
 Static factory (version to be used by external plugin factories) More...
 
static Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points)
 Compute min bound of a list points. More...
 
static Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points)
 Compute max bound of a list points. More...
 
static Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points)
 Computer center of a list of points. More...
 
static void ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, std::size_t size, const Eigen::Vector3d &color)
 Resizes the colors vector and paints a uniform color. More...
 
static void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points)
 Transforms all points with the transformation matrix. More...
 
static void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals)
 Transforms the normals with the transformation matrix. More...
 
static void TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances)
 Transforms all covariance matrices with the transformation. More...
 
static void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative)
 Apply translation to the geometry coordinates. More...
 
static void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center)
 Scale the coordinates of all points by the scaling factor scale. More...
 
static void RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center)
 Rotate all points with the rotation matrix R. More...
 
static void RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals)
 Rotate all normals with the rotation matrix R. More...
 
static void RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances)
 Rotate all covariance matrices with the rotation matrix R. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XYZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YZX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZXY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XZY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZYX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YXZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from AxisAngle RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation)
 Get Rotation Matrix from Quaternion. More...
 
static Eigen::Matrix3d GetRotationMatrixFromEulerAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from Euler angle. More...
 
- Static Public Member Functions inherited from ccObject
static unsigned GetCurrentDBVersion ()
 Returns current database version. More...
 
static void SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator)
 Sets the unique ID generator. More...
 
static ccUniqueIDGenerator::Shared GetUniqueIDGenerator ()
 Returns the unique ID generator. More...
 
static unsigned GetNextUniqueID ()
 Returns a new unassigned unique ID. More...
 
static unsigned GetLastUniqueID ()
 Returns last assigned unique ID. More...
 
static CV_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 void setParent (ccHObject *anObject)
 Sets parent object. More...
 
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, short dataVersion) const
 Save own object data. More...
 
virtual bool fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
 Loads own object data. More...
 
virtual short minimumFileVersion_MeOnly () const
 
virtual void drawNameIn3D ()
 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 (CV_OBJECT_FLAG flag) const
 Returns flag state. More...
 
virtual void setFlagState (CV_OBJECT_FLAG flag, bool state)
 Sets flag state. 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
 Reimplemented from ccSerializableObject::fromFile. More...
 

Protected Attributes

ccHObjectm_parent
 Parent. More...
 
Container m_children
 Children. More...
 
SelectionBehavior m_selectionBehavior
 Selection behavior. More...
 
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. More...
 
- Protected Attributes inherited from ccObject
QString m_name
 Object name. More...
 
QString m_baseName
 
QString m_filePath
 
bool m_removeFlag
 
unsigned m_flags
 Object flags. More...
 
QVariantMap m_metaData
 Associated meta-data. More...
 
- Protected Attributes inherited from ccDrawableObject
bool m_fixedId
 
bool m_modelRedraw
 
bool m_forceRedraw
 
float m_opacity
 
bool m_visible
 Specifies whether the object is visible or not. More...
 
bool m_selected
 Specifies whether the object is selected or not. More...
 
bool m_lockedVisibility
 Specifies whether the visibility can be changed by user or not. More...
 
bool m_colorsDisplayed
 Specifies whether colors should be displayed. More...
 
bool m_normalsDisplayed
 Specifies whether normals should be displayed. More...
 
bool m_sfDisplayed
 Specifies whether scalar field should be displayed. More...
 
ecvColor::Rgb m_tempColor
 Temporary (unique) color. More...
 
bool m_colorIsOverridden
 Temporary (unique) color activation state. More...
 
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. More...
 
CCVector3d m_nameIn3DPos
 Last 2D position of the '3D' name. More...
 
ccClipPlaneSet m_clipPlanes
 Active clipping planes (used for display only) More...
 
std::vector< DisplayState::Sharedm_displayStateStack
 The stack of pushed display states. More...
 

Detailed Description

Hierarchical CLOUDVIEWER Object.

Definition at line 25 of file ecvHObject.h.

Member Typedef Documentation

◆ Container

using ccHObject::Container = std::vector<ccHObject*>

Standard instances container (for children, etc.)

Definition at line 337 of file ecvHObject.h.

◆ GlobalBoundingBox

Global (non-shifted) bounding-box.

Definition at line 436 of file ecvHObject.h.

◆ Shared

using ccHObject::Shared = QSharedPointer<ccHObject>

Shared pointer.

Definition at line 340 of file ecvHObject.h.

◆ SharedContainer

using ccHObject::SharedContainer = std::vector<Shared>

Shared instances container (for children, etc.)

Definition at line 343 of file ecvHObject.h.

Member Enumeration Documentation

◆ DEPENDENCY_FLAGS

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'

Definition at line 257 of file ecvHObject.h.

◆ SelectionBehavior

Behavior when selected.

Enumerator
SELECTION_AA_BBOX 
SELECTION_FIT_BBOX 
SELECTION_IGNORED 

Definition at line 605 of file ecvHObject.h.

Constructor & Destructor Documentation

◆ ccHObject() [1/2]

ccHObject::ccHObject ( QString  name = QString())

◆ ccHObject() [2/2]

ccHObject::ccHObject ( const ccHObject object)

Copy constructor.

Definition at line 65 of file ecvHObject.cpp.

References m_glTransHistory, and ccGLMatrixTpl< T >::toIdentity().

◆ ~ccHObject()

ccHObject::~ccHObject ( )
overridevirtual

Default destructor.

Definition at line 74 of file ecvHObject.cpp.

References DP_DELETE_OTHER, DP_NOTIFY_OTHER_ON_DELETE, m_dependencies, m_isDeleting, and removeAllChildren().

Member Function Documentation

◆ addChild()

bool ccHObject::addChild ( ccHObject child,
int  dependencyFlags = DP_PARENT_OF_OTHER,
int  insertIndex = -1 
)
virtual

Adds a child.

Warning
by default (i.e. with the DP_PARENT_OF_OTHER flag) the child's parent will be automatically replaced by this instance. Moreover the child will be deleted
    \param child child instance
    \param dependencyFlags dependency flags
    \param insertIndex insertion index (if <0, child is simply appended
to the children list)
Returns
success

Definition at line 534 of file ecvHObject.cpp.

References addDependency(), DP_NOTIFY_OTHER_ON_DELETE, DP_PARENT_OF_OTHER, CVLog::ErrorDebug(), ccObject::isLeaf(), isShareable(), m_children, and setParent().

Referenced by ccPointPairRegistrationDlg::addAlignedPoint(), ecvAnnotationsTool::addAssociatedEntity(), ecvFilterTool::addAssociatedEntity(), ecvMeasurementTool::addAssociatedEntity(), ccClipBox::addAssociatedEntity(), ccDBRoot::addElement(), ccGraphicalTransformationTool::addEntity(), ccMeasurementRecorder::addFittingPoint(), ccCompass::addGeoObject(), ccMeasurementRecorder::addMeasurementPoint(), ecvTools::AddPointCloud(), ccSensor::addPosition(), ccPointPairRegistrationDlg::addReferencePoint(), ccPointCloud::append(), ccGraphicalSegmentationTool::applySegmentation(), FacetsClassifier::ByOrientation(), ccCircle::ccCircle(), ccGenericPrimitive::ccGenericPrimitive(), ccMesh::ccMesh(), ccTracePolylineTool::ccTracePolylineTool(), ccPolyline::Circle(), ccFacet::clone(), ccHObjectCaster::CloneChildren(), ccMesh::cloneMesh(), ExtractSIFT::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), ProjectionFilter::compute(), StatisticalOutliersRemover::compute(), CorrespondenceMatching::compute(), TemplateAlignment::compute(), DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), MinimumCutSegmentation::compute(), RegionGrowingSegmentation::compute(), SACSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsCurveFitting::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), qVoxFallProcess::Compute(), qSRA::computeCloud2ProfileRadialDist(), contourPoly(), contourPoly2(), pcl2cc::Convert(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), ConvertToGroup(), vtk2cc::ConvertToMesh(), ccCompass::convertToPointCloud(), vtk2cc::ConvertToPolyline(), ccEntityAction::ConvexHull(), ccFacet::Create(), qFacets::createFacets(), ccMesh::createNewMeshFromSelection(), ccPolyline::createNewPolylinesFromSelection(), ccCropTool::Crop(), ccCompass::distributeSelection(), qCSF::doAction(), qPoissonRecon::doAction(), qCanupoPlugin::doClassifyAction(), ccGraphicalSegmentationTool::doExportSegmentationPolyline(), q3DMASCPlugin::doTrainAction(), ccDBRoot::dropMimeData(), ccCompass::estimateStrain(), ccRasterizeTool::exportContourLines(), ccPointPropertiesDlg::exportCurrentLabel(), StereogramDialog::exportCurrentSelection(), ccCommandLineParser::exportEntity(), qFacets::exportFacets(), ccVolumeCalcTool::exportGridAsCloud(), ccGraphicalTransformationTool::exportNewEntities(), GrainsAsEllipsoids::exportResultsAsCloud(), ecvFilterTool::exportSlice(), ccPointListPickingDlg::exportToNewPolyline(), ccContourExtractor::ExtractConcaveHull2D(), ccContourExtractor::ExtractFlatContour(), CC_ITEM_TREE::findOrCreateContainer(), ccTraceTool::finishCurrentTrace(), G3Point::G3PointAction::fit(), ccCompass::fitPlaneToGeoObject(), FromFbxMesh(), ccRasterizeTool::generateCloud(), ccRasterizeTool::generateContours(), ccGeoObject::generateInterior(), ccGeoObject::generateLower(), ccRasterizeTool::generateMesh(), ccGeoObject::generateUpper(), G3Point::G3PointAction::getBorders(), ecvTools::GetClousterGroup(), GetConeProfile(), ccCompass::getInsertPoint(), ecvTools::GetPolylines(), MainWindow::getSelectedEntityBbox(), ccCommandLineParser::importFile(), ccCompass::importFoliations(), ccCompassImport::importFoliations(), ccCompass::importLineations(), ccCompassImport::importLineations(), STEPFilter::importStepFile(), ccPolyline::initWith(), ProfileLoader::Load(), IcmFilter::LoadCalibratedImages(), AsciiFilter::loadCloudFromFormatedAsciiStream(), CSVMatrixFilter::loadFile(), PhotoScanFilter::loadFile(), PcdFilter::loadFile(), ImageFileFilter::loadFile(), ObjFilter::loadFile(), OFFFilter::loadFile(), PTXFilter::loadFile(), STLFilter::loadFile(), VTKFilter::loadFile(), IcmFilter::loadFile(), PovFilter::loadFile(), SalomeHydroFilter::loadFile(), SinusxFilter::loadFile(), SoiFilter::loadFile(), SimpleBinFilter::loadFile(), DRCFilter::loadFile(), E57Filter::loadFile(), FBXFilter::loadFile(), LASFWFFilter::loadFile(), LasIOFilter::loadFile(), LASFilter::loadFile(), RDBFilter::loadFile(), PlyFilter::loadFile(), LoadImage(), qSRA::loadProfile(), LoadScan(), main(), ccMesh::merge(), ccMesh::mergeDuplicatedVertices(), QVTKWidgetCustom::mouseMoveEvent(), NodeStructureToTree(), ccTracePolylineTool::onItemPicked(), MainWindow::onItemPicked(), ccMesh::operator=(), ccMesh::partialClone(), ccTraceTool::pickupTrace(), ccFitPlaneTool::pointPicked(), ccLineationTool::pointPicked(), ccNoteTool::pointPicked(), ccPinchNodeTool::pointPicked(), ccThicknessTool::pointPicked(), ccTraceTool::pointPicked(), ccTracePolylineTool::polylineOverSampling(), CommandDelaunayTri::process(), CommandRasterize::process(), CommandVolume25D::process(), FacetsClassifier::ProcessFamiliy(), ccPointListPickingDlg::processPickedPoint(), ecvDisplayTools::ProcessPickingResult(), ccEntityAction::RansacSegmentation(), cloudViewer::io::ReadTriangleMeshFromGLTF(), ccCompass::recalculateFitPlanes(), qCanupo2DViewDialog::resetBoundary(), ccCommandLineParser::saveClouds(), ccCommandLineParser::saveMeshes(), ccMesh::setMaterialSet(), ccGenericPointCloud::setOctree(), ccMeasurementRecorder::setPlane(), ccMesh::setTexCoordinatesTable(), ccMesh::setTriNormsTable(), ccPolyline::smoothChaikin(), ecvPoissonReconDlg::start(), ccMesh::subdivide(), DistanceMapGenerationDlg::toggleOverlayGrid(), Cloth::toMesh(), qCanupo2DViewDialog::trainClassifier(), transferChild(), transferChildren(), ccMesh::TriangulateTwoPolylines(), ccCompass::tryLoading(), GrainsAsEllipsoids::updateMeshAndLineSet(), ccGenericMesh::updateTextures(), and ccPointPairRegistrationDlg::zoomGlobalOnRegistrationEntities().

◆ addDependency()

void ccHObject::addDependency ( ccHObject otherObject,
int  flags,
bool  additive = true 
)

Adds a new dependence (additive or not)

Parameters
otherObjectother object
flagsdependency flags (see DEPENDENCY_FLAGS)
additivewhether we should 'add' the flag(s) if there's already a dependence with the other object or not

Definition at line 455 of file ecvHObject.cpp.

References addDependency(), DP_NOTIFY_OTHER_ON_DELETE, CVLog::Error(), and m_dependencies.

Referenced by addChild(), addDependency(), cc2DLabel::addPickedPoint(), ccDBRoot::dropMimeData(), MainWindow::putObjectBackIntoDBTree(), ccMesh::setAssociatedCloud(), ccSubMesh::setAssociatedMesh(), ccImage::setAssociatedSensor(), and transferChild().

◆ applyGLTransformation()

void ccHObject::applyGLTransformation ( const ccGLMatrix trans)
protectedvirtual

◆ applyGLTransformation_recursive()

◆ ComputeCenter()

Eigen::Vector3d ccHObject::ComputeCenter ( const std::vector< Eigen::Vector3d > &  points)
static

Computer center of a list of points.

Definition at line 296 of file ecvHObject.cpp.

References points.

Referenced by ccMesh::GetCenter(), cloudViewer::geometry::ecvMeshBase::GetCenter(), cloudViewer::geometry::LineSet::GetCenter(), and TranslatePoints().

◆ ComputeMaxBound()

Eigen::Vector3d ccHObject::ComputeMaxBound ( const std::vector< Eigen::Vector3d > &  points)
static

◆ ComputeMinBound()

Eigen::Vector3d ccHObject::ComputeMinBound ( const std::vector< Eigen::Vector3d > &  points)
static

◆ detachAllChildren()

void ccHObject::detachAllChildren ( )

Removes a specific child.

Warning
This method may delete the child if the DP_PARENT_OF_OTHER dependency flag is set for this child (use detachChild if you want to avoid deletion). Detaches all children

Definition at line 1043 of file ecvHObject.cpp.

References m_children, and removeDependencyWith().

Referenced by ccGraphicalTransformationTool::clear(), define_ccObject(), PhotoScanFilter::loadFile(), PovFilter::loadFile(), and ccCompass::tryLoading().

◆ detachChild()

◆ draw()

void ccHObject::draw ( CC_DRAW_CONTEXT context)
overridevirtual

Draws entity and its children.

Implements ccDrawableObject.

Reimplemented in GrainsAsEllipsoids, ccMouseCircle, ccMouseCircle, and ecvOrientedBBox.

Definition at line 1438 of file ecvHObject.cpp.

References ccGLDrawContext::bbDefaultCol, ecvGui::ParamStruct::bbDefaultCol, ecvGui::ParamStruct::bbLineWidth, ecvGui::ParamStruct::bbOpacity, context, ccGLDrawContext::currentLineWidth, ccGLDrawContext::defaultLineWidth, drawBB(), drawMeOnly(), drawNameIn3D(), ECV_WIREFRAME_MODE, ccGLDrawContext::forceRedraw, getBB_recursive(), cloudViewer::BoundingBoxTpl< T >::getCenter(), ecvDisplayTools::getDataAxesGridProperties(), ecvDisplayTools::GetGLCameraParameters(), ccObject::getName(), ccDrawableObject::getOpacity(), ccObject::getRemoveFlag(), getViewId(), hideBB(), hideObject_recursive(), ecvDisplayTools::HideShowEntities(), CV_TYPES::HIERARCHY_OBJECT, ccObject::isA(), ccObject::isEnabled(), ccDrawableObject::isFixedId(), ccObject::isKindOf(), cloudViewer::BoundingBoxTpl< T >::isValid(), CV_TYPES::LABEL_2D, m_children, ccDrawableObject::m_clipPlanes, ccDrawableObject::m_forceRedraw, ccDrawableObject::m_glTransEnabled, ccDrawableObject::m_nameIn3DPos, ccDrawableObject::m_selected, ccDrawableObject::m_showNameIn3D, ccDrawableObject::m_visible, MACRO_Draw2D, MACRO_Draw3D, MACRO_EntityPicking, MACRO_Foreground, MACRO_SkipSelected, MACRO_SkipUnselected, ccGLDrawContext::meshRenderingMode, CV_TYPES::OBJECT, ccGLDrawContext::opacity, ecvGui::Parameters(), CV_TYPES::POINT_CLOUD, CV_TYPES::POINT_KDTREE, CV_TYPES::POINT_OCTREE, ccGLCameraParameters::project(), ecvDisplayTools::RemoveEntities(), ecvDisplayTools::RemoveWidgets(), ccDrawableObject::setForceRedraw(), setHideShowType(), ccDrawableObject::setRedraw(), setRedrawFlagRecursive(), setRemoveType(), showBB(), ecvGui::ParamStruct::showBBOnSelected, ecvDisplayTools::TheInstance(), ccDrawableObject::toggleClipPlanes(), CV_TYPES::TRANS_BUFFER, ccGLDrawContext::viewID, AxesGridProperties::visible, WIDGET_RECTANGLE_2D, and WIDGET_T2D.

Referenced by GrainsAsEllipsoids::draw(), ccOctree::DrawCellAsAPrimitive(), ccPolyline::drawMeOnly(), ecvDisplayTools::DrawPivot(), ecvDisplayTools::DrawWidgets(), getTypeID_recursive(), and ccPointPairRegistrationDlg::updateSphereMarks().

◆ drawBB()

◆ drawMeOnly()

virtual void ccHObject::drawMeOnly ( CC_DRAW_CONTEXT context)
inlineprotectedvirtual

◆ drawNameIn3D()

void ccHObject::drawNameIn3D ( )
protectedvirtual

Draws the entity name in 3D.

Names is displayed at the center of the bounding box by default.

Reimplemented in ccSphere.

Definition at line 1428 of file ecvHObject.cpp.

References ecvGenericDisplayTools::ALIGN_HMIDDLE, ecvGenericDisplayTools::ALIGN_VMIDDLE, ecvDisplayTools::DisplayText(), ccObject::getName(), ecvDisplayTools::GetTextDisplayFont(), ccDrawableObject::m_nameIn3DPos, Tuple3Tpl< Type >::x, and Tuple3Tpl< Type >::y.

Referenced by draw(), and updateNameIn3DRecursive().

◆ filterChildren()

unsigned ccHObject::filterChildren ( Container filteredChildren,
bool  recursive = false,
CV_CLASS_ENUM  filter = CV_TYPES::OBJECT,
bool  strict = false 
) const

Collects the children corresponding to a certain pattern.

Parameters
filteredChildrenresult container
recursivespecifies if the search should be recursive
filterpattern for children selection
strictwhether the search is strict on the type (i.e 'isA') or not (i.e. 'isKindOf')
Returns
number of collected children

Definition at line 611 of file ecvHObject.cpp.

References m_children.

Referenced by MainWindow::addToDB(), ccDisplayOptionsDlg::apply(), ccGraphicalSegmentationTool::applySegmentation(), FacetsClassifier::ByOrientation(), Classify3DMASCDialog::Classify3DMASCDialog(), DistanceMapGenerationDlg::clearOverlaySymbols(), DistanceMapGenerationDlg::clearView(), ccCompass::convertToPointCloud(), ccMesh::createNewMeshFromSelection(), ccDBRoot::data(), ccCompass::distributeSelection(), qPCV::doAction(), ccGraphicalSegmentationTool::doActionUseExistingPolyline(), ccDisplayOptionsDlg::doReject(), ccCompass::estimateP21(), ccCompass::estimateStrain(), ccCompass::estimateStructureNormals(), JsonRPCPlugin::execute(), StereogramDialog::exportCurrentSelection(), ccDBRoot::exportImages(), ccCompass::exportToSVG(), BasePclModule::getAllEntitiesOfType(), GetDefaultContainer(), qFacets::getFacetsInCurrentSelection(), ccPointListPickingDlg::getPickedPoints(), ccCommandLineParser::importFile(), StereogramWidget::init(), ccPointListPickingDlg::linkWithCloud(), AsciiFilter::loadCloudFromFormatedAsciiStream(), PovFilter::loadFile(), ccTracePolylineTool::polylineOverSampling(), CommandRANSAC::process(), qCanupoClassifDialog::qCanupoClassifDialog(), qCanupoTrainingDialog::qCanupoTrainingDialog(), qM3C2Dialog::qM3C2Dialog(), ReadCloud(), ccCompass::recalculateFitPlanes(), CorrespondenceMatchingDialog::refreshCloudComboBox(), TemplateAlignmentDialog::refreshCloudComboBox(), MinimumCutSegmentationDlg::refreshLabelComboBox(), GeneralFiltersDlg::refreshPolylineComboBox(), ccColorScaleEditorDialog::saveCurrentScale(), ccCompassExport::saveSVG(), DepthMapFileFilter::saveToFile(), DxfFilter::saveToFile(), ObjFilter::saveToFile(), PovFilter::saveToFile(), E57Filter::saveToFile(), ccPointCloud::scale(), ccDBRoot::selectChildrenByTypeAndName(), Classify3DMASCDialog::setCloudRoles(), ccDBRoot::showContextMenu(), DistanceMapGenerationDlg::toggleOverlayGrid(), ccPointCloud::Translate(), and StereogramDialog::updateFacetsFilter().

◆ find()

◆ findMaxUniqueID_recursive()

unsigned ccHObject::findMaxUniqueID_recursive ( ) const

Returns the max 'unique ID' of this entity and its siblings.

Definition at line 975 of file ecvHObject.cpp.

References ccObject::getUniqueID(), and m_children.

◆ fromFile()

bool ccHObject::fromFile ( QFile &  in,
short  dataVersion,
int  flags,
LoadedIDMap oldToNewIDMap 
)
overridevirtual

Loads data from binary stream.

Parameters
ininput file (already opened)
dataVersionfile version (for version-specific deserialization)
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
oldToNewIDMapmap to link old IDs with new IDs
Returns
success
Note: When implementing, use dataVersion checks to handle different
versions:
  • if (dataVersion >= X) { read new field } else { use default value } This ensures forward compatibility with older file formats.

Reimplemented from ccSerializableObject.

Definition at line 1177 of file ecvHObject.cpp.

◆ fromFile_MeOnly()

bool ccHObject::fromFile_MeOnly ( QFile &  in,
short  dataVersion,
int  flags,
LoadedIDMap oldToNewIDMap 
)
protectedvirtual

◆ fromFileNoChildren()

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)

Parameters
ininput file (already opened)
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
oldToNewIDMapmap to link old IDs with new IDs
Returns
success

Definition at line 1288 of file ecvHObject.cpp.

◆ getAbsoluteGLTransformation()

bool ccHObject::getAbsoluteGLTransformation ( ccGLMatrix trans) const

Returns the absolute transformation (i.e. the actual displayed GL transforamtion) of an entity

Parameters
[out]transabsolute transformation
Returns
whether a GL transformation is actually enabled or not

Definition at line 740 of file ecvHObject.cpp.

References ccDrawableObject::getGLTransformation(), getParent(), ccDrawableObject::isGLTransEnabled(), and ccGLMatrixTpl< T >::toIdentity().

Referenced by ccSphere::drawNameIn3D(), getDisplayBB_recursive(), cc2DLabel::pointPicking(), ccGenericPointCloud::pointPicking(), ccOctree::pointPicking(), and ccGenericMesh::trianglePicking().

◆ GetAxisAlignedBoundingBox()

◆ getBB_recursive()

ccBBox ccHObject::getBB_recursive ( bool  withGLFeatures = false,
bool  onlyEnabledChildren = true 
)
virtual

◆ GetCenter()

virtual Eigen::Vector3d ccHObject::GetCenter ( ) const
inlinevirtual

◆ getChild()

ccHObject* ccHObject::getChild ( unsigned  childPos) const
inline

Returns the ith child.

Parameters
childPoschild position
Returns
child object (or nullptr if wrong position)

Definition at line 325 of file ecvHObject.h.

Referenced by PclTransformTool::addActors(), ecvFilterTool::addAssociatedEntity(), ecvMeasurementTool::addAssociatedEntity(), PclUtils::PCLVis::addCaption(), ccGraphicalTransformationTool::addEntity(), ccGraphicalSegmentationTool::addEntity(), ccCompass::addGeoObject(), MainWindow::addToDB(), ccPointPairRegistrationDlg::align(), ccPointCloud::append(), ccGraphicalTransformationTool::apply(), cloudViewer::io::AutoReadEntity(), ccGraphicalTransformationTool::cancel(), ccPointPairRegistrationDlg::clear(), ccHObjectCaster::CloneChildren(), ccComparisonDlg::computeDistances(), ccEntityAction::computeNormals(), JsonRPCPlugin::execute(), ccDBRoot::expandElement(), ccDBRoot::expandOrCollapseHoveredBranch(), ccGraphicalTransformationTool::exportNewEntities(), ecvFilterTool::exportSlice(), find(), CC_ITEM_TREE::findItemInHierarchy(), FindRobust(), ccCompass::fitPlaneToGeoObject(), ccDBRoot::gatherRecursiveInformation(), ccGeoObject::generateInterior(), ccGeoObject::generateLower(), ccGeoObject::generateUpper(), ccCompass::getInsertPoint(), ccCompass::hideAllPointClouds(), ccGenericMesh::IsCloudVerticesOfMesh(), ccPolyline::IsCloudVerticesOfPolyline(), ccPointPairRegistrationDlg::label2DMove(), DistanceMapGenerationDlg::labelFontSizeChanged(), PhotoScanFilter::loadFile(), PTXFilter::loadFile(), E57Filter::loadFile(), LASFilter::loadFile(), FileIOFilter::LoadFromFile(), ccCompass::onSave(), DistanceMapGenerationDlg::overlayGridColorChanged(), DistanceMapGenerationDlg::overlaySymbolsColorChanged(), DistanceMapGenerationDlg::overlaySymbolsSizeChanged(), ccTraceTool::pickupTrace(), ccNoteTool::pointPicked(), ccCompass::recalculateFitPlanes(), ccCompass::recurseLabels(), ccCompass::recurseNormals(), ccCompass::recurseStipple(), ccClipBox::releaseAssociatedEntities(), ccPointPairRegistrationDlg::removeAlignedPoint(), ccPointPairRegistrationDlg::removeRefPoint(), ccPointPairRegistrationDlg::reset(), ccCompassExport::saveCSV(), PcdFilter::saveToFile(), AsciiFilter::saveToFile(), SalomeHydroFilter::saveToFile(), SinusxFilter::saveToFile(), MascaretFilter::saveToFile(), E57Filter::saveToFile(), FBXFilter::saveToFile(), ccCompassExport::saveXML(), ccEntityAction::setColor(), PclUtils::PCLVis::SetDataAxesGridProperties(), ccPointPairRegistrationDlg::showAlignedEntities(), ccPointPairRegistrationDlg::showReferenceEntities(), ccDBRoot::sortSelectedEntitiesChildren(), ecvDisplayTools::StartCPUBasedPointPicking(), ecvFilterTool::stop(), ccEntityAction::toggleProperty(), ccCompass::tryLoading(), ccDBRoot::unloadAll(), ccClipBox::update(), ccPointPairRegistrationDlg::updateAlignedMarkers(), ccPointPairRegistrationDlg::updateAllMarkers(), VtkUtils::TableModel::updateData(), ccNormalVectors::UpdateNormalOrientations(), ccPointPairRegistrationDlg::updateRefMarkers(), and ccCompass::writeToXML().

◆ getChildCountRecursive()

unsigned int ccHObject::getChildCountRecursive ( ) const

Returns the total number of children under this object recursively.

Returns
Number of children

Definition at line 584 of file ecvHObject.cpp.

References count, and m_children.

Referenced by ccDBRoot::data(), and define_ccObject().

◆ getChildIndex()

◆ getChildrenNumber()

unsigned ccHObject::getChildrenNumber ( ) const
inline

Returns the number of children.

Returns
children number

Definition at line 312 of file ecvHObject.h.

Referenced by PclTransformTool::addActors(), ecvFilterTool::addAssociatedEntity(), ecvMeasurementTool::addAssociatedEntity(), PclUtils::PCLVis::addCaption(), ccDBRoot::addElement(), ccGraphicalTransformationTool::addEntity(), ccGraphicalSegmentationTool::addEntity(), ecvTools::AddPointCloud(), MainWindow::addToDB(), ccPointPairRegistrationDlg::align(), ccPointCloud::append(), ccGraphicalTransformationTool::apply(), cloudViewer::io::AutoReadEntity(), ccGraphicalTransformationTool::cancel(), ccPointListPickingDlg::cancelAndExit(), ccMesh::ccMesh(), ccPointPairRegistrationDlg::clear(), ccHObjectCaster::CloneChildren(), CorrespondenceMatching::compute(), DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), SACSegmentation::compute(), NurbsCurveFitting::compute(), ccClipBox::computeArrowsScale(), ccComparisonDlg::computeDistances(), ccEntityAction::computeNormals(), qFacets::createFacets(), ecvMeasurementTool::createMeasurementTool(), ccDBRoot::data(), define_ccObject(), ccDBRoot::deleteSelectedEntities(), q3DMASCPlugin::doTrainAction(), ccDBRoot::dropMimeData(), ccDBRoot::expandElement(), ccDBRoot::expandOrCollapseHoveredBranch(), StereogramDialog::exportCurrentSelection(), qFacets::exportFacets(), qFacets::extractFacets(), ccPropertiesTreeDelegate::fillWithHObject(), ccPropertiesTreeDelegate::fillWithViewProperties(), find(), CC_ITEM_TREE::findItemInHierarchy(), FindRobust(), ccCompass::fitPlaneToGeoObject(), ccDBRoot::gatherRecursiveInformation(), ccGeoObject::generateInterior(), ccGeoObject::generateLower(), ccGeoObject::generateUpper(), ecvTools::GetClousterGroup(), ecvAnnotationsTool::getNumberOfAssociatedEntity(), ecvFilterTool::getNumberOfAssociatedEntity(), ecvMeasurementTool::getNumberOfAssociatedEntity(), ccGraphicalTransformationTool::getNumberOfValidEntities(), ecvTools::GetSegmentationGroup(), MainWindow::getSelectedEntityBbox(), ccCompass::hideAllPointClouds(), ccGenericMesh::IsCloudVerticesOfMesh(), ccPolyline::IsCloudVerticesOfPolyline(), ccPointPairRegistrationDlg::label2DMove(), DistanceMapGenerationDlg::labelFontSizeChanged(), PhotoScanFilter::loadFile(), ObjFilter::loadFile(), PTXFilter::loadFile(), E57Filter::loadFile(), FBXFilter::loadFile(), LASFilter::loadFile(), FileIOFilter::LoadFromFile(), q3DMASCPlugin::onNewSelection(), DistanceMapGenerationDlg::overlayGridColorChanged(), DistanceMapGenerationDlg::overlaySymbolsColorChanged(), DistanceMapGenerationDlg::overlaySymbolsSizeChanged(), ccTraceTool::pickupTrace(), ccPointListPickingDlg::processPickedPoint(), ccClipBox::releaseAssociatedEntities(), ccDBRoot::removeElement(), ccDBRoot::removeElements(), ecvAnnotationsTool::reset(), ccPointPairRegistrationDlg::reset(), ccClipBox::reset(), ccDBRoot::rowCount(), PcdFilter::saveToFile(), AsciiFilter::saveToFile(), SalomeHydroFilter::saveToFile(), SinusxFilter::saveToFile(), MascaretFilter::saveToFile(), E57Filter::saveToFile(), FBXFilter::saveToFile(), ccCompassExport::saveXML(), ccDBRoot::selectChildrenByTypeAndName(), ccEntityAction::setColor(), PclUtils::PCLVis::SetDataAxesGridProperties(), ccPropertiesTreeDelegate::setEditorData(), ccPointPairRegistrationDlg::showAlignedEntities(), ccDBRoot::showContextMenu(), ccPointPairRegistrationDlg::showReferenceEntities(), ccDBRoot::sortSelectedEntitiesChildren(), ccGraphicalTransformationTool::start(), ecvMeasurementTool::start(), ecvDisplayTools::StartCPUBasedPointPicking(), ccEntityAction::toggleProperty(), ccCompass::tryLoading(), ccDBRoot::unloadAll(), ccPointPairRegistrationDlg::unstackAligned(), ccPointPairRegistrationDlg::unstackRef(), ccClipBox::update(), ccPointPairRegistrationDlg::updateAllMarkers(), VtkUtils::TableModel::updateData(), ccNormalVectors::UpdateNormalOrientations(), ccCompass::writeToXML(), and ccPointPairRegistrationDlg::zoomGlobalOnRegistrationEntities().

◆ getClassID()

CV_CLASS_ENUM ccHObject::getClassID ( ) const
inlineoverridevirtual

◆ getDependencyFlagsWith()

int ccHObject::getDependencyFlagsWith ( const ccHObject otherObject)

Returns the dependency flags with a given object.

Parameters
otherObjectother object

Definition at line 487 of file ecvHObject.cpp.

References m_dependencies.

Referenced by ccDBRoot::dropMimeData(), removeAllChildren(), removeChild(), removeDependencyFlag(), MainWindow::removeObjectTemporarilyFromDBTree(), transferChild(), and transferChildren().

◆ getDisplayBB_recursive()

ccBBox ccHObject::getDisplayBB_recursive ( bool  relative)
virtual

Returns the bounding-box of this entity and it's children WHEN DISPLAYED.

Children's GL transformation is taken into account (if enabled).

Parameters
relativewhether 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)
displayif 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)
Returns
bounding-box

Definition at line 817 of file ecvHObject.cpp.

References getAbsoluteGLTransformation(), getDisplayBB_recursive(), ccDrawableObject::getGLTransformation(), getOwnBB(), cloudViewer::BoundingBoxTpl< T >::isValid(), and m_children.

Referenced by define_ccObject(), drawBB(), getDisplayBB_recursive(), ecvAnnotationsTool::getSelectedEntityBbox(), ecvFilterTool::getSelectedEntityBbox(), MainWindow::getSelectedEntityBbox(), PclUtils::PCLVis::SetDataAxesGridProperties(), DistanceMapGenerationDlg::update(), ccRasterizeTool::updateGridAndDisplay(), ccVolumeCalcTool::updateGridAndDisplay(), qCanupo2DViewDialog::updateZoom(), ccPointPairRegistrationDlg::zoomGlobalOnRegistrationEntities(), and MainWindow::zoomOnEntities().

◆ getEntityType()

◆ getFirstChild()

ccHObject* ccHObject::getFirstChild ( ) const
inline

◆ getGlobalBB_recursive()

ccHObject::GlobalBoundingBox ccHObject::getGlobalBB_recursive ( bool  withGLFeatures = false,
bool  onlyEnabledChildren = true 
)
virtual

Returns the global bounding-box of this entity and it's children.

Parameters
withGLFeatureswhether to take into account display-only elements (if any)
onlyEnabledChildrenonly consider the 'enabled' children
Returns
bounding-box

Definition at line 1670 of file ecvHObject.cpp.

References getOwnGlobalBB(), and m_children.

◆ getGLTransformationHistory()

◆ getIcon()

QIcon ccHObject::getIcon ( ) const
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.

Returns
invalid icon by default (to be re-implemented by child class)

Definition at line 248 of file ecvHObject.cpp.

Referenced by ccDBRoot::data().

◆ getIndex()

int ccHObject::getIndex ( ) const

Returns index relatively to its parent or -1 if no parent.

Definition at line 695 of file ecvHObject.cpp.

References getChildIndex(), and m_parent.

Referenced by ccSensor::addPosition(), define_ccObject(), ccSensor::getIndexBounds(), and ccDBRoot::parent().

◆ getLastChild()

ccHObject* ccHObject::getLastChild ( ) const
inline

Shortcut: returns last child.

Definition at line 400 of file ecvHObject.h.

Referenced by define_ccObject().

◆ GetMax2DBound()

virtual Eigen::Vector2d ccHObject::GetMax2DBound ( ) const
inlinevirtual

◆ GetMaxBound()

virtual Eigen::Vector3d ccHObject::GetMaxBound ( ) const
inlinevirtual

◆ GetMin2DBound()

virtual Eigen::Vector2d ccHObject::GetMin2DBound ( ) const
inlinevirtual

◆ GetMinBound()

virtual Eigen::Vector3d ccHObject::GetMinBound ( ) const
inlinevirtual

◆ GetOrientedBoundingBox()

◆ getOwnBB()

◆ getOwnFitBB()

ccBBox ccHObject::getOwnFitBB ( ccGLMatrix trans)
virtual

Returns best-fit bounding-box (if available)

Warning
Only suitable for leaf objects (i.e. without children) Therefore children bboxes are always ignored.
This method is not supported by all entities! (returns the axis-aligned bounding-box by default).
Parameters
[out]transassociated transformation (so that the bounding-box can be displayed in the right position!)
Returns
fit bounding-box

Reimplemented in ccQuadric, ccPlane, ccGBLSensor, ccDisc, and ccCameraSensor.

Definition at line 1009 of file ecvHObject.cpp.

References getOwnBB(), and ccGLMatrixTpl< T >::toIdentity().

Referenced by drawBB(), and ccPropertiesTreeDelegate::fillWithHObject().

◆ getOwnGlobalBB() [1/2]

ccHObject::GlobalBoundingBox ccHObject::getOwnGlobalBB ( bool  withGLFeatures = false)
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

Parameters
withGLFeatureswhether to take into account display-only elements (if any)
Returns
global bounding-box

Reimplemented in ccShiftedObject.

Definition at line 1654 of file ecvHObject.cpp.

References Vector3Tpl< double >::fromArray(), getOwnBB(), cloudViewer::BoundingBoxTpl< T >::maxCorner(), cloudViewer::BoundingBoxTpl< T >::minCorner(), and Tuple3Tpl< Type >::u.

Referenced by getGlobalBB_recursive().

◆ getOwnGlobalBB() [2/2]

bool ccHObject::getOwnGlobalBB ( CCVector3d minCorner,
CCVector3d maxCorner 
)
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.

Parameters
[out]minCornermin global bounding-box corner
[out]maxCornermax global bounding-box corner
Returns
whether the bounding box is valid or not

Reimplemented in ccShiftedObject.

Definition at line 1662 of file ecvHObject.cpp.

References Vector3Tpl< double >::fromArray(), getOwnBB(), cloudViewer::BoundingBoxTpl< T >::isValid(), cloudViewer::BoundingBoxTpl< T >::maxCorner(), cloudViewer::BoundingBoxTpl< T >::minCorner(), and Tuple3Tpl< Type >::u.

◆ getParent()

ccHObject* ccHObject::getParent ( ) const
inline

Returns parent object.

Returns
parent object (nullptr if no parent)

Definition at line 245 of file ecvHObject.h.

Referenced by ccDBRoot::addElement(), ccGraphicalTransformationTool::addEntity(), ccGraphicalTransformationTool::apply(), ccGraphicalSegmentationTool::applySegmentation(), FacetsClassifier::ByOrientation(), CanDetachCloud(), qCanupoProcess::Classify(), qFacets::classifyFacetsByAngle(), ccPointListPickingDlg::clearLastLabel(), ccEntityAction::clearProperty(), ExtractSIFT::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), ProjectionFilter::compute(), StatisticalOutliersRemover::compute(), CorrespondenceMatching::compute(), TemplateAlignment::compute(), DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), MinimumCutSegmentation::compute(), RegionGrowingSegmentation::compute(), SACSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsCurveFitting::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), qM3C2Process::Compute(), ccEntityAction::ConvexHull(), define_ccObject(), ccDBRoot::deleteSelectedEntities(), detachChild(), qPCV::doAction(), ccDBRoot::dropMimeData(), ccVolumeCalcTool::exportGridAsCloud(), ccGraphicalTransformationTool::exportNewEntities(), ecvFilterTool::exportSlice(), FindRobust(), ccTraceTool::finishCurrentTrace(), ccDBRoot::flags(), ccRasterizeTool::generateCloud(), ccRasterizeTool::generateMesh(), getAbsoluteGLTransformation(), G3Point::G3PointAction::getBorders(), ccGeoObject::getGeoObjectParent(), ccGeoObject::getGeoObjectRegion(), ccMesh::getUniqueIDForDisplay(), ccPolyline::getUniqueIDForDisplay(), qM3C2Tools::GuessBestParams(), ccGenericMesh::handleColorRamp(), ccCommandLineParser::importFile(), isAncestorOf(), ccGenericMesh::IsCloudVerticesOfMesh(), ccPolyline::IsCloudVerticesOfPolyline(), ccDBRoot::parent(), ccTraceTool::pickupTrace(), CommandClearNormals::process(), CommandExtractVertices::process(), FacetsClassifier::ProcessFamiliy(), ccEntityAction::RansacSegmentation(), ReadCloud(), ccCompass::recalculateFitPlanes(), removeChild(), MainWindow::removeFromDB(), MainWindow::removeObjectTemporarilyFromDBTree(), RemoveUnusedLabelsAndUpdateTheOthers(), ccColorScaleEditorDialog::saveCurrentScale(), DxfFilter::saveToFile(), DepthMapFileFilter::saveToFile(), ccEntityAction::setColor(), SetEnabled_recursive(), ccPolyline::setGlobalScale(), ccPolyline::setGlobalShift(), ccRenderingTools::ShowDepthBuffer(), ecvPoissonReconDlg::start(), transferChild(), transferChildren(), ccMesh::transformTriNormals(), ccCompass::tryLoading(), and GrainsAsEllipsoids::updateMeshAndLineSet().

◆ GetRotationMatrixFromAxisAngle()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromAxisAngle ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from AxisAngle RotationType.

Definition at line 420 of file ecvHObject.cpp.

References rotation.

◆ GetRotationMatrixFromEulerAngle()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromEulerAngle ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from Euler angle.

Definition at line 434 of file ecvHObject.cpp.

References rotation.

◆ GetRotationMatrixFromQuaternion()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromQuaternion ( const Eigen::Vector4d &  rotation)
static

Get Rotation Matrix from Quaternion.

Definition at line 426 of file ecvHObject.cpp.

References rotation.

◆ GetRotationMatrixFromXYZ()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromXYZ ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from XYZ RotationType.

Definition at line 378 of file ecvHObject.cpp.

References rotation, cloudViewer::utility::RotationMatrixX(), cloudViewer::utility::RotationMatrixY(), and cloudViewer::utility::RotationMatrixZ().

◆ GetRotationMatrixFromXZY()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromXZY ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from XZY RotationType.

Definition at line 399 of file ecvHObject.cpp.

References rotation, cloudViewer::utility::RotationMatrixX(), cloudViewer::utility::RotationMatrixY(), and cloudViewer::utility::RotationMatrixZ().

◆ GetRotationMatrixFromYXZ()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromYXZ ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from YXZ RotationType.

Definition at line 413 of file ecvHObject.cpp.

References rotation, cloudViewer::utility::RotationMatrixX(), cloudViewer::utility::RotationMatrixY(), and cloudViewer::utility::RotationMatrixZ().

◆ GetRotationMatrixFromYZX()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromYZX ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from YZX RotationType.

Definition at line 385 of file ecvHObject.cpp.

References rotation, cloudViewer::utility::RotationMatrixX(), cloudViewer::utility::RotationMatrixY(), and cloudViewer::utility::RotationMatrixZ().

◆ GetRotationMatrixFromZXY()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromZXY ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from ZXY RotationType.

Definition at line 392 of file ecvHObject.cpp.

References rotation, cloudViewer::utility::RotationMatrixX(), cloudViewer::utility::RotationMatrixY(), and cloudViewer::utility::RotationMatrixZ().

◆ GetRotationMatrixFromZYX()

Eigen::Matrix3d ccHObject::GetRotationMatrixFromZYX ( const Eigen::Vector3d &  rotation)
static

Get Rotation Matrix from ZYX RotationType.

Definition at line 406 of file ecvHObject.cpp.

References rotation, cloudViewer::utility::RotationMatrixX(), cloudViewer::utility::RotationMatrixY(), and cloudViewer::utility::RotationMatrixZ().

◆ getSelectionBehavior()

virtual SelectionBehavior ccHObject::getSelectionBehavior ( ) const
inlinevirtual

Returns selection behavior.

Definition at line 621 of file ecvHObject.h.

Referenced by drawBB(), and ccPropertiesTreeDelegate::fillWithHObject().

◆ getTypeID_recursive() [1/2]

void ccHObject::getTypeID_recursive ( std::vector< hideInfo > &  hdInfos,
bool  relative 
)

◆ getTypeID_recursive() [2/2]

◆ getUniqueIDForDisplay()

virtual unsigned ccHObject::getUniqueIDForDisplay ( ) const
inlinevirtual

Returns object unqiue ID used for display.

Reimplemented in ccPolyline, ccPointCloud, and ccMesh.

Definition at line 626 of file ecvHObject.h.

References ccObject::getUniqueID().

◆ getViewId()

QString ccHObject::getViewId ( ) const
inline

Definition at line 225 of file ecvHObject.h.

References ccObject::getUniqueID().

Referenced by PclTransformTool::addActors(), PclUtils::PCLVis::addCaption(), ccLibAlgorithms::ApplyScaleMatchingAlgorithm(), cc2DLabel::cc2DLabel(), ecvDisplayTools::ChangeEntityProperties(), cc2DLabel::clear2Dviews(), cc2DViewportLabel::clear2Dviews(), ccCameraSensor::clearDrawings(), cc2DLabel::clearLabel(), draw(), cc2DViewportLabel::drawMeOnly(), ccCameraSensor::drawMeOnly(), ccClipBox::drawMeOnly(), ccCoordinateSystem::drawMeOnly(), cc2DLabel::drawMeOnly2D(), cc2DLabel::drawMeOnly3D(), PCLDisplayTools::drawWidgets(), ccPropertiesTreeDelegate::fillModel(), ccPropertiesTreeDelegate::fillWithViewProperties(), getTypeID_recursive(), ccSensor::hideShowDrawings(), ccCameraSensor::hideShowDrawings(), ccGBLSensor::hideShowDrawings(), ecvDisplayTools::HideShowEntities(), notifyGeometryUpdate(), BasePclModule::performAction(), ecvDisplayTools::Pick2DLabel(), ecvDisplayTools::RemoveEntities(), removeFromRenderScreen(), ccTracePolylineTool::resetPoly3D(), ccGraphicalSegmentationTool::resetSegmentation(), MainWindow::resetSelectedBBox(), ccTracePolylineTool::resetTip(), ccDBRoot::setData(), PclUtils::PCLVis::SetDataAxesGridProperties(), ccPropertiesTreeDelegate::setEditorData(), cvGenericFilter::setInput(), cvGenericMeasurementTool::setInput(), PclAnnotationTool::setInputCloud(), ecvDisplayTools::StartCPUBasedPointPicking(), ccPointPairRegistrationDlg::updateSphereMarks(), and ccGenericMesh::updateTextures().

◆ hideBB()

void ccHObject::hideBB ( CC_DRAW_CONTEXT  context)

◆ hideObject_recursive()

◆ isAncestorOf()

◆ isBranchEnabled()

bool ccHObject::isBranchEnabled ( ) const
virtual

Returns whether the object and all its ancestors are enabled.

Definition at line 936 of file ecvHObject.cpp.

References isBranchEnabled(), ccObject::isEnabled(), and m_parent.

Referenced by isBranchEnabled(), and isDisplayed().

◆ isDisplayed()

bool ccHObject::isDisplayed ( ) const
virtual

Returns whether the object is actually displayed (visible) or not.

Definition at line 934 of file ecvHObject.cpp.

References isBranchEnabled(), and ccDrawableObject::isVisible().

Referenced by ccThicknessTool::onNewSelection().

◆ IsEmpty()

◆ isGroup()

bool ccHObject::isGroup ( ) const
inline

Returns whether the instance is a group.

Definition at line 237 of file ecvHObject.h.

References ccObject::getClassID(), and CV_TYPES::HIERARCHY_OBJECT.

Referenced by ecvFilterTool::addAssociatedEntity(), ecvMeasurementTool::addAssociatedEntity(), and define_ccObject().

◆ isSerializable()

◆ isShareable()

virtual bool ccHObject::isShareable ( ) const
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 ccMaterialSet, ccArray< Type, N, ComponentType >, ccArray< CompressedNormType, 1, CompressedNormType >, ccArray< TexCoords2D, 2, float >, ccArray< ecvColor::Rgba, 4, ColorCompType >, ccArray< CCVector3, 3, PointCoordinateType >, and ccArray< ecvColor::Rgb, 3, ColorCompType >.

Definition at line 602 of file ecvHObject.h.

Referenced by addChild(), removeAllChildren(), and removeChild().

◆ minimumFileVersion()

short ccHObject::minimumFileVersion ( ) const
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:

  • Forward compatibility: newer software can read older files (dataVersion check in fromFile)
  • Backward compatibility: determine minimum version needed to save current data
    Returns
    minimum file version required for this object

Implements ccSerializableObject.

Definition at line 1164 of file ecvHObject.cpp.

References ccGLMatrixTpl< T >::isIdentity(), m_children, m_glTransHistory, ccObject::minimumFileVersion(), and minimumFileVersion_MeOnly().

Referenced by ccIndexedTransformationBuffer::minimumFileVersion_MeOnly(), ccMaterialSet::minimumFileVersion_MeOnly(), and ccPointCloud::minimumFileVersion_MeOnly().

◆ minimumFileVersion_MeOnly()

short ccHObject::minimumFileVersion_MeOnly ( ) const
protectedvirtual

◆ New() [1/2]

ccHObject * ccHObject::New ( const QString &  pluginId,
const QString &  classId,
const char *  name = nullptr 
)
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

Definition at line 225 of file ecvHObject.cpp.

References ccExternalFactory::buildObject(), ccExternalFactory::Container::GetUniqueInstance(), name, and ccObject::setName().

◆ New() [2/2]

◆ notifyGeometryUpdate()

◆ onDeletionOf()

void ccHObject::onDeletionOf ( const ccHObject obj)
protectedvirtual

This method is called when another object is deleted.

For internal use.

Reimplemented in cloudViewer::geometry::Image, ccMesh, ccImage, and cc2DLabel.

Definition at line 519 of file ecvHObject.cpp.

References getChildIndex(), m_children, and removeDependencyWith().

Referenced by cc2DLabel::onDeletionOf(), ccImage::onDeletionOf(), ccMesh::onDeletionOf(), and cloudViewer::geometry::Image::onDeletionOf().

◆ onUpdateOf()

virtual void ccHObject::onUpdateOf ( ccHObject obj)
inlineprotectedvirtual

This method is called when another object (geometry) is updated.

For internal use.

Reimplemented in ccSubMesh, and ccMesh.

Definition at line 706 of file ecvHObject.h.

Referenced by ccMesh::onUpdateOf().

◆ popDisplayState()

void ccHObject::popDisplayState ( bool  apply = true)
overridevirtual

◆ pushDisplayState()

bool ccHObject::pushDisplayState ( )
overridevirtual

Pushes the current display state (overridden)

Reimplemented from ccDrawableObject.

Definition at line 1748 of file ecvHObject.cpp.

References ccDrawableObject::m_displayStateStack, and CVLog::Warning().

Referenced by ccGraphicalSegmentationTool::addEntity().

◆ redrawDisplay()

◆ redrawDisplay_recursive()

virtual void ccHObject::redrawDisplay_recursive ( bool  p)
inlinevirtual

Definition at line 536 of file ecvHObject.h.

◆ refreshDisplay_recursive()

virtual void ccHObject::refreshDisplay_recursive ( bool  p)
inlinevirtual

Definition at line 539 of file ecvHObject.h.

◆ removeAllChildren()

◆ removeChild() [1/2]

◆ removeChild() [2/2]

void ccHObject::removeChild ( int  pos)

Removes a specific child given its index.

Warning
This method may delete the child if the DP_PARENT_OF_OTHER dependency flag is set for this child (use detachChild if you want to avoid deletion).

Definition at line 1063 of file ecvHObject.cpp.

References DP_DELETE_OTHER, getDependencyFlagsWith(), getParent(), isShareable(), m_children, removeDependencyWith(), and setParent().

◆ removeDependencyFlag()

void ccHObject::removeDependencyFlag ( ccHObject otherObject,
DEPENDENCY_FLAGS  flag 
)

Removes a given dependency flag.

Parameters
otherObjectother object
flagdependency flag to remove (see DEPENDENCY_FLAGS)

Definition at line 506 of file ecvHObject.cpp.

References getDependencyFlagsWith(), and m_dependencies.

Referenced by ccDBRoot::dropMimeData(), and removeDependencyWith().

◆ removeDependencyWith()

void ccHObject::removeDependencyWith ( ccHObject otherObject)

◆ removeFromRenderScreen()

◆ resetGLTransformationHistory()

virtual void ccHObject::resetGLTransformationHistory ( )
inlinevirtual

Resets the transformation 'history' matrix.

Definition at line 639 of file ecvHObject.h.

Referenced by define_ccObject().

◆ resetGLTransformationHistory_recursive()

virtual void ccHObject::resetGLTransformationHistory_recursive ( )
inlinevirtual

Definition at line 550 of file ecvHObject.h.

Referenced by FBXFilter::loadFile(), and LoadScan().

◆ ResizeAndPaintUniformColor()

void ccHObject::ResizeAndPaintUniformColor ( std::vector< Eigen::Vector3d > &  colors,
std::size_t  size,
const Eigen::Vector3d &  color 
)
static

Resizes the colors vector and paints a uniform color.

Parameters
colorsAn array of eigen vectors specifies colors in RGB.
sizeThe resultant size of the colors array.
colorThe final color in which the colors will be painted.

Definition at line 251 of file ecvHObject.cpp.

References color, colors, LogWarning, and size.

◆ Rotate() [1/2]

virtual ccHObject& ccHObject::Rotate ( const Eigen::Matrix3d &  R)
inlinevirtual

Definition at line 190 of file ecvHObject.h.

◆ Rotate() [2/2]

virtual ccHObject& ccHObject::Rotate ( const Eigen::Matrix3d &  R,
const Eigen::Vector3d &  center 
)
inlinevirtual

Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$.

Parameters
RA 3x3 rotation matrix
centerRotation center that is used for the rotation.

Reimplemented in cloudViewer::geometry::VoxelGrid, cloudViewer::geometry::Octree, cloudViewer::geometry::LineSet, ccPolyline, ccPointCloud, ecvOrientedBBox, cloudViewer::geometry::ecvMeshBase, ccMesh, ccFacet, ccBBox, and cloudViewer::visualization::PointCloudPicker.

Definition at line 186 of file ecvHObject.h.

◆ RotateCovariances()

void ccHObject::RotateCovariances ( const Eigen::Matrix3d &  R,
std::vector< Eigen::Matrix3d > &  covariances 
)
static

Rotate all covariance matrices with the rotation matrix R.

Parameters
RA 3x3 rotation matrix
covariancesA list of covariance matrices to be transformed.

The only part that affects the covariance is the rotation part. For more information on variance propagation please visit: https://en.wikipedia.org/wiki/Propagation_of_uncertainty

Definition at line 371 of file ecvHObject.cpp.

Referenced by ccPointCloud::Rotate(), and TransformCovariances().

◆ RotateNormals()

void ccHObject::RotateNormals ( const Eigen::Matrix3d &  R,
std::vector< Eigen::Vector3d > &  normals 
)
static

Rotate all normals with the rotation matrix R.

Parameters
RA 3x3 rotation matrix
normalsA list of normals to be transformed.

Definition at line 361 of file ecvHObject.cpp.

References normal, and normals.

Referenced by cloudViewer::geometry::ecvMeshBase::Rotate().

◆ RotatePoints()

void ccHObject::RotatePoints ( const Eigen::Matrix3d &  R,
std::vector< Eigen::Vector3d > &  points,
const Eigen::Vector3d &  center 
)
static

Rotate all points with the rotation matrix R.

Parameters
RA 3x3 rotation matrix defines the axis of rotation and the norm the angle around this axis.
pointsA list of points to be transformed.
centerRotation center that is used for the rotation.

Definition at line 353 of file ecvHObject.cpp.

References points.

Referenced by cloudViewer::geometry::ecvMeshBase::Rotate(), and cloudViewer::geometry::LineSet::Rotate().

◆ Scale() [1/2]

virtual ccHObject& ccHObject::Scale ( const double  s)
inlinevirtual

Definition at line 179 of file ecvHObject.h.

References Scale().

Referenced by Scale().

◆ Scale() [2/2]

virtual ccHObject& ccHObject::Scale ( const double  s,
const Eigen::Vector3d &  center 
)
inlinevirtual

Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$.

Parameters
scaleThe scale parameter that is multiplied to the points/vertices of the geometry.
centerScale center that is used to resize the geometry.

Reimplemented in ecvOrientedBBox, cloudViewer::geometry::VoxelGrid, cloudViewer::geometry::Octree, cloudViewer::geometry::LineSet, ccPolyline, ccPointCloud, cloudViewer::geometry::ecvMeshBase, ccMesh, ccFacet, ccBBox, and cloudViewer::visualization::PointCloudPicker.

Definition at line 176 of file ecvHObject.h.

◆ ScalePoints()

void ccHObject::ScalePoints ( const double  scale,
std::vector< Eigen::Vector3d > &  points,
const Eigen::Vector3d &  center 
)
static

Scale the coordinates of all points by the scaling factor scale.

Parameters
scaleIf true, the scale is applied relative to the center of the geometry. Otherwise, the scale is directly applied to the geometry, i.e. relative to the origin.
pointsA list of points to be transformed.
centerIf true, then the scale is applied to the centered geometry.

Definition at line 345 of file ecvHObject.cpp.

References points.

Referenced by cloudViewer::geometry::ecvMeshBase::Scale(), and cloudViewer::geometry::LineSet::Scale().

◆ setForceRedrawRecursive()

void ccHObject::setForceRedrawRecursive ( bool  redraw = false)

◆ setGLTransformationHistory()

virtual void ccHObject::setGLTransformationHistory ( const ccGLMatrix mat)
inlinevirtual

◆ setHideShowType()

void ccHObject::setHideShowType ( CC_DRAW_CONTEXT context)

Definition at line 1626 of file ecvHObject.cpp.

References context, ecvDisplayTools::ConvertToEntityType(), and getClassID().

Referenced by draw().

◆ setLineWidthRecursive()

void ccHObject::setLineWidthRecursive ( PointCoordinateType  width)

◆ setParent()

virtual void ccHObject::setParent ( ccHObject anObject)
inlineprotectedvirtual

Sets parent object.

Definition at line 652 of file ecvHObject.h.

Referenced by addChild(), detachChild(), and removeChild().

◆ setPointSizeRecursive()

◆ setRedrawFlagRecursive()

◆ setRemoveType()

void ccHObject::setRemoveType ( CC_DRAW_CONTEXT context)

Definition at line 1635 of file ecvHObject.cpp.

References context, ecvDisplayTools::ConvertToEntityType(), and getClassID().

Referenced by draw().

◆ setSelected_recursive()

virtual void ccHObject::setSelected_recursive ( bool  p)
inlinevirtual

Definition at line 541 of file ecvHObject.h.

◆ setSelectionBehavior()

virtual void ccHObject::setSelectionBehavior ( SelectionBehavior  mode)
inlinevirtual

Sets selection behavior (when displayed)

WARNING: SELECTION_FIT_BBOX relies on the 'ccDrawableObject::getFitBB' method (which is not supported by all entities).

Definition at line 616 of file ecvHObject.h.

Referenced by ccCameraSensor::ccCameraSensor(), ccClipBox::ccClipBox(), ccGBLSensor::ccGBLSensor(), ccTraceTool::finishCurrentTrace(), and ccFitPlaneTool::pointPicked().

◆ showBB()

void ccHObject::showBB ( CC_DRAW_CONTEXT  context)

Definition at line 1647 of file ecvHObject.cpp.

References context, ECV_SHAPE, and ecvDisplayTools::HideShowEntities().

Referenced by draw(), and ccDBRoot::setData().

◆ swapChildren()

void ccHObject::swapChildren ( unsigned  firstChildIndex,
unsigned  secondChildIndex 
)

Swaps two children.

Definition at line 687 of file ecvHObject.cpp.

References m_children, and std::swap().

Referenced by define_ccObject(), and ccDBRoot::sortSelectedEntitiesChildren().

◆ toFile()

bool ccHObject::toFile ( QFile &  out,
short  dataVersion 
) const
overridevirtual

Saves data to binary stream.

Parameters
outoutput file (already opened)
dataVersiontarget file version (for forward/backward compatibility)
Returns
success

Reimplemented from ccSerializableObject.

Definition at line 1117 of file ecvHObject.cpp.

◆ toFile_MeOnly()

bool ccHObject::toFile_MeOnly ( QFile &  out,
short  dataVersion 
) const
protectedvirtual

◆ toggleActivation_recursive()

virtual void ccHObject::toggleActivation_recursive ( )
inlinevirtual

Definition at line 543 of file ecvHObject.h.

◆ toggleColors_recursive()

virtual void ccHObject::toggleColors_recursive ( )
inlinevirtual

Definition at line 547 of file ecvHObject.h.

Referenced by ccEntityAction::toggleProperty().

◆ toggleNormals_recursive()

virtual void ccHObject::toggleNormals_recursive ( )
inlinevirtual

Definition at line 553 of file ecvHObject.h.

Referenced by ccEntityAction::toggleProperty().

◆ toggleSF_recursive()

virtual void ccHObject::toggleSF_recursive ( )
inlinevirtual

Definition at line 556 of file ecvHObject.h.

Referenced by ccEntityAction::toggleProperty().

◆ toggleShowName_recursive()

virtual void ccHObject::toggleShowName_recursive ( )
inlinevirtual

Definition at line 559 of file ecvHObject.h.

Referenced by ccEntityAction::toggleProperty().

◆ toggleVisibility_recursive()

virtual void ccHObject::toggleVisibility_recursive ( )
inlinevirtual

Definition at line 545 of file ecvHObject.h.

Referenced by ccEntityAction::toggleProperty().

◆ transferChild()

void ccHObject::transferChild ( ccHObject child,
ccHObject newParent 
)

Transfer a given child to another parent.

Definition at line 646 of file ecvHObject.cpp.

References addChild(), addDependency(), detachChild(), getDependencyFlagsWith(), and getParent().

Referenced by ccPointCloud::append().

◆ transferChildren()

void ccHObject::transferChildren ( ccHObject newParent,
bool  forceFatherDependent = false 
)

Transfer all children to another parent.

Definition at line 664 of file ecvHObject.cpp.

References addChild(), getDependencyFlagsWith(), getParent(), m_children, and removeDependencyWith().

Referenced by ccFitPlane::Fit(), and ccCompass::mergeGeoObjects().

◆ Transform()

virtual ccHObject& ccHObject::Transform ( const Eigen::Matrix4d &  transformation)
inlinevirtual

◆ TransformCovariances()

void ccHObject::TransformCovariances ( const Eigen::Matrix4d &  transformation,
std::vector< Eigen::Matrix3d > &  covariances 
)
static

Transforms all covariance matrices with the transformation.

Parameters
transformation4x4 matrix for transformation.
covariancesA list of covariance matrices to be transformed.

Definition at line 327 of file ecvHObject.cpp.

References RotateCovariances().

Referenced by ccPointCloud::Transform().

◆ TransformNormals()

void ccHObject::TransformNormals ( const Eigen::Matrix4d &  transformation,
std::vector< Eigen::Vector3d > &  normals 
)
static

Transforms the normals with the transformation matrix.

Parameters
transformation4x4 matrix for transformation.
normalsA list of normals to be transformed.

Definition at line 317 of file ecvHObject.cpp.

References normal, and normals.

Referenced by cloudViewer::geometry::ecvMeshBase::Transform().

◆ TransformPoints()

void ccHObject::TransformPoints ( const Eigen::Matrix4d &  transformation,
std::vector< Eigen::Vector3d > &  points 
)
static

Transforms all points with the transformation matrix.

Parameters
transformation4x4 matrix for transformation.
pointsA list of points to be transformed.

Definition at line 307 of file ecvHObject.cpp.

References points.

Referenced by cloudViewer::geometry::ecvMeshBase::Transform(), and cloudViewer::geometry::LineSet::Transform().

◆ Translate()

virtual ccHObject& ccHObject::Translate ( const Eigen::Vector3d &  translation,
bool  relative = true 
)
inlinevirtual

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
relativeIf true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation.

Reimplemented in cloudViewer::geometry::VoxelGrid, cloudViewer::geometry::Octree, cloudViewer::geometry::LineSet, ccPolyline, ccPointCloud, ecvOrientedBBox, cloudViewer::geometry::ecvMeshBase, ccMesh, ccFacet, ccBBox, and cloudViewer::visualization::PointCloudPicker.

Definition at line 165 of file ecvHObject.h.

◆ TranslatePoints()

void ccHObject::TranslatePoints ( const Eigen::Vector3d &  translation,
std::vector< Eigen::Vector3d > &  points,
bool  relative 
)
static

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
pointsA list of points to be transformed.
relativeIf true, the translation is directly applied to the \points. Otherwise, the center of the \points is moved to the translation.

Definition at line 333 of file ecvHObject.cpp.

References ComputeCenter(), and points.

Referenced by cloudViewer::geometry::ecvMeshBase::Translate(), and cloudViewer::geometry::LineSet::Translate().

◆ updateNameIn3DRecursive()

Member Data Documentation

◆ m_children

◆ m_dependencies

std::map<ccHObject*, int> ccHObject::m_dependencies
protected

Dependencies map.

First parameter: other object Second parameter: dependency flags (see DEPENDENCY_FLAGS)

Definition at line 721 of file ecvHObject.h.

Referenced by addDependency(), getDependencyFlagsWith(), notifyGeometryUpdate(), removeDependencyFlag(), removeDependencyWith(), and ~ccHObject().

◆ m_glTransHistory

ccGLMatrix ccHObject::m_glTransHistory
protected

Cumulative GL transformation.

History of all the applied transformations since the creation of the object as a single transformation.

Definition at line 727 of file ecvHObject.h.

Referenced by applyGLTransformation(), ccHObject(), ccMesh::getGLTransformationHistory(), minimumFileVersion(), ccPointCloud::scale(), and ccPointCloud::Translate().

◆ m_isDeleting

bool ccHObject::m_isDeleting
protected

Flag to safely handle dependencies when the object is being deleted.

Definition at line 730 of file ecvHObject.h.

Referenced by removeDependencyWith(), and ~ccHObject().

◆ m_parent

◆ m_selectionBehavior

SelectionBehavior ccHObject::m_selectionBehavior
protected

Selection behavior.

Definition at line 715 of file ecvHObject.h.


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