ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CC_ITEM_TREE Namespace Reference

Enumerations

enum  CC_TYPES_MAP { HIERARCHY_OBJECT = CV_TYPES::HIERARCHY_OBJECT , PLANE = CV_TYPES::PLANE , LABEL2D = CV_TYPES::LABEL_2D }
 

Functions

ccHObjectfindItemInHierarchy (ccHObject *root, CC_TYPES_MAP itemType, QString itemName=nullptr)
 
ccHObjectfindOrCreateContainer (ccHObject *parent, const QString &containerName, ecvMainAppInterface *app)
 
cc2DLabelcreatePointLabel2D (QString labelText, ccPointCloud *parentCloud, QPoint clickPoint, unsigned int pointIdx)
 

Enumeration Type Documentation

◆ CC_TYPES_MAP

Enumerator
HIERARCHY_OBJECT 
PLANE 
LABEL2D 

Definition at line 20 of file ccItemTree.h.

Function Documentation

◆ createPointLabel2D()

cc2DLabel * CC_ITEM_TREE::createPointLabel2D ( QString  labelText,
ccPointCloud parentCloud,
QPoint  clickPoint,
unsigned int  pointIdx 
)

Create a cc2DLabel associated with a QPoint within a ccPointCloud.

Parameters
[in]labelTextThe label text to be displayed.
[in]parentCloudThe associated parent cloud.
[in]clickPointThe 2D clickPoint which specifies the rendered label positions.
[in]pointIdxThe point index which specifies the 3D point within the parent cloud.

Definition at line 76 of file ccItemTree.cpp.

References cc2DLabel::addPickedPoint(), cc2DLabel::displayPointLegend(), ecvDisplayTools::GetCurrentScreen(), ecvDisplayTools::GetScreenSize(), ccHObject::redrawDisplay(), cc2DLabel::setCollapsed(), cc2DLabel::setDisplayedIn2D(), ccObject::setName(), cc2DLabel::setPosition(), ccDrawableObject::setVisible(), size, and sourceCloud.

Referenced by ccMeasurementRecorder::addFittingPoint(), and ccMeasurementRecorder::addMeasurementPoint().

◆ findItemInHierarchy()

ccHObject * CC_ITEM_TREE::findItemInHierarchy ( ccHObject root,
CC_TYPES_MAP  itemType,
QString  itemName = nullptr 
)

Find an item in the root's hierarchy tree by type and optionally by name. If multiple matching objects exist in the hierarchy, the first one is returned.

Parameters
[in]rootThe root of the item tree to be searched.
[in]itemTypeThe type of items to be found.
[in]itemName(Optional) name of the searched item.
Exceptions
std::invalid_argumentException is thrown if root is nullptr
Returns
ccHObject* Returns an item if found, otherwise a nullptr.

Definition at line 28 of file ccItemTree.cpp.

References compareObjects(), ccHObject::getChild(), and ccHObject::getChildrenNumber().

Referenced by findOrCreateContainer().

◆ findOrCreateContainer()

ccHObject * CC_ITEM_TREE::findOrCreateContainer ( ccHObject parent,
const QString &  containerName,
ecvMainAppInterface app 
)

Find a matching container or create a new one if it is not existing in the parent's hierarchy tree. The newly created object is added to the parent object as a child.

Parameters
[in]parentThe parent object of the container.
[in]containerNameThe name of the new container object.
[in]appThe ecvMainAppInterface object.
Exceptions
std::invalid_argumentException is thrown if parent is nullptr
Returns
ccHObject* Returns the newly created container if not existing, otherwise existing one.

Definition at line 51 of file ccItemTree.cpp.

References ccHObject::addChild(), ecvMainAppInterface::addToDB(), findItemInHierarchy(), and CV_TYPES::HIERARCHY_OBJECT.