diff options
author | Giles Bathgate <gilesbathgate@gmail.com> | 2011-04-09 05:33:47 (GMT) |
---|---|---|
committer | Giles Bathgate <gilesbathgate@gmail.com> | 2011-04-09 05:33:47 (GMT) |
commit | 2ddbc3f1bc86253f2cfd09a9ec1757bd3656242c (patch) | |
tree | f51a59497179d34686b8d57d49e45a7a8eb09e0b /src/CGAL_renderer.h | |
parent | 40d7f266288c752e2683c026420d9f7f26e79979 (diff) |
Format the code nicely using astyle.
Diffstat (limited to 'src/CGAL_renderer.h')
-rw-r--r-- | src/CGAL_renderer.h | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/src/CGAL_renderer.h b/src/CGAL_renderer.h index 8f4a1b6..f8b41bd 100644 --- a/src/CGAL_renderer.h +++ b/src/CGAL_renderer.h @@ -39,71 +39,71 @@ using CGAL::OGL::SNC_BOUNDARY; using CGAL::OGL::SNC_SKELETON; -namespace OpenSCAD { - - namespace OGL { - - - class Polyhedron : public CGAL::OGL::Polyhedron { - public: - enum RenderColor { - CGAL_NEF3_MARKED_VERTEX_COLOR, - CGAL_NEF3_MARKED_EDGE_COLOR, - CGAL_NEF3_MARKED_FACET_COLOR, - CGAL_NEF3_UNMARKED_VERTEX_COLOR, - CGAL_NEF3_UNMARKED_EDGE_COLOR, - CGAL_NEF3_UNMARKED_FACET_COLOR, - NUM_COLORS - }; - CGAL::Color colors[NUM_COLORS]; - - void draw(bool showedges) const - { - if (this->style == SNC_BOUNDARY) { - glCallList(this->object_list_+2); - if (showedges) { +namespace OpenSCAD +{ + +namespace OGL +{ + + +class Polyhedron : public CGAL::OGL::Polyhedron +{ +public: + enum RenderColor { + CGAL_NEF3_MARKED_VERTEX_COLOR, + CGAL_NEF3_MARKED_EDGE_COLOR, + CGAL_NEF3_MARKED_FACET_COLOR, + CGAL_NEF3_UNMARKED_VERTEX_COLOR, + CGAL_NEF3_UNMARKED_EDGE_COLOR, + CGAL_NEF3_UNMARKED_FACET_COLOR, + NUM_COLORS + }; + CGAL::Color colors[NUM_COLORS]; + + void draw(bool showedges) const { + if(this->style == SNC_BOUNDARY) { + glCallList(this->object_list_+2); + if(showedges) { + glDisable(GL_LIGHTING); + glCallList(this->object_list_+1); + glCallList(this->object_list_); + } + } else { glDisable(GL_LIGHTING); glCallList(this->object_list_+1); glCallList(this->object_list_); - } - } else { - glDisable(GL_LIGHTING); - glCallList(this->object_list_+1); - glCallList(this->object_list_); + } } - } - CGAL::Color getVertexColor(Vertex_iterator v) const - { - CGAL::Color c = v->mark() ? colors[CGAL_NEF3_UNMARKED_VERTEX_COLOR] : colors[CGAL_NEF3_MARKED_VERTEX_COLOR]; - return c; - } - - CGAL::Color getEdgeColor(Edge_iterator e) const - { - CGAL::Color c = e->mark() ? colors[CGAL_NEF3_UNMARKED_EDGE_COLOR] : colors[CGAL_NEF3_MARKED_EDGE_COLOR]; - return c; - } - - CGAL::Color getFacetColor(Halffacet_iterator f) const - { - CGAL::Color c = f->mark() ? colors[CGAL_NEF3_UNMARKED_FACET_COLOR] : colors[CGAL_NEF3_MARKED_FACET_COLOR]; - return c; - } - }; - - template<typename Nef_polyhedron> - class Nef3_Converter : public CGAL::OGL::Nef3_Converter<Nef_polyhedron> { - public: - static void setColor(Polyhedron* p, Polyhedron::RenderColor color_index, - unsigned char r, unsigned char g, unsigned char b) { - assert(color_index < Polyhedron::NUM_COLORS); - p->colors[color_index] = CGAL::Color(r,g,b); - } + CGAL::Color getVertexColor(Vertex_iterator v) const { + CGAL::Color c = v->mark() ? colors[CGAL_NEF3_UNMARKED_VERTEX_COLOR] : colors[CGAL_NEF3_MARKED_VERTEX_COLOR]; + return c; + } + + CGAL::Color getEdgeColor(Edge_iterator e) const { + CGAL::Color c = e->mark() ? colors[CGAL_NEF3_UNMARKED_EDGE_COLOR] : colors[CGAL_NEF3_MARKED_EDGE_COLOR]; + return c; + } + + CGAL::Color getFacetColor(Halffacet_iterator f) const { + CGAL::Color c = f->mark() ? colors[CGAL_NEF3_UNMARKED_FACET_COLOR] : colors[CGAL_NEF3_MARKED_FACET_COLOR]; + return c; + } +}; + +template<typename Nef_polyhedron> +class Nef3_Converter : public CGAL::OGL::Nef3_Converter<Nef_polyhedron> +{ +public: + static void setColor(Polyhedron* p, Polyhedron::RenderColor color_index, + unsigned char r, unsigned char g, unsigned char b) { + assert(color_index < Polyhedron::NUM_COLORS); + p->colors[color_index] = CGAL::Color(r,g,b); + } + - - }; // Nef3_Converter +}; // Nef3_Converter - } // namespace OGL +} // namespace OGL } // namespace OpenSCAD |