summaryrefslogtreecommitdiff
path: root/src/dxftess-cgal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dxftess-cgal.cc')
-rw-r--r--src/dxftess-cgal.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/dxftess-cgal.cc b/src/dxftess-cgal.cc
index 754d161..a587987 100644
--- a/src/dxftess-cgal.cc
+++ b/src/dxftess-cgal.cc
@@ -93,7 +93,7 @@ void mark_inner_outer(QList<struct triangle> &tri, Grid2d<point_info_t> &point_i
}
}
-void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_triangle_splitting */, double h)
+void dxf_tesselate(PolySet *ps, DxfData &dxf, double rot, bool up, bool /* do_triangle_splitting */, double h)
{
CDT cdt;
@@ -106,17 +106,17 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_tr
try {
// read path data and copy all relevant infos
- for (int i = 0; i < dxf->paths.count(); i++)
+ for (size_t i = 0; i < dxf.paths.size(); i++)
{
- if (!dxf->paths[i].is_closed)
+ if (!dxf.paths[i].is_closed)
continue;
Vertex_handle first, prev;
struct point_info_t *first_pi = NULL, *prev_pi = NULL;
- for (int j = 1; j < dxf->paths[i].points.count(); j++)
+ for (size_t j = 1; j < dxf.paths[i].indices.size(); j++)
{
- double x = (*dxf->paths[i].points[j])[0];
- double y = (*dxf->paths[i].points[j])[1];
+ double x = dxf.points[dxf.paths[i].indices[j]][0];
+ double y = dxf.points[dxf.paths[i].indices[j]][1];
if (point_info.has(x, y)) {
// FIXME: How can the same path set contain the same point twice?
@@ -127,7 +127,7 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_tr
}
struct point_info_t *pi = &point_info.align(x, y);
- *pi = point_info_t(x, y, i, j, dxf->paths[i].points.count()-1);
+ *pi = point_info_t(x, y, i, j, dxf.paths[i].indices.size()-1);
Vertex_handle vh = cdt.insert(CDTPoint(x, y));
if (first_pi == NULL) {
@@ -158,7 +158,7 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_tr
}
catch (CGAL::Assertion_exception e) {
- PRINTF("CGAL error: %s", e.what());
+ PRINTF("CGAL error in dxf_tesselate(): %s", e.what());
CGAL::set_error_behaviour(old_behaviour);
return;
}
@@ -306,17 +306,17 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, bool /* do_tr
}
if (path[0] == path[1] && point[0] == 1 && point[1] == 2)
- dxf->paths[path[0]].is_inner = up;
+ dxf.paths[path[0]].is_inner = up;
if (path[0] == path[1] && point[0] == 2 && point[1] == 1)
- dxf->paths[path[0]].is_inner = !up;
+ dxf.paths[path[0]].is_inner = !up;
if (path[1] == path[2] && point[1] == 1 && point[2] == 2)
- dxf->paths[path[1]].is_inner = up;
+ dxf.paths[path[1]].is_inner = up;
if (path[1] == path[2] && point[1] == 2 && point[2] == 1)
- dxf->paths[path[1]].is_inner = !up;
+ dxf.paths[path[1]].is_inner = !up;
if (path[2] == path[0] && point[2] == 1 && point[0] == 2)
- dxf->paths[path[2]].is_inner = up;
+ dxf.paths[path[2]].is_inner = up;
if (path[2] == path[0] && point[2] == 2 && point[0] == 1)
- dxf->paths[path[2]].is_inner = !up;
+ dxf.paths[path[2]].is_inner = !up;
}
}
contact: Jan Huwald // Impressum