qCC version 2.13.alpha (Qt) - 31 May 2022
Main CloudCompare application (GUI & command line)
Signals | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ccDBRoot Class Reference

GUI database tree root. More...

#include <ccDBRoot.h>

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

Signals

void selectionChanged ()
 
void dbIsEmpty ()
 
void dbIsNotEmptyAnymore ()
 

Public Member Functions

 ccDBRoot (ccCustomQTreeView *dbTreeWidget, QTreeView *propertiesTreeWidget, QObject *parent=nullptr)
 Default constructor. More...
 
 ~ccDBRoot () override
 Destructor.
 
ccHObject * getRootEntity ()
 Returns associated root object.
 
void hidePropertiesView ()
 Hides properties view.
 
void updatePropertiesView ()
 Updates properties view.
 
void addElement (ccHObject *object, bool autoExpand=true)
 Adds an element to the DB tree.
 
void removeElement (ccHObject *object)
 Removes an element from the DB tree. More...
 
void removeElements (ccHObject::Container &objects)
 Removes several elements at once from the DB tree. More...
 
ccHObject * find (int uniqueID) const
 Finds an element in DB.
 
int countSelectedEntities (CC_CLASS_ENUM filter=CC_TYPES::OBJECT)
 Returns the number of selected entities in DB tree (optionally with a given type)
 
size_t getSelectedEntities (ccHObject::Container &selectedEntities, CC_CLASS_ENUM filter=CC_TYPES::OBJECT, dbTreeSelectionInfo *info=nullptr)
 Returns selected entities in DB tree (optionally with a given type and additional information)
 
void expandElement (ccHObject *object, bool state)
 Expands tree at a given node.
 
void unselectEntity (ccHObject *obj)
 Unselects a given entity.
 
void unselectAllEntities ()
 Unselects all entities.
 
void unloadAll ()
 Unloads all entities.
 
QVariant data (const QModelIndex &index, int role) const override
 
QModelIndex index (int row, int column, const QModelIndex &parentIndex=QModelIndex()) const override
 
QModelIndex index (ccHObject *object)
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
Qt::DropActions supportedDropActions () const override
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
QMap< int, QVariant > itemData (const QModelIndex &index) const override
 
Qt::DropActions supportedDragActions () const override
 
void changeSelection (const QItemSelection &selected, const QItemSelection &deselected)
 
void reflectObjectPropChange (ccHObject *obj)
 
void redrawCCObject (ccHObject *object)
 
void redrawCCObjectAndChildren (ccHObject *object)
 
void updateCCObject (ccHObject *object)
 
void deleteSelectedEntities ()
 
void selectEntity (ccHObject *obj, bool forceAdditiveSelection=false)
 Selects a given entity. More...
 
void selectEntities (std::unordered_set< int > entIDs)
 Selects multiple entities at once (shortcut to the other version) More...
 
void selectEntities (const ccHObject::Container &entities, bool incremental=false)
 Selects multiple entities at once. More...
 

Protected Types

enum  SortRules { SORT_A2Z , SORT_Z2A , SORT_BY_TYPE }
 Entities sorting schemes.
 

Protected Member Functions

void alignCameraWithEntity (bool reverse)
 Aligns the camera with the currently selected entity. More...
 
void showPropertiesView (ccHObject *obj)
 Shows properties view for a given element.
 
void sortSelectedEntitiesChildren (SortRules rule)
 Sorts selected entities children.
 
void expandOrCollapseHoveredBranch (bool expand)
 Expands or collapses hovered item.
 
void selectChildrenByTypeAndName (CC_CLASS_ENUM type, bool typeIsExclusive=true, QString name=QString(), bool nameIsRegex=false)
 Selects objects by type and/or name.
 

Protected Attributes

ccHObject * m_treeRoot
 Associated DB root.
 
QTreeView * m_dbTreeWidget
 Associated widget for DB tree.
 
QTreeView * m_propertiesTreeWidget
 Associated widget for selected entity's properties tree.
 
QStandardItemModel * m_propertiesModel
 Selected entity's properties data model.
 
ccPropertiesTreeDelegatem_ccPropDelegate
 Selected entity's properties delegate.
 
