7 #ifndef LIB_ALMATH_GEOMETRICS_SHAPES3D_H
8 #define LIB_ALMATH_GEOMETRICS_SHAPES3D_H
10 #include <almath/api.h>
31 return lhs.fRadius == rhs.fRadius;
38 float getRadius()
const;
53 return lhs.fHalfExtentX == rhs.fHalfExtentX &&
54 lhs.fHalfExtentY == rhs.fHalfExtentY &&
55 lhs.fRadius == rhs.fRadius;
63 float getHalfExtentX()
const;
64 float getHalfExtentY()
const;
65 float getRadius()
const;
78 Pill(
float pHalfExtent,
float pRadius);
81 return lhs.fHalfExtent == rhs.fHalfExtent &&
82 lhs.fRadius == rhs.fRadius;
88 float getHalfExtent()
const;
89 float getRadius()
const;
131 Rectangle(
float pHalfExtentX,
float pHalfExtentY);
134 return lhs.fHalfExtentX == rhs.fHalfExtentX &&
135 lhs.fHalfExtentY == rhs.fHalfExtentY;
139 return !(lhs == rhs);
142 float getHalfExtentX()
const;
143 float getHalfExtentY()
const;
166 virtual void visit(
const Pill &pShape)
const = 0;
167 virtual void visit(
const Sphere &pShape)
const = 0;
169 virtual void visit(
const Plane &pShape)
const = 0;
170 virtual void visit(
const HalfSpace &pShape)
const = 0;
171 virtual void visit(
const Rectangle &pShape)
const = 0;
172 virtual void visit(
const HalfLine &pShape)
const = 0;
181 throw std::runtime_error(fMsg);
184 throw std::runtime_error(fMsg);
187 throw std::runtime_error(fMsg);
190 throw std::runtime_error(fMsg);
193 throw std::runtime_error(fMsg);
196 throw std::runtime_error(fMsg);
199 throw std::runtime_error(fMsg);
210 #endif // LIB_ALMATH_GEOMETRICS_SHAPES3D_H
friend bool operator!=(const Rectangle &lhs, const Rectangle &rhs)
friend bool operator==(const HalfSpace &lhs, const HalfSpace &rhs)
friend bool operator==(const RoundedRectangle &lhs, const RoundedRectangle &rhs)
friend bool operator!=(const RoundedRectangle &lhs, const RoundedRectangle &rhs)
virtual void visit(const RoundedRectangle &) const override
virtual void visit(const Pill &) const override
virtual void visit(const HalfLine &) const override
friend bool operator!=(const Plane &lhs, const Plane &rhs)
virtual void visit(const Rectangle &) const override
friend bool operator!=(const Pill &lhs, const Pill &rhs)
friend bool operator!=(const HalfLine &lhs, const HalfLine &rhs)
virtual void visit(const Sphere &) const override
friend bool operator==(const Sphere &lhs, const Sphere &rhs)
virtual void visit(const Plane &) const override
NotImplementedShape3DVisitor(const std::string msg="not implemented")
friend bool operator==(const Pill &lhs, const Pill &rhs)
friend bool operator!=(const HalfSpace &lhs, const HalfSpace &rhs)
friend bool operator==(const Rectangle &lhs, const Rectangle &rhs)
friend bool operator==(const Plane &lhs, const Plane &rhs)
friend bool operator==(const HalfLine &lhs, const HalfLine &rhs)
virtual void visit(const HalfSpace &) const override
friend bool operator!=(const Sphere &lhs, const Sphere &rhs)