test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDLReflectionSolid.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 
10 
11 class DDCompactView;
12 
14  : DDLSolid( myreg )
15 {}
16 
17 // Upon starting a ReflectionSolid element, we need to clear all rSolids.
18 void
20 {
21  myRegistry_->getElement("rSolid")->clear();
22 }
23 
24 // Upon ending a ReflectionSolid element, call DDCore giving the solid name, and dimensions.
25 void
27 {
28  // get solid reference:
29  DDXMLElement* myrSolid = myRegistry_->getElement("rSolid");
30 
31  if (myrSolid->size() != 1)
32  {
33  std::cout << "WARNING: A ReflectionSolid had more than one rSolid. "
34  << "The first one was used." << std::endl;
35  std::cout << "The element to look for is " << getDDName(nmspace) << std::endl;
36  }
37 
38  DDSolid solid = DDSolid(myrSolid->getDDName(nmspace));
39  DDSolid ddreflsol = DDSolidFactory::reflection(getDDName(nmspace), solid);
40 
41  DDLSolid::setReference(nmspace, cpv);
42 }
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:37
DDXMLElement * getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
virtual size_t size(void) const
Number of elements accumulated.
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
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:48
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:896
The main class for processing parsed elements.
tuple cout
Definition: gather_cfg.py:145
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:55
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:80
void setReference(const std::string &nmspace, DDCompactView &cpv)
Definition: DDLSolid.cc:17