summaryrefslogtreecommitdiff
path: root/src/cgalrenderer.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-09-12 22:31:02 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-09-12 22:31:02 (GMT)
commit133a705feef86f11d5afc7fb69ed30585db9e533 (patch)
treef886e81c8853cdc1b26f557ad435e78c3c347a6b /src/cgalrenderer.cc
parenteb79c56ece95f5508e9ee12326995a84a1f9a5f2 (diff)
parentb927e9e1511ca655b4c15b003343ddffc08b0938 (diff)
merging
Merge remote branch 'upstream/master' into visitortests Conflicts: src/cgaladv.cc src/export.cc src/openscad.cc src/polyset.cc src/transform.cc
Diffstat (limited to 'src/cgalrenderer.cc')
-rw-r--r--src/cgalrenderer.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cgalrenderer.cc b/src/cgalrenderer.cc
index 687a0f1..d4bdffe 100644
--- a/src/cgalrenderer.cc
+++ b/src/cgalrenderer.cc
@@ -36,11 +36,13 @@ CGALRenderer::CGALRenderer(const CGAL_Nef_polyhedron &root) : root(root)
{
if (root.dim == 2) {
DxfData dd(root);
+ this->polyhedron = NULL;
this->polyset = new PolySet();
this->polyset->is2d = true;
dxf_tesselate(this->polyset, &dd, 0, true, false, 0);
}
else if (root.dim == 3) {
+ this->polyset = NULL;
this->polyhedron = new Polyhedron();
// FIXME: Make independent of Preferences
this->polyhedron->setColor(Polyhedron::CGAL_NEF3_MARKED_FACET_COLOR,
@@ -55,11 +57,16 @@ CGALRenderer::CGALRenderer(const CGAL_Nef_polyhedron &root) : root(root)
CGAL::OGL::Nef3_Converter<CGAL_Nef_polyhedron3>::convert_to_OGLPolyhedron(this->root.p3, this->polyhedron);
this->polyhedron->init();
}
+ else {
+ this->polyhedron = NULL;
+ this->polyset = NULL;
+ }
}
CGALRenderer::~CGALRenderer()
{
if (this->polyset) this->polyset->unlink();
+ delete this->polyhedron;
}
void CGALRenderer::draw(bool showfaces, bool showedges) const
contact: Jan Huwald // Impressum