00001 #ifndef DDPosData_h 00002 #define DDPosData_h 00003 00004 #include "DetectorDescription/Core/interface/DDTransform.h" 00005 #include "DetectorDescription/Base/interface/DDTranslation.h" 00006 //#include "DetectorDescription/Base/interface/DDException.h" 00007 #include "DetectorDescription/Core/interface/DDDivision.h" 00008 00010 00016 struct DDPosData 00017 { 00019 00026 DDPosData(const DDTranslation & t, const DDRotation& r, int c, const DDDivision * d = NULL ) //(mec:2007-06-07) tried = 0 when i did the delete in destructor... no help/difference. 00027 : trans_(t), rot_(r), replication_(0), copyno_(c), div_(d) 00028 { 00029 //if (!rot_.rotation()) throw DDException("rotation not defined: [" + rot_.ns() + ":" + rot_.name() +"]" ); 00030 } 00031 00032 /* Prior to this attempt do only delete div_ if it existed, we had less lost memory (mec:2007-06-07) 00033 ~DDPosData() { 00034 // delete &trans_; 00035 if ( div_ == 0 ) delete div_; 00036 } */ 00037 const DDTranslation & translation() const { return trans_; } 00038 const DDTranslation & trans() const { return trans_; } 00039 00040 const DDRotationMatrix & rotation() const { return *(rot_.rotation()); } 00041 const DDRotationMatrix & rot() const { return *(rot_.rotation()); } 00042 00043 const DDDivision & div() const { return *div_; } 00044 const DDDivision & division() const { return *div_; } 00045 00046 //const DDTranslation & trans_; /**< relative translation std::vector */ 00047 DDTranslation trans_; 00049 DDRotation rot_; 00050 //FIXME: DDPosData: replication_ provide a design! 00051 void * replication_; 00052 int copyno_; 00053 const DDDivision * div_; 00055 private: 00056 DDPosData(); 00057 DDPosData & operator=(const DDPosData &); 00058 }; 00059 #endif