forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DDCompactViewImpl.cc
54 lines (48 loc) · 1.73 KB
/
DDCompactViewImpl.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "DetectorDescription/Core/interface/DDCompactViewImpl.h"
#include "DetectorDescription/Core/interface/DDName.h"
#include "DetectorDescription/Core/interface/DDPosData.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
DDCompactViewImpl::DDCompactViewImpl( const DDLogicalPart & rootnodedata )
: root_( rootnodedata )
{
LogDebug("DDCompactViewImpl") << "Root node data = " << rootnodedata << std::endl;
}
DDCompactViewImpl::~DDCompactViewImpl()
{
Graph::adj_list::size_type it = 0;
if( graph_.size() == 0 ) {
LogDebug("DDCompactViewImpl") << "In destructor, graph is empty. Root:" << root_ << std::endl;
} else {
LogDebug("DDCompactViewImpl") << "In destructor, graph is NOT empty. Root:" << root_ << " graph_.size() = " << graph_.size() << std::endl;
for(; it < graph_.size() ; ++it ) {
Graph::edge_range erange = graph_.edges( it );
for(; erange.first != erange.second; ++(erange.first)) {
DDPosData * pd = graph_.edgeData( erange.first->second );
delete pd;
pd = nullptr;
}
}
}
edm::LogInfo("DDCompactViewImpl") << std::endl << "DDD transient representation has been destructed." << std::endl << std::endl;
}
DDCompactViewImpl::GraphWalker
DDCompactViewImpl::walker() const
{
return GraphWalker( graph_, root_ );
}
void
DDCompactViewImpl::position( const DDLogicalPart & self,
const DDLogicalPart & parent,
int copyno,
const DDTranslation & trans,
const DDRotation & rot,
const DDDivision * div )
{
DDPosData * pd = new DDPosData( trans, rot, copyno, div );
graph_.addEdge( parent, self, pd );
}
void
DDCompactViewImpl::swap( DDCompactViewImpl& implToSwap ) {
graph_.swap( implToSwap.graph_ );
}
DDCompactViewImpl::DDCompactViewImpl() { }