Bayeux  3.4.1
Core Foundation library for SuperNEMO
i_locator.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Xavier Garrido <garrido@lal.in2p3.fr>
4  * Creation date: 2010-02-09
5  * Last modified: 2013-07-16
6  *
7  * License:
8  *
9  * Description:
10  *
11  * Geometry locator abstract interface
12  *
13  * History:
14  *
15  */
16 
17 #ifndef GEOMTOOLS_I_LOCATOR_H
18 #define GEOMTOOLS_I_LOCATOR_H 1
19 
20 // This project:
21 #include <geomtools/clhep.h>
23 #include <geomtools/geom_id.h>
24 
25 namespace geomtools {
26 
27  class geom_info;
28 
32  {
33  virtual bool find_geom_id (const vector_3d & position_,
34  int type_,
35  geom_id & gid_,
36  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const = 0;
37 
38  };
39 
42  class i_locator : public i_base_locator
43  {
44 
45  public:
46 
48  virtual bool validate_id (const geom_id & id_) const = 0;
49 
51  virtual const geom_info & get_geom_info (const geom_id & id_) const = 0;
52 
53 
56  virtual const geom_id & get_geom_id (const vector_3d & position_,
57  int type_ = geom_id::INVALID_TYPE,
58  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const = 0;
59 
62  virtual bool find_geom_id (const vector_3d & position_,
63  int type_,
64  geom_id & gid_,
65  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const;
66 
67  };
68 
69  class manager;
70 
72  {
73  public:
74 
76  base_locator ();
77 
79  virtual ~base_locator ();
80 
82  virtual void initialize (const datatools::properties & config_) = 0;
83 
85  bool has_geo_manager() const;
86 
88  void set_geo_manager (const manager & mgr_);
89 
91  const manager & get_geo_manager () const;
92 
94  virtual void reset () = 0;
95 
97  virtual bool is_initialized () const = 0;
98 
101 
104 
107  virtual bool find_geom_id (const vector_3d & position_,
108  int type_,
109  geom_id & gid_,
110  double tolerance_ = GEOMTOOLS_PROPER_TOLERANCE) const = 0;
111 
112  protected:
113 
114  void _basic_initialize (const datatools::properties & config_);
115 
117 
118  private:
119 
120  const geomtools::manager * _geo_manager_;
121  };
122 
123 } // end of namespace geomtools
124 
125 #endif // GEOMTOOLS_I_LOCATOR_H
126 
127 /*
128 ** Local Variables: --
129 ** mode: c++ --
130 ** c-file-style: "gnu" --
131 ** tab-width: 2 --
132 ** End: --
133 */
datatools::logger::priority _logging_priority
Definition: i_locator.h:116
void _basic_initialize(const datatools::properties &config_)
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
virtual const geom_id & get_geom_id(const vector_3d &position_, int type_=geom_id::INVALID_TYPE, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const =0
Definition: i_locator.h:42
bool has_geo_manager() const
Check if there is a geometry manager.
Definition: i_locator.h:71
void set_geo_manager(const manager &mgr_)
Set the reference to the geometry manager.
virtual void initialize(const datatools::properties &config_)=0
Main initialization method from a list of properties.
A record for geometry information about a physical volume in a virtual geometry.
Definition: geom_info.h:38
base_locator()
Constructor.
#define GEOMTOOLS_PROPER_TOLERANCE
Definition: geomtools_config.h:26
virtual bool validate_id(const geom_id &id_) const =0
Given a geometry ID, check if it is valid (known within some internal table).
Definition: i_locator.h:31
virtual bool find_geom_id(const vector_3d &position_, int type_, geom_id &gid_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const =0
const manager & get_geo_manager() const
Get a non-mutable reference to the geometry manager.
virtual const geom_info & get_geom_info(const geom_id &id_) const =0
Given a geometry ID, returns the associated geom_info instance (from some internal table).
virtual bool is_initialized() const =0
Check if locator is initialized.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
virtual void reset()=0
Main reset method.
Geometry manager for virtual geometry modelling. Main geometry manager for the modelisation of variou...
Definition: manager.h:70
Definition: geom_id.h:41
static const uint32_t INVALID_TYPE
Definition: geom_id.h:45
virtual ~base_locator()
Destructor.
datatools::logger::priority get_logging_priority() const
Get the logging priority threshold.
virtual bool find_geom_id(const vector_3d &position_, int type_, geom_id &gid_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
void set_logging_priority(datatools::logger::priority)
Set the logging priority threshold.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125