00001 // $Id: SolidUnion.h,v 1.11 2005/12/08 19:20:01 jpalac Exp $ 00002 // =========================================================================== 00003 // CVS tag $Name: v18r12 $ 00004 // =========================================================================== 00005 #ifndef DETDESC_SOLIDUNION_H 00006 #define DETDESC_SOLIDUNION_H 1 00007 00009 #include <algorithm> 00010 #include <functional> 00011 00013 #include "DetDesc/ISolid.h" 00014 #include "DetDesc/SolidBoolean.h" 00015 00017 class StatusCode; 00018 template <class TYPE> 00019 class SolidFactory; 00020 00031 class SolidUnion: public virtual SolidBoolean 00032 { 00034 friend class SolidFactory<SolidUnion>; 00035 00036 public: 00037 00042 SolidUnion( const std::string& name , ISolid* first ); 00043 00045 virtual ~SolidUnion(); 00046 00047 public: 00048 00054 virtual std::string typeName () const { return "SolidUnion" ; }; 00055 00064 bool isInside ( const Gaudi::XYZPoint & point ) const ; 00065 bool isInside ( const Gaudi::Polar3DPoint& point ) const ; 00066 bool isInside ( const Gaudi::RhoZPhiPoint& point ) const ; 00067 00073 virtual const ISolid* coverTop () const ; 00074 00080 StatusCode unite ( ISolid* solid , 00081 const Gaudi::Transform3D* mtrx ); 00082 00089 StatusCode unite ( ISolid* child , 00090 const Gaudi::XYZPoint& position , 00091 const Gaudi::Rotation3D& rotation = Gaudi::Rotation3D() ); 00092 00093 protected: 00094 00098 SolidUnion( const std::string& Name = "Anonymous Union"); 00099 00103 StatusCode updateBP(); 00104 00105 private: 00106 00107 SolidUnion ( const SolidUnion& ) ; 00108 SolidUnion& operator=( const SolidUnion& ) ; 00109 00110 private: 00111 00112 mutable ISolid* m_coverTop ; 00113 00114 template <class aPoint> 00115 bool isInsideImpl(const aPoint& point) const; 00116 00117 }; 00118 00119 // =========================================================================== 00120 #endif 00121 // =========================================================================== 00122 00123