diff --git a/BGL/test/BGL/data/colored_tetra.ply b/BGL/test/BGL/data/colored_tetra.ply index 7ec622125d1..0512db6f502 100644 --- a/BGL/test/BGL/data/colored_tetra.ply +++ b/BGL/test/BGL/data/colored_tetra.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 diff --git a/BGL/test/BGL/data/invalid_cut.ply b/BGL/test/BGL/data/invalid_cut.ply index a158f142b37..c50bb6c56ad 100644 --- a/BGL/test/BGL/data/invalid_cut.ply +++ b/BGL/test/BGL/data/invalid_cut.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 diff --git a/BGL/test/BGL/data/invalid_nv.ply b/BGL/test/BGL/data/invalid_nv.ply index e6a3ca46bb2..18903f10b96 100644 --- a/BGL/test/BGL/data/invalid_nv.ply +++ b/BGL/test/BGL/data/invalid_nv.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 0 diff --git a/BGL/test/BGL/test_split.cpp b/BGL/test/BGL/test_split.cpp index f9b6fff3ced..9c13a2d0307 100644 --- a/BGL/test/BGL/test_split.cpp +++ b/BGL/test/BGL/test_split.cpp @@ -24,7 +24,8 @@ typedef std::vector Polyline_2; // inserts a polyline into a graph void insert(const std::vector& poly, Graph& graph, Point_vertex_map& pvmap) { - vertex_descriptor u, v; + vertex_descriptor u = boost::graph_traits::null_vertex(); + vertex_descriptor v; for (std::size_t i = 0; i < poly.size(); i++) { // check if the point is not yet in the graph if (pvmap.find(poly[i]) == pvmap.end()) { diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index 1c5a594ce1b..0181e8166cc 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -28,7 +28,7 @@ FAILURES=() for dir in $PATH_TO_DOC/* do OUTPUT=$(basename $dir) - python ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" + python3 ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" if [ $? -eq 0 ]; then echo "$dir OK" else diff --git a/Documentation/doc/scripts/documentation_parser.py b/Documentation/doc/scripts/documentation_parser.py index 187b175bf4f..462291efae6 100644 --- a/Documentation/doc/scripts/documentation_parser.py +++ b/Documentation/doc/scripts/documentation_parser.py @@ -1,3 +1,5 @@ +#/usr/bin/env python3 + from pyquery import PyQuery as pq from collections import defaultdict from sys import argv @@ -12,17 +14,17 @@ def check_type(_in, args): root_path=argv[1] d = pq(filename=op.join(op.sep, root_path,'index.xml'), parser="xml") -compounds=[p.text() for p in d('compound').items()] -types=[p.attr('kind') for p in d('compound').items()] +compounds=[p.text() for p in list(d('compound').items())] +types=[p.attr('kind') for p in list(d('compound').items())] type_map = defaultdict(list) #map dict_map = defaultdict(dict)#map > #FOREACH compounds : fill maps -for i in xrange(0,len(compounds)): +for i in range(0,len(compounds)): if check_type(types[i], "typedef"): types[i]="type" name=d('compound').children("name").eq(i).text() - members=[p.text() for p in d('compound').eq(i).children("member").items()] - m_types=[p.attr('kind') for p in d('compound').eq(i).children("member").items()] + members=[p.text() for p in list(d('compound').eq(i).children("member").items())] + m_types=[p.attr('kind') for p in list(d('compound').eq(i).children("member").items())] if (not check_type(types[i], ['example', 'file', 'dir', 'page', 'group']) and not (types[i] == "namespace" and len(members) == 0) and not (types[i] == "enum" and len(members) == 0) ): @@ -32,7 +34,7 @@ for i in xrange(0,len(compounds)): total_path=op.join(op.sep, root_path,filepath) if(op.isfile(total_path)): e = pq(filename=total_path, parser="xml") - compoundnames=[p.text() for p in e('includes').items()] + compoundnames=[p.text() for p in list(e('includes').items())] if(len(compoundnames) > 1 and compoundnames[0].find("Concept") != -1): types[i] = 'Concept '+types[i].lower() @@ -41,7 +43,7 @@ for i in xrange(0,len(compounds)): mtype_map = defaultdict(list)# map #FOREACH member : - for j in xrange(0,len(members)): + for j in range(0,len(members)): if(check_type(types[i], ['class', 'Concept class']) and m_types[j] == "function"): m_types[j]="method" @@ -62,7 +64,7 @@ for btype in type_map: out=btype if btype.endswith('s'): out+='e' - print out.title()+'s' + print(out.title()+'s') indent+=" " #FOREACH name for name in type_map[btype]: @@ -74,7 +76,7 @@ for btype in type_map: templates=[] if op.isfile(op.join(op.sep, root_path,filepath)): f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") - templateparams=f("compounddef").children("templateparamlist").eq(0).children("param").items() + templateparams=list(f("compounddef").children("templateparamlist").eq(0).children("param").items()) for param in templateparams: template_type="" template_name="" @@ -91,7 +93,7 @@ for btype in type_map: complete_template+=' = '+template_defval templates.append(complete_template) if templates==[]:#if no child was found, just take param.text() - templates=[t.text() for t in param.items()] + templates=[t.text() for t in list(param.items())] suffix="<" #as template got type, defname and declname, name is twice in template. keep only one of them. to_remove=[""] @@ -101,7 +103,7 @@ for btype in type_map: suffix="" if suffix.endswith(', '): suffix = suffix[:-2]+'>' - print indent+name+suffix + print(indent+name+suffix) indent+=" " #FOREACH mtype @@ -109,7 +111,7 @@ for btype in type_map: out=mtype if mtype.endswith('s'): out+='e' - print indent+out.title()+'s' + print(indent+out.title()+'s') indent+=" " #FOREACH member overload_map = defaultdict(int) #contains the number of times a member has appeared (to manage the overloads) @@ -123,16 +125,16 @@ for btype in type_map: if op.isfile(op.join(op.sep, root_path,filepath)): f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") index=0 - memberdefs=[m.text() for m in f("memberdef").items()] - for i in xrange(0,len(memberdefs)): - member_names=[member_name.text() for member_name in f('memberdef').eq(i).children("name").items()] + memberdefs=[m.text() for m in list(f("memberdef").items())] + for i in range(0,len(memberdefs)): + member_names=[member_name.text() for member_name in list(f('memberdef').eq(i).children("name").items())] if f('memberdef').eq(i).children("name").text() == member: if (index < overload_map[member]): index+=1 elif (index == overload_map[member]): if check_type(mtype, ['function', 'method']): args=[f('memberdef').eq(i).children("argsstring").text()] - templateparams=f('memberdef').eq(i).children("templateparamlist").children("param").items() + templateparams=list(f('memberdef').eq(i).children("templateparamlist").children("param").items()) if check_type(mtype, ['function', 'method', 'type', 'variable']): return_type=[f('memberdef').eq(i).children("type").text()] break; @@ -158,7 +160,7 @@ for btype in type_map: complete_template+=' = '+template_defval templates.append(complete_template) if templates==[]:#if no child was found, just take param.text() - templates=[t.text() for t in param.items()] + templates=[t.text() for t in list(param.items())] prefix="template <" for template in templates: @@ -171,7 +173,7 @@ for btype in type_map: prefix+=definition if(prefix != ""): prefix+=" " - print indent+prefix+member+arguments + print(indent+prefix+member+arguments) overload_map[member]+=1 #END foreach member indent=indent[:-2] diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 5fd919df74d..e8bfe64b580 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -316,6 +316,7 @@ void split_along_edges(TriangleMesh& tm, std::set extra_border_hedges; for(std::size_t k=0; k> tm1; + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(false)); + assert(vertices(tm1).size()==753); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + std::size_t nbv = vertices(tm1).size(); + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(true)); + assert(vertices(tm1).size()==nbv+2); // because of the plane diagonal + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(false).allow_self_intersections(true)); + assert(vertices(tm1).size()==753); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + std::size_t nbv = vertices(tm1).size(); + PMP::clip(tm1, K::Plane_3(0,0,1,-1), CGAL::parameters::use_compact_clipper(true).allow_self_intersections(true)); + assert(vertices(tm1).size()==nbv+2); // because of the plane diagonal + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(false)); + assert(vertices(tm1).size()==0); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(true)); + assert(vertices(tm1).size()==176); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(false).allow_self_intersections(true)); + assert(vertices(tm1).size()==0); + } + + { + TriangleMesh tm1; + std::ifstream("data-coref/open_large_cube.off") >> tm1; + PMP::clip(tm1, K::Plane_3(0,0,-1,1), CGAL::parameters::use_compact_clipper(true).allow_self_intersections(true)); + assert(vertices(tm1).size()==176); + } } template void test_split_plane() { - // test with a clipper mesh +//test with a splitter mesh Mesh tm1; std::ifstream input("data-coref/elephant.off"); input >> tm1; @@ -529,7 +587,45 @@ void test_split_plane() CGAL::clear(tm1); meshes.clear(); - //test with SI +//test with a non-closed splitter mesh (border edges in the plane) + input.open("data-coref/open_large_cube.off"); + input >> tm1; + + if(!input) + { + std::cerr<<"File not found. Aborting."<> tm1; + + if(!input) + { + std::cerr<<"File not found. Aborting."<> tm1; if(num_vertices(tm1) == 0) { @@ -735,12 +831,15 @@ void test_isocuboid() .allow_self_intersections(true)); PMP::split_connected_components(tm, meshes, params::all_default()); assert(meshes.size() == 4); - //if the order is not deterministc, put the num_vertices in a list and check - //if the list does contain all those numbers. - assert(vertices(meshes[0]).size() == 22); - assert(vertices(meshes[1]).size() == 23); - assert(vertices(meshes[2]).size() == 7); - assert(vertices(meshes[3]).size() == 4); + + std::set sizes; + for (int i=0; i<4; ++i) + sizes.insert(vertices(meshes[i]).size()); + + assert(sizes.count(22)==1); + assert(sizes.count(23)==1); + assert(sizes.count(7)==1); + assert(sizes.count(4)==1); CGAL::clear(tm); meshes.clear(); diff --git a/Polyhedron/include/CGAL/Polyhedron_3.h b/Polyhedron/include/CGAL/Polyhedron_3.h index 8c2fce47dfe..b948f2e6dcb 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_3.h @@ -110,7 +110,8 @@ public: // the degree of the vertex, i.e., edges emanating from this vertex std::size_t vertex_degree() const { - return this->halfedge()->vertex_degree(); + return this->halfedge()!=Halfedge_const_handle() + ? this->halfedge()->vertex_degree() : 0; } size_type degree() const { return vertex_degree(); } //backwards compatible diff --git a/Stream_support/doc/Stream_support/IOstream.txt b/Stream_support/doc/Stream_support/IOstream.txt index 0a979c0d106..085fe65127d 100644 --- a/Stream_support/doc/Stream_support/IOstream.txt +++ b/Stream_support/doc/Stream_support/IOstream.txt @@ -252,10 +252,10 @@ for drawing operations in many \cgal output streams. Each color is defined by a triple of integers `(r,g,b)` with 0 \f$ \le \f$ r,g,b \f$ \le \f$ 255, the so-called rgb-value of the color. -There are a 11 predefined `Color` constants available: -`BLACK`, `WHITE`, `GRAY`, `RED`, `GREEN`, -`DEEPBLUE`, `BLUE`, `PURPLE`, `VIOLET`, `ORANGE`, -and `YELLOW`. +There are a 11 predefined `Color` functions available: +`black()`, `white()`, `gray()`, `red()`, `green()`, +`deep_blue()`, `blue()`, `purple()`, `violet()`, `orange()`, +and `yellow()`. \subsection IOstreamStream Stream Support diff --git a/Stream_support/test/Stream_support/data/colored_tetra.ply b/Stream_support/test/Stream_support/data/colored_tetra.ply index 7ec622125d1..0512db6f502 100644 --- a/Stream_support/test/Stream_support/data/colored_tetra.ply +++ b/Stream_support/test/Stream_support/data/colored_tetra.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index a57834da89c..26fc352c391 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -175,8 +175,12 @@ public: bool has_simplex_specific_property(internal::PLY_read_number* property, Edge_index) { const std::string& name = property->name(); + if(name == "vertex1" || name == "vertex2") + return true; +#ifndef CGAL_NO_DEPRECATED_CODE if(name == "v0" || name == "v1") return true; +#endif return false; } @@ -365,8 +369,8 @@ public: void process_line(PLY_element& element, Edge_index& ei) { IntType v0, v1; - element.assign(v0, "v0"); - element.assign(v1, "v1"); + element.assign(v0, "vertex1"); + element.assign(v1, "vertex2"); Halfedge_index hi = m_mesh.halfedge(m_map_v2v[std::size_t(v0)], m_map_v2v[std::size_t(v1)]); @@ -961,8 +965,8 @@ bool write_PLY(std::ostream& os, if(!eprinters.empty()) { os << "element edge " << sm.number_of_edges() << std::endl; - os << "property int v0" << std::endl; - os << "property int v1" << std::endl; + os << "property int vertex1" << std::endl; + os << "property int vertex2" << std::endl; os << oss.str(); } } diff --git a/Surface_mesh/test/Surface_mesh/colored_tetra.ply b/Surface_mesh/test/Surface_mesh/colored_tetra.ply index 7ec622125d1..0512db6f502 100644 --- a/Surface_mesh/test/Surface_mesh/colored_tetra.ply +++ b/Surface_mesh/test/Surface_mesh/colored_tetra.ply @@ -18,8 +18,8 @@ property uchar green property uchar blue property int label element edge 6 -property int v0 -property int v1 +property int vertex1 +property int vertex2 property float confidence end_header 0 0 0 -0.5 -0.5 -0.5 255 255 0 0 diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index 6f32473c744..e9aea5691c9 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -1997,13 +1997,16 @@ copy_tds(const TDS_src& tds_src, CGAL_triangulation_precondition( tds_src.is_vertex(vert)); clear(); - size_type n = tds_src.number_of_vertices(); set_dimension(tds_src.dimension()); - // Number of pointers to cell/vertex to copy per cell. - int dim = (std::max)(1, dimension() + 1); + if(tds_src.number_of_vertices() == 0) + return Vertex_handle(); - if(n == 0) {return Vertex_handle();} + // Number of pointers to face/vertex to copy per face. + const int dim = (std::max)(1, dimension() + 1); + + // Number of neighbors to set in each face (dim -1 has a single face) + const int nn = (std::max)(0, dimension() + 1); //initializes maps Unique_hash_map vmap; @@ -2025,7 +2028,7 @@ copy_tds(const TDS_src& tds_src, convert_face(*fit1, *fh); } - //link vertices to a cell + //link vertices to a face vit1 = tds_src.vertices_begin(); for ( ; vit1 != tds_src.vertices_end(); vit1++) { vmap[vit1]->set_face(fmap[vit1->face()]); @@ -2034,10 +2037,10 @@ copy_tds(const TDS_src& tds_src, //update vertices and neighbor pointers fit1 = tds_src.faces().begin(); for ( ; fit1 != tds_src.faces_end(); ++fit1) { - for (int j = 0; j < dim ; ++j) { + for (int j = 0; j < dim ; ++j) fmap[fit1]->set_vertex(j, vmap[fit1->vertex(j)] ); + for (int j = 0; j < nn ; ++j) fmap[fit1]->set_neighbor(j, fmap[fit1->neighbor(j)]); - } } // remove the post condition because it is false when copying the diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h index 8a6682b6c75..b9e660d9d03 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h @@ -240,7 +240,7 @@ Triangulation_ds_face_base_2 :: set_neighbor(int i, Face_handle n) { CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( this != &*n ); + CGAL_triangulation_precondition( this != n.operator->() ); N[i] = n; } diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index bd9323321ba..6b8445a4683 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -4041,32 +4041,27 @@ copy_tds(const TDS_src& tds, || tds.is_vertex(vert) ); clear(); - - size_type n = tds.number_of_vertices(); set_dimension(tds.dimension()); - if (n == 0) return Vertex_handle(); + if(tds.number_of_vertices() == 0) + return Vertex_handle(); // Number of pointers to cell/vertex to copy per cell. - int dim = (std::max)(1, dimension() + 1); + const int dim = (std::max)(1, dimension() + 1); - // Create the vertices. - std::vector TV(n); - size_type i = 0; - - for (typename TDS_src::Vertex_iterator vit = tds.vertices_begin(); - vit != tds.vertices_end(); ++vit) - TV[i++] = vit; - - CGAL_triangulation_assertion( i == n ); + // Number of neighbors to set + const int nn = (std::max)(0, dimension() + 1); + // Initializes maps Unique_hash_map< typename TDS_src::Vertex_handle,Vertex_handle > V; Unique_hash_map< typename TDS_src::Cell_handle,Cell_handle > F; - for (i=0; i <= n-1; ++i){ - Vertex_handle vh=create_vertex( convert_vertex(*TV[i]) ); - V[ TV[i] ] = vh; - convert_vertex(*TV[i],*vh); + // Create the vertices. + for (typename TDS_src::Vertex_iterator vit = tds.vertices_begin(); + vit != tds.vertices_end(); ++vit) { + Vertex_handle vh = create_vertex( convert_vertex(*vit) ); + V[vit] = vh; + convert_vertex(*vit,*vh); } // Create the cells. @@ -4087,7 +4082,7 @@ copy_tds(const TDS_src& tds, // Hook neighbor pointers of the cells. for (typename TDS_src::Cell_iterator cit2 = tds.cells().begin(); cit2 != tds.cells_end(); ++cit2) { - for (int j = 0; j < dim; j++) + for (int j = 0; j < nn; j++) F[cit2]->set_neighbor(j, F[cit2->neighbor(j)] ); } diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index c8c982b38bc..15caad00e68 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -132,9 +132,14 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1.number_of_vertices() == 0 ); Triangul T3(T1); - Triangul T4 = T1; - T3.swap(T1); + assert(T3.tds().vertices().size() == T1.tds().vertices().size()); + assert(T3.tds().faces().size() == T1.tds().faces().size()); + Triangul T4 = T1; + assert(T4.tds().vertices().size() == T1.tds().vertices().size()); + assert(T4.tds().faces().size() == T1.tds().faces().size()); + + T3.swap(T1); /**************************/ /******* INSERTIONS *******/ @@ -162,6 +167,10 @@ _test_cls_triangulation_2( const Triangul & ) assert( T0_1.number_of_faces() == 0); assert( T0_1.is_valid() ); + Triangul T0_1b(T0_1); + assert(T0_1b.tds().vertices().size() == T0_1.tds().vertices().size()); + assert(T0_1b.tds().faces().size() == T0_1.tds().faces().size()); + // test insert_first() Triangul T0_2; Vertex_handle v0_2_0 = T0_2.insert_first(p0); @@ -184,6 +193,10 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_2.number_of_faces() == 0 ); assert( T1_2.is_valid() ); + Triangul T1_2b(T1_2); + assert(T1_2b.tds().vertices().size() == T1_2.tds().vertices().size()); + assert(T1_2b.tds().faces().size() == T1_2.tds().faces().size()); + // p1,p3,p2 [endpoints first] Triangul T1_3_0; Vertex_handle v1_3_0_1 = T1_3_0.insert(p1); assert( v1_3_0_1 != nullptr ); diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h index 8c63a6cd09b..fe5b2d041b2 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h @@ -190,7 +190,21 @@ _test_cls_triangulation_3(const Triangulation &) //######################################################################## - /**************CONSTRUCTORS (1)*********************/ + /************** CONSTRUCTORS (1)********************/ + + Cls Tm1; + assert( Tm1.dimension() == -1 ); + assert( Tm1.number_of_vertices() == 0 ); + + Cls Tm3(Tm1); + assert(Tm3 == Tm1); + + Cls Tm4 = Tm1; + assert(Tm4 == Tm1); + + Tm3.swap(Tm1); + + /************** INSERTIONS *************************/ /************** and I/O ****************************/ std::cout << " Constructor " << std::endl; @@ -214,6 +228,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 1); assert(T0.is_valid()); + Cls T0d0(T0); + assert(T0 == T0d0); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -228,6 +245,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 2); assert(T0.is_valid()); + Cls T0d1(T0); + assert(T0 == T0d1); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -242,6 +262,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 3); assert(T0.is_valid()); + Cls T0d2(T0); + assert(T0 == T0d2); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -256,6 +279,9 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.number_of_vertices() == 4); assert(T0.is_valid()); + Cls T0d3(T0); + assert(T0 == T0d3); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations {