![]() |
VR-Forces 4.6 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 | expandDown (DtElementID elementID, int numLevels=-1, bool processList=true) |
| Expands all children from the given id down. | |
| 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 |
|
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.
|
protectedvirtual |
Adds item to list to be processed.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
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::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 |
|
protected |
|
protected |
|
protected |
|
protected |