Update usage of intersection tags

This commit is contained in:
Mael Rouxel-Labbé 2019-09-19 18:32:34 +02:00
parent 7a50939809
commit e4c0bcffa0
12 changed files with 84 additions and 66 deletions

View File

@ -194,8 +194,7 @@ typedef CGAL::Triangulation_face_base_with_info_2<Face_info,P_traits> Fb1;
typedef CGAL::Constrained_triangulation_face_base_2<P_traits, Fb1> Fb; typedef CGAL::Constrained_triangulation_face_base_2<P_traits, Fb1> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS; typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
// typedef CGAL::No_intersection_tag Itag; typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits, TDS, typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits, TDS,
Itag> CDT; Itag> CDT;

View File

@ -223,7 +223,6 @@ class Basic_viewer : public CGAL::QGLViewer, public QOpenGLFunctions_2_1
typedef CGAL::Constrained_triangulation_face_base_2<P_traits, Fb1> Fb; typedef CGAL::Constrained_triangulation_face_base_2<P_traits, Fb1> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS; typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
// typedef CGAL::No_intersection_tag Itag;
typedef CGAL::Exact_predicates_tag Itag; typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits, TDS, typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits, TDS,
Itag> CDT; Itag> CDT;

View File

@ -171,11 +171,11 @@ private:
template<typename SNC_structure, typename Kernel> template<typename SNC_structure, typename Kernel>
class Triangulation_handler { class Triangulation_handler {
typedef typename CGAL::Triangulation_vertex_base_2<Kernel> Vb; typedef typename CGAL::Triangulation_vertex_base_2<Kernel> Vb;
typedef typename CGAL::Constrained_triangulation_face_base_2<Kernel> Fb; typedef typename CGAL::Constrained_triangulation_face_base_2<Kernel> Fb;
typedef typename CGAL::Triangulation_data_structure_2<Vb,Fb> TDS; typedef typename CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
typedef typename CGAL::No_intersection_tag Itag; typedef typename CGAL::No_constraint_intersection_requiring_constructions_tag Itag;
typedef typename CGAL::Constrained_triangulation_2<Kernel,TDS,Itag> CT; typedef typename CGAL::Constrained_triangulation_2<Kernel,TDS,Itag> CT;
typedef typename CT::Face_handle Face_handle; typedef typename CT::Face_handle Face_handle;
typedef typename CT::Finite_faces_iterator Finite_face_iterator; typedef typename CT::Finite_faces_iterator Finite_face_iterator;

View File

@ -221,11 +221,11 @@ public:
template<typename Kernel> template<typename Kernel>
class Triangulation_handler { class Triangulation_handler {
typedef typename CGAL::Triangulation_vertex_base_2<Kernel> Vb; typedef typename CGAL::Triangulation_vertex_base_2<Kernel> Vb;
typedef typename CGAL::Constrained_triangulation_face_base_2<Kernel> Fb; typedef typename CGAL::Constrained_triangulation_face_base_2<Kernel> Fb;
typedef typename CGAL::Triangulation_data_structure_2<Vb,Fb> TDS; typedef typename CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
typedef typename CGAL::No_intersection_tag Itag; typedef typename CGAL::No_constraint_intersection_requiring_constructions_tag Itag;
typedef typename CGAL::Constrained_triangulation_2<Kernel,TDS,Itag> CT; typedef typename CGAL::Constrained_triangulation_2<Kernel,TDS,Itag> CT;
typedef typename CT::Face_handle Face_handle; typedef typename CT::Face_handle Face_handle;
typedef typename CT::Finite_faces_iterator Finite_face_iterator; typedef typename CT::Finite_faces_iterator Finite_face_iterator;

View File

@ -257,15 +257,15 @@ private:
// wait cursor // wait cursor
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
typedef ProjectionTraits Gt; typedef ProjectionTraits Gt;
typedef CGAL::Delaunay_mesh_vertex_base_2<Gt> Vb; typedef CGAL::Delaunay_mesh_vertex_base_2<Gt> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<Gt> Fm; typedef CGAL::Delaunay_mesh_face_base_2<Gt> Fm;
typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo2,Gt,Fm> Fb; typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo2,Gt,Fm> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS; typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::No_intersection_tag Tag; typedef CGAL::No_constraint_intersection_requiring_constructions_tag Tag;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT; typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT;
typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria; typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Mesher; typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Mesher;
QTime time; // global timer QTime time; // global timer
time.start(); time.start();

View File

@ -105,11 +105,11 @@ struct Top
typedef EPICK Gt; typedef EPICK Gt;
typedef CGAL::Triangulation_vertex_base_2<Gt> Vb; typedef CGAL::Triangulation_vertex_base_2<Gt> Vb;
typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo2,Gt > Fbb; typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo2,Gt > Fbb;
typedef CGAL::Constrained_triangulation_face_base_2<Gt,Fbb> Fb; typedef CGAL::Constrained_triangulation_face_base_2<Gt,Fbb> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS; typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::No_intersection_tag Tag; typedef CGAL::No_constraint_intersection_requiring_constructions_tag Tag;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT; typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT;
//Parameterization and text displaying //Parameterization and text displaying
class ParamItem : public QGraphicsItem class ParamItem : public QGraphicsItem

View File

@ -137,17 +137,16 @@ private:
// Types used for the convexification of the mesh // Types used for the convexification of the mesh
// Each triangulation vertex is associated its corresponding vertex_descriptor // Each triangulation vertex is associated its corresponding vertex_descriptor
typedef CGAL::Triangulation_vertex_base_with_info_2<vertex_descriptor, typedef CGAL::Triangulation_vertex_base_with_info_2<vertex_descriptor, Kernel> Vb;
Kernel> Vb; // Each triangulation face is associated a color (inside/outside information)
// Each triangultaion face is associated a color (inside/outside information) typedef CGAL::Triangulation_face_base_with_info_2<int, Kernel> Fb;
typedef CGAL::Triangulation_face_base_with_info_2<int, Kernel> Fb; typedef CGAL::Constrained_triangulation_face_base_2<Kernel, Fb> Cfb;
typedef CGAL::Constrained_triangulation_face_base_2<Kernel, Fb> Cfb; typedef CGAL::Triangulation_data_structure_2<Vb, Cfb> TDS;
typedef CGAL::Triangulation_data_structure_2<Vb, Cfb> TDS; typedef CGAL::No_constraint_intersection_requiring_constructions_tag Itag;
typedef CGAL::No_intersection_tag Itag;
// Can choose either a triangulation or a Delaunay triangulation // Can choose either a triangulation or a Delaunay triangulation
typedef CGAL::Constrained_triangulation_2<Kernel, TDS, Itag> CT; typedef CGAL::Constrained_triangulation_2<Kernel, TDS, Itag> CT;
// typedef CGAL::Constrained_Delaunay_triangulation_2<Kernel, TDS, Itag> CT; // typedef CGAL::Constrained_Delaunay_triangulation_2<Kernel, TDS, Itag> CT;
// Private fields // Private fields
private: private:

View File

@ -52,24 +52,36 @@ _test_cdt_throwing(const Pt& p0, const Pt& p1, const Pt& p2, const Pt& p3,
// There must have been an intersection // There must have been an intersection
assert(intersection_type != NO_INTERSECTION); assert(intersection_type != NO_INTERSECTION);
// If the intersection requires no construction, then only 'no_intersection_tag' throws // If the intersection requires no construction, then only 'No_constraint_intersection_tag' throws
if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION) { if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION)
assert((boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value)); {
} else { assert((boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_tag>::value));
}
else // threw and it's not a construction-less intersection ---> real intersection
{
assert(intersection_type == INTERSECTION); assert(intersection_type == INTERSECTION);
assert((boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value) || assert((boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_tag>::value) ||
(boost::is_same<typename Triang::Itag, CGAL::No_intersection_requiring_constructions_tag>::value)); #ifndef CGAL_NO_DEPRECATED_CODE
(boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value) ||
#endif
(boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_requiring_constructions_tag>::value));
} }
return; return;
} }
if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION) { if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION)
// Even with an intersection without construction, 'No_intersection_tag' should throw {
assert(!(boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value)); // Even with an intersection without construction, 'No_constraint_intersection_tag' should have thrown
} else if(intersection_type == INTERSECTION) { assert(!(boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_tag>::value));
assert(!(boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value) && }
!(boost::is_same<typename Triang::Itag, CGAL::No_intersection_requiring_constructions_tag>::value)); else if(intersection_type == INTERSECTION)
{
assert(!(boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_tag>::value) &&
#ifndef CGAL_NO_DEPRECATED_CODE
!(boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value) &&
#endif
!(boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_requiring_constructions_tag>::value));
} }
} }

