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::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,
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::Triangulation_data_structure_2<Vb,Fb> TDS;
// typedef CGAL::No_intersection_tag Itag;
typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits, TDS,
Itag> CDT;

View File

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

View File

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

View File

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

View File

@ -105,11 +105,11 @@ struct Top
typedef EPICK Gt;
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::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::No_intersection_tag Tag;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::No_constraint_intersection_requiring_constructions_tag Tag;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT;
//Parameterization and text displaying
class ParamItem : public QGraphicsItem

View File

@ -137,17 +137,16 @@ private:
// Types used for the convexification of the mesh
// Each triangulation vertex is associated its corresponding vertex_descriptor
typedef CGAL::Triangulation_vertex_base_with_info_2<vertex_descriptor,
Kernel> Vb;
// Each triangultaion face is associated a color (inside/outside information)
typedef CGAL::Triangulation_face_base_with_info_2<int, Kernel> Fb;
typedef CGAL::Constrained_triangulation_face_base_2<Kernel, Fb> Cfb;
typedef CGAL::Triangulation_data_structure_2<Vb, Cfb> TDS;
typedef CGAL::No_intersection_tag Itag;
typedef CGAL::Triangulation_vertex_base_with_info_2<vertex_descriptor, Kernel> Vb;
// Each triangulation face is associated a color (inside/outside information)
typedef CGAL::Triangulation_face_base_with_info_2<int, Kernel> Fb;
typedef CGAL::Constrained_triangulation_face_base_2<Kernel, Fb> Cfb;
typedef CGAL::Triangulation_data_structure_2<Vb, Cfb> TDS;
typedef CGAL::No_constraint_intersection_requiring_constructions_tag Itag;
// Can choose either a triangulation or a Delaunay triangulation
typedef CGAL::Constrained_triangulation_2<Kernel, TDS, Itag> CT;
// typedef CGAL::Constrained_Delaunay_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;
// Private fields
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
assert(intersection_type != NO_INTERSECTION);
// If the intersection requires no construction, then only 'no_intersection_tag' throws
if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION) {
assert((boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value));
} else {
// If the intersection requires no construction, then only 'No_constraint_intersection_tag' throws
if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION)
{
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((boost::is_same<typename Triang::Itag, CGAL::No_intersection_tag>::value) ||
(boost::is_same<typename Triang::Itag, CGAL::No_intersection_requiring_constructions_tag>::value));
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));
}
return;
}
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));
} else if(intersection_type == INTERSECTION) {
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));
if(intersection_type == INTERSECTION_WITHOUT_CONSTRUCTION)
{
// Even with an intersection without construction, 'No_constraint_intersection_tag' should have thrown
assert(!(boost::is_same<typename Triang::Itag, CGAL::No_constraint_intersection_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;
const unsigned nb_input_points = sizeof(input)/sizeof(vec);
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_data_structure_2<CDT_2_vb, CDT_2_fb> CDT_2_tds;
typedef CGAL::No_intersection_tag CDT_2_itag;
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_data_structure_2<CDT_2_vb, CDT_2_fb> CDT_2_tds;
typedef CGAL::No_constraint_intersection_requiring_constructions_tag CDT_2_itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<CDT_2_traits,
CDT_2_tds,
CDT_2_itag> CDT_2;

View File

@ -30,9 +30,8 @@ template class CGAL::Constrained_Delaunay_triangulation_2<TestK>;
int main()
{
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;
_test_cls_const_Del_triangulation(CDt2());

View File

@ -22,6 +22,8 @@
#define CGAL_NO_CDT_2_WARNING
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
#include <CGAL/_test_types.h>
#include <CGAL/Constrained_triangulation_2.h>
@ -33,16 +35,24 @@ template class CGAL::Constrained_triangulation_2<TestK>;
int main()
{
std::cout << "Testing constrained_triangulation "<< std::endl;
std::cout << " with No_intersection_tag : " << std::endl;
typedef CGAL::Constrained_triangulation_2<TestK> Ct;
_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;
std::cout << " with No_constraint_intersection_tag : " << std::endl;
typedef CGAL::No_constraint_intersection_tag CItag;
typedef CGAL::Constrained_triangulation_2<TestK, CGAL::Default, CItag> 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 << " with Exact_predicates_tag : " << std::endl;
typedef CGAL::Triangulation_vertex_base_2<TestK> Vb;

View File

@ -75,13 +75,13 @@ public:
typedef CGAL::Tag_true Supports_simple_polygon_category;
private:
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
typedef CGAL::No_intersection_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS, Itag> CDT;
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::No_constraint_intersection_requiring_constructions_tag Itag;
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
struct Make_constraint