openscad/src/polyset.h

41 lines
1.0 KiB
C
Raw Normal View History

#ifndef POLYSET_H_
#define POLYSET_H_
#include "Geometry.h"
2011-10-01 03:36:30 +04:00
#include "system-gl.h"
#include "grid.h"
2011-10-01 03:36:30 +04:00
#include "linalg.h"
#include "renderer.h"
#include <vector>
#include <string>
class PolySet : public Geometry
{
public:
typedef std::vector<Vector3d> Polygon;
std::vector<Polygon> polygons;
std::vector<Polygon> borders;
Grid3d<void*> grid;
bool is2d;
int convexity;
PolySet();
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; }
virtual unsigned int getConvexity() const {return this->convexity; }
2011-09-02 00:42:46 +04:00
bool empty() const { return polygons.size() == 0; }
void append_poly();
void append_vertex(double x, double y, double z = 0.0);
void insert_vertex(double x, double y, double z = 0.0);
void render_surface(Renderer::csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo = NULL) const;
void render_edges(Renderer::csgmode_e csgmode) const;
};
#endif