Renamed CGAL_renderer to CGAL_OGL_Polyhedron for clarity

master
Marius Kintel 2014-08-15 13:04:34 -04:00
parent 49749da7dd
commit 6405456c8a
6 changed files with 22 additions and 23 deletions

View File

@ -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 \

View File

@ -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<class Polyhedron> CGALRenderer::getPolyhedron() const
shared_ptr<class CGAL_OGL_Polyhedron> CGALRenderer::getPolyhedron() const
{
if (this->N && !this->polyhedron) buildPolyhedron();
return this->polyhedron;
@ -70,7 +70,7 @@ shared_ptr<class Polyhedron> 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<CGAL_Nef_polyhedron3>::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<class Polyhedron> polyhedron = getPolyhedron();
shared_ptr<class CGAL_OGL_Polyhedron> 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<class Polyhedron> polyhedron = getPolyhedron();
shared_ptr<class CGAL_OGL_Polyhedron> polyhedron = getPolyhedron();
if (polyhedron) {
CGAL::Bbox_3 cgalbbox = polyhedron->bbox();
bbox = BoundingBox(

View File

@ -13,10 +13,10 @@ public:
virtual BoundingBox getBoundingBox() const;
private:
shared_ptr<class Polyhedron> getPolyhedron() const;
shared_ptr<class CGAL_OGL_Polyhedron> getPolyhedron() const;
void buildPolyhedron() const;
mutable shared_ptr<class Polyhedron> polyhedron;
mutable shared_ptr<class CGAL_OGL_Polyhedron> polyhedron;
shared_ptr<const CGAL_Nef_polyhedron> N;
shared_ptr<const class PolySet> polyset;
};

View File

@ -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 <CGAL/Bbox_3.h>
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); }
};

View File

@ -1084,7 +1084,7 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &polygons, std::
}
size_t numholes = polygons2d.size()-1;
PRINTB("seeding %i holes",numholes);
PRINTDB("seeding %i holes",numholes);
std::list<CDTPoint> list_of_seeds;
for (size_t i=1;i<polygons2d.size();i++) {
std::vector<CGAL_Point_2> &pgon = polygons2d[i];
@ -1105,16 +1105,16 @@ bool tessellate_3d_face_with_holes( std::vector<CGAL_Polygon_3> &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<CDT>() );
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 =

View File

@ -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"