diff options
Diffstat (limited to 'polyset.cc')
-rw-r--r-- | polyset.cc | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -41,8 +41,12 @@ void PolySet::insert_vertex(double x, double y, double z) polygons.last().insert(0, Point(x, y, z)); } -void PolySet::render_opengl() const +void PolySet::render_surface(colormode_e colormode) const { + if (colormode == COLOR_MATERIAL) + glColor3ub(249, 215, 44); + if (colormode == COLOR_CUTOUT) + glColor3ub(157, 203, 81); for (int i = 0; i < polygons.size(); i++) { const Polygon *poly = &polygons[i]; glBegin(GL_POLYGON); @@ -54,6 +58,23 @@ void PolySet::render_opengl() const } } +void PolySet::render_edges(colormode_e colormode) const +{ + if (colormode == COLOR_MATERIAL) + glColor3ub(255, 236, 94); + if (colormode == COLOR_CUTOUT) + glColor3ub(171, 216, 86); + for (int i = 0; i < polygons.size(); i++) { + const Polygon *poly = &polygons[i]; + glBegin(GL_LINE_STRIP); + for (int j = 0; j < poly->size(); j++) { + const Point *p = &poly->at(j); + glVertex3d(p->x, p->y, p->z); + } + glEnd(); + } +} + #ifdef ENABLE_CGAL class CGAL_Build_PolySet : public CGAL::Modifier_base<CGAL_HDS> |