CMS 3D CMS Logo

DDLRotationSequence.cc
Go to the documentation of this file.
8 
9 #include <cstddef>
10 #include <map>
11 #include <utility>
12 
13 class DDCompactView;
14 
16  : DDLRotationByAxis( myreg )
17 {}
18 
19 void
21  DDCompactView& cpv )
22 {
23  myRegistry_->getElement("RotationByAxis")->clear();
24 }
25 
26 void
28  DDCompactView& cpv )
29 {
33  std::shared_ptr<DDLRotationByAxis> myRotations =
34  std::static_pointer_cast<DDLRotationByAxis>(myRegistry_->getElement("RotationByAxis"));
35  DDXMLAttribute atts;
36 
38  for (size_t i = 0; i < myRotations->size(); ++i)
39  {
40  atts = myRotations->getAttributeSet(i);
41  R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second);
42  }
43 
44  DDRotationMatrix* ddr = new DDRotationMatrix(R);
45  DDRotation rot = DDrot(getDDName(nmspace), ddr);
46 
47  myRotations->clear();
48  clear();
49 }
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:67
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:54
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:79