CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
DDExpandedView Class Reference

Provides an exploded view of the detector (tree-view) More...

#include <DDExpandedView.h>

Public Types

typedef std::vector< int > nav_type
 std::vector of sibling numbers More...
 
typedef std::pair< int const
*, size_t > 
NavRange
 

Public Member Functions

void clearScope ()
 clears the scope; the full tree is available, depth=0 More...
 
int copyno () const
 Copy number associated with the current node. More...
 
nav_type copyNumbers () const
 return the stack of copy numbers More...
 
 DDExpandedView (const DDCompactView &)
 Constructs an expanded-view based on the compact-view. More...
 
int depth () const
 depth of the scope. 0 means unrestricted depth. More...
 
bool firstChild ()
 set the current node to the first child ... More...
 
const DDGeoHistorygeoHistory () const
 The list of ancestors up to the root-node of the current node. More...
 
bool goTo (const nav_type &)
 transversed the DDExpandedView according to the given stack of sibling numbers More...
 
bool goTo (NavRange)
 
bool goTo (int const *newpos, size_t sz)
 
bool goToHistory (const DDGeoHistory &sc)
 
const DDLogicalPartlogicalPart () const
 The logical-part of the current node in the expanded-view. More...
 
DDsvalues_type mergedSpecifics () const
 
void mergedSpecificsV (DDsvalues_type &res) const
 
nav_type navPos () const
 return the stack of sibling numbers which indicates the current position in the DDExpandedView More...
 
bool next ()
 set current node to the next node in the expanded tree More...
 
bool nextB ()
 broad search order of next() More...
 
bool nextSibling ()
 set the current node to the next sibling ... More...
 
bool parent ()
 set the current node to the parent node ... More...
 
void reset ()
 true, if a call to firstChild() would succeed (current node has at least one child) More...
 
const DDRotationMatrixrotation () const
 The absolute rotation of the current node. More...
 
const DDGeoHistoryscope () const
 The scope of the expanded-view. More...
 
bool setScope (const DDGeoHistory &hist, int depth=0)
 sets the scope of the expanded view More...
 
std::vector< const
DDsvalues_type * > 
specifics () const
 User specific data attached to the current node. More...
 
void specificsV (std::vector< const DDsvalues_type * > &vc) const
 
const DDTranslationtranslation () const
 The absolute translation of the current node. More...
 
virtual ~DDExpandedView ()
 

Protected Member Functions

bool descend (const DDGeoHistory &sc)
 

Protected Attributes

unsigned int depth_
 depth of the scope, 0==unrestricted depth More...
 
DDGeoHistory history_
 std::vector of DDExpandedNode More...
 
std::vector< nav_typenextBStack_
 
const DDRotationMatrix rot_
 
DDGeoHistory scope_
 scope of the expanded view More...
 
const DDTranslation trans_
 
DDCompactView::walker_type w2_
 
DDCompactView::walker_typewalker_
 the tricky walker More...
 
const DDPosDataworldpos_
 ??? More...
 

Friends

class DDFilteredView
 

Detailed Description

Provides an exploded view of the detector (tree-view)

DDExpandedView provides a tree-walker (iterator) for the expanded view of the detector description. Further it provides a registration mechanism for call-backs whenever a node in the expanded view becomes current and fullfills the user-defined predicate.

FIXME: DDExpandedView: in the Prototype just one class - FIXME: later seperation of interface & implementation!Taking a DDCompactView the DDExpandedView expands the compact-view into a detector tree. One instance of DDExpandedView corresponds to one node in the tree. It is the 'current' node. By using tree navigation ( next(), nextSibling(), parent(), firstChild() ) the DDExpandedView represents the new corresponding node.

Definition at line 35 of file DDExpandedView.h.

Member Typedef Documentation

typedef std::vector<int> DDExpandedView::nav_type

std::vector of sibling numbers

Definition at line 41 of file DDExpandedView.h.

typedef std::pair<int const *, size_t> DDExpandedView::NavRange

Definition at line 42 of file DDExpandedView.h.

