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.
1 /***************************************************************************
2  DDLReflectionSolid.cc - description
3  -------------------
4  begin : Mon Mar 4, 2002
5  email : case@ucdhep.ucdavis.edu
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * DDDParser sub-component of DDD *
11  * *
12  ***************************************************************************/
13 
16 
20 
22  : DDLSolid( myreg )
23 {}
24 
26 {}
27 
28 // Upon starting a ReflectionSolid element, we need to clear all rSolids.
29 void
31 {
32  myRegistry_->getElement("rSolid")->clear();
33 }
34 
35 // Upon ending a ReflectionSolid element, call DDCore giving the solid name, and dimensions.
36 void
38 {
39  DCOUT_V('P', "DDLReflectionSolid::processElement started");
40 
41  // get solid reference:
42  DDXMLElement* myrSolid = myRegistry_->getElement("rSolid");
43 
44  if (myrSolid->size() != 1)
45  {
46  std::cout << "WARNING: A ReflectionSolid had more than one rSolid. "
47  << "The first one was used." << std::endl;
48  std::cout << "The element to look for is " << getDDName(nmspace) << std::endl;
49  }
50 
51  DDSolid solid = DDSolid(myrSolid->getDDName(nmspace));
52  DDSolid ddreflsol = DDSolidFactory::reflection(getDDName(nmspace), solid);
53 
54  DDLSolid::setReference(nmspace, cpv);
55 
56  DCOUT_V('P', "DDLReflectionSolid::processElement completed");
57 }
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:186
~DDLReflectionSolid(void)
Destructor.
type of data representation of DDCompactView
Definition: DDCompactView.h:77
DDLReflectionSolid(DDLElementRegistry *myreg)
Constructor.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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)
Called by loadAttributes AFTER attributes are loaded.
virtual size_t size(void) const
Number of elements accumulated.
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Processing the element.
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDLSolid processes Box elements.
Definition: DDLSolid.h:27
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:58
static DDSolid reflection(const DDName &name, const DDSolid &s)
Definition: DDSolid.cc:852
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:61
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:86
void setReference(const std::string &nmspace, DDCompactView &cpv)
Definition: DDLSolid.cc:26