BlinkenArea - GitList
Repositories
Blog
Wiki
dxfngc
Code
Commits
Branches
Tags
Search
Tree:
48bbb1b
Branches
Tags
master
dxfngc
src
polygons.h
implement converting paths of layer into CGAL polygons
Stefan Schuermans
commited
48bbb1b
at 2013-01-27 16:03:24
polygons.h
Blame
History
Raw
/* drawing (DXF) to G-code (NGC) converter * Copyright 2013 Stefan Schuermans <stefan@schuermans.info> * Copyleft: CC-BY-SA http://creativecommons.org/licenses/by-sa/3.0/ */ #ifndef POLYGONS_H #define POLYGONS_H #include <boost/shared_ptr.hpp> #include <vector> #include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Polygon_2.h> #include <CGAL/Polygon_with_holes_2.h> #include <CGAL/create_offset_polygons_2.h> #include "layer.h" /// a set of polygons class Polygons { public: typedef CGAL::Exact_predicates_exact_constructions_kernel CgKern; typedef CgKern::Point_2 CgPoint; typedef CGAL::Polygon_2<CgKern> CgPoly; typedef CGAL::Polygon_with_holes_2<CgKern> CgPolyHoles; typedef CGAL::Straight_skeleton_2<CgKern> CgSskel; typedef std::vector<CgPoly> CgPolyVec; typedef std::vector<CgPolyHoles> CgPolyHolesVec; typedef boost::shared_ptr<CgPoly> CgPolyPtr; typedef boost::shared_ptr<CgPolyHoles> CgPolyHolesPtr; typedef boost::shared_ptr<CgSskel> CgSskelPtr; typedef std::vector<CgPolyPtr> CgPolyPtrVec; typedef std::vector<CgPolyHolesPtr> CgPolyHolesPtrVec; /** * @brief clear all polygons */ void clear(); /** * @brief add polygons from layer * @param[in] layer layer to obtain the polygons from * @param[in] eqDist maximum distance of two points to be considered equal * @return if the layer could be converted to polygons and imported */ bool addLayer(const Layer &layer, double eqDist); /** * @brief load polygons from layer * @param[in] layer layer to obtain the polygons from * @param[in] eqDist maximum distance of two points to be considered equal * @return if the layer could be converted to polygons and imported */ bool loadLayer(const Layer &layer, double eqDist); /// polygons CgPolyHolesVec mPolys; }; #endif // #ifndef POLYGONS_H