diff --git a/openscad.pro b/openscad.pro index e16020e8..e40c956a 100644 --- a/openscad.pro +++ b/openscad.pro @@ -223,7 +223,7 @@ HEADERS += src/typedefs.h \ src/rendersettings.h \ src/colormap.h \ src/ThrownTogetherRenderer.h \ - src/CGAL_renderer.h \ + src/CGAL_OGL_Polyhedron.h \ src/OGL_helper.h \ src/QGLView.h \ src/GLView.h \ diff --git a/src/CGALRenderer.cc b/src/CGALRenderer.cc index b42dd307..c9b816c5 100644 --- a/src/CGALRenderer.cc +++ b/src/CGALRenderer.cc @@ -35,7 +35,7 @@ #include "printutils.h" #include "CGALRenderer.h" -#include "CGAL_renderer.h" +#include "CGAL_OGL_Polyhedron.h" #include "CGAL_Nef_polyhedron.h" #include "cgal.h" @@ -61,7 +61,7 @@ CGALRenderer::~CGALRenderer() { } -shared_ptr CGALRenderer::getPolyhedron() const +shared_ptr CGALRenderer::getPolyhedron() const { if (this->N && !this->polyhedron) buildPolyhedron(); return this->polyhedron; @@ -70,7 +70,7 @@ shared_ptr CGALRenderer::getPolyhedron() const void CGALRenderer::buildPolyhedron() const { PRINTD("buildPolyhedron"); - this->polyhedron.reset(new Polyhedron(*this->colorscheme)); + this->polyhedron.reset(new CGAL_OGL_Polyhedron(*this->colorscheme)); CGAL::OGL::Nef3_Converter::convert_to_OGLPolyhedron(*this->N->p3, this->polyhedron.get()); // CGAL_NEF3_MARKED_FACET_COLOR <- CGAL_FACE_BACK_COLOR // CGAL_NEF3_UNMARKED_FACET_COLOR <- CGAL_FACE_FRONT_COLOR @@ -124,7 +124,7 @@ void CGALRenderer::draw(bool showfaces, bool showedges) const } } else { - shared_ptr polyhedron = getPolyhedron(); + shared_ptr polyhedron = getPolyhedron(); if (polyhedron) { PRINTD("draw() polyhedron"); if (showfaces) polyhedron->set_style(SNC_BOUNDARY); @@ -143,7 +143,7 @@ BoundingBox CGALRenderer::getBoundingBox() const bbox = this->polyset->getBoundingBox(); } else { - shared_ptr polyhedron = getPolyhedron(); + shared_ptr polyhedron = getPolyhedron(); if (polyhedron) { CGAL::Bbox_3 cgalbbox = polyhedron->bbox(); bbox = BoundingBox( diff --git a/src/CGALRenderer.h b/src/CGALRenderer.h index 4bb2c673..d3fae77a 100644 --- a/src/CGALRenderer.h +++ b/src/CGALRenderer.h @@ -13,10 +13,10 @@ public: virtual BoundingBox getBoundingBox() const; private: - shared_ptr getPolyhedron() const; + shared_ptr getPolyhedron() const; void buildPolyhedron() const; - mutable shared_ptr polyhedron; + mutable shared_ptr polyhedron; shared_ptr N; shared_ptr polyset; }; diff --git a/src/CGAL_renderer.h b/src/CGAL_OGL_Polyhedron.h similarity index 91% rename from src/CGAL_renderer.h rename to src/CGAL_OGL_Polyhedron.h index 433eb7d6..ef056258 100644 --- a/src/CGAL_renderer.h +++ b/src/CGAL_OGL_Polyhedron.h @@ -36,7 +36,7 @@ using CGAL::OGL::SNC_BOUNDARY; using CGAL::OGL::SNC_SKELETON; -class Polyhedron : public CGAL::OGL::Polyhedron +class CGAL_OGL_Polyhedron : public CGAL::OGL::Polyhedron { public: @@ -50,14 +50,14 @@ public: NUM_COLORS }; - Polyhedron(const ColorScheme &cs) { - PRINTD("Polyhedron()"); + CGAL_OGL_Polyhedron(const ColorScheme &cs) { + PRINTD("CGAL_OGL_Polyhedron()"); // Set default colors. setColor(CGAL_NEF3_MARKED_VERTEX_COLOR,0xb7,0xe8,0x5c); setColor(CGAL_NEF3_UNMARKED_VERTEX_COLOR,0xff,0xf6,0x7c); // Face and Edge colors are taken from default colorscheme setColorScheme(cs); - PRINTD("Polyhedron() end"); + PRINTD("CGAL_OGL_Polyhedron() end"); } void draw(bool showedges) const { @@ -98,12 +98,12 @@ public: return c; } - void setColor(Polyhedron::RenderColor color_index, const Color4f &c) { + void setColor(CGAL_OGL_Polyhedron::RenderColor color_index, const Color4f &c) { PRINTDB("setColor %i %f %f %f",color_index%c[0]%c[1]%c[2]); this->colors[color_index] = CGAL::Color(c[0]*255,c[1]*255,c[2]*255); } - void setColor(Polyhedron::RenderColor color_index, + void setColor(CGAL_OGL_Polyhedron::RenderColor color_index, unsigned char r, unsigned char g, unsigned char b) { PRINTDB("setColor %i %i %i %i",color_index%r%g%b); this->colors[color_index] = CGAL::Color(r,g,b); @@ -122,7 +122,7 @@ public: private: CGAL::Color colors[NUM_COLORS]; -}; // Polyhedron +}; // CGAL_OGL_Polyhedron @@ -131,10 +131,10 @@ private: #include -class Polyhedron +class CGAL_OGL_Polyhedron { public: - Polyhedron() {} + CGAL_OGL_Polyhedron() {} void draw(bool showedges) const {} CGAL::Bbox_3 bbox() const { return CGAL::Bbox_3(-1,-1,-1,1,1,1); } }; diff --git a/src/cgalutils.cc b/src/cgalutils.cc index e7265b9b..5b642c58 100644 --- a/src/cgalutils.cc +++ b/src/cgalutils.cc @@ -1084,7 +1084,7 @@ bool tessellate_3d_face_with_holes( std::vector &polygons, std:: } size_t numholes = polygons2d.size()-1; - PRINTB("seeding %i holes",numholes); + PRINTDB("seeding %i holes",numholes); std::list list_of_seeds; for (size_t i=1;i &pgon = polygons2d[i]; @@ -1105,16 +1105,16 @@ bool tessellate_3d_face_with_holes( std::vector &polygons, std:: //PRINTB("seed %s",*li); double x = CGAL::to_double( li->x() ); double y = CGAL::to_double( li->y() ); - PRINTB("seed %f,%f",x%y); + PRINTDB("seed %f,%f",x%y); } - PRINT("seeding done"); + PRINTD("seeding done"); - PRINT( "meshing" ); + PRINTD( "meshing" ); CGAL::refine_Delaunay_mesh_2_without_edge_refinement( cdt, list_of_seeds.begin(), list_of_seeds.end(), DummyCriteria() ); - PRINT("meshing done"); + PRINTD("meshing done"); // this fails because it calls is_simple and is_simple fails on many // Nef Polyhedron faces //CGAL::Orientation original_orientation = diff --git a/src/export_png.cc b/src/export_png.cc index fad2a42f..d9c4b5a4 100644 --- a/src/export_png.cc +++ b/src/export_png.cc @@ -8,7 +8,6 @@ #ifdef ENABLE_CGAL #include "CGALRenderer.h" -#include "CGAL_renderer.h" #include "cgal.h" #include "cgalutils.h" #include "CGAL_Nef_polyhedron.h"