diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dxfdata.h | 2 | ||||
-rw-r--r-- | src/dxflinextrude.cc | 5 | ||||
-rw-r--r-- | src/dxfrotextrude.cc | 5 | ||||
-rw-r--r-- | src/dxftess.cc | 5 | ||||
-rw-r--r-- | src/mainwin.cc | 2 | ||||
-rw-r--r-- | src/nef2dxf.cc | 3 | ||||
-rw-r--r-- | src/projection.cc | 14 |
7 files changed, 33 insertions, 3 deletions
diff --git a/src/dxfdata.h b/src/dxfdata.h index e88fafd..d59ff5a 100644 --- a/src/dxfdata.h +++ b/src/dxfdata.h @@ -39,7 +39,9 @@ public: DxfData(); DxfData(double fn, double fs, double fa, QString filename, QString layername = QString(), double xorigin = 0.0, double yorigin = 0.0, double scale = 1.0); +#ifdef ENABLE_CGAL DxfData(const struct CGAL_Nef_polyhedron &N); +#endif Point *addPoint(double x, double y); diff --git a/src/dxflinextrude.cc b/src/dxflinextrude.cc index 0542493..f1aaf8c 100644 --- a/src/dxflinextrude.cc +++ b/src/dxflinextrude.cc @@ -233,6 +233,7 @@ PolySet *DxfLinearExtrudeNode::render_polyset(render_mode_e rm) const if (filename.isEmpty()) { +#ifdef ENABLE_CGAL QTime t; QProgressDialog *pd = NULL; @@ -268,6 +269,10 @@ PolySet *DxfLinearExtrudeNode::render_polyset(render_mode_e rm) const PRINTF_NOCACHE("..rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60); delete pd; } +#else // ENABLE_CGAL + PRINT("WARNING: Found linear_extrude() statement without dxf file but compiled without CGAL support!"); + dxf = new DxfData(); +#endif // ENABLE_CGAL } else { dxf = new DxfData(fn, fs, fa, filename, layername, origin_x, origin_y, scale); } diff --git a/src/dxfrotextrude.cc b/src/dxfrotextrude.cc index ae43f53..21718ac 100644 --- a/src/dxfrotextrude.cc +++ b/src/dxfrotextrude.cc @@ -136,6 +136,7 @@ PolySet *DxfRotateExtrudeNode::render_polyset(render_mode_e rm) const if (filename.isEmpty()) { +#ifdef ENABLE_CGAL QTime t; QProgressDialog *pd; @@ -169,6 +170,10 @@ PolySet *DxfRotateExtrudeNode::render_polyset(render_mode_e rm) const PRINTF_NOCACHE("..rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60); delete pd; } +#else // ENABLE_CGAL + PRINT("WARNING: Found rotate_extrude() statement without dxf file but compiled without CGAL support!"); + dxf = new DxfData(); +#endif // ENABLE_CGAL } else { dxf = new DxfData(fn, fs, fa, filename, layername, origin_x, origin_y, scale); } diff --git a/src/dxftess.cc b/src/dxftess.cc index c51fb9c..e145391 100644 --- a/src/dxftess.cc +++ b/src/dxftess.cc @@ -25,12 +25,11 @@ #include "printutils.h" -#define CGAL_TESSELATE -#ifdef CGAL_TESSELATE +#ifdef ENABLE_CGAL #include "dxftess-cgal.cc" #else #include "dxftess-glu.cc" -#endif // CGAL_TESSELATE +#endif /*! Converts all paths in the given DxfData to PolySet::borders polygons diff --git a/src/mainwin.cc b/src/mainwin.cc index 9ee4d9d..a0ce9b0 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1215,7 +1215,9 @@ void MainWindow::actionExportDXF() void MainWindow::actionFlushCaches() { PolySet::ps_cache.clear(); +#ifdef ENABLE_CGAL AbstractNode::cgal_nef_cache.clear(); +#endif dxf_dim_cache.clear(); dxf_cross_cache.clear(); } diff --git a/src/nef2dxf.cc b/src/nef2dxf.cc index 5df8a45..44d7561 100644 --- a/src/nef2dxf.cc +++ b/src/nef2dxf.cc @@ -27,6 +27,8 @@ #include "grid.h" #include "cgal.h" +#ifdef ENABLE_CGAL + DxfData::DxfData(const struct CGAL_Nef_polyhedron &N) { Grid2d<int> grid(GRID_COARSE); @@ -70,3 +72,4 @@ DxfData::DxfData(const struct CGAL_Nef_polyhedron &N) fixup_path_direction(); } +#endif // ENABLE_CGAL diff --git a/src/projection.cc b/src/projection.cc index 77b7bf9..75aaf44 100644 --- a/src/projection.cc +++ b/src/projection.cc @@ -93,6 +93,8 @@ void register_builtin_projection() builtin_modules["projection"] = new ProjectionModule(); } +#ifdef ENABLE_CGAL + static void report_func(const class AbstractNode*, void *vp, int mark) { QProgressDialog *pd = (QProgressDialog*)vp; @@ -291,6 +293,18 @@ cant_project_non_simple_polyhedron: return ps; } +#else // ENABLE_CGAL + +PolySet *ProjectionNode::render_polyset(render_mode_e) const +{ + PRINT("WARNING: Found projection() statement but compiled without CGAL support!"); + PolySet *ps = new PolySet(); + ps->is2d = true; + return ps; +} + +#endif // ENABLE_CGAL + QString ProjectionNode::dump(QString indent) const { if (dump_cache.isEmpty()) { |