![]() |
VR-Forces Developer's Guide
|
Hierarchy that will keep track of parent/child element id relationships. Will emit signals when the tree is modified.

Public Types | |
| typedef std::vector< DtElementID > | ElementIDs |
| typedef std::set< const DtElementIDHierarchyNode * > | VisibilityProcessingList |
| typedef boost::function < DtElementIDHierarchyNode::DisplayState(const DtElementIDHierarchyNode *)> | ExpectedDisplayState |
Static Public Member Functions | |
| static bool | nodeElementIdSort (DtElementIDHierarchyNode *a, DtElementIDHierarchyNode *b) |
Public Attributes | |
| boost::signalslib::signal < void(DtElementIDHierarchyNode *) > | signal_hierarchyItemModified |
| boost::signalslib::signal < void(DtElementIDHierarchyNode *) > | signal_hierarchyItemToBeRemoved |
| boost::signalslib::signal < void(DtElementIDHierarchyNode *) > | signal_hierarchyItemAboutToBeRemoved |
| boost::signalslib::signal < void(DtElementIDHierarchy *) > | signal_hierarchyUpdated |
| boost::signalslib::signal < void(DtElementID, const ElementIDs &)> | signal_updateHierarchy |
| boost::signalslib::signal < void(DtElementID, DtElementIDHierarchyNode::DisplayState)> | signal_echelonVisibilityChange |
| boost::signalslib::signal < void(VisibilityProcessingList)> | signal_visibilityChanged |
Protected Types | |
| typedef boost::unordered_map < DtElementID, DtElementIDHierarchyNode * > | HierarchyNodeMap |
Protected Member Functions | |
| virtual void | processVisibilityState (const DtElementIDHierarchyNode *) |
| virtual void | processSingleNode (DtElementIDHierarchyNode *node, bool forceUpdate=false) |
| virtual void | processParentedNode (DtElementIDHierarchyNode *node, bool forceUpdate=false, bool processChildren=true) |
| virtual void | processNodeWithChildren (DtElementIDHierarchyNode *node, bool forceUpdate=false) |
| virtual void | attachParentToChildrenAndRemoveMissingChildren (DtElementID parentId, ElementIDs newChildren) |
| virtual void | hierarchyUpdated () |
| virtual void | aboutToBeRemovedFromHierarchy (DtElementIDHierarchyNode *) |
| virtual void | updateHierarchy (DtElementID id, const ElementIDs &children, bool setAsNewChildren=true) |
| virtual void | attachParentToChildren (DtElementID parentId, const ElementIDs &children, bool setAsNewChildren=true) |
| virtual void | removeAllChildrenFromParent (DtElementID) |
| virtual void | hierarchyItemModified (DtElementIDHierarchyNode *) |
Protected Attributes | |
| HierarchyNodeMap | myFlatHierarchy |
| VisibilityProcessingList | myVisibilityProcessingList |
| ExpectedDisplayState | myExpectedDisplayState |
| bool | myInitiallyExpanded |
| typedef std::vector<DtElementID> makVrv::DtElementIDHierarchy::ElementIDs |
| typedef std::set<const DtElementIDHierarchyNode*> makVrv::DtElementIDHierarchy::VisibilityProcessingList |
| typedef boost::function<DtElementIDHierarchyNode::DisplayState (const DtElementIDHierarchyNode*)> makVrv::DtElementIDHierarchy::ExpectedDisplayState |
|
protected |
| makVrv::DtElementIDHierarchy::DtElementIDHierarchy | ( | ) |
|
virtual |
|
virtual |
Adds a new root node (if missing) and modifies the children of that root node to contain (or remove) the element ids specified. If setAsNewChildren is true (the default), the children added will be considered the only children of the parent. If false, the children will be added (appended) if they are not already children.
|
virtual |
| void makVrv::DtElementIDHierarchy::setFlags | ( | DtElementID | id, |
| int | flags | ||
| ) |
Sets the flags for the specified item.
| int makVrv::DtElementIDHierarchy::flags | ( | DtElementID | id | ) | const |
Returns flags for specified item.
|
virtual |
Removes the specified item from the hierarchy.
|
virtual |
Returns true if the child is a child of the parent. If recurse flag is true, will also check the children of the parent to see if it is anywhere in the hierarchy.
| bool makVrv::DtElementIDHierarchy::isInHierarchy | ( | DtElementID | id | ) | const |
Returns true if this element is in the hierarchy.
| DtElementIDHierarchyNode* makVrv::DtElementIDHierarchy::parentOf | ( | DtElementID | id | ) |
| const DtElementIDHierarchyNode* makVrv::DtElementIDHierarchy::parentOf | ( | DtElementID | id | ) | const |
| DtElementIDHierarchyNode* makVrv::DtElementIDHierarchy::hierarchyNode | ( | DtElementID | id | ) |
| const DtElementIDHierarchyNode* makVrv::DtElementIDHierarchy::hierarchyNode | ( | DtElementID | elementID | ) | const |
| bool makVrv::DtElementIDHierarchy::hasChildren | ( | DtElementID | id | ) | const |
| int makVrv::DtElementIDHierarchy::level | ( | const DtElementIDHierarchyNode * | node | ) | const |
Level of node – recursively counts the number of parents.
|
virtual |
Returns the expanded state of the element id. If not found, will return expanded.
|
virtual |
Removes the parent/child relationship.
|
virtual |
Hooks the child to the particular parent. If already a child of another element, will unhook that first.
|
virtual |
Expands specified element by showing children and hiding root. This will only show immediate children. If process list is false, will not emit signal to process the visibility changes. Call processVisibilityList to complete process. If expandAll is true, also expands anything underneath the node that has children.
|
virtual |
Expands all children and their children.
|
virtual |
Expands all children from the given id down.
| [in] | elementID | is the id of the node to start the expansion. |
| [in] | numLevels | is the number of levels to expand (less than zero expands all levels). |
| [in] | processList | is a flag to emit visibility change signals. |
|
virtual |
Collapses parent and all parents.
|
virtual |
Collapses all items that are expanded and shows parent. This will collapse all children of the parent recursively. If process list is false, will not emit signal to process the visibility changes. Call processVisibilityList to complete process.
|
virtual |
Processes visibility state list by emitting signal.
| void makVrv::DtElementIDHierarchy::setInitiallyExpanded | ( | bool | ) |
State flags to determine how items might be shown when first added to the list. Initially expanded is by default false.
|
virtual |
|
virtual |
Modifies item given aggregate settings record.
| void makVrv::DtElementIDHierarchy::setExpectedDisplayStateFunction | ( | ExpectedDisplayState | ) |
Sets the function to return the expected display state. Initially expectedDisplayState.
|
virtual |
Given the node, will return the expected display state based on parent information.
|
virtual |
Reprocesses all the nodes, updating as need be due to settings changes.
|
virtual |
Return a list of all the nodes that are leaf nodes (have a parent and no children)
|
virtual |
update the hierarchy using the id and children
|
static |
|
protectedvirtual |
Adds item to list to be processed.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Internal utility function for processing a child that needs to be added to a parent and remove any missing children.
|
protectedvirtual |
Called when hierarchy is updated. Default is no-op.
|
protectedvirtual |
Called when a hieararchy item is about to be removed. Default is no-op.
|
protectedvirtual |
Update the hierarchy with the parent/child information. If setAsNewChildren is true (the default), the children added will be considered the only children of the parent. If false, the children will be added (appended) if they are not already children.
|
protectedvirtual |
Hook up parent to children. Unhook children that are no longer part of this parent. If the child list is empty, tries to find all children that should have this parent that are not hooked to it. If setAsNewChildren is true (the default), the children added will be considered the only children of the parent. If false, the children will be added (appended) if they are not already children.
|
protectedvirtual |
|
protectedvirtual |
Called when a hierarchy item is modified. Default no-ops.
| boost::signalslib::signal<void (DtElementIDHierarchyNode*) > makVrv::DtElementIDHierarchy::signal_hierarchyItemModified |
| boost::signalslib::signal<void (DtElementIDHierarchyNode*) > makVrv::DtElementIDHierarchy::signal_hierarchyItemToBeRemoved |
Called before disconnecting from tree and before signal_hierarchyItemAboutToBeRemoved.
| boost::signalslib::signal<void (DtElementIDHierarchyNode*) > makVrv::DtElementIDHierarchy::signal_hierarchyItemAboutToBeRemoved |
| boost::signalslib::signal<void (DtElementIDHierarchy*) > makVrv::DtElementIDHierarchy::signal_hierarchyUpdated |
| boost::signalslib::signal<void (DtElementID, const ElementIDs&)> makVrv::DtElementIDHierarchy::signal_updateHierarchy |
| boost::signalslib::signal<void (DtElementID, DtElementIDHierarchyNode::DisplayState)> makVrv::DtElementIDHierarchy::signal_echelonVisibilityChange |
| boost::signalslib::signal<void (VisibilityProcessingList)> makVrv::DtElementIDHierarchy::signal_visibilityChanged |
|
protected |
|
protected |
|
protected |
|
protected |