diff --git a/Packages/Nef_3/TODO b/Packages/Nef_3/TODO index 9966fa00f75..fcb37aaa01c 100644 --- a/Packages/Nef_3/TODO +++ b/Packages/Nef_3/TODO @@ -6,5 +6,6 @@ Nef_3 Package: TODO - Extended kernel with infimaximal box - Define endpoint of segments used for ray shoting to be in the infimaximal box. +- Constructor from a halfspace. - Write a SNC_const_decorator class cloning the current SNC_decorator class methods but using constant attributes. diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_const_decorator.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_const_decorator.h index 75ab20105ba..6df4f236248 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_const_decorator.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_const_decorator.h @@ -284,7 +284,7 @@ Size_type number_of_sface_cycles() const; Size_type number_of_connected_components() const; /*{\Mop calculates the number of connected components of |P|.}*/ -void print_statistics(std::stringstream& os = std::cout) const +void print_statistics(std::ostream& os = std::cout) const /*{\Mop print the statistics of |P|: the number of vertices, edges, and faces.}*/ { diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_io_parser.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_io_parser.h index 495d09bda66..c87189e0075 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_io_parser.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_io_parser.h @@ -123,7 +123,7 @@ std::string index(SHalfloop_handle l) const std::string index(SFace_handle f) const { return FI(f,verbose); } -static void dump(Vertex_handle v, std::ostream& os = cerr); +static void dump(Vertex_handle v, std::ostream& os = std::cerr); /*{\Mstatic prints the plane map decorated by |D| to |os|.}*/ }; // SNC_SM_io_parser diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_triangulator.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_triangulator.h index 2118923c6d2..3792d4ec1f2 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_triangulator.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_SM_triangulator.h @@ -137,6 +137,7 @@ public: #define USING(t) typedef typename Base::t t USING(Vertex_handle); USING(Halfedge_handle); + USING(Halfedge_const_handle); USING(Halfloop_handle); USING(Face_handle); USING(Vertex_iterator); @@ -159,6 +160,8 @@ public: USING(SFace_const_handle); #undef USING + typedef typename Base::Kernel Kernel; + typedef std::pair Halfedge_pair; /*{\Mtypes 3}*/ diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index 57a77c8443c..8c5c980fd0d 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -165,7 +165,7 @@ public: template SNC_io_parser::SNC_io_parser(std::istream& is, SNC_structure& W) : Base(W), in(is), out(std::cout) -{ CGAL_nef3_assertion(W.empty()); +{ CGAL_nef3_assertion(W.is_empty()); verbose = false; } template diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h index 47494833ba1..79367c0d6e0 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h @@ -30,7 +30,7 @@ // ============================================================================ //#ifndef CGAL_SNC_POINT_LOCATOR_H #ifdef CGAL_NEF3_DEPRECATED_CLASS -/* funcionality now provided by SNC_ray_shoter.h */ +#error funcionality now provided by SNC_ray_shoter.h #define CGAL_SNC_POINT_LOCATOR_H #include diff --git a/Packages/Nef_3/include/CGAL/Nef_3/SNC_structure.h b/Packages/Nef_3/include/CGAL/Nef_3/SNC_structure.h index 54216faed77..b1812e14b31 100644 --- a/Packages/Nef_3/include/CGAL/Nef_3/SNC_structure.h +++ b/Packages/Nef_3/include/CGAL/Nef_3/SNC_structure.h @@ -919,14 +919,17 @@ public: TRACEN("removing "<index(u)<<" & "<index(SD.twin(u))); Halfedge_handle src(SD.source(u)), tgt(SD.target(u)); if ( SD.is_closed_at_source(u) ) - SD.set_face( SD.source(u), SD.face(u)); + SD.set_face( src, fu); if ( SD.is_closed_at_source( SD.twin(u)) ) - SD.set_face( SD.target(u), SD.face(u)); + SD.set_face( tgt, fu); + /* TO VERIFY: does is_closed_at_source(u) imply is_isolated(src)? + if it is true, the svertex face update is not necesary. */ SD.delete_edge_pair(u); if( SD.is_isolated(src)) SD.delete_vertex_only(src); if( SD.is_isolated(tgt)) SD.delete_vertex_only(tgt); + /* TO VERIFY: can both svertices be isolated at the same time? */ } } else if( assign(l, fc)) { diff --git a/Packages/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Packages/Nef_3/include/CGAL/Nef_polyhedron_3.h index 10249964009..9bb331e152a 100644 --- a/Packages/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Packages/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -234,7 +234,7 @@ protected: SVertex_handle sv[3]; for(int vi=0; vi<3; ++vi) { sv[vi] = SD.new_vertex(sp[vi]); - D.mark(sv[vi]) = space; + D.mark(sv[vi]) = true; } /* create facet's edge uses */ Sphere_segment ss[3]; @@ -244,27 +244,31 @@ protected: ss[si] = Sphere_segment(sp[si],sp[(si+1)%3]); SD.circle(she[si]) = ss[si].sphere_circle(); SD.circle(SD.twin(she[si])) = ss[si].opposite().sphere_circle(); - SD.mark(she[si]) = space; + SD.mark(she[si]) = true; } /* create facets */ SFace_handle fi = SD.new_face(); SFace_handle fe = SD.new_face(); SD.link_as_face_cycle(she[0], fi); SD.link_as_face_cycle(SD.twin(she[0]), fe); + SD.mark(fi) = true; + SD.mark(fe) = true; /* set face mark */ - SHalfedge_iterator e = SD.shalfedges_begin(); - SFace_handle f; - Sphere_point p1 = SD.point(SD.source(e)); - Sphere_point p2 = SD.point(SD.target(e)); - Sphere_point p3 = SD.point(SD.target(SD.next(e))); - if ( spherical_orientation(p1,p2,p3) > 0 ) - f = SD.face(e); - else - f = SD.face(SD.twin(e)); - SD.mark(f) = space; + if( space == EMPTY) { + SHalfedge_iterator e = SD.shalfedges_begin(); + SFace_handle f; + Sphere_point p1 = SD.point(SD.source(e)); + Sphere_point p2 = SD.point(SD.target(e)); + Sphere_point p3 = SD.point(SD.target(SD.next(e))); + if ( spherical_orientation(p1,p2,p3) > 0 ) + f = SD.face(e); + else + f = SD.face(SD.twin(e)); + SD.mark(f) = false; + } // SD.mark_of_halfsphere(-1) = (x<0 && y>0 && z>0); // SD.mark_of_halfsphere(+1) = (x>0 && y>0 && z<0); - /* TODO: to check if the commented code above is wrong */ + /* TODO: to check if the commented code above could be wrong */ SM_point_locator L(v); L.init_marks_of_halfspheres(); #ifdef CGAL_NEF3_DUMP_SPHERE_MAPS @@ -588,8 +592,8 @@ public: bool contains(Object_handle h) const /*{\Mop returns true iff the object |h| is contained in the set represented by |\Mvar|.}*/ - // TO IMPLEMENT: { SNC_point_locator PL(snc()); return PL.mark(h);} - { return false; } + // { SNC_point_locator PL(snc()); return PL.mark(h);} + { CGAL_nef3_assertion_msg( 0, "not implemented."); } bool contained_in_boundary(Object_handle h) const /*{\Mop returns true iff the object |h| is contained in the $2$-skeleton