CMS 3D CMS Logo

DDLRotationSequence.cc
Go to the documentation of this file.
2 
3 #include <stddef.h>
4 #include <map>
5 #include <utility>
6 
13 
14 class DDCompactView;
15 
17  : DDLRotationByAxis( myreg )
18 {}
19 
20 void
22 {
23  myRegistry_->getElement("RotationByAxis")->clear();
24 }
25 
26 void
28 {
32  std::shared_ptr<DDLRotationByAxis> myRotations = std::static_pointer_cast<DDLRotationByAxis>(myRegistry_->getElement("RotationByAxis"));
33  DDXMLAttribute atts;
34 
36  for (size_t i = 0; i < myRotations->size(); ++i)
37  {
38  atts = myRotations->getAttributeSet(i);
39  R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second);
40  }
41 
42  DDRotationMatrix* ddr = new DDRotationMatrix(R);
43  DDRotation rot = DDrot(getDDName(nmspace), ddr);
44 
45  myRotations->clear();
46  clear();
47 }
48 
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:172
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
type of data representation of DDCompactView
Definition: DDCompactView.h:90
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:45
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
std::shared_ptr< DDXMLElement > getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
DDLRotationSequence(DDLElementRegistry *myreg)
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
DDLRotationByAxis handles RotationByAxis elements.
The main class for processing parsed elements.
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:55
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:80