1 #pragma once 2 3 #include "Geometry.h" 4 #include "cgal.h" 5 #include "memory.h" 6 #include <string> 7 #include "linalg.h" 8 9 class CGAL_Nef_polyhedron : public Geometry 10 { 11 public: 12 VISITABLE_GEOMETRY(); 13 CGAL_Nef_polyhedron(const CGAL_Nef_polyhedron3 *p = nullptr); CGAL_Nef_polyhedron(shared_ptr<const CGAL_Nef_polyhedron3> p)14 CGAL_Nef_polyhedron(shared_ptr<const CGAL_Nef_polyhedron3> p) : p3(p) {} 15 CGAL_Nef_polyhedron(const CGAL_Nef_polyhedron &src); ~CGAL_Nef_polyhedron()16 ~CGAL_Nef_polyhedron() {} 17 18 size_t memsize() const override; 19 // FIXME: Implement, but we probably want a high-resolution BBox.. getBoundingBox()20 BoundingBox getBoundingBox() const override { assert(false && "not implemented"); return BoundingBox(); } 21 std::string dump() const override; getDimension()22 unsigned int getDimension() const override { return 3; } 23 // Empty means it is a geometric node which has zero area/volume 24 bool isEmpty() const override; copy()25 Geometry *copy() const override { return new CGAL_Nef_polyhedron(*this); } numFacets()26 size_t numFacets() const override { return p3->number_of_facets(); } 27 reset()28 void reset() { p3.reset(); } 29 CGAL_Nef_polyhedron operator+(const CGAL_Nef_polyhedron &other) const; 30 CGAL_Nef_polyhedron &operator+=(const CGAL_Nef_polyhedron &other); 31 CGAL_Nef_polyhedron &operator*=(const CGAL_Nef_polyhedron &other); 32 CGAL_Nef_polyhedron &operator-=(const CGAL_Nef_polyhedron &other); 33 CGAL_Nef_polyhedron &minkowski(const CGAL_Nef_polyhedron &other); 34 void transform(const Transform3d &matrix); 35 void resize(const Vector3d &newsize, const Eigen::Matrix<bool,3,1> &autosize); 36 37 shared_ptr<const CGAL_Nef_polyhedron3> p3; 38 }; 39