#ifndef POLYSET_H_ #define POLYSET_H_ #include "Geometry.h" #include "system-gl.h" #include "linalg.h" #include "renderer.h" #include "Polygon2d.h" #include #include class PolySet : public Geometry { public: typedef std::vector Polygon; std::vector polygons; bool is2d; PolySet(); PolySet(const Polygon2d &origin); virtual ~PolySet(); virtual size_t memsize() const; virtual BoundingBox getBoundingBox() const; virtual std::string dump() const; virtual unsigned int getDimension() const { return this->is2d ? 2 : 3; } bool empty() const { return polygons.size() == 0; } size_t numPolygons() const { return polygons.size(); } void append_poly(); void append_vertex(double x, double y, double z = 0.0); void append_vertex(Vector3d v); void insert_vertex(double x, double y, double z = 0.0); void insert_vertex(Vector3d v); void append(const PolySet &ps); void render_surface(Renderer::csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo = NULL) const; void render_edges(Renderer::csgmode_e csgmode) const; void transform(const Transform3d &mat); void resize(Vector3d newsize, const Eigen::Matrix &autosize); private: Polygon2d polygon; }; #endif