qCC  version 2.5.4 (Qt) - 19 Apr. 2014
 All Classes Functions Variables Typedefs Enumerations
Public Slots | Signals | Public Member Functions | Protected Types | Protected Slots | 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]

Public Slots

void changeSelection (const QItemSelection &selected, const QItemSelection &deselected)
 
void reflectObjectPropChange (ccHObject *obj)
 
void redrawCCObject (ccHObject *anObject)
 
void redrawCCObjectAndChildren (ccHObject *anObject)
 
void updateCCObject (ccHObject *anObject)
 
void deleteSelectedEntities ()
 
void selectEntity (int uniqueID)
 Shortcut to selectEntity(ccHObject*)
 
void selectEntities (std::set< int > entIDs)
 Selects multiple entities at once. More...
 

Signals

void selectionChanged ()
 

Public Member Functions

 ccDBRoot (ccCustomQTreeView *dbTreeWidget, QTreeView *propertiesTreeWidget, QObject *parent=0)
 Default constructor. More...
 
virtual ~ccDBRoot ()
 Destructor.
 
ccHObject * getRootEntity ()
 Returns associated root object.
 
void hidePropertiesView ()
 Hides properties view.
 
void updatePropertiesView ()
 Updates properties view.
 
void addElement (ccHObject *anObject, bool autoExpand=true)
 Adds an element to the DB tree.
 
void removeElement (ccHObject *anObject)
 Removes an element from the DB tree.
 
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)
 
int getSelectedEntities (ccHObject::Container &selEntities, CC_CLASS_ENUM filter=CC_TYPES::OBJECT, dbTreeSelectionInfo *info=NULL)
 Returns selected entities in DB tree (optionally with a given type and additional information)
 
void expandElement (ccHObject *anObject, bool state)
 Expands tree at a given node.
 
void selectEntity (ccHObject *obj, bool forceAdditiveSelection=false)
 Selects a given entity. More...
 
void unselectEntity (ccHObject *obj)
 Unselects a given entity.
 
void unselectAllEntities ()
 Unselects all entities.
 
void unloadAll ()
 Unloads all entities.
 
virtual QVariant data (const QModelIndex &index, int role) const
 
virtual QModelIndex index (int row, int column, const QModelIndex &parentIndex=QModelIndex()) const
 
virtual QModelIndex index (ccHObject *object)
 
virtual QModelIndex parent (const QModelIndex &index) const
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
virtual Qt::DropActions supportedDropActions () const
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
virtual QMap< int, QVariant > itemData (const QModelIndex &index) const
 

Protected Types

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

Protected Slots

void showContextMenu (const QPoint &)
 
void expandBranch ()
 
void collapseBranch ()
 
void gatherRecursiveInformation ()
 
void sortSiblingsAZ ()
 
void sortSiblingsZA ()
 
void sortSiblingsType ()
 
void toggleSelectedEntities ()
 
void toggleSelectedEntitiesVisibility ()
 
void toggleSelectedEntitiesColor ()
 
void toggleSelectedEntitiesNormals ()
 
void toggleSelectedEntitiesSF ()
 
void toggleSelectedEntitiesMat ()
 
void toggleSelectedEntities3DName ()
 
void addEmptyGroup ()
 
void alignCameraWithEntityDirect ()
 
void alignCameraWithEntityIndirect ()
 

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 toggleSelectedEntitiesProperty (unsigned prop)
 Toggles a given property (enable state, visibility, normal, color, SF, etc.) on selected entities. More...
 
void sortSelectedEntitiesSiblings (SortRules rule)
 Sorts selected entities siblings.
 
void expandOrCollapseHoveredBranch (bool expand)
 Expands or collapses hovered item.
 

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_sortSiblingsAZ
 Context menu action: sort siblings in alphabetical order.
 
QAction * m_sortSiblingsZA
 Context menu action: sort siblings in reverse alphabetical order.
 
QAction * m_sortSiblingsType
 Context menu action: sort siblings by type.
 
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.
 
QPoint m_contextMenuPos
 Last context menu pos.
 

Detailed Description

GUI database tree root.

Constructor & Destructor Documentation

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

Default constructor.

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

Member Function Documentation

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)
void ccDBRoot::selectEntities ( std::set< int >  entIDs)
slot

Selects multiple entities at once.

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

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
void ccDBRoot::toggleSelectedEntitiesProperty ( unsigned  prop)
protected

Toggles a given property (enable state, visibility, normal, color, SF, etc.) on selected entities.

Properties are: 0 - enable state 1 - visibility 2 - normal 3 - color 4 - SF 5 - materials/textures 6 - 3D name


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