View File

@ -29,10 +29,10 @@ bool test(std::string test_name)
std::cerr << "Testing " << test_name << std::endl; std::cerr << "Testing " << test_name << std::endl;
const unsigned nb_input_points = sizeof(input)/sizeof(vec); const unsigned nb_input_points = sizeof(input)/sizeof(vec);
typedef CGAL::Constrained_triangulation_face_base_2<CDT_2_traits> CDT_2_fb; typedef CGAL::Constrained_triangulation_face_base_2<CDT_2_traits> CDT_2_fb;
typedef CGAL::Triangulation_vertex_base_2<CDT_2_traits> CDT_2_vb; typedef CGAL::Triangulation_vertex_base_2<CDT_2_traits> CDT_2_vb;
typedef CGAL::Triangulation_data_structure_2<CDT_2_vb, CDT_2_fb> CDT_2_tds; typedef CGAL::Triangulation_data_structure_2<CDT_2_vb, CDT_2_fb> CDT_2_tds;
typedef CGAL::No_intersection_tag CDT_2_itag; typedef CGAL::No_constraint_intersection_requiring_constructions_tag CDT_2_itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<CDT_2_traits, typedef CGAL::Constrained_Delaunay_triangulation_2<CDT_2_traits,
CDT_2_tds, CDT_2_tds,
CDT_2_itag> CDT_2; CDT_2_itag> CDT_2;

