From cf04e57d38a7461e96af2bc6f3d43976e0524dde Mon Sep 17 00:00:00 2001 From: Peter Hachenberger Date: Sun, 5 Mar 2006 17:34:34 +0000 Subject: [PATCH] examples for the construction of a set of polygons and a set of polylines. --- .gitattributes | 2 ++ Nef_3/examples/Nef_3/polygon_construction.C | 28 ++++++++++++++++++++ Nef_3/examples/Nef_3/polyline_construction.C | 28 ++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 Nef_3/examples/Nef_3/polygon_construction.C create mode 100644 Nef_3/examples/Nef_3/polyline_construction.C diff --git a/.gitattributes b/.gitattributes index 67e7c3f1aeb..cd945dd9a30 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1112,6 +1112,8 @@ Nef_3/doc_tex/Nef_3_ref/fig/shalfloopB.pdf -text svneol=unset#unset Nef_3/doc_tex/Nef_3_ref/fig/snc.eps -text Nef_3/doc_tex/Nef_3_ref/fig/snc.gif -text svneol=unset#unset Nef_3/doc_tex/Nef_3_ref/fig/snc.pdf -text svneol=unset#unset +Nef_3/examples/Nef_3/polygon_construction.C -text +Nef_3/examples/Nef_3/polyline_construction.C -text Nef_3/test/Nef_3/data/2_cycles_on_halfsphere.off -text Nef_3/test/Nef_3/data/2_cycles_on_halfsphere2.off -text Nef_3/test/Nef_3/data/centered_cube.off -text diff --git a/Nef_3/examples/Nef_3/polygon_construction.C b/Nef_3/examples/Nef_3/polygon_construction.C new file mode 100644 index 00000000000..7318299f505 --- /dev/null +++ b/Nef_3/examples/Nef_3/polygon_construction.C @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Gmpz NT; +typedef CGAL::Homogeneous Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; +typedef Point_3* point_iterator; +typedef std::pair point_range; +typedef std::list polygon; +typedef polygon::const_iterator polygon_iterator; +typedef CGAL::Polygon_constructor +Polygon_constructor; + +int main() { + + Point_3 pl[4] = {Point_3(0,0,0), Point_3(1,0,0), + Point_3(1,1,0), Point_3(0,1,0)}; + polygon poly; + poly.push_back(point_range(pl,pl+4)); + Nef_polyhedron N; + Polygon_constructor pc(poly.begin(), poly.end()); + N.delegate(pc,true); + std::cout << N; +} diff --git a/Nef_3/examples/Nef_3/polyline_construction.C b/Nef_3/examples/Nef_3/polyline_construction.C new file mode 100644 index 00000000000..15a37fa989b --- /dev/null +++ b/Nef_3/examples/Nef_3/polyline_construction.C @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Gmpz NT; +typedef CGAL::Homogeneous Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; +typedef Point_3* point_iterator; +typedef std::pair point_range; +typedef std::list polyline; +typedef polyline::const_iterator polyline_iterator; +typedef CGAL::Polyline_constructor +Polyline_constructor; + +int main() { + + Point_3 pl[4] = {Point_3(0,0,0), Point_3(1,0,0), + Point_3(1,1,0), Point_3(0,1,0)}; + polyline poly; + poly.push_back(point_range(pl,pl+4)); + Nef_polyhedron N; + Polyline_constructor pc(poly.begin(), poly.end()); + N.delegate(pc,true); + std::cout << N; +}