#ifndef slic3r_BoundingBox_hpp_ #define slic3r_BoundingBox_hpp_ #include #include "Point.hpp" #include "Polygon.hpp" namespace Slic3r { typedef Point Size; typedef Point3 Size3; typedef Pointf Sizef; typedef Pointf3 Sizef3; template class BoundingBoxBase { public: PointClass min; PointClass max; BoundingBoxBase() {}; BoundingBoxBase(const std::vector points); void merge(const PointClass &point); void merge(const BoundingBoxBase &bb); void scale(double factor); PointClass size() const; void translate(coordf_t x, coordf_t y); PointClass center() const; }; template class BoundingBox3Base : public BoundingBoxBase { public: BoundingBox3Base() {}; BoundingBox3Base(const std::vector points); void merge(const PointClass &point); void merge(const BoundingBox3Base &bb); PointClass size() const; void translate(coordf_t x, coordf_t y, coordf_t z); PointClass center() const; }; class BoundingBox : public BoundingBoxBase { public: void polygon(Polygon* polygon) const; BoundingBox() {}; BoundingBox(const Points points) : BoundingBoxBase(points) {}; }; /* class BoundingBoxf : public BoundingBoxBase {}; class BoundingBox3 : public BoundingBox3Base {}; */ class BoundingBoxf3 : public BoundingBox3Base { public: BoundingBoxf3() {}; BoundingBoxf3(const std::vector points) : BoundingBox3Base(points) {}; }; } #endif