View File

@ -30,9 +30,8 @@ template class CGAL::Constrained_Delaunay_triangulation_2<TestK>;
int main() int main()
{ {
std::cout << "Testing constrained_Delaunay_triangulation "<< std::endl; std::cout << "Testing constrained_Delaunay_triangulation "<< std::endl;
std::cout << " with No_intersection_tag : " << std::endl; std::cout << " with No_constraint_intersection_requiring_constructions_tag : " << std::endl;
typedef CGAL::Constrained_Delaunay_triangulation_2<TestK> CDt2; typedef CGAL::Constrained_Delaunay_triangulation_2<TestK> CDt2;
_test_cls_const_Del_triangulation(CDt2()); _test_cls_const_Del_triangulation(CDt2());

View File

@ -22,6 +22,8 @@
#define CGAL_NO_CDT_2_WARNING #define CGAL_NO_CDT_2_WARNING
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/_test_types.h> #include <CGAL/_test_types.h>
#include <CGAL/Constrained_triangulation_2.h> #include <CGAL/Constrained_triangulation_2.h>
@ -33,16 +35,24 @@ template class CGAL::Constrained_triangulation_2<TestK>;
int main() int main()
{ {
std::cout << "Testing constrained_triangulation "<< std::endl; std::cout << "Testing constrained_triangulation "<< std::endl;
std::cout << " with No_intersection_tag : " << std::endl; std::cout << " with No_constraint_intersection_tag : " << std::endl;
typedef CGAL::Constrained_triangulation_2<TestK> Ct; typedef CGAL::No_constraint_intersection_tag CItag;
_test_cls_constrained_triangulation(Ct());
std::cout << "Testing constrained_triangulation "<< std::endl;
std::cout << " with No_intersection_requiring_constructions_tag : " << std::endl;
typedef CGAL::No_intersection_requiring_constructions_tag CItag;
typedef CGAL::Constrained_triangulation_2<TestK, CGAL::Default, CItag> Ctwoc; typedef CGAL::Constrained_triangulation_2<TestK, CGAL::Default, CItag> Ctwoc;
_test_cls_constrained_triangulation(Ctwoc()); _test_cls_constrained_triangulation(Ctwoc());
std::exit(1);
std::cout << "Testing constrained_triangulation "<< std::endl;
std::cout << " with No_constraint_intersection_requiring_constructions_tag (default): " << std::endl;
#ifndef CGAL_NO_DEPRECATED_CODE
typedef CGAL::No_intersection_tag CDItag;
typedef CGAL::Constrained_triangulation_2<TestK, CGAL::Default, CDItag> Ct;
#else
typedef CGAL::Constrained_triangulation_2<TestK> Ct;
#endif
_test_cls_constrained_triangulation(Ct());
std::cout << "Testing constrained_triangulation "<< std::endl; std::cout << "Testing constrained_triangulation "<< std::endl;
std::cout << " with Exact_predicates_tag : " << std::endl; std::cout << " with Exact_predicates_tag : " << std::endl;
typedef CGAL::Triangulation_vertex_base_2<TestK> Vb; typedef CGAL::Triangulation_vertex_base_2<TestK> Vb;

View File

@ -75,13 +75,13 @@ public:
typedef CGAL::Tag_true Supports_simple_polygon_category; typedef CGAL::Tag_true Supports_simple_polygon_category;
private: private:
typedef CGAL::Triangulation_vertex_base_2<K> Vb; typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb; typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS; typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::No_intersection_tag Itag; typedef CGAL::No_constraint_intersection_requiring_constructions_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS, Itag> CDT; typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS, Itag> CDT;
typedef std::pair<Point_2,Point_2> Constraint; typedef std::pair<Point_2, Point_2> Constraint;
// Functor to create edge constraints for the CDT out of Halfedges // Functor to create edge constraints for the CDT out of Halfedges
struct Make_constraint struct Make_constraint