29 lines
737 B
C++
Executable File
29 lines
737 B
C++
Executable File
#ifndef GEOMETRY_H
|
|
#define GEOMETRY_H
|
|
|
|
#include "simulation/coordinates.h"
|
|
|
|
// class defining the miminmum requirement of a Geometry class
|
|
class Geometry {
|
|
public:
|
|
// check if Coordinate position is contained in the Geometry
|
|
virtual bool isInside(const Coordinate& position) const = 0;
|
|
};
|
|
|
|
// Geometry class for a cylinder
|
|
class Cylinder : public Geometry {
|
|
public:
|
|
// Constructor: takes the radius and height of the cylinder
|
|
// z always starts at 0
|
|
Cylinder(double radius, double height);
|
|
// check whether Coordinate position lies within the Cylinder
|
|
// i.e. z in (0,height), r in (0,radius)
|
|
bool isInside(const Coordinate& position) const;
|
|
|
|
private:
|
|
const double radius_;
|
|
const double height_;
|
|
};
|
|
|
|
#endif /* GEOMETRY_H */
|