![]() |
VR-Forces 4.10 Class Documentation
|
Widget for display the objects, terrains, observers in the scene in a list. More...

Public Types | |
| enum | ItemsListWidgetItemDataRole { ItemElementId = Qt::UserRole, ItemDisplayName, ItemType, ItemIsSubType } |
| Item data stored in the objects tree widget item. More... | |
Public Member Functions | |
| virtual | ~DtItemsListWidget () |
| DTOR. More... | |
| void | setupGui () |
| Create the widgets and layout. Called in the CTOR. More... | |
| void | connectSignals () |
| Connect the signals. More... | |
| virtual void | addSubTypeTopLevelItem (const DtElementAttributes::ElementSubtypes &subType, const std::string &displayName, int index, const std::string &icon) |
| Add a top level item which has subtype items as children(Friendly, Opposing, Munitions, etc). More... | |
| virtual void | addSubTypeTopLevelItem (const DtElementAttributes::ElementSubtypes &subType, const std::string &displayName, int index, double r, double g, double b) |
| Add a top level item which has subtype items as children(Friendly, Opposing, Munitions, etc). More... | |
| virtual void | addSubTypeItem (const DtElementAttributes::ElementSubtypes &subType, DtElementID elementId, const std::string &displayName) |
| Add a subtype item(Friendly, Opposing, Munitions, etc). More... | |
| virtual bool | hasSubTypeTopLevelItem (const DtElementAttributes::ElementSubtypes &subType) |
| Check if the tree has a subtype top level item with the given subType. More... | |
| virtual void | addTypeTopLevelItem (const DtElementEntry::ElementType &type, const std::string &displayName, int index, const std::string &icon) |
| Add a top level item which has type items as children(Observers, Tactical Graphics, etc). More... | |
| virtual void | addTypeItem (const DtElementEntry::ElementType &type, DtElementID elementId, const std::string &displayName) |
| Add a tye item(Observers, Tactical Graphics, etc). More... | |
| virtual bool | hasTypeTopLevelItem (const DtElementEntry::ElementType &type) |
| Check if the tree has a type top level item with the given type. More... | |
| virtual void | sortItems () |
| Sort all the tree widget items under subType top level item and type top level item. More... | |
| virtual void | removeItem (DtElementID id) |
| Remove an item with the given element Id from the tree. More... | |
| virtual void | renameItem (DtElementID id, const std::string &newName) |
| Rename an item with the new name. More... | |
| virtual void | updateItemDamageState (DtElementID id, DtEntityStateListener::DamageState damageState) |
| Update the damage state of the item, update the icon mostly. More... | |
| virtual void | updateItemSubType (DtElementID id, int subType) |
| Update the subType of the item, change of force type etc. More... | |
| virtual void | setSelectedItems (const DtSelectionManager::IdSet &selected, const DtSelectionManager::IdSet &deselected) |
| Update the current selection of the tree widget. More... | |
| virtual bool | comparator (const QTreeWidgetItem &lhs, const QTreeWidgetItem &rhs) const |
| compare the names of two list items for sorting This method is used for sorting the objects in a item list. More... | |
Protected Slots | |
| virtual void | on_objectsTreeWidget_rightClickOnItem (QTreeWidgetItem *item, QMouseEvent *, int column) |
| Slot when user right click on the tree widget item. More... | |
| virtual void | on_objectsTreeWidget_itemDoubleClicked (QTreeWidgetItem *item, int column) |
| Slot when user double click on the tree widget item. More... | |
| virtual void | on_objectsTreeWidget_itemSelectionChanged () |
| Slot when the current selection of the tree widget changed. More... | |
| virtual void | on_lookupLineEdit_textChanged (QString str) |
| Slot the text of the line edit changed. More... | |
| virtual void | on_searchCleanButton_released () |
| Slot when user click on the clean filter button. More... | |
Protected Member Functions | |
| DtItemsListWidget (DtDe &de, QWidget *parent=NULL, const Qt::WindowFlags &f=0) | |
| CTOR. Use DtOsgEarthProfileDialogCreator to create an instance of this class. More... | |
| void | setItemAttributes (QTreeWidgetItem *item, DtElementID elementId, const QString &displayName) |
| Set the attributes of the item. More... | |
| DtElementID | getItemElementId (QTreeWidgetItem *item) |
| Convenient function to get the element id of the item. More... | |
| bool | parseNumber (const QTreeWidgetItem &lhs, int &number, QString &name) const |
| This helper function is used by the comparator to determine is a name is of the type described in. More... | |
Protected Attributes | |
| DtDe & | myDe |
| QVBoxLayout * | myMainLayout |
| QLabel * | myLookupLabel |
| QLineEdit * | myLookupLineEdit |
| QPushButton * | mySearchCleanButton |
| DtTreeWidget * | myObjectsTreeWidget |
| boost::unordered_map < DtElementEntry::ElementType, QTreeWidgetItem * > | myElementTypeItemsMap |
| boost::unordered_map < DtElementAttributes::ElementSubtypes, QTreeWidgetItem * > | myElementSubtypeItemsMap |
| boost::unordered_map < DtElementID, QTreeWidgetItem * > | myElementItemsMap |
| std::map< const QString, std::pair< QString, int > > | myObjectListCache |
Private Member Functions | |
| DtItemsListWidget ()=delete | |
| Unimplemented Default CTOR. More... | |
| DtItemsListWidget (const DtItemsListWidget &orig)=delete | |
| Not implemented. More... | |
| DtItemsListWidget & | operator= (const DtItemsListWidget &orig)=delete |
| Not implemented. More... | |
Friends | |
| class | DtItemsListWidgetCreator |
Additional Inherited Members | |
Public Attributes inherited from makVrv::DtItemsListInterface | |
| boost::signalslib::signal < void(DtElementID)> | signal_itemAttachRequested |
| boost::signalslib::signal < void(std::vector < DtElementID >)> | signal_itemSelectionChanged |
Widget for display the objects, terrains, observers in the scene in a list.
Used by DtObjectsListWidget, DtTerrainListWidget, DtObserversListWidget.
|
virtual |
DTOR.
|
protected |
CTOR. Use DtOsgEarthProfileDialogCreator to create an instance of this class.
|
privatedelete |
Unimplemented Default CTOR.
|
privatedelete |
Not implemented.
| void makVrv::DtItemsListWidget::setupGui | ( | ) |
Create the widgets and layout. Called in the CTOR.
| void makVrv::DtItemsListWidget::connectSignals | ( | ) |
Connect the signals.
|
virtual |
Add a top level item which has subtype items as children(Friendly, Opposing, Munitions, etc).
| subType | The subtype of the child items. |
| displayName | The display name of the top level item. |
| index | The index of the top level item in the tree. |
| icon | The icon of the item, empty string means no icon. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Add a top level item which has subtype items as children(Friendly, Opposing, Munitions, etc).
| subType | The subtype of the child items. |
| displayName | The display name of the top level item. |
| index | The index of the top level item in the tree. |
| r | The red color of the icon if the icon is generated by the color. |
| g | The red color of the icon if the icon is generated by the color. |
| b | The red color of the icon if the icon is generated by the color. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Add a subtype item(Friendly, Opposing, Munitions, etc).
| subType | The subtype of the item |
| elementId | The elementId of the item. |
| displayName | The display name of the item. |
| icon | The icon of the item, empty string means no icon. |
| r | The red color of the icon[0,1]. |
| g | The green color of the icon[0,1]. |
| b | The blue color of the icon[0,1]. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Check if the tree has a subtype top level item with the given subType.
| subType | The subtype of the item |
Implements makVrv::DtItemsListInterface.
|
virtual |
Add a top level item which has type items as children(Observers, Tactical Graphics, etc).
| type | The type of the child items. |
| displayName | The display name of the top level item. |
| index | The index of the top level item in the tree. |
| icon | The icon of the item, empty string means no icon. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Add a tye item(Observers, Tactical Graphics, etc).
| type | The type of the item |
| elementId | The elementId of the item. |
| displayName | The display name of the item. |
| icon | The icon of the item, empty string means no icon. |
| r | The red color of the icon[0,1]. |
| g | The green color of the icon[0,1]. |
| b | The blue color of the icon[0,1]. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Check if the tree has a type top level item with the given type.
| type | The type of the item |
Implements makVrv::DtItemsListInterface.
|
virtual |
Sort all the tree widget items under subType top level item and type top level item.
Implements makVrv::DtItemsListInterface.
Reimplemented in makVrv::DtTerrainListWidget, makVrv::DtObjectsListWidget, and makVrv::DtObserversListWidget.
|
virtual |
Remove an item with the given element Id from the tree.
Implements makVrv::DtItemsListInterface.
|
virtual |
Rename an item with the new name.
| newName | The new name of the item. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Update the damage state of the item, update the icon mostly.
| damageState | DtDamageState enum. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Update the subType of the item, change of force type etc.
| subType | DtElementAttributes::ElementSubtypes enum. |
Implements makVrv::DtItemsListInterface.
|
virtual |
Update the current selection of the tree widget.
Implements makVrv::DtItemsListInterface.
|
virtual |
compare the names of two list items for sorting This method is used for sorting the objects in a item list.
It works like a standard 'operator<' - true if lhs is < rhs, false otherwise. This default comparator looks for names of the form '<someString> <someNumber>', which is what most VR-Forces marking texts look like (e.g., Civ 1, Civ 2). If the names compared are both of that form and both have the same base string, then they are compared based on the number (so Civ 2 < Civ 10); otherwise they are compared lexicographically.
|
protected |
Set the attributes of the item.
| item | The QTreeWidgetItem. |
| elementId | The elementId of the item. |
| displayName | The display name of the item. |
|
protected |
Convenient function to get the element id of the item.
| item | The QTreeWidgetItem. The element id of the item. |
|
protected |
This helper function is used by the comparator to determine is a name is of the type described in.
|
protectedvirtualslot |
Slot when user right click on the tree widget item.
|
protectedvirtualslot |
Slot when user double click on the tree widget item.
|
protectedvirtualslot |
Slot when the current selection of the tree widget changed.
|
protectedvirtualslot |
Slot the text of the line edit changed.
|
protectedvirtualslot |
Slot when user click on the clean filter button.
|
privatedelete |
Not implemented.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |