CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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

◆ Graph

Definition at line 16 of file DDCompactViewImpl.h.

◆ GraphWalker

Definition at line 17 of file DDCompactViewImpl.h.

Constructor & Destructor Documentation

◆ DDCompactViewImpl() [1/2]

DDCompactViewImpl::DDCompactViewImpl ( )
explicit

Definition at line 45 of file DDCompactViewImpl.cc.

45 {}

◆ DDCompactViewImpl() [2/2]

DDCompactViewImpl::DDCompactViewImpl ( const DDLogicalPart rootnodedata)

Definition at line 6 of file DDCompactViewImpl.cc.

References LogDebug.

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

◆ ~DDCompactViewImpl()

DDCompactViewImpl::~DDCompactViewImpl ( )

Definition at line 10 of file DDCompactViewImpl.cc.

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

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

Member Function Documentation

◆ current()

DDLogicalPart& DDCompactViewImpl::current ( ) const

◆ graph()

const Graph& DDCompactViewImpl::graph ( ) const
inline

Definition at line 30 of file DDCompactViewImpl.h.

References graph_.

30 { return graph_; }

◆ position()

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

Definition at line 33 of file DDCompactViewImpl.cc.

References math::Graph< N, E >::addEdge(), graph_, class-composition::parent, and makeMuonMisalignmentScenario::rot.

38  {
39  DDPosData* pd = new DDPosData(trans, rot, copyno, div);
40  graph_.addEdge(parent, self, pd);
41 }
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:231

◆ root()

const DDLogicalPart& DDCompactViewImpl::root ( ) const
inline

Definition at line 26 of file DDCompactViewImpl.h.

References root_.

Referenced by setRoot().

26 { return root_; }
DDLogicalPart root_

◆ setRoot()

void DDCompactViewImpl::setRoot ( const DDLogicalPart root)
inline

Definition at line 24 of file DDCompactViewImpl.h.

References root(), and root_.

24 { root_ = root; }
DDLogicalPart root_
const DDLogicalPart & root() const

◆ swap()

void DDCompactViewImpl::swap ( DDCompactViewImpl implToSwap)

Definition at line 43 of file DDCompactViewImpl.cc.

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

43 { graph_.swap(implToSwap.graph_); }
void swap(Graph< N, E > &)
Definition: Graph.h:363

◆ walker()

DDCompactViewImpl::GraphWalker DDCompactViewImpl::walker ( ) const

Definition at line 31 of file DDCompactViewImpl.cc.

References graph_, and root_.

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

Member Data Documentation

◆ graph_

Graph DDCompactViewImpl::graph_
protected

Definition at line 45 of file DDCompactViewImpl.h.

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

◆ root_

DDLogicalPart DDCompactViewImpl::root_
protected

Definition at line 44 of file DDCompactViewImpl.h.

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