30 lines
605 B
C++
Executable File
30 lines
605 B
C++
Executable File
#ifndef GEOMETRY_H
|
|
#define GEOMETRY_H
|
|
|
|
#include "simulation/coordinates.h"
|
|
|
|
enum class GeometryPositioning {
|
|
bottom,
|
|
top,
|
|
hull,
|
|
inside
|
|
};
|
|
class Geometry {
|
|
public:
|
|
virtual bool isInside(const Coordinate& position) const = 0;
|
|
virtual GeometryPositioning isWhere(const Coordinate& position) const = 0;
|
|
};
|
|
|
|
class Cylinder : public Geometry {
|
|
public:
|
|
Cylinder(double radius, double height);
|
|
bool isInside(const Coordinate& position) const;
|
|
GeometryPositioning isWhere(const Coordinate& position) const;
|
|
|
|
private:
|
|
const double radius_;
|
|
const double height_;
|
|
};
|
|
|
|
#endif /* GEOMETRY_H */
|