Constructor & Destructor Documentation

DDExpandedView::DDExpandedView ( const DDCompactView cpv)

Constructs an expanded-view based on the compact-view.

After construction the instance corresponds to the root of the geometrical tree.

Definition at line 7 of file DDExpandedView.cc.

DDExpandedView::~DDExpandedView ( )
virtual

Definition at line 30 of file DDExpandedView.cc.

Member Function Documentation

void DDExpandedView::clearScope ( )

clears the scope; the full tree is available, depth=0

Definition at line 295 of file DDExpandedView.cc.

int DDExpandedView::copyno ( ) const

Copy number associated with the current node.

Definition at line 62 of file DDExpandedView.cc.

Referenced by DDExpandedViewDump().

DDExpandedView::nav_type DDExpandedView::copyNumbers ( ) const

return the stack of copy numbers

Definition at line 475 of file DDExpandedView.cc.

int DDExpandedView::depth ( ) const

depth of the scope. 0 means unrestricted depth.

Definition at line 56 of file DDExpandedView.cc.

bool DDExpandedView::descend ( const DDGeoHistory sc)
protected

Definition at line 380 of file DDExpandedView.cc.

bool DDExpandedView::firstChild ( )

set the current node to the first child ...

returns true, if a child of the current node exists and updates this otherwise returns false

Definition at line 117 of file DDExpandedView.cc.

const DDGeoHistory & DDExpandedView::geoHistory ( ) const

The list of ancestors up to the root-node of the current node.

Definition at line 50 of file DDExpandedView.cc.

Referenced by DDExpandedViewDump(), GeometryInfoDump::dumpInfo(), and DDQuery::exec().

bool DDExpandedView::goTo ( const nav_type newpos)

transversed the DDExpandedView according to the given stack of sibling numbers

Definition at line 423 of file DDExpandedView.cc.

Referenced by DDDefaultNumberingScheme::node().

bool DDExpandedView::goTo ( NavRange  newpos)

Definition at line 428 of file DDExpandedView.cc.

bool DDExpandedView::goTo ( int const *  newpos,
size_t  sz 
)

Definition at line 432 of file DDExpandedView.cc.

bool DDExpandedView::goToHistory ( const DDGeoHistory pos)
 NOT IN THE PROTOTYPE

goTo will reset the ExpandedView if pos is not a valid position. Currently no checks are implemented to verify that pos is within the current scope of the ExpandedView.

Definition at line 347 of file DDExpandedView.cc.

const DDLogicalPart & DDExpandedView::logicalPart ( ) const

The logical-part of the current node in the expanded-view.

Definition at line 32 of file DDExpandedView.cc.

Referenced by DDExpandedViewDump(), and GeometryInfoDump::dumpInfo().

DDsvalues_type DDExpandedView::mergedSpecifics ( ) const

Definition at line 266 of file DDExpandedView.cc.

void DDExpandedView::mergedSpecificsV ( DDsvalues_type res) const

Definition at line 272 of file DDExpandedView.cc.

DDExpandedView::nav_type DDExpandedView::navPos ( ) const

return the stack of sibling numbers which indicates the current position in the DDExpandedView

Definition at line 463 of file DDExpandedView.cc.

Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), GeometryInfoDump::dumpInfo(), and DDDefaultNumberingScheme::id().

bool DDExpandedView::next ( void  )

set current node to the next node in the expanded tree

Tree transversal:

  • try to go to the first child
  • else try to go to the next sibling
  • else try to go to the next sibling of the parent

Currently the whole remaining subtree is transversed when next() is subsequently called.

Definition at line 195 of file DDExpandedView.cc.

Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), DDExpandedViewDump(), ddstats(), GeometryInfoDump::dumpInfo(), and DDQuery::exec().

bool DDExpandedView::nextB ( )

broad search order of next()

broad first

Definition at line 215 of file DDExpandedView.cc.

bool DDExpandedView::nextSibling ( )

set the current node to the next sibling ...

returns true, if a next sibling exists and updates this otherwise returns false. If a scope was set, the nextSibling of the root of the scope is not selected.

