summaryrefslogtreecommitdiff
path: root/src/CGALRenderer.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
commit1e64dddf1ea30282c89de7f35854a68614234652 (patch)
tree165d37c1c66f6ff79d48c74794238b3f0bed09da /src/CGALRenderer.cc
parent5c779159c208ca3d88c88479ab29f9cd66574859 (diff)
parentd0856efe6da545693f9c50a8a2514a9f999ab5ef (diff)
Merge branch 'master' of github.com:openscad/openscad into issue159
Diffstat (limited to 'src/CGALRenderer.cc')
-rw-r--r--src/CGALRenderer.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/CGALRenderer.cc b/src/CGALRenderer.cc
index adf1217..4357e44 100644
--- a/src/CGALRenderer.cc
+++ b/src/CGALRenderer.cc
@@ -43,7 +43,11 @@
CGALRenderer::CGALRenderer(const CGAL_Nef_polyhedron &root) : root(root)
{
- if (root.dim == 2) {
+ if (this->root.isNull()) {
+ this->polyhedron = NULL;
+ this->polyset = NULL;
+ }
+ else if (root.dim == 2) {
DxfData *dd = root.convertToDxfData();
this->polyhedron = NULL;
this->polyset = new PolySet();
@@ -67,10 +71,6 @@ 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()
@@ -81,6 +81,7 @@ CGALRenderer::~CGALRenderer()
void CGALRenderer::draw(bool showfaces, bool showedges) const
{
+ if (this->root.isNull()) return;
if (this->root.dim == 2) {
// Draw 2D polygons
glDisable(GL_LIGHTING);
contact: Jan Huwald // Impressum