#include <DetectorDescription/Parser/src/DDLRotationSequence.h>
Public Member Functions | |
DDLRotationSequence () | |
Constructor. | |
void | preProcessElement (const std::string &name, const std::string &nmspace) |
Called by loadAttributes AFTER attributes are loaded. | |
void | processElement (const std::string &name, const std::string &nmspace) |
Processing the element. | |
~DDLRotationSequence () | |
Destructor. |
DDLRotationSequence.h - description ------------------- begin: Friday Nov. 15, 2003 email: case@ucdhep.ucdavis.edu
This is the RotationSequence processor.
Definition at line 26 of file DDLRotationSequence.h.
DDLRotationSequence::DDLRotationSequence | ( | ) |
DDLRotationSequence::~DDLRotationSequence | ( | ) |
void DDLRotationSequence::preProcessElement | ( | const std::string & | name, | |
const std::string & | nmspace | |||
) | [virtual] |
Called by loadAttributes AFTER attributes are loaded.
The preProcessElement method can assume that the attributes are loaded and perform any code that is necessary at the start of an element.
This would allow users to call their own code to setup anything necessary for the continued processing of the child elements.
Reimplemented from DDLRotationByAxis.
Definition at line 44 of file DDLRotationSequence.cc.
References DDXMLElement::clear(), and DDLElementRegistry::getElement().
00045 { 00046 DDLElementRegistry::getElement("RotationByAxis")->clear(); 00047 }
void DDLRotationSequence::processElement | ( | const std::string & | name, | |
const std::string & | nmspace | |||
) | [virtual] |
Processing the element.
The processElement method completes any necessary work to process the XML element.
For example, this can be used to call the DDCore to make the geometry in memory. There is a default for this so that if not declared in the inheriting class, no processing is done.
Reimplemented from DDLRotationByAxis.
Definition at line 50 of file DDLRotationSequence.cc.
References DDXMLElement::clear(), DCOUT_V, DDrot(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDLElementRegistry::getElement(), i, DDLRotationByAxis::processOne(), dttmaxenums::R, rot, and DDXMLElement::size().
00051 { 00052 00053 DCOUT_V('P', "DDLRotationSequence::processElement started " << name); 00054 00058 DDLRotationByAxis* myRotations = 00059 dynamic_cast <DDLRotationByAxis * > (DDLElementRegistry::getElement("RotationByAxis")); 00060 DDXMLAttribute atts; 00061 00062 DDRotationMatrix R; 00063 for (size_t i = 0; i < myRotations->size(); ++i) 00064 { 00065 atts = myRotations->getAttributeSet(i); 00066 R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second); 00067 } 00068 00069 DDRotationMatrix* ddr = new DDRotationMatrix(R); 00070 DDRotation rot = DDrot(getDDName(nmspace), ddr); 00071 00072 myRotations->clear(); 00073 clear(); 00074 00075 DCOUT_V('P', "DDLRotationSequence::processElement completed"); 00076 }