ATLAS Offline Software
Loading...
Searching...
No Matches
unionHandler.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
9#include <iostream>
13
14using namespace xercesc;
15
16unionHandler::unionHandler(const std::string& s,
18 : XMLHandler(s, c)
19{
20// std::cout<<"Creating handler for composition"<<std::endl;
21}
22
24 xercesc::DOMNode *t)
25{
26 AGDDVolumeStore& vs = c.GetVolumeStore();
27 AGDDSectionStore& ss = c.GetSectionStore();
28 AGDDPositionerStore& ps = c.GetPositionerStore();
29
30 bool res;
31 std::string name=getAttributeAsString(c, t, "name",res);
32
33 AGDDUnion *u=new AGDDUnion(name, vs, ss);
34
35 StopLoop(true);
36
37 DOMNode* child;
38
39 int before=ps.NrOfPositioners();
40
41 IAGDDParser& parser = *c.GetParser();
42 for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
43 {
44 if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
45 parser.elementLoop(c, child);
46 }
47 }
48
49 int after=ps.NrOfPositioners();
50 for (int i=before;i<after;i++)
51 {
52 AGDDPositioner *posit=ps.GetPositioner(i);
53 if (vs.Exist(posit->Volume()))
54 u->AddDaughter(posit);
55 }
56
57 std::string col=getAttributeAsString(c, t, "color",res);
58 if (res)
59 u->SetColor(col);
60}
std::pair< std::vector< unsigned int >, bool > res
static Double_t ss
const std::string & Volume()
bool Exist(std::string)
void StopLoop(bool)
XMLHandler(const std::string &n, AGDDController &c)
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
unionHandler(const std::string &, AGDDController &c)
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override