///////////////////////////////////////////////////////////////////////////////
/// \class RAT::Geometry
///
/// \brief  Constructs the geometry
///
/// \author Phil G Jones <p.g.jones@qmul.ac.uk>
/// \author Aksel Hallin <aksel.hallin@ualberta.ca> -- contact person
///
/// REVISION HISTORY:\n
///     2013-08-07: P G Jones - New file. \n
///
/// \details Constructs the geometry. All geometric factories should be
/// registered in the ConstructGeometries method of this class. This class is
/// a singleton.
///
///////////////////////////////////////////////////////////////////////////////

#ifndef __RAT_Geometry_hh__
#define __RAT_Geometry_hh__

#include <string>

namespace RAT
{

class Geometry
{
public:
  /// Singleton accessor
  ///
  /// @return pointer to the Geometry instance
  inline static Geometry* Get();

  /// Construct all the geometries in table defined
  ///
  /// Forced overlap checking should be added to check that no geometries
  /// overlap, however this should be avoided as it drastically slows rat.
  ///
  /// @param[in] table name default is GEO
  /// @param[in] checkOverlaps true if overlap checking is forced
  void ConstructGeometries( const std::string& table="GEO", const bool checkOverlaps=false );

private:
  /// Constructs the factories and solids
  Geometry();
  /// Destructs the factories and solids
  ~Geometry();
  /// Do not call
  Geometry( Geometry& );
  /// Do not call
  void operator=( Geometry& );
};

inline Geometry*
Geometry::Get()
{
  static Geometry geometry;
  return &geometry;
}

} //::RAT

#endif