test
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.
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  DDLRotationByAxis* myRotations =
33  dynamic_cast <DDLRotationByAxis * > (myRegistry_->getElement("RotationByAxis"));
34  DDXMLAttribute atts;
35 
37  for (size_t i = 0; i < myRotations->size(); ++i)
38  {
39  atts = myRotations->getAttributeSet(i);
40  R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second);
41  }
42 
43  DDRotationMatrix* ddr = new DDRotationMatrix(R);
44  DDRotation rot = DDrot(getDDName(nmspace), ddr);
45 
46  myRotations->clear();
47  clear();
48 }
int i
Definition: DBlmapReader.cc:9
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.
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a &quot;row&quot; of attributes, i.e. one attribute set.
Definition: DDXMLElement.cc:73
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: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.
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