CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes
DDCompactViewImpl Class Reference

#include <DDCompactViewImpl.h>

Public Types

using Graph = math::Graph< DDLogicalPart, DDPosData * >
 
using GraphWalker = math::GraphWalker< DDLogicalPart, DDPosData * >
 

Public Member Functions

DDLogicalPartcurrent () const
 
 DDCompactViewImpl ()
 
 DDCompactViewImpl (const DDLogicalPart &rootnodedata)
 
const Graphgraph () const
 
void position (const DDLogicalPart &self, const DDLogicalPart &parent, int copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div)
 
const DDLogicalPartroot () const
 
void setRoot (const DDLogicalPart &root)
 
void swap (DDCompactViewImpl &)
 
GraphWalker walker () const
 
 ~DDCompactViewImpl ()
 

Protected Attributes

Graph graph_
 
DDLogicalPart root_
 

Detailed Description

Definition at line 14 of file DDCompactViewImpl.h.

Member Typedef Documentation

Definition at line 18 of file DDCompactViewImpl.h.

Definition at line 19 of file DDCompactViewImpl.h.

Constructor & Destructor Documentation

DDCompactViewImpl::DDCompactViewImpl ( )
explicit

Definition at line 54 of file DDCompactViewImpl.cc.

54 { }
DDCompactViewImpl::DDCompactViewImpl ( const DDLogicalPart rootnodedata)

Definition at line 6 of file DDCompactViewImpl.cc.

References LogDebug.

7  : root_( rootnodedata )
8 {
9  LogDebug("DDCompactViewImpl") << "Root node data = " << rootnodedata << std::endl;
10 }
#define LogDebug(id)
DDLogicalPart root_
DDCompactViewImpl::~DDCompactViewImpl ( )

Definition at line 12 of file DDCompactViewImpl.cc.

References math::Graph< N, E >::edgeData(), math::Graph< N, E >::edges(), graph_, LogDebug, root_, and math::Graph< N, E >::size().

13 {
15  if( graph_.size() == 0 ) {
16  LogDebug("DDCompactViewImpl") << "In destructor, graph is empty. Root:" << root_ << std::endl;
17  } else {
18  LogDebug("DDCompactViewImpl") << "In destructor, graph is NOT empty. Root:" << root_ << " graph_.size() = " << graph_.size() << std::endl;
19  for(; it < graph_.size() ; ++it ) {
20  Graph::edge_range erange = graph_.edges( it );
21  for(; erange.first != erange.second; ++(erange.first)) {
22  DDPosData * pd = graph_.edgeData( erange.first->second );
23  delete pd;
24  pd = nullptr;
25  }
26  }
27  }
28  edm::LogInfo("DDCompactViewImpl") << std::endl << "DDD transient representation has been destructed." << std::endl << std::endl;
29 }
#define LogDebug(id)
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
edge_range edges(index_type nodeIndex)
Definition: Graph.h:272
DDLogicalPart root_
uint16_t size_type
std::pair< edge_iterator, edge_iterator > edge_range
Definition: Graph.h:135
const E & edgeData(index_type i) const
Definition: Graph.h:178
auto size() const -> adj_list::size_type
Definition: Graph.h:196

Member Function Documentation

DDLogicalPart& DDCompactViewImpl::current ( ) const

Referenced by root().

const Graph& DDCompactViewImpl::graph ( ) const
inline
void DDCompactViewImpl::position ( const DDLogicalPart self,
const DDLogicalPart parent,
int  copyno,
const DDTranslation trans,
const DDRotation rot,
const DDDivision div 
)

Definition at line 38 of file DDCompactViewImpl.cc.

References math::Graph< N, E >::addEdge(), and graph_.

Referenced by graph().

44 {
45  DDPosData * pd = new DDPosData( trans, rot, copyno, div );
46  graph_.addEdge( parent, self, pd );
47 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
void addEdge(const N &from, const N &to, const E &edge)
Definition: Graph.h:261
const DDLogicalPart& DDCompactViewImpl::root ( ) const
inline

Definition at line 28 of file DDCompactViewImpl.h.

References current(), and root_.

Referenced by setRoot().

28 { return root_; }
DDLogicalPart root_
void DDCompactViewImpl::setRoot ( const DDLogicalPart root)
inline

Definition at line 26 of file DDCompactViewImpl.h.

References root(), and root_.

26 { root_=root; }
DDLogicalPart root_
const DDLogicalPart & root() const
void DDCompactViewImpl::swap ( DDCompactViewImpl implToSwap)

Definition at line 50 of file DDCompactViewImpl.cc.

References graph_, and math::Graph< N, E >::swap().

Referenced by graph().

50  {
51  graph_.swap( implToSwap.graph_ );
52 }
void swap(Graph< N, E > &)
Definition: Graph.h:413
DDCompactViewImpl::GraphWalker DDCompactViewImpl::walker ( ) const

Definition at line 32 of file DDCompactViewImpl.cc.

References graph_, and root_.

Referenced by graph().

33 {
34  return GraphWalker( graph_, root_ );
35 }
DDLogicalPart root_
math::GraphWalker< DDLogicalPart, DDPosData * > GraphWalker

Member Data Documentation

Graph DDCompactViewImpl::graph_
protected

Definition at line 47 of file DDCompactViewImpl.h.

Referenced by graph(), position(), swap(), walker(), and ~DDCompactViewImpl().

DDLogicalPart DDCompactViewImpl::root_
protected

Definition at line 46 of file DDCompactViewImpl.h.

Referenced by root(), setRoot(), walker(), and ~DDCompactViewImpl().