CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/DetectorDescription/Parser/src/DDLRotationSequence.cc

Go to the documentation of this file.
00001 /***************************************************************************
00002                           DDLRotationSequence.cc  -  description
00003                              -------------------
00004     begin                : Friday November 14, 2003
00005     email                : case@ucdhep.ucdavis.edu
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *           DDDParser sub-component of DDD                                *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #include "DetectorDescription/Parser/src/DDLRotationSequence.h"
00015 
00016 #include "DetectorDescription/Core/interface/DDName.h"
00017 #include "DetectorDescription/Base/interface/DDdebug.h"
00018 #include "DetectorDescription/Base/interface/DDRotationMatrix.h"
00019 #include "DetectorDescription/Core/interface/DDTransform.h"
00020 
00021 DDLRotationSequence::DDLRotationSequence( DDLElementRegistry* myreg )
00022   : DDLRotationByAxis( myreg ) 
00023 {}
00024 
00025 DDLRotationSequence::~DDLRotationSequence( void )
00026 {}
00027 
00028 void
00029 DDLRotationSequence::preProcessElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
00030 {
00031   myRegistry_->getElement("RotationByAxis")->clear();
00032 }
00033 
00034 void
00035 DDLRotationSequence::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
00036 {
00037   DCOUT_V('P', "DDLRotationSequence::processElement started " << name);
00038 
00042   DDLRotationByAxis* myRotations = 
00043     dynamic_cast <DDLRotationByAxis * > (myRegistry_->getElement("RotationByAxis"));
00044   DDXMLAttribute atts;
00045 
00046   DDRotationMatrix R;
00047   for (size_t i = 0; i < myRotations->size(); ++i)
00048   {
00049     atts = myRotations->getAttributeSet(i);
00050     R = myRotations->processOne(R, atts.find("axis")->second, atts.find("angle")->second);
00051   }
00052     
00053   DDRotationMatrix* ddr = new DDRotationMatrix(R);
00054   DDRotation rot = DDrot(getDDName(nmspace), ddr);
00055 
00056   myRotations->clear();
00057   clear();
00058 
00059   DCOUT_V('P', "DDLRotationSequence::processElement completed");
00060 }