Definition at line 72 of file DDExpandedView.cc.

bool DDExpandedView::parent ( )

set the current node to the parent node ...

returns ture, if a parent exists and updates this otherwise returns false. When false is returned, the root node of the scope is reached.

Definition at line 157 of file DDExpandedView.cc.

Referenced by Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner::autosizeScrollArea(), Vispa.Share.ImageExporter.ImageExporter::exportImageDialog(), Vispa.Views.WidgetView.WidgetView::restoreSelection(), and Vispa.Views.WidgetView.WidgetView::select().

void DDExpandedView::reset ( void  )

true, if a call to firstChild() would succeed (current node has at least one child)

clears the scope and sets the ExpandedView to its root-node

Definition at line 301 of file DDExpandedView.cc.

Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), and DDQuery::exec().

const DDRotationMatrix & DDExpandedView::rotation ( void  ) const

The absolute rotation of the current node.

Definition at line 44 of file DDExpandedView.cc.

Referenced by DDExpandedViewDump(), and GeometryInfoDump::dumpInfo().

const DDGeoHistory & DDExpandedView::scope ( ) const

The scope of the expanded-view.

All navigational commands only operate in the subtree rooted by the node marked by the node of the DDGeoHistory returned by this method. If the size() of the scope equals 0, the full scope covering the whole expanded-view is set (default).

Definition at line 290 of file DDExpandedView.cc.

bool DDExpandedView::setScope ( const DDGeoHistory sc,
int  depth = 0 
)

sets the scope of the expanded view

The scope of the expanded-view is set to the subtree rooted by the node marked by the DDGeohistory hist. The current not of the expanded view is set to the root of the subtree. All navigational methods apply only on the subtree.

In case of hist not marking a valid node in the expanded-view, the state of the expanded-view is unchanged and false is returned by setScope(). Otherwise true is returned.

Definition at line 319 of file DDExpandedView.cc.

Referenced by DDQuery::exec().

std::vector< const DDsvalues_type * > DDExpandedView::specifics ( ) const

User specific data attached to the current node.

User specific data can be attached to single nodes or a selection of nodes in the expanded view through the DDSpecifics interface.

The resulting std::vector is of size 0 if no specific data was attached.

Definition at line 240 of file DDExpandedView.cc.

Referenced by DDQuery::exec().

void DDExpandedView::specificsV ( std::vector< const DDsvalues_type * > &  vc) const

Definition at line 249 of file DDExpandedView.cc.

const DDTranslation & DDExpandedView::translation ( void  ) const

The absolute translation of the current node.

Definition at line 38 of file DDExpandedView.cc.

Referenced by DDExpandedViewDump(), and GeometryInfoDump::dumpInfo().

Friends And Related Function Documentation

friend class DDFilteredView
friend

Definition at line 37 of file DDExpandedView.h.

Member Data Documentation

unsigned int DDExpandedView::depth_
protected

depth of the scope, 0==unrestricted depth

Definition at line 135 of file DDExpandedView.h.

DDGeoHistory DDExpandedView::history_
protected

std::vector of DDExpandedNode

Definition at line 133 of file DDExpandedView.h.

std::vector<nav_type> DDExpandedView::nextBStack_
protected

Definition at line 137 of file DDExpandedView.h.

const DDRotationMatrix DDExpandedView::rot_
protected

Definition at line 132 of file DDExpandedView.h.

DDGeoHistory DDExpandedView::scope_
protected

scope of the expanded view

Definition at line 134 of file DDExpandedView.h.

const DDTranslation DDExpandedView::trans_
protected

Definition at line 131 of file DDExpandedView.h.

DDCompactView::walker_type DDExpandedView::w2_
protected

Definition at line 130 of file DDExpandedView.h.

DDCompactView::walker_type* DDExpandedView::walker_
protected

the tricky walker

Definition at line 129 of file DDExpandedView.h.

const DDPosData* DDExpandedView::worldpos_
protected

???

Definition at line 136 of file DDExpandedView.h.