/////////////////////////////////////////////////////////////////////////////// /// \class RAT::GeoSolid /// /// \brief Base class for solids /// /// \author Phil G Jones /// \author Aksel Hallin -- contact person /// /// REVISION HISTORY:\n /// 2013-08-07 : P G Jones - New file. \n /// /// \details All solids should derive from this in order to be built by one of /// the GeoSolidXXXFactories. /// /////////////////////////////////////////////////////////////////////////////// #ifndef __RAT_GeoSolid_hh__ #define __RAT_GeoSolid_hh__ #include #include #include class G4VSolid; namespace RAT { class GeoSolid { public: /// Static method to invoke construction of a solid that is returned. /// /// @param[in] volumeName Name of the volume the solid is to reside in /// @param[in] table DBLinkPtr to the table that defines the solid. /// @return the geant4 solid requested static G4VSolid* ConstructSolid( const std::string& volumeName, DBLinkPtr table ); /// Destroy the solid c++-factory, cleans up all solid code static void Destruct(); /// Standard GeoSolid constructor /// /// @param[in] name The solid-factory name, used in ratdb to invoke factory code inline GeoSolid( const std::string& name ); /// Construct the solid /// /// This method is abstract and should be defined by classes that build solids. /// /// @param[in] volumeName Name of the volume the solid is to reside in /// @param[in] table DBLinkPtr to the table that defines the solid. /// @return the geant4 solid requested virtual G4VSolid* Construct( const std::string& volumeName, DBLinkPtr table ) const = 0; virtual ~GeoSolid() {}; private: static std::map< std::string, GeoSolid* > fsSolids; ///< Static map of solid-factories by name }; GeoSolid::GeoSolid( const std::string& name ) { fsSolids[name] = this; } } //::RAT #endif