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.

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

References LogDebug.

◆ ~DDCompactViewImpl()

DDCompactViewImpl::~DDCompactViewImpl ( )

Definition at line 10 of file DDCompactViewImpl.cc.

10  {
12  if (graph_.size() == 0) {
13  LogDebug("DDCompactViewImpl") << "In destructor, graph is empty. Root:" << root_ << std::endl;
14  } else {
15  LogDebug("DDCompactViewImpl") << "In destructor, graph is NOT empty. Root:" << root_
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 }

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

Member Function Documentation

◆ current()

DDLogicalPart& DDCompactViewImpl::current ( ) const

◆ graph()

const Graph& DDCompactViewImpl::graph ( ) const
inline

Definition at line 30 of file DDCompactViewImpl.h.

30 { return graph_; }

References 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.

38  {
39  DDPosData* pd = new DDPosData(trans, rot, copyno, div);
40  graph_.addEdge(parent, self, pd);
41 }

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

◆ root()

const DDLogicalPart& DDCompactViewImpl::root ( ) const
inline

Definition at line 26 of file DDCompactViewImpl.h.

26 { return root_; }

References root_.

Referenced by setRoot().

◆ setRoot()

void DDCompactViewImpl::setRoot ( const DDLogicalPart root)
inline

Definition at line 24 of file DDCompactViewImpl.h.

24 { root_ = root; }

References root(), and root_.

◆ swap()

void DDCompactViewImpl::swap ( DDCompactViewImpl implToSwap)

Definition at line 43 of file DDCompactViewImpl.cc.

43 { graph_.swap(implToSwap.graph_); }

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

◆ walker()

DDCompactViewImpl::GraphWalker DDCompactViewImpl::walker ( ) const

Definition at line 31 of file DDCompactViewImpl.cc.

31 { return GraphWalker(graph_, root_); }

References graph_, and root_.

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(), walker(), and ~DDCompactViewImpl().

DDCompactViewImpl::root_
DDLogicalPart root_
Definition: DDCompactViewImpl.h:44
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
math::Graph::size
auto size() const -> adj_list::size_type
Definition: Graph.h:176
DDPosData
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
math::Graph::edgeData
const E & edgeData(index_type i) const
Definition: Graph.h:158
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
math::Graph::addEdge
void addEdge(const N &from, const N &to, const E &edge)
Definition: Graph.h:231
DDCompactViewImpl::GraphWalker
math::GraphWalker< DDLogicalPart, DDPosData * > GraphWalker
Definition: DDCompactViewImpl.h:17
DDCompactViewImpl::root
const DDLogicalPart & root() const
Definition: DDCompactViewImpl.h:26
math::Graph::swap
void swap(Graph< N, E > &)
Definition: Graph.h:363
DDCompactViewImpl::graph_
Graph graph_
Definition: DDCompactViewImpl.h:45
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
math::Graph::edges
edge_range edges(index_type nodeIndex)
Definition: Graph.h:240
class-composition.parent
parent
Definition: class-composition.py:88
math::Graph< DDLogicalPart, DDPosData * >::edge_range
std::pair< edge_iterator, edge_iterator > edge_range
Definition: Graph.h:115