CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
18  myRegistry_->getElement("RotationByAxis")->clear();
19 }
20 
25  std::shared_ptr<DDLRotationByAxis> myRotations =
26  std::static_pointer_cast<DDLRotationByAxis>(myRegistry_->getElement("RotationByAxis"));
27  DDXMLAttribute atts;
28 
30  for (size_t i = 0; i < myRotations->size(); ++i) {
31  atts = myRotations->getAttributeSet(i);
32  R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second);
33  }
34 
35  DDRotation rot = DDrot(getDDName(nmspace), std::make_unique<DDRotationMatrix>(R));
36 
37  myRotations->clear();
38  clear();
39 }
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:173
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:45
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
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, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDLRotationByAxis handles RotationByAxis elements.
The main class for processing parsed elements.
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:40
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:56