ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
AGDD
AGDDHandlers
src
snakeHandler.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AGDDHandlers/snakeHandler.h
"
6
#include "
AGDDControl/XercesParser.h
"
7
#include "
AGDDControl/XMLHandlerStore.h
"
8
#include "
AGDDControl/AGDDController.h
"
9
#include "
AGDDHandlers/snake_pointHandler.h
"
10
#include "
AGDDModel/AGDDSnake.h
"
11
12
#include <iostream>
13
#include <vector>
14
15
using namespace
xercesc;
16
17
snakeHandler::snakeHandler
(
const
std::string& s,
18
AGDDController
& c)
19
:
XMLHandler
(s, c)
20
{
21
}
22
23
void
snakeHandler::ElementHandle
(
AGDDController
& c,
24
xercesc::DOMNode *t)
25
{
26
bool
res
=
false
;
27
std::string name=
getAttributeAsString
(c, t,
"name"
,
res
);
28
std::string material=
getAttributeAsString
(c, t,
"material"
,
res
);
29
double
radius=
getAttributeAsDouble
(c, t,
"radius"
,
res
);
30
31
std::vector<GeoTrf::Vector3D> points;
32
33
AGDDSnake
*vol=
new
AGDDSnake
(name, c.GetVolumeStore(), c.GetSectionStore());
34
vol->
SetMaterial
(material);
35
vol->
Radius
(radius);
36
37
StopLoop
(
true
);
38
DOMNode* child;
39
40
snake_pointHandler
* pointHand =
dynamic_cast<
snake_pointHandler
*
>
41
(c.GetHandlerStore().GetHandler(
"snake_point"
));
42
if
(!pointHand) std::abort();
43
44
IAGDDParser
& parser = *c.GetParser();
45
for
(child=t->getFirstChild();child!=0;child=child->getNextSibling())
46
{
47
if
(child->getNodeType()==DOMNode::ELEMENT_NODE) {
48
parser.elementLoop(c, child);
49
points.push_back (pointHand->
CurrentPoint
());
50
}
51
}
52
53
int
nPoints=points.size();
54
for
(
int
i=0;i<nPoints;i++)
55
vol->
SetPoint
(points[i]);
56
57
std::string col=
getAttributeAsString
(c, t,
"color"
,
res
);
58
if
(
res
)
59
vol->
SetColor
(col);
60
61
}
AGDDController.h
AGDDSnake.h
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
XMLHandlerStore.h
XercesParser.h
AGDDController
Definition
AGDDController.h:30
AGDDSnake
Definition
AGDDSnake.h:14
AGDDSnake::SetPoint
void SetPoint(const GeoTrf::Vector3D &p)
Definition
AGDDSnake.h:20
AGDDSnake::Radius
double Radius() const
Definition
AGDDSnake.h:25
AGDDVolume::SetMaterial
void SetMaterial(const std::string &n)
Definition
AGDDVolume.h:24
AGDDVolume::SetColor
void SetColor(const std::string &c)
Definition
AGDDVolume.h:36
IAGDDParser
Definition
IAGDDParser.h:15
XMLHandler::StopLoop
void StopLoop(bool)
Definition
XMLHandler.cxx:28
XMLHandler::getAttributeAsDouble
double getAttributeAsDouble(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:78
XMLHandler::XMLHandler
XMLHandler(const std::string &n, AGDDController &c)
Definition
XMLHandler.cxx:15
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:69
snakeHandler::snakeHandler
snakeHandler(const std::string &, AGDDController &c)
Definition
snakeHandler.cxx:17
snakeHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition
snakeHandler.cxx:23
snake_pointHandler
Definition
snake_pointHandler.h:14
snake_pointHandler::CurrentPoint
GeoTrf::Vector3D CurrentPoint()
Definition
snake_pointHandler.h:20
snakeHandler.h
snake_pointHandler.h
Generated on
for ATLAS Offline Software by
1.17.0