CMS 3D CMS Logo

DDLReflectionSolid.cc
Go to the documentation of this file.
7 
8 #include <iostream>
9 
10 class DDCompactView;
11 
13  : DDLSolid( myreg )
14 {}
15 
16 // Upon starting a ReflectionSolid element, we need to clear all rSolids.
17 void
19 {
20  myRegistry_->getElement("rSolid")->clear();
21 }
22 
23 // Upon ending a ReflectionSolid element, call DDCore giving the solid name, and dimensions.
24 void
26 {
27  // get solid reference:
28  auto myrSolid = myRegistry_->getElement("rSolid");
29 
30  if (myrSolid->size() != 1)
31  {
32  std::cout << "WARNING: A ReflectionSolid had more than one rSolid. "
33  << "The first one was used." << std::endl;
34  std::cout << "The element to look for is " << getDDName(nmspace) << std::endl;
35  }
36 
37  DDSolid solid = DDSolid(myrSolid->getDDName(nmspace));
38  DDSolid ddreflsol = DDSolidFactory::reflection(getDDName(nmspace), solid);
39 
40  DDLSolid::setReference(nmspace, cpv);
41 }
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:172
type of data representation of DDCompactView
Definition: DDCompactView.h:90
DDLReflectionSolid(DDLElementRegistry *myreg)
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
std::shared_ptr< DDXMLElement > getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
DDLSolid processes Box elements.
Definition: DDLSolid.h:30
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
static DDSolid reflection(const DDName &name, const DDSolid &s)
Definition: DDSolid.cc:1065
The main class for processing parsed elements.
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:79
void setReference(const std::string &nmspace, DDCompactView &cpv)
Definition: DDLSolid.cc:16