Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
GeometryBase.hh
Go to the documentation of this file.
1#ifndef G_GEOMETRY_BASE_H
2#define G_GEOMETRY_BASE_H
3
4#include <string>
5
6#include "Medium.hh"
7#include "Solid.hh"
8
9namespace Garfield {
10
11/// Abstract base class for geometry classes.
12
14 public:
15 /// Constructor
16 GeometryBase() = default;
17 /// Destructor
18 virtual ~GeometryBase() {}
19
20 /// Retrieve the medium at a given point.
21 virtual Medium* GetMedium(const double x, const double y,
22 const double z) const = 0;
23
24 /// Return the number of solids in the geometry.
25 virtual unsigned int GetNumberOfSolids() const { return 0; }
26 /// Get a solid from the list.
27 virtual Solid* GetSolid(const unsigned int /*i*/) const { return nullptr; }
28 /// Get a solid from the list, together with the associated medium.
29 virtual Solid* GetSolid(const unsigned int /*i*/, Medium*& medium) const {
30 medium = nullptr;
31 return nullptr;
32 }
33 /// Check if a point is inside the geometry.
34 virtual bool IsInside(const double x, const double y,
35 const double z) const = 0;
36
37 /// Get the bounding box (envelope of the geometry).
38 virtual bool GetBoundingBox(double& xmin, double& ymin, double& zmin,
39 double& xmax, double& ymax, double& zmax) = 0;
40
41 protected:
42 std::string m_className = "GeometryBase";
43};
44}
45
46#endif
Abstract base class for geometry classes.
Definition: GeometryBase.hh:13
virtual Medium * GetMedium(const double x, const double y, const double z) const =0
Retrieve the medium at a given point.
virtual unsigned int GetNumberOfSolids() const
Return the number of solids in the geometry.
Definition: GeometryBase.hh:25
GeometryBase()=default
Constructor.
virtual bool IsInside(const double x, const double y, const double z) const =0
Check if a point is inside the geometry.
virtual Solid * GetSolid(const unsigned int, Medium *&medium) const
Get a solid from the list, together with the associated medium.
Definition: GeometryBase.hh:29
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0
Get the bounding box (envelope of the geometry).
virtual Solid * GetSolid(const unsigned int) const
Get a solid from the list.
Definition: GeometryBase.hh:27
virtual ~GeometryBase()
Destructor.
Definition: GeometryBase.hh:18
Abstract base class for media.
Definition: Medium.hh:13
Abstract base class for solids.
Definition: Solid.hh:28