VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtElementIDHierarchy Class Reference

Hierarchy that will keep track of parent/child element id relationships. More...

Inheritance diagram for makVrv::DtElementIDHierarchy:
Inheritance graph
[legend]

Public Types

typedef std::vector< DtElementIDElementIDs
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.
DtElementIDHierarchyNodeparentOf (DtElementID id)
const DtElementIDHierarchyNodeparentOf (DtElementID id) const
DtElementIDHierarchyNodehierarchyNode (DtElementID id)
const DtElementIDHierarchyNodehierarchyNode (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

Detailed Description

Hierarchy that will keep track of parent/child element id relationships.

Will emit signals when the tree is modified

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtElementIDHierarchy::DtElementIDHierarchy ( )
virtual makVrv::DtElementIDHierarchy::~DtElementIDHierarchy ( )
virtual

Member Function Documentation

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

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 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::expandDown ( DtElementID  elementID,
int  numLevels = -1,
bool  processList = true 
)
virtual

Expands all children from the given id down.

Parameters
[in]elementIDis the id of the node to start the expansion.
[in]numLevelsis the number of levels to expand (less than zero expands all levels).
[in]processListis a flag to emit visibility change signals.
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.

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 bool makVrv::DtElementIDHierarchy::initiallyExpanded ( ) const
virtual
virtual void makVrv::DtElementIDHierarchy::processNode ( DtElementIDHierarchyNode node,
bool  forceUpdate = false 
)
virtual

Modifies item given aggregate settings record.

void makVrv::DtElementIDHierarchy::setExpectedDisplayStateFunction ( ExpectedDisplayState  )

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 )
protectedvirtual

Adds item to list to be processed.

virtual void makVrv::DtElementIDHierarchy::processSingleNode ( DtElementIDHierarchyNode node,
bool  forceUpdate = false 
)
protectedvirtual
virtual void makVrv::DtElementIDHierarchy::processParentedNode ( DtElementIDHierarchyNode node,
bool  forceUpdate = false,
bool  processChildren = true 
)
protectedvirtual
virtual void makVrv::DtElementIDHierarchy::processNodeWithChildren ( DtElementIDHierarchyNode node,
bool  forceUpdate = false 
)
protectedvirtual
virtual void makVrv::DtElementIDHierarchy::hierarchyUpdated ( )
protectedvirtual

Called when hierarchy is updated. Default is no-op.

virtual void makVrv::DtElementIDHierarchy::aboutToBeRemovedFromHierarchy ( DtElementIDHierarchyNode )
protectedvirtual

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 
)
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

virtual void makVrv::DtElementIDHierarchy::attachParentToChildren ( DtElementID  parentId,
const ElementIDs children,
bool  setAsNewChildren = true 
)
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

virtual void makVrv::DtElementIDHierarchy::removeAllChildrenFromParent ( DtElementID  )
protectedvirtual
virtual void makVrv::DtElementIDHierarchy::hierarchyItemModified ( DtElementIDHierarchyNode )
protectedvirtual

Called when a hierarchy item is modified. Default no-ops.

Member Data Documentation

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
HierarchyNodeMap makVrv::DtElementIDHierarchy::myFlatHierarchy
protected
VisibilityProcessingList makVrv::DtElementIDHierarchy::myVisibilityProcessingList
protected
ExpectedDisplayState makVrv::DtElementIDHierarchy::myExpectedDisplayState
protected
bool makVrv::DtElementIDHierarchy::myInitiallyExpanded
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)