![]() |
VR-Forces 4.0.4 Class Documentation
|
Hierarchy that will keep track of parent/child element id relationships. More...

Public Types | |
| typedef std::vector< DtElementID > | ElementIDs |
| typedef std::set< const DtElementIDHierarchyNode * > | VisibilityProcessingList |
| typedef boost::function < DtElementIDHierarchyNode::DisplayState(const DtElementIDHierarchyNode *)> | ExpectedDisplayState |
Public Member Functions | |
| DtElementIDHierarchy () | |
| virtual | ~DtElementIDHierarchy () |
| virtual void | addToHierarchy (DtElementID elementID, DtElementID child, int flags=0, bool setAsNewChildren=true, bool processList=true) |
| Adds a new root node (if missing) and modifies the children of that root node to contain (or remove) the element ids specified. | |
| virtual void | addToHierarchy (DtElementID elementID, const ElementIDs &children=ElementIDs(), int flags=0, bool setAsNewChildren=true, bool processList=true) |
| void | setFlags (DtElementID id, int flags) |
| Sets the flags for the specified item. | |
| int | flags (DtElementID id) const |
| Returns flags for specified item. | |
| virtual void | removeFromHierarchy (DtElementID id) |
| Removes the specified item from the hierarchy. | |
| virtual bool | isChild (DtElementID parentId, DtElementID childId, bool recurse=false) const |
| Returns true if the child is a child of the parent. | |
| bool | isInHierarchy (DtElementID id) const |
| Returns true if this element is in the hierarchy. | |
| DtElementIDHierarchyNode * | parentOf (DtElementID id) |
| const DtElementIDHierarchyNode * | parentOf (DtElementID id) const |
| DtElementIDHierarchyNode * | hierarchyNode (DtElementID id) |
| const DtElementIDHierarchyNode * | hierarchyNode (DtElementID elementID) const |
| bool | hasChildren (DtElementID id) const |
| int | level (const DtElementIDHierarchyNode *node) const |
| Level of node -- recursively counts the number of parents. | |
| virtual DtElementIDHierarchyNode::DisplayState | displayState (DtElementID elementID) const |
| Returns the expanded state of the element id. If not found, will return expanded. | |
| virtual void | detachChildFromParent (DtElementID child) |
| Removes the parent/child relationship. | |
| virtual void | attachChildToParent (DtElementID child, DtElementID parent, bool processList=true) |
| Hooks the child to the particular parent. If already a child of another element, will unhook that first. | |
| virtual void | expand (DtElementID elementID, bool processList=true) |
| Expands specified element by showing children and hiding root. | |
| virtual void | expandAll (DtElementID elementID, bool processList=true) |
| Expands all children and their children. | |
| virtual void | collapseAll (DtElementID elementID, bool processList=true) |
| Collapses parent and all parents. | |
| virtual void | collapse (DtElementID elementID, bool processList=true) |
| Collapses all items that are expanded and shows parent. | |
| virtual void | processVisibilityList () |
| Processes visibility state list by emitting signal. | |
| void | setInitiallyExpanded (bool) |
| State flags to determine how items might be shown when first added to the list. Initially expanded is by default false. | |
| virtual bool | initiallyExpanded () const |
| virtual void | processNode (DtElementIDHierarchyNode *node, bool forceUpdate=false) |
| Modifies item given aggregate settings record. | |
| void | setExpectedDisplayStateFunction (ExpectedDisplayState) |
| Sets the function to return the expected display state. Initially expectedDisplayState. | |
| virtual DtElementIDHierarchyNode::DisplayState | expectedDisplayStateFor (const DtElementIDHierarchyNode *node) |
| Given the node, will return the expected display state based on parent information. | |
| virtual void | reprocessAllNodes () |
| Reprocesses all the nodes, updating as need be due to settings changes. | |
Public Attributes | |
| boost::signal< void(DtElementIDHierarchyNode *) > | signal_hierarchyItemModified |
| boost::signal< void(DtElementIDHierarchyNode *) > | signal_hierarchyItemToBeRemoved |
| Called before disconnecting from tree and before signal_hierarchyItemAboutToBeRemoved. | |
| boost::signal< void(DtElementIDHierarchyNode *) > | signal_hierarchyItemAboutToBeRemoved |
| boost::signal< void(DtElementIDHierarchy *) > | signal_hierarchyUpdated |
| boost::signal< void(DtElementID, const ElementIDs &)> | signal_updateHierarchy |
| boost::signal< void(DtElementID, DtElementIDHierarchyNode::DisplayState)> | signal_echelonVisibilityChange |
| boost::signal< void(VisibilityProcessingList)> | signal_visibilityChanged |
Protected Types | |
| typedef boost::unordered_map < DtElementID, DtElementIDHierarchyNode * > | HierarchyNodeMap |
Protected Member Functions | |
| virtual void | processVisibilityState (const DtElementIDHierarchyNode *) |
| Adds item to list to be processed. | |
| 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 | hierarchyUpdated () |
| Called when hierarchy is updated. Default is no-op. | |
| virtual void | aboutToBeRemovedFromHierarchy (DtElementIDHierarchyNode *) |
| Called when a hieararchy item is about to be removed. Default is no-op. | |
| virtual void | updateHierarchy (DtElementID id, const ElementIDs &children, bool setAsNewChildren=true) |
| Update the hierarchy with the parent/child information. | |
| virtual void | attachParentToChildren (DtElementID parentId, const ElementIDs &children, bool setAsNewChildren=true) |
| Hook up parent to children. | |
| virtual void | removeAllChildrenFromParent (DtElementID) |
| virtual void | hierarchyItemModified (DtElementIDHierarchyNode *) |
| Called when a hierarchy item is modified. Default no-ops. | |
Protected Attributes | |
| HierarchyNodeMap | myFlatHierarchy |
| VisibilityProcessingList | myVisibilityProcessingList |
| ExpectedDisplayState | myExpectedDisplayState |
| bool | myInitiallyExpanded |
Hierarchy that will keep track of parent/child element id relationships.
Will emit signals when the tree is modified
| 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 |
typedef boost::unordered_map<DtElementID, DtElementIDHierarchyNode*> makVrv::DtElementIDHierarchy::HierarchyNodeMap [protected] |
| virtual makVrv::DtElementIDHierarchy::~DtElementIDHierarchy | ( | ) | [virtual] |
| virtual void makVrv::DtElementIDHierarchy::addToHierarchy | ( | DtElementID | elementID, |
| DtElementID | child, | ||
| int | flags = 0, |
||
| bool | setAsNewChildren = true, |
||
| bool | processList = true |
||
| ) | [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::addToHierarchy | ( | DtElementID | elementID, |
| const ElementIDs & | children = ElementIDs(), |
||
| int | flags = 0, |
||
| bool | setAsNewChildren = true, |
||
| bool | processList = true |
||
| ) | [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 void makVrv::DtElementIDHierarchy::removeFromHierarchy | ( | DtElementID | id | ) | [virtual] |
Removes the specified item from the hierarchy.
| virtual bool makVrv::DtElementIDHierarchy::isChild | ( | DtElementID | parentId, |
| DtElementID | childId, | ||
| bool | recurse = false |
||
| ) | const [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
Returns true if this element is in the hierarchy.
| const DtElementIDHierarchyNode* makVrv::DtElementIDHierarchy::parentOf | ( | DtElementID | id | ) | const |
| 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 DtElementIDHierarchyNode::DisplayState makVrv::DtElementIDHierarchy::displayState | ( | DtElementID | elementID | ) | const [virtual] |
Returns the expanded state of the element id. If not found, will return expanded.
| virtual void makVrv::DtElementIDHierarchy::detachChildFromParent | ( | DtElementID | child | ) | [virtual] |
Removes the parent/child relationship.
| virtual void makVrv::DtElementIDHierarchy::attachChildToParent | ( | DtElementID | child, |
| DtElementID | parent, | ||
| bool | processList = true |
||
| ) | [virtual] |
Hooks the child to the particular parent. If already a child of another element, will unhook that first.
| virtual void makVrv::DtElementIDHierarchy::expand | ( | DtElementID | elementID, |
| bool | processList = true |
||
| ) | [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 void makVrv::DtElementIDHierarchy::expandAll | ( | DtElementID | elementID, |
| bool | processList = true |
||
| ) | [virtual] |
Expands all children and their children.
| virtual void makVrv::DtElementIDHierarchy::collapseAll | ( | DtElementID | elementID, |
| bool | processList = true |
||
| ) | [virtual] |
Collapses parent and all parents.
| virtual void makVrv::DtElementIDHierarchy::collapse | ( | DtElementID | elementID, |
| bool | processList = true |
||
| ) | [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 void makVrv::DtElementIDHierarchy::processVisibilityList | ( | ) | [virtual] |
Processes visibility state list by emitting signal.
State flags to determine how items might be shown when first added to the list. Initially expanded is by default false.
| virtual bool makVrv::DtElementIDHierarchy::initiallyExpanded | ( | ) | const [virtual] |
| virtual void makVrv::DtElementIDHierarchy::processNode | ( | DtElementIDHierarchyNode * | node, |
| bool | forceUpdate = false |
||
| ) | [virtual] |
Modifies item given aggregate settings record.
Sets the function to return the expected display state. Initially expectedDisplayState.
| virtual DtElementIDHierarchyNode::DisplayState makVrv::DtElementIDHierarchy::expectedDisplayStateFor | ( | const DtElementIDHierarchyNode * | node | ) | [virtual] |
Given the node, will return the expected display state based on parent information.
| virtual void makVrv::DtElementIDHierarchy::reprocessAllNodes | ( | ) | [virtual] |
Reprocesses all the nodes, updating as need be due to settings changes.
| virtual void makVrv::DtElementIDHierarchy::processVisibilityState | ( | const DtElementIDHierarchyNode * | ) | [protected, virtual] |
Adds item to list to be processed.
| virtual void makVrv::DtElementIDHierarchy::processSingleNode | ( | DtElementIDHierarchyNode * | node, |
| bool | forceUpdate = false |
||
| ) | [protected, virtual] |
| virtual void makVrv::DtElementIDHierarchy::processParentedNode | ( | DtElementIDHierarchyNode * | node, |
| bool | forceUpdate = false, |
||
| bool | processChildren = true |
||
| ) | [protected, virtual] |
| virtual void makVrv::DtElementIDHierarchy::processNodeWithChildren | ( | DtElementIDHierarchyNode * | node, |
| bool | forceUpdate = false |
||
| ) | [protected, virtual] |
| virtual void makVrv::DtElementIDHierarchy::hierarchyUpdated | ( | ) | [protected, virtual] |
Called when hierarchy is updated. Default is no-op.
| virtual void makVrv::DtElementIDHierarchy::aboutToBeRemovedFromHierarchy | ( | DtElementIDHierarchyNode * | ) | [protected, virtual] |
Called when a hieararchy item is about to be removed. Default is no-op.
| virtual void makVrv::DtElementIDHierarchy::updateHierarchy | ( | DtElementID | id, |
| const ElementIDs & | children, | ||
| bool | setAsNewChildren = true |
||
| ) | [protected, virtual] |
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
| virtual void makVrv::DtElementIDHierarchy::attachParentToChildren | ( | DtElementID | parentId, |
| const ElementIDs & | children, | ||
| bool | setAsNewChildren = true |
||
| ) | [protected, virtual] |
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
| virtual void makVrv::DtElementIDHierarchy::removeAllChildrenFromParent | ( | DtElementID | ) | [protected, virtual] |
| virtual void makVrv::DtElementIDHierarchy::hierarchyItemModified | ( | DtElementIDHierarchyNode * | ) | [protected, virtual] |
Called when a hierarchy item is modified. Default no-ops.
| boost::signal<void (DtElementIDHierarchyNode*) > makVrv::DtElementIDHierarchy::signal_hierarchyItemModified |
| boost::signal<void (DtElementIDHierarchyNode*) > makVrv::DtElementIDHierarchy::signal_hierarchyItemToBeRemoved |
Called before disconnecting from tree and before signal_hierarchyItemAboutToBeRemoved.
| boost::signal<void (DtElementIDHierarchyNode*) > makVrv::DtElementIDHierarchy::signal_hierarchyItemAboutToBeRemoved |
| boost::signal<void (DtElementIDHierarchy*) > makVrv::DtElementIDHierarchy::signal_hierarchyUpdated |
| boost::signal<void (DtElementID, const ElementIDs&)> makVrv::DtElementIDHierarchy::signal_updateHierarchy |
| boost::signal<void (DtElementID, DtElementIDHierarchyNode::DisplayState)> makVrv::DtElementIDHierarchy::signal_echelonVisibilityChange |
| boost::signal<void (VisibilityProcessingList)> makVrv::DtElementIDHierarchy::signal_visibilityChanged |