From 40538db82e4256a1f7a9f3c409c00ecff97e97ff Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 1 Apr 2014 17:19:54 +0200 Subject: [PATCH] Use boost::optional::get_ptr() + comments --- Triangulation/include/CGAL/Delaunay_triangulation.h | 10 +++++++++- Triangulation/include/CGAL/Triangulation.h | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Triangulation/include/CGAL/Delaunay_triangulation.h b/Triangulation/include/CGAL/Delaunay_triangulation.h index 61e30dd8350..d7103048ac3 100644 --- a/Triangulation/include/CGAL/Delaunay_triangulation.h +++ b/Triangulation/include/CGAL/Delaunay_triangulation.h @@ -172,6 +172,11 @@ public: { } + // With this constructor, + // the user can specify a Flat_orientation_d object to be used for + // orienting simplices of a specific dimension + // (= preset_flat_orientation_.first) + // It it used for by dark triangulations created by DT::remove Delaunay_triangulation( int dim, const std::pair &preset_flat_orientation, @@ -453,10 +458,13 @@ Delaunay_triangulation typedef typename Dark_triangulation::Vertex_handle Dark_v_handle; typedef typename Dark_triangulation::Full_cell_handle Dark_s_handle; + // If flat_orientation_ is defined, we give it the Dark triangulation + // so that the orientation it uses for "current_dimension()"-simplices is + // coherent with the global triangulation Dark_triangulation dark_side( maximal_dimension(), flat_orientation_ ? - std::make_pair(current_dimension(), &flat_orientation_.get()) + std::make_pair(current_dimension(), flat_orientation_.get_ptr()) : std::make_pair(std::numeric_limits::max(), NULL) ); Dark_s_handle dark_s; diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index d4bb7a65285..443b74f82cb 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -149,6 +149,10 @@ protected: // DATA MEMBERS Vertex_handle infinity_; mutable std::vector orientations_; mutable boost::optional flat_orientation_; + // The user can specify a Flat_orientation_d object to be used for + // orienting simplices of a specific dimension + // (= preset_flat_orientation_.first) + // preset_flat_orientation_.first = numeric_limits::max() otherwise) std::pair preset_flat_orientation_; // for stochastic walk in the locate() function: mutable Random rng_; @@ -201,6 +205,11 @@ public: clear(); } + // With this constructor, + // the user can specify a Flat_orientation_d object to be used for + // orienting simplices of a specific dimension + // (= preset_flat_orientation_.first) + // It it used for by dark triangulations created by DT::remove Triangulation( int dim, const std::pair &preset_flat_orientation,