mirror of https://github.com/CGAL/cgal
Update usage of intersection tags
This commit is contained in:
parent
7a50939809
commit
e4c0bcffa0
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ private:
|
|||
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::No_constraint_intersection_requiring_constructions_tag Itag;
|
||||
typedef typename CGAL::Constrained_triangulation_2<Kernel,TDS,Itag> CT;
|
||||
|
||||
typedef typename CT::Face_handle Face_handle;
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ public:
|
|||
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::No_constraint_intersection_requiring_constructions_tag Itag;
|
||||
typedef typename CGAL::Constrained_triangulation_2<Kernel,TDS,Itag> CT;
|
||||
|
||||
typedef typename CT::Face_handle Face_handle;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ private:
|
|||
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::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;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ typedef CGAL::Triangulation_vertex_base_2<Gt> Vb;
|
|||
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::No_constraint_intersection_requiring_constructions_tag Tag;
|
||||
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Tag> CDT;
|
||||
|
||||
//Parameterization and text displaying
|
||||
|
|
|
|||
|
|
@ -137,13 +137,12 @@ 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_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_intersection_tag Itag;
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ bool test(std::string test_name)
|
|||
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::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;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ public:
|
|||
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::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
|
||||
|
|
|
|||
Loading…
Reference in New Issue