diff options
Diffstat (limited to 'src/polyset.h')
-rw-r--r-- | src/polyset.h | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/src/polyset.h b/src/polyset.h index 8712ff2..8f23130 100644 --- a/src/polyset.h +++ b/src/polyset.h @@ -1,30 +1,21 @@ #ifndef POLYSET_H_ #define POLYSET_H_ -#include <GL/glew.h> // this must be included before the GL headers -#include <qgl.h> - +#include <GL/glew.h> #include "grid.h" -#ifdef ENABLE_OPENCSG -# include <opencsg.h> -#endif -#ifdef ENABLE_CGAL -# include "cgal.h" -#endif +#include <vector> +#include <Eigen/Core> +#include <Eigen/Geometry> -#include <QCache> +using Eigen::Vector3d; +typedef Eigen::AlignedBox<double, 3> BoundingBox; class PolySet { public: - struct Point { - double x, y, z; - Point() : x(0), y(0), z(0) { } - Point(double x, double y, double z) : x(x), y(y), z(z) { } - }; - typedef QList<Point> Polygon; - QVector<Polygon> polygons; - QVector<Polygon> borders; + typedef std::vector<Vector3d> Polygon; + std::vector<Polygon> polygons; + std::vector<Polygon> borders; Grid3d<void*> grid; bool is2d; @@ -34,15 +25,10 @@ public: ~PolySet(); void append_poly(); - void append_vertex(double x, double y, double z); - void insert_vertex(double x, double y, double z); + void append_vertex(double x, double y, double z = 0.0); + void insert_vertex(double x, double y, double z = 0.0); - void append_vertex(double x, double y) { - append_vertex(x, y, 0.0); - } - void insert_vertex(double x, double y) { - insert_vertex(x, y, 0.0); - } + BoundingBox getBoundingBox() const; enum colormode_e { COLORMODE_NONE, @@ -62,22 +48,9 @@ public: CSGMODE_HIGHLIGHT_DIFFERENCE = 22 }; - struct ps_cache_entry { - PolySet *ps; - QString msg; - ps_cache_entry(PolySet *ps); - ~ps_cache_entry(); - }; - - static QCache<QString,ps_cache_entry> ps_cache; - void render_surface(colormode_e colormode, csgmode_e csgmode, double *m, GLint *shaderinfo = NULL) const; void render_edges(colormode_e colormode, csgmode_e csgmode) const; -#ifdef ENABLE_CGAL - CGAL_Nef_polyhedron render_cgal_nef_polyhedron() const; -#endif - int refcount; PolySet *link(); void unlink(); |