QAction * m_expandBranch
 Context menu action: expand tree branch.
 
QAction * m_collapseBranch
 Context menu action: collapse tree branch.
 
QAction * m_gatherInformation
 Context menu action: gather (recursive) information on selected entities.
 
QAction * m_sortChildrenAZ
 Context menu action: sort children in alphabetical order.
 
QAction * m_sortChildrenZA
 Context menu action: sort children in reverse alphabetical order.
 
QAction * m_sortChildrenType
 Context menu action: sort children by type.
 
QAction * m_selectByTypeAndName
 Context menu action: select object by type and/or by name.
 
QAction * m_deleteSelectedEntities
 Context menu action: delete selected entities.
 
QAction * m_toggleSelectedEntities
 Context menu action: enabled/disable selected entities.
 
QAction * m_toggleSelectedEntitiesVisibility
 Context menu action: hide/show selected entities.
 
QAction * m_toggleSelectedEntitiesColor
 Context menu action: hide/show selected entities color.
 
QAction * m_toggleSelectedEntitiesNormals
 Context menu action: hide/show selected entities normals.
 
QAction * m_toggleSelectedEntitiesMat
 Context menu action: hide/show selected entities materials/textures.
 
QAction * m_toggleSelectedEntitiesSF
 Context menu action: hide/show selected entities SF.
 
QAction * m_toggleSelectedEntities3DName
 Context menu action: hide/show selected entities 3D name.
 
QAction * m_addEmptyGroup
 Context menu action: add empty group.
 
QAction * m_alignCameraWithEntity
 Context menu action: use 3-points labels or planes to orient camera.
 
QAction * m_alignCameraWithEntityReverse
 Context menu action: reverse of m_alignCameraWithEntity.
 
QAction * m_enableBubbleViewMode
 Context menu action: enable bubble-view (on a sensor)
 
QAction * m_editLabelScalarValue
 Context menu action: change current scalar value (via a 2D label)
 
QPoint m_contextMenuPos
 Last context menu pos.
 

Detailed Description

GUI database tree root.

Constructor & Destructor Documentation

◆ ccDBRoot()

ccDBRoot::ccDBRoot ( ccCustomQTreeView dbTreeWidget,
QTreeView *  propertiesTreeWidget,
QObject *  parent = nullptr 
)

Default constructor.

Parameters
dbTreeWidgetwidget for DB tree display
propertiesTreeWidgetwidget for selected entity's properties tree display
parentwidget QObject parent

Member Function Documentation

◆ alignCameraWithEntity()

void ccDBRoot::alignCameraWithEntity ( bool  reverse)
protected

Aligns the camera with the currently selected entity.

Parameters
reversewhether to use the entity's normal (false) or its inverse (true)

◆ removeElement()

void ccDBRoot::removeElement ( ccHObject *  object)

Removes an element from the DB tree.

Automatically calls prepareDisplayForRefresh on the object.

◆ removeElements()

void ccDBRoot::removeElements ( ccHObject::Container &  objects)

Removes several elements at once from the DB tree.

Faster than multiple calls to removeElement. Automatically calls prepareDisplayForRefresh on the objects.

Warning
The input container will be cleared.

◆ selectEntities() [1/2]

void ccDBRoot::selectEntities ( const ccHObject::Container &  entities,
bool  incremental = false 
)

Selects multiple entities at once.

Parameters
entitiesset of the entities to 'select'
incrementalwhether to 'add' the input set to the selected entities set or to use it as replacement

◆ selectEntities() [2/2]

void ccDBRoot::selectEntities ( std::unordered_set< int >  entIDs)

Selects multiple entities at once (shortcut to the other version)

Parameters
entIDslist of the IDs of the entities to select

◆ selectEntity()

void ccDBRoot::selectEntity ( ccHObject *  obj,
bool  forceAdditiveSelection = false 
)

Selects a given entity.

If ctrl is pressed by the user at the same time, previous selection will be simply updated accordingly.

Parameters
objentity to select
forceAdditiveSelectionwhether to force additive selection (just as if CTRL key is pressed) or not

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