1 #ifndef _det_MPositionable_h
2 #define _det_MPositionable_h
4 #include <utl/ShadowPtr.h>
6 #include <utl/Vector.h>
7 #include <utl/CoordinateSystemPtr.h>
8 #include <utl/TransformationMatrix.h>
9 #include <fwk/LocalCoordinateSystem.h>
119 template<
class Config>
281 template<
class Config>
284 template<
class Config>
287 template<
class Config>
290 template<
class Config>
293 template<
class Config>
296 template<
class Config>
299 template<
class Config>
302 template<
class Config>
309 return fConfig.template GetData<double, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fComponent1, kComponent1Tag);
312 template<
class Config>
314 {
return fConfig.template GetData<double, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fComponent2, kComponent2Tag); }
316 template<
class Config>
318 {
return fConfig.template GetData<double, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fComponent3, kComponent3Tag); }
320 template<
class Config>
322 {
return fConfig.template GetData<double, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fEulerPhi, kEulerPhiTag); }
324 template<
class Config>
326 {
return fConfig.template GetData<double, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fEulerTheta, kEulerThetaTag); }
328 template<
class Config>
330 {
return fConfig.template GetData<double, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fEulerPsi, kEulerPsiTag); }
332 template<
class Config>
334 {
return fConfig.template GetData<CoordinateType, utl::ThrowOnZeroDereference, utl::ShadowPtr>(fCoordinateType, kCoordinateTypeTag); }
336 template<
class Config>
338 {
return utl::Point(0, 0, 0, GetLocalCoordinateSystem()); }
340 template<
class Config>
345 if (!fLocalCoordinateSystem) {
349 auto cs = GetReferenceCoordinateSystem();
351 const double c1 = GetComponent1();
352 const double c2 = GetComponent2();
353 const double c3 = GetComponent3();
355 const double phi = GetEulerPhi();
356 const double theta = GetEulerTheta();
357 const double psi = GetEulerPsi();
359 if (c1 || c2 || c3 || phi || theta || psi) {
361 const Type& ct = Type::Create(Type::KindCreator::Create(GetCoordinateType()));
382 fLocalCoordinateSystem = cs;
384 return fLocalCoordinateSystem;
virtual double GetComponent1() const
First component of the position vector.
const Config & fConfig
Hold a reference to the configuration proxy.
virtual utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const =0
virtual double GetEulerPsi() const
Third Euler angle for rotation over (intermediate) z.
utl::ShadowPtr< CoordinateType > fCoordinateType
virtual CoordinateType GetCoordinateType() const
Coordinate type.
Mixin class to be inherited from objects that have a position.
static const std::string kCoordinateTypeTag
utl::ShadowPtr< double > fEulerTheta
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Local system based on position and configured rotations.
utl::ShadowPtr< double > fComponent1
virtual double GetComponent2() const
Second component of the position vector.
utl::Point GetPosition() const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
virtual double GetEulerTheta() const
Second Euler angle for rotation over (intermediate) x.
static const std::string kEulerPsiTag
Tag for third rotation's Euler angle in config.
virtual double GetComponent3() const
Third component of the position vector.
utl::ShadowPtr< double > fComponent2
virtual double GetEulerPhi() const
First Euler angle for rotation over (original) z.
static const std::string kComponent2Tag
Tag for second vector component in config.
MPositionable(const Config &cp)
static const std::string kComponent3Tag
Tag for third vector component in config.
utl::ShadowPtr< double > fEulerPsi
Base class for classes indicating coordinate types.
utl::CoordinateSystemPtr fLocalCoordinateSystem
static const std::string kEulerPhiTag
Tag for first rotation's Euler angle in config.
utl::ShadowPtr< double > fEulerPhi
static const std::string kComponent1Tag
Tag for first vector component in config.
utl::ShadowPtr< double > fComponent3
std::string CoordinateType
Simple internal typedef to emulate the actual enumeration via a type handled in the configuration mec...
Type
The type of file that we are acutally opening.
static const std::string kEulerThetaTag
Tag for second rotation's Euler angle in config.
void Config(const std::string &infile)