diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-01 02:09:06 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-01 02:09:06 (GMT) |
commit | 1633fb0344c92631562c2a802e8deddf2ce4637f (patch) | |
tree | e6e71a9d9a524119db9cc430c5f8409c6839aa9a /src/export.cc | |
parent | c193372d2ff20d32900d72e817e7c9608ae36112 (diff) |
Refactoring of CGAL functionality to allow for forward-declaration of CGAL classes in header files, reducing coupling and thus compilation times
Diffstat (limited to 'src/export.cc')
-rw-r--r-- | src/export.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/export.cc b/src/export.cc index e46a14f..17a14c8 100644 --- a/src/export.cc +++ b/src/export.cc @@ -24,6 +24,7 @@ * */ +#include "export.h" #include "printutils.h" #include "polyset.h" #include "dxfdata.h" @@ -34,6 +35,7 @@ #include <errno.h> #ifdef ENABLE_CGAL +#include "CGAL_Nef_polyhedron.h" #include "cgal.h" /*! @@ -43,7 +45,7 @@ void export_stl(CGAL_Nef_polyhedron *root_N, QTextStream &output, QProgressDialog *pd) { CGAL_Polyhedron P; - root_N->p3.convert_to_Polyhedron(P); + root_N->p3->convert_to_Polyhedron(P); typedef CGAL_Polyhedron::Vertex Vertex; typedef CGAL_Polyhedron::Vertex_const_iterator VCI; @@ -131,12 +133,12 @@ void export_dxf(CGAL_Nef_polyhedron *root_N, QTextStream &output, QProgressDialo << " 2\n" << "ENTITIES\n"; - DxfData dd(*root_N); - for (int i=0; i<dd.paths.size(); i++) + DxfData *dd =root_N->convertToDxfData(); + for (int i=0; i<dd->paths.size(); i++) { - for (int j=1; j<dd.paths[i].points.size(); j++) { - const Vector2d &p1 = *dd.paths[i].points[j-1]; - const Vector2d &p2 = *dd.paths[i].points[j]; + for (int j=1; j<dd->paths[i].points.size(); j++) { + const Vector2d &p1 = *dd->paths[i].points[j-1]; + const Vector2d &p2 = *dd->paths[i].points[j]; double x1 = p1[0]; double y1 = p1[1]; double x2 = p2[0]; @@ -173,6 +175,7 @@ void export_dxf(CGAL_Nef_polyhedron *root_N, QTextStream &output, QProgressDialo output << " 0\n" <<"EOF\n"; + delete dd; setlocale(LC_NUMERIC, ""); // Set default locale } |