Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Solid.hh
Go to the documentation of this file.
1#ifndef G_SOLID_H
2#define G_SOLID_H
3
4namespace Garfield {
5
6/// Abstract base class for solids.
7
8class Solid {
9
10 public:
11 /// Constructor
12 Solid() : m_debug(false) {}
13 /// Destructor
14 virtual ~Solid() {}
15
16 /// Check whether a given point is inside the solid.
17 virtual bool IsInside(const double x, const double y,
18 const double z) const = 0;
19 /// Return the bounding box of the solid.
20 virtual bool GetBoundingBox(double& xmin, double& ymin, double& zmin,
21 double& xmax, double& ymax, double& zmax) const = 0;
22 /// Return true if the solid is a box.
23 virtual bool IsBox() const { return false; }
24 /// Return true if the solid is a tube.
25 virtual bool IsTube() const { return false; }
26 /// Return true if the solid is a sphere.
27 virtual bool IsSphere() const { return false; }
28
29 virtual bool GetCenter(double& x, double& y, double& z) const = 0;
30 virtual bool GetDimensions(double& l1, double& l2, double& l3) const = 0;
31 virtual bool GetOrientation(double& ctheta, double& stheta, double& cphi,
32 double& shpi) const = 0;
33
34 /// Switch on debugging messages.
35 void EnableDebugging() { m_debug = true; }
36 void DisableDebugging() { m_debug = false; }
37
38 protected:
39 bool m_debug;
40};
41}
42
43#endif
Abstract base class for solids.
Definition: Solid.hh:8
virtual bool IsTube() const
Return true if the solid is a tube.
Definition: Solid.hh:25
virtual ~Solid()
Destructor.
Definition: Solid.hh:14
virtual bool IsInside(const double x, const double y, const double z) const =0
Check whether a given point is inside the solid.
virtual bool IsBox() const
Return true if the solid is a box.
Definition: Solid.hh:23
virtual bool GetOrientation(double &ctheta, double &stheta, double &cphi, double &shpi) const =0
void EnableDebugging()
Switch on debugging messages.
Definition: Solid.hh:35
void DisableDebugging()
Definition: Solid.hh:36
Solid()
Constructor.
Definition: Solid.hh:12
virtual bool GetCenter(double &x, double &y, double &z) const =0
virtual bool GetDimensions(double &l1, double &l2, double &l3) const =0
bool m_debug
Definition: Solid.hh:39
virtual bool IsSphere() const
Return true if the solid is a sphere.
Definition: Solid.hh:27
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const =0
Return the bounding box of the solid.