CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDLRotationSequence.cc
Go to the documentation of this file.
1 /***************************************************************************
2  DDLRotationSequence.cc - description
3  -------------------
4  begin : Friday November 14, 2003
5  email : case@ucdhep.ucdavis.edu
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * DDDParser sub-component of DDD *
11  * *
12  ***************************************************************************/
13 
15 
20 
22  : DDLRotationByAxis( myreg )
23 {}
24 
26 {}
27 
28 void
29 DDLRotationSequence::preProcessElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
30 {
31  myRegistry_->getElement("RotationByAxis")->clear();
32 }
33 
34 void
35 DDLRotationSequence::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
36 {
37  DCOUT_V('P', "DDLRotationSequence::processElement started " << name);
38 
42  DDLRotationByAxis* myRotations =
43  dynamic_cast <DDLRotationByAxis * > (myRegistry_->getElement("RotationByAxis"));
44  DDXMLAttribute atts;
45 
47  for (size_t i = 0; i < myRotations->size(); ++i)
48  {
49  atts = myRotations->getAttributeSet(i);
50  R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second);
51  }
52 
53  DDRotationMatrix* ddr = new DDRotationMatrix(R);
54  DDRotation rot = DDrot(getDDName(nmspace), ddr);
55 
56  myRotations->clear();
57  clear();
58 
59  DCOUT_V('P', "DDLRotationSequence::processElement completed");
60 }
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Called by loadAttributes AFTER attributes are loaded.
int i
Definition: DBlmapReader.cc:9
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:186
~DDLRotationSequence(void)
Destructor.
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a &quot;row&quot; of attributes, i.e. one attribute set.
Definition: DDXMLElement.cc:79
type of data representation of DDCompactView
Definition: DDCompactView.h:77
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:55
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDXMLElement * getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
virtual DDRotationMatrix processOne(DDRotationMatrix R, std::string &axis, std::string &angle)
virtual size_t size(void) const
Number of elements accumulated.
DDLRotationSequence(DDLElementRegistry *myreg)
Constructor.
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:93
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDLRotationByAxis handles RotationByAxis elements.
The main class for processing parsed elements.
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:61
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:86
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Processing the element.