diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/export.cc | 15 | ||||
-rw-r--r-- | src/export_png.cc | 29 |
2 files changed, 30 insertions, 14 deletions
diff --git a/src/export.cc b/src/export.cc index 2d5f5a4..6ec28ef 100644 --- a/src/export.cc +++ b/src/export.cc @@ -195,20 +195,7 @@ void export_dxf(CGAL_Nef_polyhedron *root_N, std::ostream &output) setlocale(LC_NUMERIC, ""); // Set default locale } -void export_png_with_cgal(CGAL_Nef_polyhedron *root_N, std::ostream &output) -{ - output << "solid OpenSCAD_Model\n"; - output << "endsolid OpenSCAD_Model\n"; -} - -void export_png_with_opencsg(CGAL_Nef_polyhedron *root_N, std::ostream &output) -{ - output << "solid OpenSCAD_Model opencsg\n"; - output << "endsolid OpenSCAD_Model opencsg\n"; -} - - -#endif +#endif // ENABLE_CGAL #ifdef DEBUG #include <boost/foreach.hpp> diff --git a/src/export_png.cc b/src/export_png.cc new file mode 100644 index 0000000..96e30fa --- /dev/null +++ b/src/export_png.cc @@ -0,0 +1,29 @@ +#include "export.h" +#include "printutils.h" +#include "OffscreenView.h" +#include "CsgInfo.h" +#include <stdio.h> + +#ifdef ENABLE_CGAL + +void export_png_with_cgal(CGAL_Nef_polyhedron *root_N, std::ostream &output) +{ + CsgInfo csgInfo; + try { + csgInfo.glview = new OffscreenView(512,512); + } catch (int error) { + fprintf(stderr,"Can't create OpenGL OffscreenView. Code: %i.\n", error); + } + output << "solid OpenSCAD_Model\n"; + output << "endsolid OpenSCAD_Model\n"; +} + +void export_png_with_opencsg(CGAL_Nef_polyhedron *root_N, std::ostream &output) +{ + CsgInfo csgInfo; + output << "solid OpenSCAD_Model opencsg\n"; + output << "endsolid OpenSCAD_Model opencsg\n"; +} + + +#endif // ENABLE_CGAL |