From 580a1efd5c178d58c3f3256ad61381e7cbde47da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 22 May 2020 15:31:50 +0200 Subject: [PATCH] Remove trailing whitespace / tabs --- .../doc/Alpha_shapes_3/Alpha_shapes_3.txt | 54 +- .../CGAL/IO/Alpha_shape_3_VRML_2_ostream.h | 6 +- BGL/doc/BGL/PackageDescription.txt | 12 +- BGL/include/CGAL/boost/graph/properties.h | 4 +- BGL/test/BGL/test_Prefix.h | 18 +- Geomview/include/CGAL/IO/Geomview_stream.h | 94 +-- .../CGAL/Linear_cell_complex_constructors.h | 2 +- Mesh_2/doc/Mesh_2/Mesh_2.txt | 52 +- Mesh_2/include/CGAL/IO/write_vtu.h | 86 +-- Mesh_3/include/CGAL/IO/File_maya.h | 46 +- Mesh_3/include/CGAL/IO/File_medit.h | 180 ++--- Mesh_3/include/CGAL/IO/output_to_vtu.h | 62 +- .../Point_set_processing_3.txt | 80 +-- .../Polygon_mesh_processing/intersection.h | 8 +- ...olyfit_example_model_complexty_control.cpp | 22 +- .../polyfit_example_user_provided_planes.cpp | 22 +- .../polyfit_example_with_region_growing.cpp | 16 +- .../polyfit_example_without_input_planes.cpp | 26 +- .../Polyhedron/Plugins/IO/PLY_io_plugin.cpp | 16 +- .../Polyhedron/Plugins/IO/VTK_io_plugin.cpp | 32 +- .../Polyhedron/Scene_polygon_soup_item.cpp | 92 +-- .../Polyhedron/Scene_surface_mesh_item.cpp | 110 +-- .../CGAL/IO/Polyhedron_VRML_1_ostream.h | 2 +- .../CGAL/IO/Polyhedron_geomview_ostream.h | 2 +- .../CGAL/IO/Polyhedron_inventor_ostream.h | 2 +- .../include/CGAL/IO/Polyhedron_iostream.h | 2 +- Property_map/include/CGAL/property_map.h | 32 +- .../examples/Ridges_3/Ridges_Umbilics_LCC.cpp | 102 +-- .../examples/Stream_support/CMakeLists.txt | 6 +- .../examples/Stream_support/Point_WKT.cpp | 2 +- .../examples/Stream_support/Polygon_WKT.cpp | 2 +- .../examples/Stream_support/iv2off.cpp | 2 +- .../examples/Stream_support/read_WKT.cpp | 8 +- .../examples/Stream_support/read_xml.cpp | 6 +- .../include/CGAL/IO/Istream_iterator.h | 6 +- .../include/CGAL/IO/OFF/File_header_OFF.h | 6 +- .../CGAL/IO/OFF/File_header_extended_OFF.h | 6 +- .../include/CGAL/IO/OFF/Scanner_OFF.h | 12 +- .../include/CGAL/IO/OFF/generic_copy_OFF.h | 6 +- .../include/CGAL/IO/OI/File_writer_inventor.h | 6 +- .../include/CGAL/IO/OI/Inventor_ostream.h | 4 +- .../include/CGAL/IO/Ostream_iterator.h | 6 +- Stream_support/src/CGAL/File_header_OFF.cpp | 6 +- .../src/CGAL/File_header_extended_OFF.cpp | 6 +- Stream_support/test/Stream_support/vrml2.cpp | 2 +- .../doc/Surface_mesh/Surface_mesh.txt | 106 +-- Surface_mesh/include/CGAL/Surface_mesh/IO.h | 4 +- ...Complex_2_in_triangulation_3_file_writer.h | 12 +- .../doc/Surface_mesher/Surface_mesher.txt | 22 +- ...Complex_2_in_triangulation_3_file_writer.h | 354 +++++----- .../CGAL/Triangulation_data_structure_2.h | 668 +++++++++--------- .../doc/Triangulation/Triangulation.txt | 120 ++-- .../examples/Triangulation_2/terr_trian.cpp | 124 ++-- 53 files changed, 1342 insertions(+), 1342 deletions(-) diff --git a/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt b/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt index db529f4a991..fdd63f691f8 100644 --- a/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt +++ b/Alpha_shapes_3/doc/Alpha_shapes_3/Alpha_shapes_3.txt @@ -2,13 +2,13 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_3D_Alpha_Shapes \cgalAutoToc \authors Tran Kai Frank Da, Sébastien Loriot, and Mariette Yvinec -\image html alphashape.png -\image latex alphashape.png +\image html alphashape.png +\image latex alphashape.png Assume we are given a set \f$ S\f$ of points in 2D or 3D and we would like to have something like "the shape formed by these points". This is @@ -56,8 +56,8 @@ are based on its generalization, the regular triangulation replacing the euclidean distance by the power to weighted points. Let us consider the basic case with a Delaunay triangulation. -We first define the alpha complex of the set of points \f$ S\f$. -The alpha complex is a subcomplex +We first define the alpha complex of the set of points \f$ S\f$. +The alpha complex is a subcomplex of the Delaunay triangulation. For a given value of \f$ \alpha\f$, the alpha complex includes all the simplices in the Delaunay triangulation which have @@ -75,17 +75,17 @@ singular if it is not a facet of a \f$ (k+1)\f$-simplex of the complex. the alpha shapes correspond strictly to the above definition. The regularized mode provides a regularized version of the alpha shapes. It corresponds to the domain covered by a regularized version -of the alpha complex where singular faces are removed +of the alpha complex where singular faces are removed (See \cgalFigureRef{figgenregex} for an example). -\cgalFigureBegin{figgenregex,gen-reg-ex.png} +\cgalFigureBegin{figgenregex,gen-reg-ex.png} Comparison of general and regularized alpha-shape. Left: Some points are taken on the surface of a torus, three points being taken relatively far from the surface of the torus; Middle: The general alpha-shape (for a large enough alpha value) contains the singular triangle facet of the three isolated points; Right: The regularized version (for the same value of alpha) does not contains any singular facet. \cgalFigureEnd -The alpha shapes of a set of points +The alpha shapes of a set of points \f$ S\f$ form a discrete family, even though they are defined for all real numbers \f$ \alpha\f$. -The entire family of alpha shapes can be represented +The entire family of alpha shapes can be represented through the underlying triangulation of \f$ S\f$. In this representation each \f$ k\f$-simplex of the underlying triangulation is associated with an interval that specifies for which values of \f$ \alpha\f$ the \f$ k\f$-simplex @@ -95,23 +95,23 @@ easily. Furthermore, we can select the optimal value of \f$ \alpha\f$ to get an alpha shape including all data points and having less than a given number of connected components. Also, the alpha-values allows to define a filtration on the -faces of the triangulation of a set of points. +faces of the triangulation of a set of points. In this filtration, the faces of the triangulation are output -in increasing order of the alpha value -for which they appear +in increasing order of the alpha value +for which they appear in the alpha complex. In case of equal alpha values, lower dimensional faces are output first. The definition is analog in the case of weighted alpha shapes. The input set is now a set of weighted points (which can be regarded -as spheres) and the underlying triangulation +as spheres) and the underlying triangulation is the regular triangulation of this set. Two spheres, or two weighted points, with centers \f$ C_1, C_2\f$ -and radii \f$ r_1, r_2 \f$ are said to be orthogonal iff +and radii \f$ r_1, r_2 \f$ are said to be orthogonal iff \f$ C_1C_2 ^2 = r_1^2 + r_2^2\f$ and suborthogonal iff \f$ C_1C_2 ^2 < r_1^2 + r_2^2\f$. For a given value of \f$ \alpha\f$, -the weighted alpha complex is formed with the simplices of the +the weighted alpha complex is formed with the simplices of the regular triangulation triangulation such that there is a sphere orthogonal to the weighted points associated with the vertices of the simplex and suborthogonal to all the other @@ -127,7 +127,7 @@ The class `Alpha_shape_3` represents the whole family of alpha shapes for a given set of points. The class includes the underlying triangulation `Dt` of the set, and associates to each \f$ k\f$-face of this triangulation -an interval specifying +an interval specifying for which values of \f$ \alpha\f$ the face belongs to the alpha complex. The second template parameter, `ExactAlphaComparisonTag`, is a tag that, @@ -139,11 +139,11 @@ the \f$ \alpha\f$ values where the alpha shape changes. Additionally, the class has a filtration member function that, given an output iterator with `Object` -as value type, outputs the faces of the triangulation -according to the +as value type, outputs the faces of the triangulation +according to the order of apparition in the alpha complex when alpha increases. -Finally, it provides a function to determine +Finally, it provides a function to determine the smallest value \f$ \alpha\f$ such that the alpha shape satisfies the following two properties:
    @@ -157,7 +157,7 @@ points cannot be inserted or removed. \subsection AlphaShape_3DAlphaShapeForAFixedAlpha Alpha Shape for a Fixed Alpha -Given a value of alpha, the class `Fixed_alpha_shape_3
    ` represents one +Given a value of alpha, the class `Fixed_alpha_shape_3
    ` represents one alpha shape for a given set of points. The class includes the underlying triangulation `Dt` of the set, and associates to each \f$ k\f$-face of this triangulation @@ -168,7 +168,7 @@ points can be inserted or removed. Both classes provide member functions to classify for a (given) value of \f$ \alpha\f$ the different faces of the triangulation as -`EXTERIOR`, `SINGULAR`, `REGULAR` or +`EXTERIOR`, `SINGULAR`, `REGULAR` or `INTERIOR` with respect to the alpha shape. A \f$ k\f$-face on the boundary of the alpha complex is said to be: `REGULAR` if it is a subface of the alpha-complex which @@ -189,7 +189,7 @@ of its circumscribed circle is larger than alpha. The classes provide also output iterators to get for a given `alpha` value the vertices, edges, facets and cells of the different types -(`EXTERIOR`, `SINGULAR`, `REGULAR` or +(`EXTERIOR`, `SINGULAR`, `REGULAR` or `INTERIOR`). \subsection AlphaShape3DIO Input/Output @@ -237,7 +237,7 @@ The triangulation data structure of the triangulation has to be a model of the concept `TriangulationDataStructure_3`, and it must be parameterized with vertex and cell classes, which are model of the concepts `FixedAlphaShapeVertex_3` and `FixedAlphaShapeCell_3`. -The package provides models `Fixed_alpha_shape_vertex_base_3` +The package provides models `Fixed_alpha_shape_vertex_base_3` and `Fixed_alpha_shape_cell_base_3`, respectively. \subsection AlphaShape3D_ConceptAndModelsTDS Triangulation data structure @@ -266,7 +266,7 @@ represents only one alpha shape (for a fixed alpha). When using the same kernel, `Fixed_alpha_shape_3
    ` is a lighter version. It is thus naturally much more efficient when the alpha-shape is needed for a single given value of alpha. In addition, note that the class `Alpha_shape_3` -requires constructions (squared radius of simplices) while the +requires constructions (squared radius of simplices) while the class `Fixed_alpha_shape_3
    ` uses only predicates. This implies that a certified construction of one (several) alpha-shape, using the `Alpha_shape_3` requires a kernel @@ -278,13 +278,13 @@ two that supports incremental insertion and removal of points. We give the time spent while computing the alpha shape of a protein (considered as a set of weighted points) featuring 4251 atoms (using `gcc 4.3` under Linux with `-O3` -and `-DNDEBUG` flags, on a 2.27GHz Intel(R) Xeon(R) E5520 CPU): +and `-DNDEBUG` flags, on a 2.27GHz Intel(R) Xeon(R) E5520 CPU): Using `Exact_predicates_inexact_constructions_kernel`, building the regular triangulation requires 0.09s, then the class `Fixed_alpha_shape_3
    ` required 0.05s while the class `Alpha_shape_3` requires 0.35s if `ExactAlphaComparisonTag` is `Tag_false` (and 0.70s with `Tag_true`). Using `Exact_predicates_exact_constructions_kernel`, building -the regular triangulation requires 0.19s and then the class `Alpha_shape_3` +the regular triangulation requires 0.19s and then the class `Alpha_shape_3` requires 0.90s. \section Alpha_shapes_3Examples Examples @@ -350,6 +350,6 @@ results will suffer from round-off problems. \cgalExample{Alpha_shapes_3/ex_periodic_alpha_shapes_3.cpp} -*/ +*/ } /* namespace CGAL */ diff --git a/Alpha_shapes_3/include/CGAL/IO/Alpha_shape_3_VRML_2_ostream.h b/Alpha_shapes_3/include/CGAL/IO/Alpha_shape_3_VRML_2_ostream.h index b6b35831d81..2308b93b92d 100644 --- a/Alpha_shapes_3/include/CGAL/IO/Alpha_shape_3_VRML_2_ostream.h +++ b/Alpha_shapes_3/include/CGAL/IO/Alpha_shape_3_VRML_2_ostream.h @@ -1,9 +1,9 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); // @@ -74,7 +74,7 @@ operator<<(VRML_2_ostream& os, os << Indent << " "; for (int i=0; i<4; i++) if (i != (*Flist_it).second){ - os << V[(*Flist_it).first->vertex(i)]; + os << V[(*Flist_it).first->vertex(i)]; os << ", "; } if (Flist_it != Flist_end) diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 1f97d6e521b..23c068224b3 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -34,12 +34,12 @@ digraph example { \cgalHeading{Notations}
    -
    `G`
    A type that is a model of a graph concept.
    -
    `g`
    An object of type `G`.
    -
    `u`, `v`
    Objects of type `boost::graph_traits::%vertex_descriptor`.
    -
    `h`
    An object of type `boost::graph_traits::%halfedge_descriptor`.
    -
    `e`
    An object of type `boost::graph_traits::%edge_descriptor`.
    -
    `f`
    An object of type `boost::graph_traits::%face_descriptor`.
    +
    `G`
    A type that is a model of a graph concept.
    +
    `g`
    An object of type `G`.
    +
    `u`, `v`
    Objects of type `boost::graph_traits::%vertex_descriptor`.
    +
    `h`
    An object of type `boost::graph_traits::%halfedge_descriptor`.
    +
    `e`
    An object of type `boost::graph_traits::%edge_descriptor`.
    +
    `f`
    An object of type `boost::graph_traits::%face_descriptor`.
    \cgalHeading{%VertexListGraph} diff --git a/BGL/include/CGAL/boost/graph/properties.h b/BGL/include/CGAL/boost/graph/properties.h index 8fd55a00264..588ea76885e 100644 --- a/BGL/include/CGAL/boost/graph/properties.h +++ b/BGL/include/CGAL/boost/graph/properties.h @@ -5,7 +5,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Andreas Fabri, Fernando Cacciola @@ -90,7 +90,7 @@ using boost::face_external_index; namespace CGAL { namespace internal { - + template struct Index_accessor : boost::put_get_helper< std::size_t&, Index_accessor > diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index 6ed14a6590c..be2f523aaec 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -174,7 +174,7 @@ bool read_a_mesh(Polyhedron& p, const std::string& str) } template -std::vector t_data() +std::vector t_data() { std::vector vs; for(unsigned int i = 0; i < sizeof(data) / sizeof(data[0]); ++i) { @@ -258,7 +258,7 @@ struct Surface_fixture_1 { f1 = CGAL::is_border(halfedge(u, m),m) ? face(opposite(halfedge(u, m), m), m) : face(halfedge(u, m), m); assert(f1 != boost::graph_traits::null_face()); CGAL::Halfedge_around_face_iterator hafib, hafie; - for(boost::tie(hafib, hafie) = CGAL::halfedges_around_face(halfedge(f1, m), m); hafib != hafie; ++hafib) + for(boost::tie(hafib, hafie) = CGAL::halfedges_around_face(halfedge(f1, m), m); hafib != hafie; ++hafib) { if(! CGAL::is_border(opposite(*hafib, m), m)) f2 = face(opposite(*hafib, m), m); @@ -408,7 +408,7 @@ struct Surface_fixture_4 { h2 = *hb; ++found; } - } + } } } assert(found == 2); @@ -442,7 +442,7 @@ struct Surface_fixture_5 { } else if(get(pm, target(*hb,m)) == Point_3(2,-1,0)){ h2 = *hb; found++; - } + } } } assert(found == 2); @@ -461,9 +461,9 @@ struct Surface_fixture_6 { assert(CGAL::is_valid_polygon_mesh(m)); typename boost::graph_traits::halfedge_descriptor h; - + h1 = halfedge(*faces(m).first, m); - + h2 = next(next(h1,m),m); } @@ -480,7 +480,7 @@ struct Surface_fixture_7 { assert(is_reading_successful); assert(CGAL::is_valid_polygon_mesh(m)); - h = *(halfedges(m).first); + h = *(halfedges(m).first); } Graph m; @@ -512,9 +512,9 @@ struct Surface_fixture_8 { get(pm, target(*hb,m)) == Point_3(0,0,0)){ h3 = *hb; found++; - } + } } - + assert(found == 3); } diff --git a/Geomview/include/CGAL/IO/Geomview_stream.h b/Geomview/include/CGAL/IO/Geomview_stream.h index 118d368fa35..6aa44324fc4 100644 --- a/Geomview/include/CGAL/IO/Geomview_stream.h +++ b/Geomview/include/CGAL/IO/Geomview_stream.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997,1998,1999,2000,2001 +// Copyright (c) 1997,1998,1999,2000,2001 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Andreas Fabri, Sylvain Pion @@ -40,8 +40,8 @@ namespace CGAL { class CGAL_EXPORT Geomview_stream { public: Geomview_stream(const Bbox_3 &bbox = Bbox_3(0,0,0, 1,1,1), - const char *machine = nullptr, - const char *login = nullptr); + const char *machine = nullptr, + const char *login = nullptr); bool fail() const { return false; } bool good() const { return true; } @@ -90,62 +90,62 @@ public: double get_vertex_radius() const { - return radius; + return radius; } double set_vertex_radius(double r) { - std::swap(r, radius); - return r; + std::swap(r, radius); + return r; } int get_line_width() const { - return line_width; + return line_width; } int set_line_width(int w) { - std::swap(w, line_width); + std::swap(w, line_width); return w; } bool set_wired(bool b) { - std::swap(b, wired_flag); - return b; + std::swap(b, wired_flag); + return b; } bool get_wired() const { - return wired_flag; + return wired_flag; } bool set_echo(bool b) { - std::swap(b, echo_flag); - return b; + std::swap(b, echo_flag); + return b; } bool get_echo() const { - return echo_flag; + return echo_flag; } bool set_raw(bool b) { - std::swap(b, raw_flag); - return b; + std::swap(b, raw_flag); + return b; } bool get_raw() const { - return raw_flag; + return raw_flag; } bool set_trace(bool b) { - std::swap(b, trace_flag); - return b; + std::swap(b, trace_flag); + return b; } bool get_trace() const { - return trace_flag; + return trace_flag; } void trace(const std::string s) const @@ -171,27 +171,27 @@ public: bool set_binary_mode(bool b = true) { - std::swap(b, binary_flag); - return b; + std::swap(b, binary_flag); + return b; } bool set_ascii_mode(bool b = true) { - return !set_binary_mode(!b); + return !set_binary_mode(!b); } bool get_binary_mode() const { - return binary_flag; + return binary_flag; } bool get_ascii_mode() const { - return !binary_flag; + return !binary_flag; } std::string get_new_id(const std::string & s); const Bbox_3 & get_bbox() { - return bb; + return bb; } void pickplane() @@ -201,7 +201,7 @@ public: static char* nth(char* s, int count); static void parse_point(const char* pickpoint, - double &x, double &y, double &z, double &w); + double &x, double &y, double &z, double &w); private: void setup_geomview(const char *machine, const char *login); void frame(const Bbox_3 &bbox); @@ -228,9 +228,9 @@ output_point(Geomview_stream &gv, const FT &x, const FT &y, const FT &z) { bool ascii_bak = true; // the initialization value shuts up the compiler. if (!gv.get_raw()) { - ascii_bak = gv.set_ascii_mode(); - gv << "(geometry " << gv.get_new_id("P") - << " {appearance {linewidth 5 material {edgecolor " + ascii_bak = gv.set_ascii_mode(); + gv << "(geometry " << gv.get_new_id("P") + << " {appearance {linewidth 5 material {edgecolor " << gv.vcr() << gv.vcg() << gv.vcb() << "}}{SKEL 1 1 "; } @@ -238,7 +238,7 @@ output_point(Geomview_stream &gv, const FT &x, const FT &y, const FT &z) if (!gv.get_raw()) { gv << "1 0\n}})"; - gv.set_ascii_mode(ascii_bak); + gv.set_ascii_mode(ascii_bak); } } @@ -363,8 +363,8 @@ Geomview_stream::draw_triangles(InputIterator begin, InputIterator end) std::vector points; for (Tit i = triangles.begin(); i != triangles.end(); ++i) for (int j = 0; j < 3; ++j) - if (point_map.insert(typename Point_map::value_type(i->vertex(j), - points.size())).second) + if (point_map.insert(typename Point_map::value_type(i->vertex(j), + points.size())).second) points.push_back(i->vertex(j)); bool ascii_bak = get_ascii_mode(); @@ -383,8 +383,8 @@ Geomview_stream::draw_triangles(InputIterator begin, InputIterator end) // Triangles vertices indices. for (Tit tit = triangles.begin(); tit != triangles.end(); ++tit) { (*this) << 3; - for (int j = 0; j < 3; ++j) - (*this) << point_map[tit->vertex(j)]; + for (int j = 0; j < 3; ++j) + (*this) << point_map[tit->vertex(j)]; (*this) << 0; // without color. } // Footer. @@ -487,14 +487,14 @@ operator<<(Geomview_stream &gv, const Ray_2 &r) // Note: it won't work if double is not convertible to an RT... const Bbox_3 & bb = gv.get_bbox(); Object result = intersection(Iso_rectangle_2( - Point_2(bb.xmin(), bb.ymin()), - Point_2(bb.xmax(), bb.ymax())), r); + Point_2(bb.xmin(), bb.ymin()), + Point_2(bb.xmax(), bb.ymax())), r); Point_2 ipoint; Segment_2 iseg; if (assign(ipoint, result)) - gv << ipoint; + gv << ipoint; else if (assign(iseg, result)) - gv << iseg; + gv << iseg; return gv; } #endif @@ -509,14 +509,14 @@ operator<<(Geomview_stream &gv, const Line_2 &r) // Note: it won't work if double is not convertible to an RT... const Bbox_3 & bb = gv.get_bbox(); Object result = intersection(Iso_rectangle_2( - Point_2(bb.xmin(), bb.ymin()), - Point_2(bb.xmax(), bb.ymax())), r); + Point_2(bb.xmin(), bb.ymin()), + Point_2(bb.xmax(), bb.ymax())), r); Point_2 ipoint; Segment_2 iseg; if (assign(ipoint, result)) - gv << ipoint; + gv << ipoint; else if (assign(iseg, result)) - gv << iseg; + gv << iseg; return gv; } #endif @@ -563,7 +563,7 @@ Geomview_stream& operator>>(Geomview_stream &gv, Point_3 &point) { const char *gclpick = - "(pick world pickplane * nil nil nil nil nil nil nil)"; + "(pick world pickplane * nil nil nil nil nil nil nil)"; bool ascii_bak = gv.set_ascii_mode(); gv << "(pickable pickplane yes) (ui-target pickplane yes)" @@ -580,7 +580,7 @@ operator>>(Geomview_stream &gv, Point_3 &point) // we echo the input if (gv.get_echo()) - gv << point; + gv << point; // we are done and tell geomview to stop sending pick events gv << "(uninterest " << gclpick << ") (pickable pickplane no)"; diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 6c5d00c316b..c4509d7feca 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -340,7 +340,7 @@ namespace CGAL { std::ofstream output(filename); if (!output.is_open()) { return false; } - + return write_off(alcc, output); } diff --git a/Mesh_2/doc/Mesh_2/Mesh_2.txt b/Mesh_2/doc/Mesh_2/Mesh_2.txt index 3709fa6a895..fef716532ff 100644 --- a/Mesh_2/doc/Mesh_2/Mesh_2.txt +++ b/Mesh_2/doc/Mesh_2/Mesh_2.txt @@ -1,7 +1,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_2D_Conforming_Triangulations_and_Meshes \anchor userchapter2DMeshes \cgalAutoToc @@ -12,9 +12,9 @@ conforming triangulations and 2D meshes. Conforming triangulations will be described in Section \ref secMesh_2_conforming_triangulation and meshes in Section \ref secMesh_2_meshes. -\section secMesh_2_conforming_triangulation Conforming Triangulations +\section secMesh_2_conforming_triangulation Conforming Triangulations -\subsection secMesh_2_conforming_definitions Definitions +\subsection secMesh_2_conforming_definitions Definitions A triangulation is a Delaunay triangulation if the circumscribing circle of any facet of the triangulation contains no vertex in its @@ -46,18 +46,18 @@ triangulation by adding vertices, called Steiner vertices, on constrained edges until they are decomposed into subconstraints small enough to be Delaunay or Gabriel edges. -\subsection secMesh_2_building_conforming Building Conforming Triangulations +\subsection secMesh_2_building_conforming Building Conforming Triangulations Constrained Delaunay triangulations can be refined into -conforming triangulations by the two following global functions: +conforming triangulations by the two following global functions: \code{.cpp} -template +template void make_conforming_Delaunay_2 (CDT& t) \endcode \code{.cpp} -template +template void make_conforming_Gabriel_2 (CDT& t) \endcode @@ -86,7 +86,7 @@ triangulation and then into a conforming Gabriel triangulation. For additional control of the refinement algorithm, this class also provides separate functions to insert one Steiner point at a time. -\subsection secMesh_2_example_making_conforming Example: Making a Triangulation Conforming Delaunay and Then Conforming Gabriel +\subsection secMesh_2_example_making_conforming Example: Making a Triangulation Conforming Delaunay and Then Conforming Gabriel This example inserts several segments into a constrained Delaunay triangulation, makes it conforming Delaunay, and then conforming @@ -101,9 +101,9 @@ See \cgalFigureRef{Conformexampleconform} From left to right: Initial Delaunay triangulation, the corresponding conforming Delaunay, and the corresponding Gabriel triangulation. \cgalFigureEnd -\section secMesh_2_meshes Meshes +\section secMesh_2_meshes Meshes -\subsection secMesh_2_meshes_definition Definitions +\subsection secMesh_2_meshes_definition Definitions A mesh is a partition of a given region into simplices whose shapes and sizes satisfy several criteria. @@ -121,10 +121,10 @@ boundary or internals constraints. The segments of the Pslg cover the boundary of the domain. The Pslg divides the plane into several connected components. By -default, the domain is the union of the bounded connected components. +default, the domain is the union of the bounded connected components. See \cgalFigureRef{Domain} for an example of a domain -defined without using seed points, and a possible mesh of it. +defined without using seed points, and a possible mesh of it. \cgalFigureBegin{Domain,domain-domain-mesh.png} A domain defined without seed points and the generated mesh. @@ -137,7 +137,7 @@ seed points mark components to be meshed or they mark components not to be meshed (holes). See -\cgalFigureRef{Domainseeds} for another domain defined with the same Pslg and two seed points used to define holes. +\cgalFigureRef{Domainseeds} for another domain defined with the same Pslg and two seed points used to define holes. In the corresponding mesh these two holes are triangulated but not meshed. @@ -146,7 +146,7 @@ two holes are triangulated but not meshed. A domain with two seeds points defining holes and the generated mesh. \cgalFigureEnd -\subsection secMesh_2_criteria Shape and Size Criteria +\subsection secMesh_2_criteria Shape and Size Criteria The shape criterion for triangles is a lower bound \f$ B\f$ on the ratio between the circumradius and the shortest edge length. Such a bound @@ -193,7 +193,7 @@ satisfy size and shape criteria except for the small input angles. In addition, the algorithm may succeed in producing meshes with a lower angle bound greater than \f$ 20.7\f$ degrees, but there is no such guarantee. -\subsection secMesh_2_building_meshes Building Meshes +\subsection secMesh_2_building_meshes Building Meshes Meshes are obtained from constrained Delaunay triangulations by calling the global function : @@ -217,14 +217,14 @@ defines criteria that the triangles have to satisfy. \cgal provides two models for this concept:
    • `Delaunay_mesh_criteria_2`, that defines a shape criterion -that bounds the minimum angle of triangles, +that bounds the minimum angle of triangles,
    • `Delaunay_mesh_size_criteria_2`, that adds to the previous criterion a bound on the maximum edge length.
    If the function `refine_Delaunay_mesh_2()` is called several times on the -same triangulation with different criteria, the algorithm rebuilds the -internal data structure used for meshing at every call. In order to avoid +same triangulation with different criteria, the algorithm rebuilds the +internal data structure used for meshing at every call. In order to avoid rebuild the data structure at every call, the advanced user can use the class `Delaunay_mesher_2`. This class provides also step by step functions. Those functions insert one vertex at a time. @@ -243,8 +243,8 @@ function of the face type (see the concept `DelaunayMeshFaceBase_2`). \subsection secMesh_2_optimization Optimization of Meshes with Lloyd -The package also provides a global function that runs Lloyd optimization iterations on the -mesh generated by Delaunay refinement. The goal of this mesh optimization is to +The package also provides a global function that runs Lloyd optimization iterations on the +mesh generated by Delaunay refinement. The goal of this mesh optimization is to improve the angles inside the mesh, and make them as close as possible to 60 degrees. \code{.cpp} @@ -257,7 +257,7 @@ Note that this global function has more parameters (see details in reference pag This optimization process alternates relocating vertices to the center of mass of their Voronoi cells, and updating the Delaunay connectivity of the triangulation. -The center of mass is computed with respect to a sizing function that was designed to +The center of mass is computed with respect to a sizing function that was designed to preserve the local density of points in the mesh generated by Delaunay refinement. See Figure \cgalFigureRef{Lloydfigure} for a mesh generated by `refine_Delaunay_mesh_2()` and optimized @@ -270,7 +270,7 @@ shows the histogram of angles inside these meshes. \cgalFigureEnd \cgalFigureBegin{LloydHistogramfigure,lloyd-histograms.png} -Histograms of angles inside the mesh after Delaunay refinement, and after 10 and 100 iterations +Histograms of angles inside the mesh after Delaunay refinement, and after 10 and 100 iterations of Lloyd optimization. After Delaunay refinement, angles are in the interval [28.5; 121.9] degrees. After 10 iterations of Lloyd optimization, they are in [29.1; 110.8]. 100 iterations take them to [29.3; 109.9]. @@ -316,11 +316,11 @@ faces is used to count them. \subsubsection Mesh_2ExampleLloyd Example Using the Lloyd optimizer -This example uses the global function `lloyd_optimize_mesh_2()`. +This example uses the global function `lloyd_optimize_mesh_2()`. The mesh is generated using the function `refine_Delaunay_mesh_2()` of `CGAL::Delaunay_mesher_2`, -and is then optimized using `lloyd_optimize_mesh_2()`. The optimization will stop +and is then optimized using `lloyd_optimize_mesh_2()`. The optimization will stop after 10 (set by `max_iteration_number`) iterations of alternating vertex relocations -and Delaunay connectivity updates. More termination conditions can be used and are detailed +and Delaunay connectivity updates. More termination conditions can be used and are detailed in the Reference Manual. @@ -330,6 +330,6 @@ in the Reference Manual. \section secMesh_2_IO Input/Output It is possible to export the result of a meshing in VTU, using the function `write_vtu()`. For more information about this format, see \ref IOStreamVTK. -*/ +*/ } /* namespace CGAL */ diff --git a/Mesh_2/include/CGAL/IO/write_vtu.h b/Mesh_2/include/CGAL/IO/write_vtu.h index 318779386ce..33d06f89b91 100644 --- a/Mesh_2/include/CGAL/IO/write_vtu.h +++ b/Mesh_2/include/CGAL/IO/write_vtu.h @@ -27,14 +27,14 @@ //todo try to factorize with functors namespace CGAL{ // writes the appended data into the .vtu file -template +template void -write_vector(std::ostream& os, - const std::vector& vect) +write_vector(std::ostream& os, + const std::vector& vect) { const char* buffer = reinterpret_cast(&(vect[0])); std::size_t size = vect.size()*sizeof(FT); - + os.write(reinterpret_cast(&size), sizeof(std::size_t)); // number of bytes encoded os.write(buffer, vect.size()*sizeof(FT)); // encoded data } @@ -42,7 +42,7 @@ write_vector(std::ostream& os, // writes the cells tags before binary data is appended template -void +void write_cells_tag_2(std::ostream& os, const CDT & tr, std::size_t number_of_triangles, @@ -64,18 +64,18 @@ write_cells_tag_2(std::ostream& os, os << " \n" << " \n"; // 3 indices (size_t) per triangle + length of the encoded data (size_t) - offset += (3 * number_of_triangles + 1) * sizeof(std::size_t); + offset += (3 * number_of_triangles + 1) * sizeof(std::size_t); // 2 indices (size_t) per edge (size_t) offset += (2 * std::distance(tr.constrained_edges_begin(), - tr.constrained_edges_end())) * sizeof(std::size_t); + tr.constrained_edges_end())) * sizeof(std::size_t); } else { - os << "\">\n"; - for(typename CDT::Finite_faces_iterator + os << "\">\n"; + for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin(), end = tr.finite_faces_end(); fit != end; ++fit) @@ -89,11 +89,11 @@ write_cells_tag_2(std::ostream& os, } os << " \n"; } - + // Write offsets os << " \n"; offset += (number_of_triangles +std::distance(tr.constrained_edges_begin(), @@ -102,9 +102,9 @@ write_cells_tag_2(std::ostream& os, // 1 offset (size_t) per cell + length of the encoded data (size_t) } else { - os << "\">\n"; + os << "\">\n"; std::size_t cells_offset = 0; - for(typename CDT::Finite_faces_iterator fit = + for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin() ; fit != tr.finite_faces_end() ; ++fit ) @@ -114,7 +114,7 @@ write_cells_tag_2(std::ostream& os, cells_offset += 3; os << cells_offset << " "; } - } + } os << " \n"; } @@ -126,13 +126,13 @@ write_cells_tag_2(std::ostream& os, os << " offset=\"" << offset << "\"/>\n"; offset += number_of_triangles + std::distance(tr.constrained_edges_begin(), - tr.constrained_edges_end()) + tr.constrained_edges_end()) + sizeof(std::size_t); // 1 unsigned char per cell + length of the encoded data (size_t) } else { - os << "\">\n"; - for(typename CDT::Finite_faces_iterator fit = + os << "\">\n"; + for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin() ; fit != tr.finite_faces_end() ; ++fit ) @@ -147,7 +147,7 @@ write_cells_tag_2(std::ostream& os, os << " \n"; } -// writes the cells appended data at the end of the .vtu file +// writes the cells appended data at the end of the .vtu file template void write_cells_2(std::ostream& os, @@ -160,9 +160,9 @@ write_cells_2(std::ostream& os, std::vector cell_type(number_of_triangles,5); // triangles == 5 cell_type.resize(cell_type.size() + std::distance(tr.constrained_edges_begin(), tr.constrained_edges_end()), 3); // line == 3 - + std::size_t off = 0; - for(typename CDT::Finite_faces_iterator + for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin(), end = tr.finite_faces_end(); fit != end; ++fit) @@ -197,7 +197,7 @@ write_cells_2(std::ostream& os, // writes the points tags before binary data is appended template -void +void write_cdt_points_tag(std::ostream& os, const Tr & tr, std::map & V, @@ -218,12 +218,12 @@ write_cdt_points_tag(std::ostream& os, << format; if (binary) { - os << "\" offset=\"" << offset << "\"/>\n"; + os << "\" offset=\"" << offset << "\"/>\n"; offset += 3 * tr.number_of_vertices() * sizeof(FT) + sizeof(std::size_t); // dim coords per points + length of the encoded data (size_t) } else { - os << "\">\n"; + os << "\">\n"; for( Finite_vertices_iterator vit = tr.finite_vertices_begin(); vit != tr.finite_vertices_end(); ++vit) @@ -231,7 +231,7 @@ write_cdt_points_tag(std::ostream& os, V[vit] = inum++; os << vit->point()[0] << " "; os << vit->point()[1] << " "; - if(dim == 3) + if(dim == 3) os << vit->point()[2] << " "; else os << 0.0 << " "; @@ -241,7 +241,7 @@ write_cdt_points_tag(std::ostream& os, os << " \n"; } -// writes the points appended data at the end of the .vtu file +// writes the points appended data at the end of the .vtu file template void write_cdt_points(std::ostream& os, @@ -270,37 +270,37 @@ write_cdt_points(std::ostream& os, // writes the attribute tags before binary data is appended template -void +void write_attribute_tag_2 (std::ostream& os, - const std::string& attr_name, - const std::vector& attribute, - bool binary, - std::size_t& offset) + const std::string& attr_name, + const std::vector& attribute, + bool binary, + std::size_t& offset) { std::string format = binary ? "appended" : "ascii"; std::string type = (sizeof(T) == 8) ? "Float64" : "Float32"; - os << " \n"; + os << "\" offset=\"" << offset << "\"/>\n"; offset += attribute.size() * sizeof(T) + sizeof(std::size_t); } else { typedef typename std::vector::const_iterator Iterator; - os << "\">\n"; + os << "\">\n"; for (Iterator it = attribute.begin(); - it != attribute.end(); - ++it ) + it != attribute.end(); + ++it ) os << *it << " "; os << " \n"; } } -// writes the attributes appended data at the end of the .vtu file +// writes the attributes appended data at the end of the .vtu file template void write_attributes_2(std::ostream& os, - const std::vector& att) + const std::vector& att) { IO::internal::write_vector(os,att); } @@ -321,7 +321,7 @@ void write_vtu_with_attributes(std::ostream& os, #else // CGAL_BIG_ENDIAN os << " byte_order=\"BigEndian\""; #endif - + switch(sizeof(std::size_t)) { case 4: os << " header_type=\"UInt32\""; break; case 8: os << " header_type=\"UInt64\""; break; @@ -329,16 +329,16 @@ void write_vtu_with_attributes(std::ostream& os, } os << ">\n" << " " << "\n"; - + int number_of_triangles = 0; - for(typename CDT::Finite_faces_iterator + for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin(), end = tr.finite_faces_end(); fit != end; ++fit) { if(fit->is_in_domain()) ++number_of_triangles; } - os << " \n"; std::size_t offset = 0; const bool binary = (mode == IO::BINARY); @@ -356,7 +356,7 @@ void write_vtu_with_attributes(std::ostream& os, os << " \n" << " \n"; if (binary) { - os << "\n_"; + os << "\n_"; write_cdt_points(os,tr,V); // write points before cells to fill the std::map V write_cells_2(os,tr, number_of_triangles, V); for(std::size_t i = 0; i< attributes.size(); ++i) diff --git a/Mesh_3/include/CGAL/IO/File_maya.h b/Mesh_3/include/CGAL/IO/File_maya.h index a0730fa7ee1..228e7648bf8 100644 --- a/Mesh_3/include/CGAL/IO/File_maya.h +++ b/Mesh_3/include/CGAL/IO/File_maya.h @@ -27,8 +27,8 @@ namespace CGAL { template void -output_to_maya(std::ostream& os, - const C3T3& c3t3, +output_to_maya(std::ostream& os, + const C3T3& c3t3, bool surfaceOnly = true) { typedef typename C3T3::Triangulation Tr; @@ -44,7 +44,7 @@ output_to_maya(std::ostream& os, #ifdef CGAL_MESH_3_IO_VERBOSE std::cerr << "Output to maya:\n"; #endif - + const Tr& tr = c3t3.triangulation(); //------------------------------------------------------- @@ -75,13 +75,13 @@ output_to_maya(std::ostream& os, os << " setAttr \".cuvs\" -type \"string\" \"map1\";" << std::endl; os << " setAttr \".dcol\" yes;" << std::endl; os << " setAttr \".dcc\" -type \"string\" \"Ambient+Diffuse\";" << std::endl; - + os << " connectAttr \"" << name << "Shape.iog\" \":initialShadingGroup.dsm\" -na;\n\n"; - + //------------------------------------------------------- // Colors //------------------------------------------------------ - + /*os << " setAttr \".ccls\" -type \"string\" \"colorSet\";\n"; os << " setAttr \".clst[0].clsn\" -type \"string\" \"colorSet\";\n"; os << " setAttr \".clst[0].rprt\" 3;\n"; @@ -90,11 +90,11 @@ output_to_maya(std::ostream& os, os << " 100 250 50" << std::endl; os << " 0 200 200" << std::endl; os << " ;\n";*/ - + //------------------------------------------------------- // Vertices //------------------------------------------------------ - + boost::unordered_map V; std::stringstream vertices_sstr; int num_vertices = 0; @@ -110,7 +110,7 @@ output_to_maya(std::ostream& os, vertices_sstr << " " << CGAL::to_double(p.x()) << " " << CGAL::to_double(p.y()) << " " << CGAL::to_double(p.z()) << std::endl; } } - + os << " setAttr -s " << num_vertices << " \".vt[0:" << num_vertices-1 << "]\"" << std::endl; os << vertices_sstr.str(); os << ";\n"; @@ -134,7 +134,7 @@ output_to_maya(std::ostream& os, //------------------------------------------------------- typename C3T3::size_type number_of_triangles = c3t3.number_of_facets_in_complex(); - + std::stringstream facets_sstr; //std::stringstream normals_sstr; @@ -147,7 +147,7 @@ output_to_maya(std::ostream& os, // Surface only if (surfaceOnly) { - facets_sstr << " setAttr -s " << number_of_triangles + facets_sstr << " setAttr -s " << number_of_triangles << " \".fc[0:" << number_of_triangles-1 << "]\" -type \"polyFaces\" \n"; int c = 0; for( Facet_iterator fit = c3t3.facets_in_complex_begin(); @@ -163,9 +163,9 @@ output_to_maya(std::ostream& os, indices[j] = V[vh]; //points[j] = tr.point(fit->first, i); } - + // Reverse triangle orientation? - bool reverse_triangle = + bool reverse_triangle = (fit->second % 2 == 0 && !c3t3.is_in_complex(fit->first)) || (fit->second % 2 != 0 && c3t3.is_in_complex(fit->first)); if (reverse_triangle) @@ -194,7 +194,7 @@ output_to_maya(std::ostream& os, // ith edge of triangle facets_sstr << pos << " "; } - + // 1 triangles facets_sstr << std::endl; // Colors @@ -204,7 +204,7 @@ output_to_maya(std::ostream& os, // Tetrahedra = 4 facets for each else { - facets_sstr << " setAttr -s " << 4*c3t3.number_of_cells_in_complex() + facets_sstr << " setAttr -s " << 4*c3t3.number_of_cells_in_complex() << " \".fc[0:" << 4*c3t3.number_of_cells_in_complex()-1 << "]\" -type \"polyFaces\" \n"; int c = 0; for( Cell_iterator cit = c3t3.cells_in_complex_begin(); @@ -222,7 +222,7 @@ output_to_maya(std::ostream& os, indices[j] = V[vh]; //points[j] = tr.point(cit, i); } - + // Reverse triangle orientation? bool reverse_triangle = (facet_i % 2 != 0 && c3t3.is_in_complex(cit, facet_i)); if (reverse_triangle) @@ -251,7 +251,7 @@ output_to_maya(std::ostream& os, // ith edge of triangle facets_sstr << pos << " "; } - + // 1 triangles facets_sstr << std::endl; // Colors @@ -261,30 +261,30 @@ output_to_maya(std::ostream& os, } facets_sstr << ";\n\n"; //normals_sstr << ";\n\n"; - + //------------------------------------------------------- // Edges //------------------------------------------------------- - os << " setAttr -s " << edges.size() << " \".ed[0:" + os << " setAttr -s " << edges.size() << " \".ed[0:" << edges.size() - 1 << "]\"" << std::endl; for (EdgeList::const_iterator it = edges.begin(), it_end = edges.end() ; it != it_end ; ++it) os << " " << it->first << " " << it->second << " " << 0 << std::endl; os << ";\n"; - + //------------------------------------------------------- // Normals //------------------------------------------------------- - + //os << normals_sstr.str(); //------------------------------------------------------- // Facets //------------------------------------------------------- - + os << facets_sstr.str(); - + //------------------------------------------------------- // Tetrahedra //------------------------------------------------------- diff --git a/Mesh_3/include/CGAL/IO/File_medit.h b/Mesh_3/include/CGAL/IO/File_medit.h index 41d6bb991e2..81afaedf5dd 100644 --- a/Mesh_3/include/CGAL/IO/File_medit.h +++ b/Mesh_3/include/CGAL/IO/File_medit.h @@ -126,13 +126,13 @@ private: else return -1; } - + private: const C3T3& r_c3t3_; Subdomain_map subdomain_map_; }; - -// Accessor + +// Accessor template int get(const Rebind_cell_pmap& cmap, @@ -146,7 +146,7 @@ unsigned int get_size(const Rebind_cell_pmap& cmap) { return cmap.subdomain_number(); } - + // ----------------------------------- // No_rebind_cell_pmap @@ -157,21 +157,21 @@ class No_rebind_cell_pmap typedef typename C3T3::Subdomain_index Subdomain_index; typedef typename C3T3::Cell_handle Cell_handle; typedef unsigned int size_type; - + public: No_rebind_cell_pmap(const C3T3& c3t3) : r_c3t3_(c3t3) {} - + int subdomain_index(const Cell_handle& ch) const { return static_cast(r_c3t3_.subdomain_index(ch)); } - + size_type subdomain_number() const { typedef typename C3T3::Cells_in_complex_iterator Cell_iterator; std::set subdomain_set; - + for( Cell_iterator cell_it = r_c3t3_.cells_in_complex_begin(); cell_it != r_c3t3_.cells_in_complex_end(); ++cell_it) @@ -179,15 +179,15 @@ public: // Add subdomain index in set subdomain_set.insert(subdomain_index(cell_it)); } - + return subdomain_set.size(); } - + private: const C3T3& r_c3t3_; }; - -// Accessor + +// Accessor template int get(const No_rebind_cell_pmap& cmap, @@ -195,8 +195,8 @@ get(const No_rebind_cell_pmap& cmap, { return cmap.subdomain_index(ch); } - - + + // ----------------------------------- // Rebind_facet_pmap // ----------------------------------- @@ -207,17 +207,17 @@ class Rebind_facet_pmap typedef std::map Surface_map; typedef typename C3T3::Facet Facet; typedef unsigned int size_type; - + public: Rebind_facet_pmap(const C3T3& c3t3, const Cell_pmap& cell_pmap) : r_c3t3_(c3t3) , cell_pmap_(cell_pmap) { typedef typename C3T3::Facets_in_complex_iterator Facet_iterator; - + int first_index = 1; int index_counter = first_index; - + for( Facet_iterator facet_it = r_c3t3_.facets_in_complex_begin(); facet_it != r_c3t3_.facets_in_complex_end(); ++facet_it) @@ -229,11 +229,11 @@ public: if(is_insert_successful.second) ++index_counter; } - + // Find cell_pmap_ unused indices typedef typename C3T3::Cells_in_complex_iterator Cell_iterator; std::set cell_label_set; - + for( Cell_iterator cell_it = r_c3t3_.cells_in_complex_begin(); cell_it != r_c3t3_.cells_in_complex_end(); ++cell_it) @@ -241,7 +241,7 @@ public: // Add subdomain index in set cell_label_set.insert(get(cell_pmap_, cell_it)); } - + // Rebind indices index_counter = get_first_unused_label(cell_label_set,first_index); for ( typename Surface_map::iterator mit = surface_map_.begin() ; @@ -251,11 +251,11 @@ public: mit->second = index_counter++; index_counter = get_first_unused_label(cell_label_set,index_counter); } - + #ifdef CGAL_MESH_3_IO_VERBOSE std::cerr << "Nb of surface patches: " << surface_map_.size() << "\n"; std::cerr << "Surface mapping:\n\t" ; - + typedef typename Surface_map::iterator Surface_map_iterator; for ( Surface_map_iterator surf_it = surface_map_.begin() ; surf_it != surface_map_.end() ; @@ -267,17 +267,17 @@ public: std::cerr << "\n"; #endif } - + int surface_index(const Facet& f) const { return surface_index(r_c3t3_.surface_patch_index(f)); } - + size_type surface_number() const { return surface_map_.size(); } - + private: int surface_index(const Surface_patch_index& index) const { @@ -288,23 +288,23 @@ private: else return -1; } - + int get_first_unused_label(const std::set& label_set, int search_start) const { while ( label_set.end() != label_set.find(search_start) ) ++search_start; - + return search_start; } - + private: const C3T3& r_c3t3_; const Cell_pmap& cell_pmap_; Surface_map surface_map_; }; - + // Accessors template int @@ -313,7 +313,7 @@ get(const Rebind_facet_pmap& fmap, { return fmap.surface_index(f); } - + template unsigned int get_size(const Rebind_facet_pmap& fmap, @@ -322,7 +322,7 @@ get_size(const Rebind_facet_pmap& fmap, return fmap.surface_number(f); } - + // ----------------------------------- // No_rebind_facet_pmap // ----------------------------------- @@ -332,7 +332,7 @@ class No_rebind_facet_pmap typedef typename C3T3::Surface_patch_index Surface_patch_index; typedef typename C3T3::Facet Facet; typedef unsigned int size_type; - + public: No_rebind_facet_pmap(const C3T3& c3t3, const Cell_pmap& /*cell_pmap*/) : r_c3t3_(c3t3) {} @@ -341,7 +341,7 @@ public: { return static_cast(r_c3t3_.surface_patch_index(f)); } - + private: const C3T3& r_c3t3_; }; @@ -365,16 +365,16 @@ class No_rebind_facet_pmap_first typedef typename C3T3::Surface_patch_index Surface_patch_index; typedef typename C3T3::Facet Facet; typedef unsigned int size_type; - + public: No_rebind_facet_pmap_first(const C3T3& c3t3, const Cell_pmap& /*cell_pmap*/) : r_c3t3_(c3t3) {} - + int surface_index(const Facet& f) const { return static_cast(r_c3t3_.surface_patch_index(f).first); } - + private: const C3T3& r_c3t3_; }; @@ -388,8 +388,8 @@ get(const No_rebind_facet_pmap_first& fmap, { return fmap.surface_index(f); } - - + + // ----------------------------------- // No_rebind_facet_pmap_second // ----------------------------------- @@ -399,16 +399,16 @@ class No_rebind_facet_pmap_second typedef typename C3T3::Surface_patch_index Surface_patch_index; typedef typename C3T3::Facet Facet; typedef unsigned int size_type; - + public: No_rebind_facet_pmap_second(const C3T3& c3t3, const Cell_pmap& /*cell_pmap*/) : r_c3t3_(c3t3) {} - + int surface_index(const Facet& f) const { return static_cast(r_c3t3_.surface_patch_index(f).second); } - + private: const C3T3& r_c3t3_; }; @@ -422,9 +422,9 @@ get(const No_rebind_facet_pmap_second& fmap, { return fmap.surface_index(f); } - - - + + + // ----------------------------------- // No_patch_facet_pmap_first // ----------------------------------- @@ -434,32 +434,32 @@ class No_patch_facet_pmap_first typedef typename C3T3::Surface_patch_index Surface_patch_index; typedef typename C3T3::Facet Facet; typedef typename C3T3::Cell_handle Cell_handle; - + public: No_patch_facet_pmap_first(const C3T3&, const Cell_pmap& cell_pmap) : cell_pmap_(cell_pmap) { } - + int surface_index(const Facet& f) const { Cell_handle c1 = f.first; Cell_handle c2 = c1->neighbor(f.second); - + int label1 = get(cell_pmap_,c1); int label2 = get(cell_pmap_,c2); - + if ( 0 == label1 || -1 == label1 ) label1 = label2; if ( 0 == label2 || -1 == label2 ) label2 = label1; - + return (std::min)(label1,label2); } - + private: const Cell_pmap& cell_pmap_; }; -// Accessors +// Accessors template int get(const No_patch_facet_pmap_first& fmap, @@ -477,32 +477,32 @@ class No_patch_facet_pmap_second typedef typename C3T3::Surface_patch_index Surface_patch_index; typedef typename C3T3::Facet Facet; typedef typename C3T3::Cell_handle Cell_handle; - + public: No_patch_facet_pmap_second(const C3T3&, const Cell_pmap& cell_pmap) : cell_pmap_(cell_pmap) { } - + int surface_index(const Facet& f) const { Cell_handle c1 = f.first; Cell_handle c2 = c1->neighbor(f.second); - + int label1 = get(cell_pmap_,c1); int label2 = get(cell_pmap_,c2); - + if ( 0 == label1 || -1 == label1 ) label1 = label2; if ( 0 == label2 || -1 == label2 ) label2 = label1; - + return (std::max)(label1,label2); } - + private: const Cell_pmap& cell_pmap_; }; -// Accessors +// Accessors template int get(const No_patch_facet_pmap_second& fmap, @@ -510,11 +510,11 @@ get(const No_patch_facet_pmap_second& fmap, { return fmap.surface_index(f); } - - + + // ----------------------------------- // Default_vertex_index_pmap -// ----------------------------------- +// ----------------------------------- template class Default_vertex_pmap { @@ -611,26 +611,26 @@ get(const Default_vertex_pmap& vmap, // ----------------------------------- // Null pmap -// ----------------------------------- +// ----------------------------------- template struct Null_facet_pmap { Null_facet_pmap(const C3T3&, const Cell_pmap&) {} }; - + template int get(const Null_facet_pmap&, const typename C3T3::Facet&) { return 0; } - + template struct Null_vertex_pmap { Null_vertex_pmap(const C3T3&, const Cell_pmap&, const Facet_pmap&) {} }; - + template int get(const Null_vertex_pmap&, const typename C3T3::Vertex_handle&) @@ -645,7 +645,7 @@ int get(const Null_vertex_pmap&, template struct Medit_pmap_generator{}; - + template struct Medit_pmap_generator { @@ -653,11 +653,11 @@ struct Medit_pmap_generator typedef Rebind_facet_pmap Facet_pmap; typedef Null_facet_pmap Facet_pmap_twice; typedef Default_vertex_pmap Vertex_pmap; - + bool print_twice() { return false; } }; - - + + template struct Medit_pmap_generator { @@ -665,7 +665,7 @@ struct Medit_pmap_generator typedef No_patch_facet_pmap_first Facet_pmap; typedef No_patch_facet_pmap_second Facet_pmap_twice; typedef Default_vertex_pmap Vertex_pmap; - + bool print_twice() { return true; } }; @@ -677,10 +677,10 @@ struct Medit_pmap_generator typedef No_patch_facet_pmap_first Facet_pmap; typedef No_patch_facet_pmap_second Facet_pmap_twice; typedef Default_vertex_pmap Vertex_pmap; - + bool print_twice() { return true; } }; - + template struct Medit_pmap_generator { @@ -688,17 +688,17 @@ struct Medit_pmap_generator typedef Rebind_facet_pmap Facet_pmap; typedef Null_facet_pmap Facet_pmap_twice; typedef Null_vertex_pmap Vertex_pmap; - + bool print_twice() { return false; } }; - + //------------------------------------------------------- // IO functions //------------------------------------------------------- - + template void output_to_medit(std::ostream& os, @@ -707,18 +707,18 @@ output_to_medit(std::ostream& os, #ifdef CGAL_MESH_3_IO_VERBOSE std::cerr << "Output to medit:\n"; #endif - + typedef Medit_pmap_generator Generator; typedef typename Generator::Cell_pmap Cell_pmap; typedef typename Generator::Facet_pmap Facet_pmap; typedef typename Generator::Facet_pmap_twice Facet_pmap_twice; typedef typename Generator::Vertex_pmap Vertex_pmap; - + Cell_pmap cell_pmap(c3t3); Facet_pmap facet_pmap(c3t3,cell_pmap); Facet_pmap_twice facet_pmap_twice(c3t3,cell_pmap); Vertex_pmap vertex_pmap(c3t3,cell_pmap,facet_pmap); - + output_to_medit(os, c3t3, vertex_pmap, @@ -726,14 +726,14 @@ output_to_medit(std::ostream& os, cell_pmap, facet_pmap_twice, Generator().print_twice()); - + #ifdef CGAL_MESH_3_IO_VERBOSE std::cerr << "done.\n"; #endif } - + template subdomain_index() > f.first->neighbor(f.second)->subdomain_index()) f = tr.mirror_facet(f); } - + // Get facet vertices in CCW order. Vertex_handle vh1 = f.first->vertex((f.second + 1) % 4); Vertex_handle vh2 = f.first->vertex((f.second + 2) % 4); Vertex_handle vh3 = f.first->vertex((f.second + 3) % 4); - + // Facet orientation also depends on parity. if (f.second % 2 != 0) std::swap(vh2, vh3); - - os << V[vh1] << ' ' << V[vh2] << ' ' << V[vh3] << ' '; + + os << V[vh1] << ' ' << V[vh2] << ' ' << V[vh3] << ' '; os << get(facet_pmap, *fit) << '\n'; - + // Print triangle again if needed, with opposite orientation if ( print_each_facet_twice ) { - os << V[vh3] << ' ' << V[vh2] << ' ' << V[vh1] << ' '; + os << V[vh3] << ' ' << V[vh2] << ' ' << V[vh1] << ' '; os << get(facet_twice_pmap, *fit) << '\n'; } } diff --git a/Mesh_3/include/CGAL/IO/output_to_vtu.h b/Mesh_3/include/CGAL/IO/output_to_vtu.h index ea9fefd1edb..a6041c49f69 100644 --- a/Mesh_3/include/CGAL/IO/output_to_vtu.h +++ b/Mesh_3/include/CGAL/IO/output_to_vtu.h @@ -30,7 +30,7 @@ namespace CGAL{ template -void +void write_cells_tag(std::ostream& os, const C3T3 & c3t3, std::map & V, @@ -52,7 +52,7 @@ write_cells_tag(std::ostream& os, os << " \n" << " \n"; offset += (4 * c3t3.number_of_cells() + 1) * sizeof(std::size_t); @@ -69,11 +69,11 @@ write_cells_tag(std::ostream& os, } os << "\n \n"; } - + // Write offsets os << " \n"; offset += (c3t3.number_of_cells() + 1) * sizeof(std::size_t); @@ -83,12 +83,12 @@ write_cells_tag(std::ostream& os, os << ">\n"; std::size_t cells_offset = 0; for( Cell_iterator cit = c3t3.cells_in_complex_begin() ; - cit != c3t3.cells_in_complex_end() ; - ++cit ) + cit != c3t3.cells_in_complex_end() ; + ++cit ) { - cells_offset += 4; - os << cells_offset << " "; - } + cells_offset += 4; + os << cells_offset << " "; + } os << "\n \n"; } @@ -104,8 +104,8 @@ write_cells_tag(std::ostream& os, else { os << ">\n"; for( Cell_iterator cit = c3t3.cells_in_complex_begin() ; - cit != c3t3.cells_in_complex_end() ; - ++cit ) + cit != c3t3.cells_in_complex_end() ; + ++cit ) os << "10 "; os << "\n \n"; } @@ -131,7 +131,7 @@ write_cells(std::ostream& os, off += 4; offsets.push_back(off); for (int i=0; i<4; i++) - connectivity_table.push_back(V[cit->vertex(i)]); + connectivity_table.push_back(V[cit->vertex(i)]); } IO::internal::write_vector(os,connectivity_table); @@ -141,7 +141,7 @@ write_cells(std::ostream& os, template -void +void write_c3t3_points_tag(std::ostream& os, const Tr & tr, std::size_t size_of_vertices, @@ -163,12 +163,12 @@ write_c3t3_points_tag(std::ostream& os, << format; if (binary) { - os << "\" offset=\"" << offset << "\"/>\n"; + os << "\" offset=\"" << offset << "\"/>\n"; offset += 3 * size_of_vertices * sizeof(FT) + sizeof(std::size_t); // dim coords per points + length of the encoded data (size_t) } else { - os << "\">\n"; + os << "\">\n"; for( Finite_vertices_iterator vit = tr.finite_vertices_begin(); vit != tr.finite_vertices_end(); ++vit) @@ -187,7 +187,7 @@ write_c3t3_points_tag(std::ostream& os, os << " \n"; } -// writes the points appended data at the end of the .vtu file +// writes the points appended data at the end of the .vtu file template void write_c3t3_points(std::ostream& os, @@ -217,12 +217,12 @@ write_c3t3_points(std::ostream& os, // writes the attribute tags before binary data is appended template -void +void write_attribute_tag(std::ostream& os, - const std::string& attr_name, - const std::vector& attribute, - bool binary, - std::size_t& offset) + const std::string& attr_name, + const std::vector& attribute, + bool binary, + std::size_t& offset) { std::string format = binary ? "appended" : "ascii"; std::string type = ""; @@ -239,28 +239,28 @@ write_attribute_tag(std::ostream& os, else type = "UInt64"; } - os << " \n"; + os << "\" offset=\"" << offset << "\"/>\n"; offset += attribute.size() * sizeof(T) + sizeof(std::size_t); } else { typedef typename std::vector::const_iterator Iterator; - os << "\">\n"; + os << "\">\n"; for (Iterator it = attribute.begin(); - it != attribute.end(); - ++it ) + it != attribute.end(); + ++it ) os << *it << " "; os << "\n \n"; } } -// writes the attributes appended data at the end of the .vtu file +// writes the attributes appended data at the end of the .vtu file template void write_attributes(std::ostream& os, - const std::vector& att) + const std::vector& att) { IO::internal::write_vector(os,att); } @@ -292,7 +292,7 @@ void output_to_vtu_with_attributes(std::ostream& os, #else // CGAL_BIG_ENDIAN os << " byte_order=\"BigEndian\""; #endif - + switch(sizeof(std::size_t)) { case 4: os << " header_type=\"UInt32\""; break; case 8: os << " header_type=\"UInt64\""; break; @@ -328,7 +328,7 @@ void output_to_vtu_with_attributes(std::ostream& os, os << " \n" << " \n"; if (binary) { - os << "\n_"; + os << "\n_"; write_c3t3_points(os,tr,V); // fills V if the mode is BINARY write_cells(os,c3t3,V); for(std::size_t i = 0; i< attributes.size(); ++i) @@ -364,7 +364,7 @@ void output_to_vtu(std::ostream& os, double v = cit->subdomain_index(); mids.push_back(v); } - + std::vector > atts; Vtu_attributes v = &mids; atts.push_back(std::make_pair("MeshDomain", v)); diff --git a/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt b/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt index e91e9808702..1d8a90ca53c 100644 --- a/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt +++ b/Point_set_processing_3/doc/Point_set_processing_3/Point_set_processing_3.txt @@ -1,7 +1,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_Point_Set_Processing \anchor chappoint_set_processing_3 @@ -22,12 +22,12 @@ Point set processing. Left: 275K points sampled on the statue of an elephant wit In the context of surface reconstruction we can position the elements of this component along the common surface reconstruction pipeline (\cgalFigureRef{Point_set_processing_3figpipeline}) which involves the -following steps: +following steps: -# Scanning and scan registration to produce a set of points or points with normals; -# Outlier removal; --# Simplification to reduce the number of input points; --# Smoothing to reduce noise in the input data; +-# Simplification to reduce the number of input points; +-# Smoothing to reduce noise in the input data; -# Normal estimation and orientation when the normals are not already provided by the acquisition device; and -# Surface reconstruction. Chapter \ref Chapter_Poisson_Surface_Reconstruction "Poisson Surface Reconstruction" @@ -84,9 +84,9 @@ The following classes described in Chapter \ref PkgPropertyMap provide property maps for the implementations of points with normals listed above: -- `Identity_property_map` -- `First_of_pair_property_map` and `Second_of_pair_property_map` -- `Nth_of_tuple_property_map` +- `Identity_property_map` +- `First_of_pair_property_map` and `Second_of_pair_property_map` +- `Nth_of_tuple_property_map` `Identity_property_map` is the default value of the position property map expected by all functions in this component. @@ -96,7 +96,7 @@ See below examples using pair and tuple property maps. Users of this package may use other types to represent positions and normals if they implement the corresponding property maps. -Points and normals can even be stored in separate containers +Points and normals can even be stored in separate containers and accessed by their index, as any built-in vector is also a property map. @@ -128,7 +128,7 @@ parameters (than can be deduced automatically in simple cases) are moved to the end of the function in a single named parameter object (see \ref BGLNamedParameters). The code translated to the current API becomes: - + \code std::vector points; @@ -297,7 +297,7 @@ The 4 functions presented here work both with 2D points and 3D points and they shouldn't be used if the point sets do not sample a curve in 2D or a surface in 3D. -\subsection Point_set_processing_3Example_scale_estimation_global Global Scale Example +\subsection Point_set_processing_3Example_scale_estimation_global Global Scale Example The following example reads a 3D point set in the `xyz` format and: @@ -340,7 +340,7 @@ one point set w.r.t. another and directly aligns it to it. \subsection Point_set_processing_3Examples_registration_OpenGR OpenGR Example -The following example reads two point sets and aligns them using the +The following example reads two point sets and aligns them using the \ref thirdpartyOpenGR library, using the Super4PCS algorithm: \cgalExample{Point_set_processing_3/registration_with_OpenGR.cpp} @@ -389,7 +389,7 @@ defined by the parameter delta (accuracy). Using too wide values will slow down the algorithm by increasing the size of the congruent set, while using to small values prevents to find a solution. This parameter impacts other steps of -the algorithm, see the paper \cgalCite{cgal:mam-sffgp-14} for more details. +the algorithm, see the paper \cgalCite{cgal:mam-sffgp-14} for more details. \subsubsection Point_set_processing_3Examples_registration_OpenGR_parameter_normal Parameter: maximum normal deviation @@ -402,7 +402,7 @@ candidates that should indeed have been matched and may thus result in a quality \subsubsection Point_set_processing_3Examples_registration_OpenGR_parameter_overlap Parameter: overlap -Ratio of expected overlap between the two point sets: it is ranging between 0 (no overlap) to 1 (100% overlap). +Ratio of expected overlap between the two point sets: it is ranging between 0 (no overlap) to 1 (100% overlap). The overlap parameter controls the size of the basis used for registration, as shown below: @@ -411,7 +411,7 @@ The effect of varying overlap parameter on the size of the basis used for regist \cgalFigureEnd Usually, the larger the overlap, the faster the algorithm. -When the overlap is unknown, a simple way to set this parameter is to start from +When the overlap is unknown, a simple way to set this parameter is to start from 100% overlap, and decrease the value until obtaining a good result. Using too small values will slow down the algorithm, and reduce the accuracy of the result. @@ -424,7 +424,7 @@ randomly, it is recommended to use a large time value to explore the whole space \subsection Point_set_processing_3Examples_registration_PointMatcher PointMatcher Example -The following example reads two point sets and aligns them using the +The following example reads two point sets and aligns them using the \ref thirdpartylibpointmatcher library, using the ICP algorithm. It also shows how to customize ICP algorithm by using possible configurations: \cgalExample{Point_set_processing_3/registration_with_pointmatcher.cpp} @@ -463,7 +463,7 @@ The method used for matching (linking) the points from to the points in the refe Corresponds to `matcher` configuration module of \ref thirdpartylibpointmatcher library. The matcher should be chosen and set from possible components of -the `matcher` configuration module. +the `matcher` configuration module. See libpointmatcher documentation for possible configurations. @@ -478,7 +478,7 @@ range. Corresponds to `outlierFilters` configuration module of \ref thirdpartylibpointmatcher library. The filters should be chosen and set from possible components of -the `outlierFilters` configuration module. +the `outlierFilters` configuration module. See libpointmatcher documentation for possible configurations. @@ -489,7 +489,7 @@ the error between the point sets. Corresponds to `errorMinimizer` configuration module of \ref thirdpartylibpointmatcher library. The error minimizer should be chosen and set from possible components of -the `errorMinimizer` configuration module. +the `errorMinimizer` configuration module. See libpointmatcher documentation for possible configurations. @@ -500,7 +500,7 @@ typically provide deeper scrutiny than the logger. Corresponds to `inspector` configuration module of \ref thirdpartylibpointmatcher library. The inspector should be chosen and set from possible components of -the `inspector` configuration module. +the `inspector` configuration module. See libpointmatcher documentation for possible configurations. @@ -512,7 +512,7 @@ does not get effected by this configuration. Corresponds to `logger` configuration module of \ref thirdpartylibpointmatcher library. The logger should be chosen and set from possible components of -the `logger` configuration module. +the `logger` configuration module. See libpointmatcher documentation for possible configurations. @@ -526,7 +526,7 @@ The following example reads two point sets and aligns them by using both \ref thirdpartyOpenGR and \ref thirdpartylibpointmatcher libraries, respectively. It depicts a use case where a coarse estimation of a registration transformation is done using the Super4PCS algorithm. Then, a fine registration from this coarse -registration using the ICP algorithm. +registration using the ICP algorithm. \cgalExample{Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp} \cgalFigureRef{Point_set_processing_3tableRegistrationRegistration_visualization_table} demonstrates @@ -603,7 +603,7 @@ above-mentioned example was used. \cgalFigureCaptionBegin{Point_set_processing_3tableRegistrationRegistration_visualization_table} Visualization of registered hippo scans with different registration methods. Two scans are used: red as the reference, green as the one for which the transformation -is computed and applied. To obtain the results, the example code given in +is computed and applied. To obtain the results, the example code given in \ref Point_set_processing_3Examples_registration_OpenGR , \ref Point_set_processing_3Examples_registration_PointMatcher , \ref Point_set_processing_3Examples_registration_OpenGR_PointMatcher_Pipeline @@ -681,7 +681,7 @@ simplification of the point set through local clusters directly selected by the user or it automatically adapts to the local variation of the point set. -Function `wlop_simplify_and_regularize_point_set()` not only simplifies, +Function `wlop_simplify_and_regularize_point_set()` not only simplifies, but also regularizes downsampled points. This is an implementation of the Weighted Locally Optimal Projection (WLOP) algorithm \cgalCite{wlop-2009}. @@ -743,7 +743,7 @@ Computing density weights for each point is an optional preprocessing. For examp \cgalFigureBegin{Point_set_processing_3figWLOP_parameter_density, WLOP_parameter_density.jpg} -Comparison between with and without density: Left: input. Middle: `require_uniform_sampling = false`. Right: `require_uniform_sampling=true`. +Comparison between with and without density: Left: input. Middle: `require_uniform_sampling = false`. Right: `require_uniform_sampling=true`. \cgalFigureEnd \subsubsection Point_set_processing_3WLOP_parameter_neighborhood_size Parameter: neighbor_radius @@ -754,14 +754,14 @@ Comparison between different sizes of neighbor radius. \cgalFigureEnd \subsubsection Point_set_processing_3WLOP_parallel_performance Parallel Performance -A parallel version of WLOP is provided and requires the executable to be linked against the +A parallel version of WLOP is provided and requires the executable to be linked against the Intel TBB library. To control the number of threads used, the user may use the tbb::task_scheduler_init class. -See the TBB documentation +See the TBB documentation for more details. We provide below a speed-up chart generated using the parallel version of the WLOP algorithm. The machine used is a PC running Windows 7 64-bits with a 4-core i7-4700HQ@2.40GHz CPU with 8GB of RAM. \cgalFigureBegin{Point_set_processing_3figWLOP_parallel_performance, parallel_WLOP_performance.jpg} -Parallel WLOP speed-up, compared to the sequential version of the algorithm. +Parallel WLOP speed-up, compared to the sequential version of the algorithm. \cgalFigureEnd @@ -771,11 +771,11 @@ Two smoothing functions are devised to smooth an input point set. Function `jet_smooth_point_set()` smooths the input point set by projecting each point onto a smooth parametric surface patch -(so-called jet surface) fitted over its nearest neighbors. +(so-called jet surface) fitted over its nearest neighbors. Function `bilateral_smooth_point_set()` smooths the input point set by iteratively projecting each point onto the implicit surface patch fitted over its nearest neighbors. -Bilateral projection preserves sharp features according to the normal (gradient) information. +Bilateral projection preserves sharp features according to the normal (gradient) information. Normals are thus required as input. For more details, see section 4 of \cgalCite{ear-2013}. For both functions, the user can either specify a fixed number of @@ -783,7 +783,7 @@ nearest neighbors or a fixed spherical neighborhood radius. \subsection Point_set_processing_3Example_jet_smoothing Jet Smoothing Example -The following example generates a set of 9 points close to the `xy` +The following example generates a set of 9 points close to the `xy` plane and smooths them using 8 nearest neighbors: \cgalExample{Point_set_processing_3/jet_smoothing_example.cpp} @@ -798,14 +798,14 @@ Comparison for two smoothing methods: Left: Input, 250K points, normal-color map \subsubsection Point_set_processing_3Bilateral_smoothing_parallel_performance Parallel -Performance: -A parallel version of bilateral smoothing is provided and requires the executable to be linked against the +Performance: +A parallel version of bilateral smoothing is provided and requires the executable to be linked against the Intel TBB library. The number of threads used is controlled through the tbb::task_scheduler_init class. See the TBB documentation for more details. We provide below a speed-up chart generated using the parallel version of the bilateral smoothing algorithm. The machine used is a PC running Windows 7 64-bits with a 4-core i7-4700HQ@2.40GHz CPU with 8GB of RAM. \cgalFigureBegin{Point_set_processing_3Bilateral_smoothing_parallel_performance, parallel_bilateral_smooth_point_set_performance.jpg} -Parallel bilateral smoothing speed-up, compared to the sequential version of the algorithm. +Parallel bilateral smoothing speed-up, compared to the sequential version of the algorithm. \cgalFigureEnd \section Point_set_processing_3NormalEstimation Normal Estimation @@ -837,9 +837,9 @@ of nearest neighbors or a fixed spherical neighborhood radius. Function `mst_orient_normals()` orients the normals of a set of points with unoriented normals using the method described by Hoppe et -al. in Surface reconstruction from unorganized points \cgalCite{cgal:hddms-srup-92}. +al. in Surface reconstruction from unorganized points \cgalCite{cgal:hddms-srup-92}. More specifically, this method constructs a -Riemannian graph over the input points (the graph of the +Riemannian graph over the input points (the graph of the nearest neighbor points) and propagates a seed normal orientation within a minimum spanning tree computed over this graph. The result is an oriented normal vector for each input unoriented normal, except for @@ -873,7 +873,7 @@ The following example reads a point set from a file, upsamples it to get a dense \subsubsection Point_set_processing_3Upsample_Parameter1 Parameter: edge_sensitivity This parameter controls where the new points are inserted. Larger values of edge-sensitivity give higher priority to inserting points along the sharp features. -For example, as shown in the following figure, high value is preferable when one wants to insert more points on sharp features, where the local gradient is high, e.g., darts, cusps, creases and corners. In contrast, points are evenly inserted when edge_sensitivity is set to 0. The range of possible value is [0, 1]. +For example, as shown in the following figure, high value is preferable when one wants to insert more points on sharp features, where the local gradient is high, e.g., darts, cusps, creases and corners. In contrast, points are evenly inserted when edge_sensitivity is set to 0. The range of possible value is [0, 1]. \cgalFigureBegin{Point_set_processing_3figUpsample_edge_sensitivity, upsample_edge_sensitivity.jpg} @@ -884,14 +884,14 @@ Upsampling for different edge-sensitivity parameter values. The input containing This parameter controls the preservation of sharp features. \cgalFigureBegin{Point_set_processing_3figUpsample_sharpness_angle, upsample_sharpness_angle.jpg} -Upsampling for different sharpness_angle parameter values. The input containing 850 points is upsampled to 425K points in all cases depicted. +Upsampling for different sharpness_angle parameter values. The input containing 850 points is upsampled to 425K points in all cases depicted. \cgalFigureEnd \subsubsection Point_set_processing_3upsample_neighborhood_size Parameter: neighbor_radius Usually, the neighborhood of sample points should include at least one ring of neighboring sample points. Using small neighborhood size may not be able to insert new points. Using big neighborhood size can fill small holes, but points inserted on the edges could be irregular. The function will use a neighborhood size estimation if this parameter value is set to default or smaller than zero. \cgalFigureBegin{Point_set_processing_3figupsample_neighborhood_size, upsample_neighborhood_size.jpg} -Comparison between different sizes of neighbor radius. +Comparison between different sizes of neighbor radius. \cgalFigureEnd \section Point_set_processing_3FeaturesEstimation Feature Edges Estimation @@ -915,7 +915,7 @@ points that are on sharp edges: The function `structure_point_set()` generates a structured version of the input point set assigned to a set of planes. Such an input can be -produced by a shape detection algorithm (see \ref PkgShapeDetectionRef). +produced by a shape detection algorithm (see \ref PkgShapeDetectionRef). Point set structuring is based on the article \cgalCite{cgal:la-srpss-13}. - __Planes__: inliers of each detected plane are replaced by sets of @@ -995,5 +995,5 @@ Started from GSoC'2019, Necip Fazil Yildiran with the help of Nicolas Mellado an libraries that perform registration on two point sets. -*/ +*/ } /* namespace CGAL */ diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index 427e1490b3b..ef0a9dfc361 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -414,7 +414,7 @@ compute_face_face_intersection(const FaceRange& face_range1, CGAL::Bbox_3 b1 = CGAL::Polygon_mesh_processing::bbox(tm1, np1), b2 = CGAL::Polygon_mesh_processing::bbox(tm2, np2); - + if(!CGAL::do_overlap(b1, b2)) { return out; @@ -643,7 +643,7 @@ compute_face_polylines_intersection(const FaceRange& face_range, using parameters::get_parameter; CGAL_precondition(CGAL::is_triangle_mesh(tm)); - + CGAL::Bbox_3 b1,b2; b1 = CGAL::Polygon_mesh_processing::bbox(tm, np); for(std::size_t i =0; i< polyline_range.size(); ++i) @@ -651,10 +651,10 @@ compute_face_polylines_intersection(const FaceRange& face_range, b2 += CGAL::bbox_3(polyline_range[i].begin(), polyline_range[i].end()); } - + if(!CGAL::do_overlap(b1,b2)) return out; - + typedef TriangleMesh TM; typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename GetVertexPointMap::const_type VertexPointMap; diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp index 940d7283ec2..09953e4f292 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp @@ -6,10 +6,10 @@ #ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; +typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; #elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; +typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #endif @@ -20,17 +20,17 @@ typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; -typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; +typedef CGAL::Surface_mesh Surface_mesh; // Point with normal, and plane index -typedef boost::tuple PNI; -typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; -typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; -typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; +typedef boost::tuple PNI; +typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; +typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; +typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; /* * The following example shows how to control the model complexity by diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp index 4b1d9e28582..3a77feeba8f 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp @@ -6,10 +6,10 @@ #ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; +typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; #elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; +typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #endif @@ -20,17 +20,17 @@ typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; -typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; +typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; +typedef CGAL::Surface_mesh Surface_mesh; // Point with normal, and plane index -typedef boost::tuple PNI; -typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; -typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; -typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; +typedef boost::tuple PNI; +typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; +typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; +typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; /* * The following example shows the reconstruction using user-provided diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp index 5e4f2ee4363..4478e2e9cd4 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp @@ -14,7 +14,7 @@ typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; #elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; +typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #endif @@ -23,19 +23,19 @@ typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; +typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; // Point with normal, and plane index. typedef boost::tuple PNI; typedef std::vector Point_vector; -typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; -typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; -typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; +typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; +typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; +typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; typedef CGAL::Shape_detection::Point_set:: Sphere_neighbor_query Neighbor_query; @@ -44,8 +44,8 @@ Least_squares_plane_fit_region Regi typedef CGAL::Shape_detection:: Region_growing Region_growing; -typedef CGAL::Surface_mesh Surface_mesh; -typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; +typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; class Index_map { diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp index e17845a9478..c2a4c11066d 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp @@ -8,12 +8,12 @@ #ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; +typedef CGAL::SCIP_mixed_integer_program_traits MIP_Solver; #elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand #include -typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; +typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #endif @@ -25,26 +25,26 @@ typedef CGAL::GLPK_mixed_integer_program_traits MIP_Solver; #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; +typedef Kernel::Point_3 Point; +typedef Kernel::Vector_3 Vector; // Point with normal, and plane index -typedef boost::tuple PNI; -typedef std::vector Point_vector; -typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; -typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; -typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; +typedef boost::tuple PNI; +typedef std::vector Point_vector; +typedef CGAL::Nth_of_tuple_property_map<0, PNI> Point_map; +typedef CGAL::Nth_of_tuple_property_map<1, PNI> Normal_map; +typedef CGAL::Nth_of_tuple_property_map<2, PNI> Plane_index_map; typedef CGAL::Shape_detection::Efficient_RANSAC_traits Traits; typedef CGAL::Shape_detection::Efficient_RANSAC Efficient_ransac; -typedef CGAL::Shape_detection::Plane Plane; +typedef CGAL::Shape_detection::Plane Plane; typedef CGAL::Shape_detection::Point_to_shape_index_map Point_to_shape_index_map; -typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; -typedef CGAL::Surface_mesh Surface_mesh; +typedef CGAL::Polygonal_surface_reconstruction Polygonal_surface_reconstruction; +typedef CGAL::Surface_mesh Surface_mesh; /* * This example first extracts planes from the input point cloud diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp index 2ebcbe87edc..9388fa0f5f2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp @@ -30,9 +30,9 @@ class Polyhedron_demo_ply_plugin : public: bool isDefaultLoader(const CGAL::Three::Scene_item *item) const override - { - if(qobject_cast(item)) - return true; + { + if(qobject_cast(item)) + return true; return false; } QString name() const override{ return "ply_plugin"; } @@ -66,7 +66,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { ok = false; return QList(); } - + // Test if input is mesh or point set bool input_is_mesh = false; std::string line; @@ -101,7 +101,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { // First try mesh SMesh *surface_mesh = new SMesh(); std::string comments; - + if (CGAL::read_PLY(in, *surface_mesh, comments)) { Scene_surface_mesh_item* sm_item = new Scene_surface_mesh_item(surface_mesh); @@ -191,13 +191,13 @@ save(QFileInfo fileinfo,QList& items) if (!ok) return false; - + std::ofstream out(fileinfo.filePath().toUtf8().data(), std::ios::binary); if (choice == tr("Binary")) CGAL::set_binary_mode(out); else out.precision (std::numeric_limits::digits10 + 2); - + // This plugin supports point sets const Scene_points_with_normal_item* point_set_item = qobject_cast(item); @@ -233,7 +233,7 @@ save(QFileInfo fileinfo,QList& items) items.pop_front(); return res; } - + // This plugin supports textured surface meshes const Scene_textured_surface_mesh_item* stm_item = qobject_cast(item); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp index efe6a5089a6..285edb1fcad 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp @@ -71,7 +71,7 @@ #include typedef Scene_surface_mesh_item Scene_facegraph_item; typedef Scene_facegraph_item::Face_graph FaceGraph; -typedef boost::property_traits::type>::value_type Point; @@ -206,8 +206,8 @@ public: return (qobject_cast(item) || qobject_cast(item)); } - - + + bool save(QFileInfo fileinfo,QList& items) { Scene_item* item = items.front(); @@ -219,7 +219,7 @@ public: const Scene_facegraph_item* poly_item = qobject_cast(item); - + if (poly_item) { if (extension != "vtp") @@ -250,11 +250,11 @@ public: qobject_cast(item); if(!c3t3_item || extension != "vtu") return false; - + std::ofstream os(output_filename.data()); os << std::setprecision(16); const C3t3& c3t3 = c3t3_item->c3t3(); - + CGAL::output_to_vtu(os, c3t3); } items.pop_front(); @@ -286,7 +286,7 @@ public: CGAL::Three::Three::scene()->addItem(item); return QList()< data; vtkSmartPointer obs = vtkSmartPointer::New(); @@ -351,7 +351,7 @@ public: { group = new Scene_group_item(fileinfo.baseName()); } - + if(is_polygon_mesh) { FaceGraph* poly = new FaceGraph(); @@ -373,7 +373,7 @@ public: } } } - + if (is_c3t3) { typedef boost::array Facet; // 3 = id @@ -421,7 +421,7 @@ public: } } CGAL::build_triangulation(c3t3_item->c3t3().triangulation(), points, finite_cells, border_facets); - + for( C3t3::Triangulation::Finite_cells_iterator cit = c3t3_item->c3t3().triangulation().finite_cells_begin(); cit != c3t3_item->c3t3().triangulation().finite_cells_end(); @@ -437,7 +437,7 @@ public: } } } - + //if there is no facet in the complex, we add the border facets. if(c3t3_item->c3t3().number_of_facets_in_complex() == 0) { @@ -447,10 +447,10 @@ public: ++fit) { typedef C3t3::Triangulation::Cell_handle Cell_handle; - + Cell_handle c = fit->first; Cell_handle nc = c->neighbor(fit->second); - + // By definition, Subdomain_index() is supposed to be the id of the exterior if(c->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index() && nc->subdomain_index() == C3t3::Triangulation::Cell::Subdomain_index()) @@ -476,7 +476,7 @@ public: return QList()< > segments; @@ -498,14 +498,14 @@ public: return QList()<addItem(group); return QList()< positions_poly; @@ -104,7 +104,7 @@ struct Scene_polygon_soup_item_priv{ bool is_triangle, is_quad, stats_computed; double minl, maxl, meanl, midl, mini, maxi, ave; std::size_t nb_null_edges, nb_degen_faces; - + Scene_polygon_soup_item* item; }; @@ -120,7 +120,7 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol { const CGAL::qglviewer::Vec off = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); EPICK::Vector_3 offset(off.x,off.y,off.z); - + //Computes the normal of the facet Traits::Vector_3 normal = CGAL::NULL_VECTOR; @@ -135,7 +135,7 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol } if (normal == CGAL::NULL_VECTOR) // No normal could be computed, return return; - + typedef FacetTriangulator FT; std::size_t it = 0; @@ -310,7 +310,7 @@ Scene_polygon_soup_item_priv::compute_normals_and_vertices() const{ positions_nm_lines.push_back(b.y()+offset.y); positions_nm_lines.push_back(b.z()+offset.z); } - + } @@ -333,7 +333,7 @@ Scene_polygon_soup_item::~Scene_polygon_soup_item() delete d; } -Scene_polygon_soup_item* +Scene_polygon_soup_item* Scene_polygon_soup_item::clone() const { Scene_polygon_soup_item* new_soup = new Scene_polygon_soup_item(); new_soup->d->soup = d->soup->clone(); @@ -419,7 +419,7 @@ void Scene_polygon_soup_item::inside_out() invalidateOpenGLBuffers(); } -bool +bool Scene_polygon_soup_item::orient() { @@ -457,7 +457,7 @@ Scene_polygon_soup_item::orient() } -bool +bool Scene_polygon_soup_item::save(std::ostream& out) const { @@ -506,7 +506,7 @@ Scene_polygon_soup_item::exportAsSurfaceMesh(SMesh *out_surface_mesh) } return false; } -QString +QString Scene_polygon_soup_item::toolTip() const { @@ -542,10 +542,10 @@ Scene_polygon_soup_item::draw(CGAL::Three::Viewer_interface* viewer) const { computeElements(); initializeBuffers(viewer); } - + if(renderingMode() == Flat || renderingMode() == FlatPlusEdges) { - + if(d->soup->fcolors.empty()) getTriangleContainer(Priv::Flat_facets)->setColor(this->color()); getTriangleContainer(Priv::Flat_facets)->draw(viewer, d->soup->fcolors.empty()); @@ -560,7 +560,7 @@ Scene_polygon_soup_item::draw(CGAL::Three::Viewer_interface* viewer) const { void Scene_polygon_soup_item::drawPoints(CGAL::Three::Viewer_interface* viewer) const { - + if(d->soup == 0) return; if(!isInit(viewer)) initGL(viewer); @@ -639,7 +639,7 @@ void Scene_polygon_soup_item::compute_bbox() const { bbox.xmax(),bbox.ymax(),bbox.zmax())); } -void +void Scene_polygon_soup_item::new_vertex(const double& x, const double& y, const double& z) @@ -647,8 +647,8 @@ Scene_polygon_soup_item::new_vertex(const double& x, d->soup->points.push_back(Point_3(x, y, z)); } - -void + +void Scene_polygon_soup_item::new_triangle(const std::size_t i, const std::size_t j, const std::size_t k) @@ -694,7 +694,7 @@ void Scene_polygon_soup_item::load(const std::vector& points, const std:: d->soup->fcolors.reserve (fcolors.size()); std::copy (fcolors.begin(), fcolors.end(), std::back_inserter (d->soup->fcolors)); - + d->soup->vcolors.reserve (vcolors.size()); std::copy (vcolors.begin(), vcolors.end(), std::back_inserter (d->soup->vcolors)); } @@ -732,7 +732,7 @@ void Scene_polygon_soup_item::itemAboutToBeDestroyed(Scene_item *item) } } -const Polygon_soup::Edges& +const Polygon_soup::Edges& Scene_polygon_soup_item::non_manifold_edges() const { return d->soup->non_manifold_edges; @@ -742,19 +742,19 @@ void Scene_polygon_soup_item::initializeBuffers(Viewer_interface *v) const { getTriangleContainer(Priv::Flat_facets)->initializeBuffers(v); getTriangleContainer(Priv::Flat_facets)->setFlatDataSize(d->nb_polys); - + getTriangleContainer(Priv::Smooth_facets)->initializeBuffers(v); getTriangleContainer(Priv::Smooth_facets)->setFlatDataSize(d->nb_polys); - + getEdgeContainer(Priv::Edges)->initializeBuffers(v); getEdgeContainer(Priv::Edges)->setFlatDataSize(d->nb_lines); - + getEdgeContainer(Priv::NM_edges)->initializeBuffers(v); getEdgeContainer(Priv::NM_edges)->setFlatDataSize(d->nb_nm_edges); - + getPointContainer(0)->initializeBuffers(v); getPointContainer(0)->setFlatDataSize(d->nb_lines); - + d->normals.resize(0); d->positions_poly.resize(0); d->normals.shrink_to_fit(); @@ -768,15 +768,15 @@ void Scene_polygon_soup_item::initializeBuffers(Viewer_interface *v) const } void Scene_polygon_soup_item::computeElements() const -{ +{ QApplication::setOverrideCursor(Qt::WaitCursor); d->compute_normals_and_vertices(); - + getTriangleContainer(Priv::Flat_facets)->allocate( Tc::Flat_vertices, d->positions_poly.data(), static_cast(d->positions_poly.size()*sizeof(float))); - + getTriangleContainer(Priv::Flat_facets)->allocate( Tc::Flat_normals, d->normals.data(), @@ -792,12 +792,12 @@ void Scene_polygon_soup_item::computeElements() const Tc::Flat_vertices, d->positions_poly.data(), static_cast(d->positions_poly.size()*sizeof(float))); - + getTriangleContainer(Priv::Smooth_facets)->allocate( Tc::Flat_normals, d->normals.data(), static_cast(d->normals.size()*sizeof(float))); - + if(!d->v_colors.empty()) { getTriangleContainer(Priv::Smooth_facets)->allocate( @@ -805,28 +805,28 @@ void Scene_polygon_soup_item::computeElements() const d->v_colors.data(), static_cast(d->v_colors.size()*sizeof(float))); } - + d->nb_polys = d->positions_poly.size(); - + getEdgeContainer(Priv::Edges)->allocate( Ec::Vertices, d->positions_lines.data(), static_cast(d->positions_lines.size()*sizeof(float))); - + getPointContainer(0)->allocate( Pc::Vertices, d->positions_lines.data(), static_cast(d->positions_lines.size()*sizeof(float))); - - + + getEdgeContainer(Priv::NM_edges)->allocate( Ec::Vertices, d->positions_nm_lines.data(), static_cast(d->positions_nm_lines.size()*sizeof(float))); - + d->nb_nm_edges = d->positions_nm_lines.size(); d->nb_lines = d->positions_lines.size(); - + setBuffersFilled(true); QApplication::restoreOverrideCursor(); } @@ -858,19 +858,19 @@ CGAL::Three::Scene_item::Header_data Scene_polygon_soup_item::header() const //titles data.titles.append(QString("#Points")); - + data.titles.append(QString("#Polygons")); data.titles.append(QString("Pure Triangle")); data.titles.append(QString("Pure Quad")); data.titles.append(QString("#Degenerate Polygons")); - + data.titles.append(QString("#Edges")); data.titles.append(QString("Minimum Length")); data.titles.append(QString("Maximum Length")); data.titles.append(QString("Median Length")); data.titles.append(QString("Mean Length")); data.titles.append(QString("#Degenerate Edges")); - + data.titles.append(QString("Minimum")); data.titles.append(QString("Maximum")); data.titles.append(QString("Average")); @@ -881,7 +881,7 @@ QString Scene_polygon_soup_item::computeStats(int type) { if(!d->stats_computed) d->compute_stats(); - + switch(type) { case NB_VERTICES: @@ -890,7 +890,7 @@ QString Scene_polygon_soup_item::computeStats(int type) return QString::number(d->soup->polygons.size()); case NB_EDGES: return QString::number(d->nb_lines/6); - + case NB_DEGENERATED_FACES: { if(d->is_triangle) @@ -900,7 +900,7 @@ QString Scene_polygon_soup_item::computeStats(int type) else return QString("n/a"); } - + case MIN_LENGTH: return QString::number(d->minl); case MAX_LENGTH: @@ -911,14 +911,14 @@ QString Scene_polygon_soup_item::computeStats(int type) return QString::number(d->meanl); case NB_NULL_LENGTH: return QString::number(d->nb_null_edges); - + case MIN_ANGLE: return QString::number(d->mini); case MAX_ANGLE: return QString::number(d->maxi); case MEAN_ANGLE: return QString::number(d->ave); - + case IS_PURE_TRIANGLE: if(d->is_triangle) return QString("yes"); @@ -961,8 +961,8 @@ Scene_polygon_soup_item_priv::compute_stats() accumulator_set< double, features< tag::min, tag::max, tag::mean > > angles_acc; double rad_to_deg = 180. / CGAL_PI; - - + + for(auto poly : soup->polygons) { if(poly.size() != 3) @@ -974,7 +974,7 @@ Scene_polygon_soup_item_priv::compute_stats() Polygon_soup::Point_3 a(soup->points[poly[i]]), b(soup->points[poly[(i+1)%poly.size()]]), c(soup->points[poly[(i+2)%poly.size()]]); - if (a == b) + if (a == b) ++nb_null_edges; edges_acc(CGAL::sqrt(CGAL::squared_distance(a, b))); typename Traits::Vector_3 ba(b, a); @@ -994,6 +994,6 @@ Scene_polygon_soup_item_priv::compute_stats() mini = extract_result< tag::min >(angles_acc); maxi = extract_result< tag::max >(angles_acc); ave = extract_result< tag::mean >(angles_acc); - + stats_computed = true; } diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index a976eb2dfd8..728cfd81aa7 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -151,7 +151,7 @@ struct Scene_surface_mesh_item_priv{ true)); item->setPointContainer(0, new Point_container(VI::PROGRAM_WITHOUT_LIGHT, false)); - + has_feature_edges = false; invalidate_stats(); vertices_displayed = false; @@ -193,7 +193,7 @@ struct Scene_surface_mesh_item_priv{ void* get_aabb_tree(); QList triangulate_primitive(face_descriptor fit, EPICK::Vector_3 normal); - + //! \brief triangulate_facet Triangulates a facet. //! \param fd a face_descriptor of the facet that needs to be triangulated. //! \param fnormals a property_map containing the normals of the mesh. @@ -310,7 +310,7 @@ void Scene_surface_mesh_item::standard_constructor(SMesh* sm) d->textFItems = new TextListItem(this); are_buffers_filled = false; invalidate(ALL); - + } Scene_surface_mesh_item::Scene_surface_mesh_item(SMesh* sm) { @@ -393,39 +393,39 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: v_colors.clear(); idx_data_.clear(); idx_data_.shrink_to_fit(); - + SMesh::Property_map vnormals = smesh_->add_property_map("v:normal").first; - + SMesh::Property_map fnormals = smesh_->add_property_map("f:normal").first; CGAL::Polygon_mesh_processing::compute_face_normals(*smesh_,fnormals); - + typedef boost::graph_traits::face_descriptor face_descriptor; CGAL::Polygon_mesh_processing::compute_vertex_normals(*smesh_,vnormals); - + const CGAL::qglviewer::Vec o = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); EPICK::Vector_3 offset(o.x, o.y, o.z); - + SMesh::Property_map positions = smesh_->points(); - + SMesh::Property_map vcolors = smesh_->property_map("v:color").first; - + SMesh::Property_map fcolors = smesh_->property_map("f:color").first; - + boost::property_map< SMesh, boost::vertex_index_t >::type im = get(boost::vertex_index, *smesh_); - + idx_data_.reserve(num_faces(*smesh_) * 3); - + typedef CGAL::Buffer_for_vao CPF; typedef boost::graph_traits::face_descriptor face_descriptor; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits::edge_descriptor edge_descriptor; - + if(name.testFlag(Scene_item_rendering_helper::GEOMETRY)) { for(face_descriptor fd : faces(*smesh_)) @@ -445,7 +445,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: facet_points.push_back(positions[target(hd, *smesh_)]); } bool is_convex = CPF::is_facet_convex(facet_points, fnormals[fd]); - + if(is_convex && is_quad(halfedge(fd,*smesh_),*smesh_) ) { halfedge_descriptor hd = halfedge(fd,*smesh_); @@ -453,12 +453,12 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: idx_data_.push_back(source(hd, *smesh_)); idx_data_.push_back(source(next(hd, *smesh_), *smesh_)); idx_data_.push_back(source(next(next(hd, *smesh_), *smesh_), *smesh_)); - + //2nd half idx_data_.push_back(source(hd, *smesh_)); idx_data_.push_back(source(next(next(hd, *smesh_), *smesh_), *smesh_)); idx_data_.push_back(source(prev(hd, *smesh_), *smesh_)); - } + } else if(is_convex) { triangulate_convex_facet(fd, &fnormals, 0, &im, name, true); @@ -470,10 +470,10 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } } } - + if(name.testFlag(Scene_item_rendering_helper::COLORS)) { - + has_fpatch_id = smesh_->property_map("f:patch_id").second; has_fcolors = smesh_->property_map("f:color").second; has_vcolors = smesh_->property_map("v:color").second; @@ -496,19 +496,19 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } idx_edge_data_.shrink_to_fit(); } - + if(name.testFlag(Scene_item_rendering_helper::COLORS) && has_fpatch_id){ initialize_colors(); } - - + + //compute the Flat data - + flat_vertices.clear(); flat_normals.clear(); f_colors.clear(); - + for(face_descriptor fd : faces(*smesh_)) { if(is_triangle(halfedge(fd,*smesh_),*smesh_)) @@ -531,7 +531,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: { //The sharp features detection produces patch ids >=1, this //is meant to insure the wanted id is in the range [min,max] - QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; + QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; CGAL::Color color(c.red(),c.green(),c.blue()); CPF::add_color_in_buffer(color, f_colors); } @@ -560,7 +560,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: CGAL::Color *c; if(has_fpatch_id) { - QColor color = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; + QColor color = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; c = new CGAL::Color(color.red(),color.green(),color.blue()); } else if(has_fcolors) @@ -568,13 +568,13 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: else c = 0; addFlatData(p,n,c, name); - + hd = next(halfedge(fd, *smesh_),*smesh_); addFlatData(positions[source(hd, *smesh_)] ,fnormals[fd] ,c ,name); - + hd = next(next(halfedge(fd, *smesh_),*smesh_), *smesh_); addFlatData(positions[source(hd, *smesh_)] ,fnormals[fd] @@ -586,13 +586,13 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: ,fnormals[fd] ,c ,name); - + hd = next(next(halfedge(fd, *smesh_),*smesh_), *smesh_); addFlatData(positions[source(hd, *smesh_)] ,fnormals[fd] ,c ,name); - + hd = prev(halfedge(fd, *smesh_), *smesh_); addFlatData(positions[source(hd, *smesh_)] ,fnormals[fd] @@ -611,7 +611,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } } } - + if(has_vcolors && name.testFlag(Scene_item_rendering_helper::COLORS)) { for(vertex_descriptor vd : vertices(*smesh_)) @@ -622,7 +622,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: v_colors.push_back((float)c.blue()/255); } } - + if(floated && (name.testFlag(Scene_item_rendering_helper::GEOMETRY)|| name.testFlag(Scene_item_rendering_helper::NORMALS))) { @@ -646,7 +646,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: idx_feature_edge_data_size = idx_feature_edge_data_.size(); idx_data_size = idx_data_.size(); flat_vertices_size = flat_vertices.size(); - + item->getPointContainer(0)->allocate(Pt::Vertices, smooth_vertices.data(), static_cast(num_vertices(*smesh_)*3*sizeof(cgal_gl_data))); item->getEdgeContainer(0)->allocate(Ed::Indices, idx_edge_data_.data(), @@ -688,7 +688,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: else item->getTriangleContainer(0)->allocate(Tri::VColors, 0, 0); } - + QApplication::restoreOverrideCursor(); } @@ -719,7 +719,7 @@ void Scene_surface_mesh_item_priv::initializeBuffers(CGAL::Three::Viewer_interfa item->getEdgeContainer(1)->initializeBuffers(viewer); item->getEdgeContainer(0)->initializeBuffers(viewer); item->getPointContainer(0)->initializeBuffers(viewer); - + ////Clean-up item->getPointContainer(0)->setFlatDataSize(vertices(*smesh_).size()*3); item->getTriangleContainer(1)->setFlatDataSize(flat_vertices_size); @@ -757,8 +757,8 @@ void Scene_surface_mesh_item::draw(CGAL::Three::Viewer_interface *viewer) const d->initializeBuffers(viewer); setBuffersInit(viewer, true); } - - + + if(renderingMode() == Gouraud || renderingMode() == GouraudPlusEdges) { @@ -872,7 +872,7 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, Point p0,p1,p2; SMesh::Halfedge_around_face_circulator he(halfedge(fd, *smesh_), *smesh_); SMesh::Halfedge_around_face_circulator he_end = he; - + while(next(*he, *smesh_) != prev(*he_end, *smesh_)) { ++he; @@ -887,7 +887,7 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, CGAL::Color* color; if(has_fpatch_id) { - QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; + QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; color = new CGAL::Color(c.red(),c.green(),c.blue()); } else if(has_fcolors) @@ -902,7 +902,7 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, (*fnormals)[fd], color, name); - + addFlatData(p2, (*fnormals)[fd], color, @@ -926,7 +926,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, Scene_item_rendering_helper::Gl_data_names name, bool index) const { - + //Computes the normal of the facet EPICK::Vector_3 normal = get(*fnormals, fd); if(normal == CGAL::NULL_VECTOR) @@ -946,7 +946,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, } next_ =next(next_, *smesh_); }while(next_ != start); - + if (normal == CGAL::NULL_VECTOR) // No normal could be computed, return { qDebug()<<"Warning : normal is not valid. Facet not displayed"; @@ -959,7 +959,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, qDebug()<<"Warning : normal is not valid. Facet not displayed"; return; } - + typedef FacetTriangulator::vertex_descriptor> FT; const CGAL::qglviewer::Vec off = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); EPICK::Vector_3 offset(off.x,off.y,off.z); @@ -979,14 +979,14 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, CGAL::Color* color; if(has_fpatch_id) { - QColor c= item->color_vector()[fpatch_id_map[fd] - min_patch_id]; + QColor c= item->color_vector()[fpatch_id_map[fd] - min_patch_id]; color = new CGAL::Color(c.red(),c.green(),c.blue()); } else if(has_fcolors) color = &(*fcolors)[fd]; else color = 0; - + addFlatData(ffit->vertex(0)->point()-offset, (*fnormals)[fd], color, @@ -995,7 +995,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, (*fnormals)[fd], color, name); - + addFlatData(ffit->vertex(2)->point()-offset, (*fnormals)[fd], color, @@ -1013,7 +1013,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, idx_data_.push_back((*im)[triangulation.v2v[ffit->vertex(2)]]); } } - + } } void delete_aabb_tree(Scene_surface_mesh_item* item) @@ -1116,7 +1116,7 @@ void* Scene_surface_mesh_item_priv::get_aabb_tree() for(face_descriptor f : faces(*sm)) { //if face is degenerate, skip it - if (CGAL::is_triangle(halfedge(f, *sm), *sm) + if (CGAL::is_triangle(halfedge(f, *sm), *sm) && CGAL::Polygon_mesh_processing::is_degenerate_triangle_face(f, *sm)) continue; //if face not triangle, triangulate corresponding primitive before adding it to the tree @@ -1291,7 +1291,7 @@ void Scene_surface_mesh_item::invalidate(Gl_data_names name) setBuffersInit(viewer, false); viewer->update(); } - + getTriangleContainer(1)->reset_vbos(name); getTriangleContainer(0)->reset_vbos(name); getEdgeContainer(1)->reset_vbos(name); @@ -1810,7 +1810,7 @@ void Scene_surface_mesh_item::zoomToPosition(const QPoint &point, CGAL::Three::V bool found = false; CGAL::qglviewer::Vec point_under = viewer->camera()->pointUnderPixel(point,found); EPICK::Point_3 ray_origin; - CGAL::qglviewer::Vec dir; + CGAL::qglviewer::Vec dir; if(viewer->camera()->type() == CGAL::qglviewer::Camera::PERSPECTIVE) { ray_origin = EPICK::Point_3(viewer->camera()->position().x - offset.x, @@ -1821,7 +1821,7 @@ void Scene_surface_mesh_item::zoomToPosition(const QPoint &point, CGAL::Three::V else { dir = viewer->camera()->viewDirection(); - ray_origin = EPICK::Point_3(point_under.x - dir.x, + ray_origin = EPICK::Point_3(point_under.x - dir.x, point_under.y - dir.y, point_under.z - dir.z); } @@ -1996,8 +1996,8 @@ QMenu* Scene_surface_mesh_item::contextMenu() actionZoomToId->setObjectName("actionZoomToId"); connect(actionZoomToId, &QAction::triggered, this, &Scene_surface_mesh_item::zoomToId); - - + + setProperty("menu_changed", true); menu->setProperty(prop_name, true); } @@ -2123,7 +2123,7 @@ bool Scene_surface_mesh_item::testDisplayId(double x, double y, double z, CGAL:: EPICK::Point_3 src(x - offset.x, y - offset.y, z - offset.z); - + CGAL::qglviewer::Camera* cam = viewer->camera(); EPICK::Point_3 dest( cam->position().x - offset.x, cam->position().y - offset.y, @@ -2313,7 +2313,7 @@ void Scene_surface_mesh_item::computeElements()const const_cast(this)->itemChanged(); } -void +void Scene_surface_mesh_item::initializeBuffers(CGAL::Three::Viewer_interface* viewer)const { const_cast(this)->//temporary, until the drawing pipeline is not const anymore. diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_VRML_1_ostream.h b/Polyhedron/include/CGAL/IO/Polyhedron_VRML_1_ostream.h index 8138be7648e..86b2ed6f28d 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_VRML_1_ostream.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_VRML_1_ostream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_geomview_ostream.h b/Polyhedron/include/CGAL/IO/Polyhedron_geomview_ostream.h index 7cf4c73bb51..f424d515159 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_geomview_ostream.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_geomview_ostream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_inventor_ostream.h b/Polyhedron/include/CGAL/IO/Polyhedron_inventor_ostream.h index b9821e732ce..a6a3b8a4a61 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_inventor_ostream.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_inventor_ostream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_iostream.h b/Polyhedron/include/CGAL/IO/Polyhedron_iostream.h index f1ba5277414..ca7523ae3ee 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_iostream.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_iostream.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Property_map/include/CGAL/property_map.h b/Property_map/include/CGAL/property_map.h index cd21388f824..f5f50023601 100644 --- a/Property_map/include/CGAL/property_map.h +++ b/Property_map/include/CGAL/property_map.h @@ -186,7 +186,7 @@ struct Dereference_property_map /// Free function to create a `Dereference_property_map` property map. /// -/// \relates Dereference_property_map +/// \relates Dereference_property_map template // Type convertible to `key_type` Dereference_property_map::type> make_dereference_property_map(Iter) @@ -236,7 +236,7 @@ struct Identity_property_map_no_lvalue /// Free function to create a `Identity_property_map` property map. /// -/// \relates Identity_property_map +/// \relates Identity_property_map template // Key and value type Identity_property_map make_identity_property_map(T) @@ -246,8 +246,8 @@ Identity_property_map /// \ingroup PkgPropertyMapRef -/// Property map that accesses the first item of a `std::pair`. -/// \tparam Pair Instance of `std::pair`. +/// Property map that accesses the first item of a `std::pair`. +/// \tparam Pair Instance of `std::pair`. /// \cgalModels `LvaluePropertyMap` /// /// \sa `CGAL::Second_of_pair_property_map` @@ -271,9 +271,9 @@ struct First_of_pair_property_map /// @} }; -/// Free function to create a `First_of_pair_property_map` property map. +/// Free function to create a `First_of_pair_property_map` property map. /// -/// \relates First_of_pair_property_map +/// \relates First_of_pair_property_map template // Pair type First_of_pair_property_map make_first_of_pair_property_map(Pair) @@ -282,13 +282,13 @@ First_of_pair_property_map } /// \ingroup PkgPropertyMapRef -/// -/// Property map that accesses the second item of a `std::pair`. -/// -/// \tparam Pair Instance of `std::pair`. -/// +/// +/// Property map that accesses the second item of a `std::pair`. +/// +/// \tparam Pair Instance of `std::pair`. +/// /// \cgalModels `LvaluePropertyMap` -/// +/// /// \sa `CGAL::First_of_pair_property_map` template struct Second_of_pair_property_map @@ -312,7 +312,7 @@ struct Second_of_pair_property_map /// Free function to create a Second_of_pair_property_map property map. /// -/// \relates Second_of_pair_property_map +/// \relates Second_of_pair_property_map template // Pair type Second_of_pair_property_map make_second_of_pair_property_map(Pair) @@ -321,12 +321,12 @@ Second_of_pair_property_map } /// \ingroup PkgPropertyMapRef -/// +/// /// Property map that accesses the Nth item of a `boost::tuple` or a `std::tuple`. -/// +/// /// \tparam N %Index of the item to access. /// \tparam Tuple Instance of `boost::tuple` or `std::tuple`. -/// +/// /// \cgalModels `LvaluePropertyMap` template struct Nth_of_tuple_property_map diff --git a/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp b/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp index 280aea6d0e4..31900442aee 100644 --- a/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp +++ b/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp @@ -47,13 +47,13 @@ typedef boost::associative_property_map< Face2Vector_map > Face2Vector_property_ //RIDGES typedef CGAL::Ridge_line Ridge_line; typedef CGAL::Ridge_approximation < PolyhedralSurf, - VertexFT_property_map, - VertexVector_property_map > Ridge_approximation; + VertexFT_property_map, + VertexVector_property_map > Ridge_approximation; //UMBILICS typedef CGAL::Umbilic Umbilic; typedef CGAL::Umbilic_approximation < PolyhedralSurf, - VertexFT_property_map, - VertexVector_property_map > Umbilic_approximation; + VertexFT_property_map, + VertexVector_property_map > Umbilic_approximation; //create property maps VertexFT_map vertex_k1_map, vertex_k2_map, @@ -86,8 +86,8 @@ unsigned int min_nb_points = (d_fitting + 1) * (d_fitting + 2) / 2; */ template void gather_fitting_points(vertex_descriptor v, - std::vector &in_points, - Poly_rings& poly_rings, + std::vector &in_points, + Poly_rings& poly_rings, VertexPointMap vpm) { //container to collect vertices of v on the PolyhedralSurf @@ -148,7 +148,7 @@ void compute_differential_quantities(PolyhedralSurf& P, Poly_rings& poly_rings) assert( d_monge >= 3); // run the main fct : perform the fitting monge_form = monge_fit(in_points.begin(), in_points.end(), - d_fitting, d_monge); + d_fitting, d_monge); //switch min-max ppal curv/dir wrt the mesh orientation const Vector_3 normal_mesh = computeFacetsAverageUnitNormal(P,v, face2normal_pm, Kernel()); @@ -164,18 +164,18 @@ void compute_differential_quantities(PolyhedralSurf& P, Poly_rings& poly_rings) if ( d_monge >= 4) { //= 3*b1^2+(k1-k2)(c0-3k1^3) vertex_P1_map[v] = - 3*monge_form.coefficients()[3]*monge_form.coefficients()[3] - +(monge_form.coefficients()[0]-monge_form.coefficients()[1]) - *(monge_form.coefficients()[6] - -3*monge_form.coefficients()[0]*monge_form.coefficients()[0] - *monge_form.coefficients()[0]); + 3*monge_form.coefficients()[3]*monge_form.coefficients()[3] + +(monge_form.coefficients()[0]-monge_form.coefficients()[1]) + *(monge_form.coefficients()[6] + -3*monge_form.coefficients()[0]*monge_form.coefficients()[0] + *monge_form.coefficients()[0]); //= 3*b2^2+(k2-k1)(c4-3k2^3) vertex_P2_map[v] = - 3*monge_form.coefficients()[4]*monge_form.coefficients()[4] - +(-monge_form.coefficients()[0]+monge_form.coefficients()[1]) - *(monge_form.coefficients()[10] - -3*monge_form.coefficients()[1]*monge_form.coefficients()[1] - *monge_form.coefficients()[1]); + 3*monge_form.coefficients()[4]*monge_form.coefficients()[4] + +(-monge_form.coefficients()[0]+monge_form.coefficients()[1]) + *(monge_form.coefficients()[10] + -3*monge_form.coefficients()[1]*monge_form.coefficients()[1] + *monge_form.coefficients()[1]); } } //END FOR LOOP } @@ -228,10 +228,10 @@ int main() if ( int_tag == 3 ) tag_order = CGAL::Ridge_order_3; if ( int_tag == 4 ) tag_order = CGAL::Ridge_order_4; if ( int_tag != 3 && int_tag != 4 ) - {std::cerr << "ridge_order must be CGAL::Ridge_order_3 or CGAL::Ridge_order_4"; - return 1;} + {std::cerr << "ridge_order must be CGAL::Ridge_order_3 or CGAL::Ridge_order_4"; + return 1;} } -#else +#else std::cerr << "Command-line options require Boost.ProgramOptions" << std::endl; if_name = "data/poly2x^2+y^2-0.062500.off"; d_fitting = 3; @@ -261,26 +261,26 @@ int main() if (of_name[i] == '/') of_name[i]='_'; std::ostringstream str_4ogl; str_4ogl << "data/" - << of_name << "RIDGES" - << "-d" << d_fitting - << "-m" << d_monge - << "-t" << tag_order - << "-a" << nb_rings - << "-p" << nb_points_to_use - << ".4ogl.txt"; + << of_name << "RIDGES" + << "-d" << d_fitting + << "-m" << d_monge + << "-t" << tag_order + << "-a" << nb_rings + << "-p" << nb_points_to_use + << ".4ogl.txt"; std::cout << str_4ogl.str() << std::endl ; std::ofstream out_4ogl(str_4ogl.str().c_str() , std::ios::out); //if verbose only... std::ostringstream str_verb; str_verb << "data/" - << of_name << "RIDGES" - << "-d" << d_fitting - << "-m" << d_monge - << "-t" << tag_order - << "-a" << nb_rings - << "-p" << nb_points_to_use - << ".verb.txt"; + << of_name << "RIDGES" + << "-d" << d_fitting + << "-m" << d_monge + << "-t" << tag_order + << "-a" << nb_rings + << "-p" << nb_points_to_use + << ".verb.txt"; std::cout << str_verb.str() << std::endl ; std::ofstream out_verb(str_verb.str().c_str() , std::ios::out); @@ -288,11 +288,11 @@ int main() PolyhedralSurf P; CGAL::read_OFF(if_name.c_str(), P); fprintf(stderr, "loadMesh %d Ves %d Facets\n", - (int)num_vertices(P), (int)num_faces(P)); + (int)num_vertices(P), (int)num_faces(P)); if(verbose) out_verb << "Polysurf with " << num_vertices(P) - << " vertices and " << num_faces(P) - << " facets. " << std::endl; + << " vertices and " << num_faces(P) + << " facets. " << std::endl; //exit if not enough points in the model if (min_nb_points > num_vertices(P)) @@ -313,10 +313,10 @@ int main() //-------------------------------------------------------------------------- std::cout << "Compute ridges..." << std::endl; Ridge_approximation ridge_approximation(P, - vertex_k1_pm, vertex_k2_pm, - vertex_b0_pm, vertex_b3_pm, - vertex_d1_pm, vertex_d2_pm, - vertex_P1_pm, vertex_P2_pm ); + vertex_k1_pm, vertex_k2_pm, + vertex_b0_pm, vertex_b3_pm, + vertex_d1_pm, vertex_d2_pm, + vertex_P1_pm, vertex_P2_pm ); std::vector ridge_lines; std::back_insert_iterator > ii(ridge_lines); @@ -327,11 +327,11 @@ int main() // or with the global function CGAL::compute_max_ridges(P, - vertex_k1_pm, vertex_k2_pm, - vertex_b0_pm, vertex_b3_pm, - vertex_d1_pm, vertex_d2_pm, - vertex_P1_pm, vertex_P2_pm, - ii, tag_order); + vertex_k1_pm, vertex_k2_pm, + vertex_b0_pm, vertex_b3_pm, + vertex_d1_pm, vertex_d2_pm, + vertex_P1_pm, vertex_P2_pm, + ii, tag_order); std::vector::iterator iter_lines = ridge_lines.begin(), iter_end = ridge_lines.end(); @@ -360,14 +360,14 @@ int main() //explicit construction of the class // Umbilic_approximation umbilic_approximation(P, -// vertex_k1_pm, vertex_k2_pm, -// vertex_d1_pm, vertex_d2_pm); +// vertex_k1_pm, vertex_k2_pm, +// vertex_d1_pm, vertex_d2_pm); // umbilic_approximation.compute(umb_it, umb_size); //or global function call CGAL::compute_umbilics(P, - vertex_k1_pm, vertex_k2_pm, - vertex_d1_pm, vertex_d2_pm, - umb_it, umb_size); + vertex_k1_pm, vertex_k2_pm, + vertex_d1_pm, vertex_d2_pm, + umb_it, umb_size); std::vector::iterator iter_umb = umbilics.begin(), iter_umb_end = umbilics.end(); diff --git a/Stream_support/examples/Stream_support/CMakeLists.txt b/Stream_support/examples/Stream_support/CMakeLists.txt index 00fedc088e0..01093aacdb7 100644 --- a/Stream_support/examples/Stream_support/CMakeLists.txt +++ b/Stream_support/examples/Stream_support/CMakeLists.txt @@ -17,7 +17,7 @@ if ( CGAL_FOUND ) message(STATUS "This project requires the Boost library, and will not be compiled.") - return() + return() endif() @@ -37,10 +37,10 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "off_bbox.cpp" ) create_single_source_cgal_program( "off_glue.cpp" ) create_single_source_cgal_program( "off_transform.cpp" ) - + else () message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() + return() endif() diff --git a/Stream_support/examples/Stream_support/Point_WKT.cpp b/Stream_support/examples/Stream_support/Point_WKT.cpp index 5fa0a152819..ce6020f4e23 100644 --- a/Stream_support/examples/Stream_support/Point_WKT.cpp +++ b/Stream_support/examples/Stream_support/Point_WKT.cpp @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) { typedef CGAL::Point_2 Point; typedef std::vector MultiPoint; - + std::ifstream is((argc>1)?argv[1]:"data/multipoint.wkt"); MultiPoint mp; CGAL::read_multi_point_WKT(is, mp); diff --git a/Stream_support/examples/Stream_support/Polygon_WKT.cpp b/Stream_support/examples/Stream_support/Polygon_WKT.cpp index d6d0226311c..19945cf0c57 100644 --- a/Stream_support/examples/Stream_support/Polygon_WKT.cpp +++ b/Stream_support/examples/Stream_support/Polygon_WKT.cpp @@ -34,7 +34,7 @@ int main(int argc, char* argv[]) for(Polygon p : polys) std::cout<2)?argv[2]:"data/multipolygon.wkt"); MultiPolygon mp; diff --git a/Stream_support/examples/Stream_support/iv2off.cpp b/Stream_support/examples/Stream_support/iv2off.cpp index ab9e80e2e76..91e89957d55 100644 --- a/Stream_support/examples/Stream_support/iv2off.cpp +++ b/Stream_support/examples/Stream_support/iv2off.cpp @@ -258,7 +258,7 @@ int main( int argc, char **argv) { } if ( !*p_in) { cerr << argv[0] << ": error: cannot open file '"<< iname - << "' for reading." < Point; typedef std::vector MultiPoint; - + typedef std::vector LineString; typedef std::vector MultiLineString; - + typedef CGAL::Polygon_with_holes_2 Polygon; typedef std::vector MultiPolygon; @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) MultiLineString polylines; MultiPolygon polygons; CGAL::read_WKT(is, points,polylines,polygons); - + for(Point p : points) std::cout< points; for(boost::property_tree::ptree::value_type& node : tree.get_child("PolySet.Polygon")){ - boost::property_tree::ptree subtree = node.second; + boost::property_tree::ptree subtree = node.second; if( node.first == "Point" ){ for( boost::property_tree::ptree::value_type const& v : subtree.get_child( "" ) ) { std::string label = v.first; - + if ( label == "" ) { Point_3 p(subtree.get( label+".X"), subtree.get( label+".Y"), @@ -31,7 +31,7 @@ int main(int argc, char* argv[]) } } } - } + } std::cout << points.size() << " points read"<< std::endl; return 0; diff --git a/Stream_support/include/CGAL/IO/Istream_iterator.h b/Stream_support/include/CGAL/IO/Istream_iterator.h index 050ba4cbdf4..04a2d93cad9 100644 --- a/Stream_support/include/CGAL/IO/Istream_iterator.h +++ b/Stream_support/include/CGAL/IO/Istream_iterator.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/include/CGAL/IO/OFF/File_header_OFF.h b/Stream_support/include/CGAL/IO/OFF/File_header_OFF.h index ea19a765652..70e8e9a9f29 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_header_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/File_header_OFF.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/include/CGAL/IO/OFF/File_header_extended_OFF.h b/Stream_support/include/CGAL/IO/OFF/File_header_extended_OFF.h index 425d16a4b38..440d1e3d16b 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_header_extended_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/File_header_extended_OFF.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/include/CGAL/IO/OFF/Scanner_OFF.h b/Stream_support/include/CGAL/IO/OFF/Scanner_OFF.h index 12771499d7c..e828f74a431 100644 --- a/Stream_support/include/CGAL/IO/OFF/Scanner_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/Scanner_OFF.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997,2005 +// Copyright (c) 1997,2005 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner // Ralf Osbild @@ -101,7 +101,7 @@ private: File_scanner_OFF* m_scan; std::size_t m_cnt; value_type m_current; - + void next() { CGAL_assertion( m_scan != nullptr); @@ -162,7 +162,7 @@ private: std::size_t no; m_scan->scan_facet( no, m_cnt); m_indices.reserve( no); - std::size_t index = (std::numeric_limits::max)(); + std::size_t index = (std::numeric_limits::max)(); // A huge value helps to detect a potential // error in the function scan_facet_vertex_index for (std::size_t i = 0; i < no; ++i) { @@ -177,7 +177,7 @@ private: public: value_type::size_type size_of_indices () const // RO { return m_indices.size(); } - typedef value_type::size_type indices_size_type; // RO + typedef value_type::size_type indices_size_type; // RO public: typedef File_scanner_OFF Scanner; typedef I_Scanner_OFF_facet_iterator Self; diff --git a/Stream_support/include/CGAL/IO/OFF/generic_copy_OFF.h b/Stream_support/include/CGAL/IO/OFF/generic_copy_OFF.h index 31446e62c56..ba264567d68 100644 --- a/Stream_support/include/CGAL/IO/OFF/generic_copy_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/generic_copy_OFF.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h b/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h index ebeb4c1fffb..73e6557a814 100644 --- a/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h +++ b/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/include/CGAL/IO/OI/Inventor_ostream.h b/Stream_support/include/CGAL/IO/OI/Inventor_ostream.h index ed23b6c417b..975ea1ed542 100644 --- a/Stream_support/include/CGAL/IO/OI/Inventor_ostream.h +++ b/Stream_support/include/CGAL/IO/OI/Inventor_ostream.h @@ -1,9 +1,9 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); // diff --git a/Stream_support/include/CGAL/IO/Ostream_iterator.h b/Stream_support/include/CGAL/IO/Ostream_iterator.h index b20f2d7eb67..8d3911471cf 100644 --- a/Stream_support/include/CGAL/IO/Ostream_iterator.h +++ b/Stream_support/include/CGAL/IO/Ostream_iterator.h @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/src/CGAL/File_header_OFF.cpp b/Stream_support/src/CGAL/File_header_OFF.cpp index a1401ada008..a014e1887d4 100644 --- a/Stream_support/src/CGAL/File_header_OFF.cpp +++ b/Stream_support/src/CGAL/File_header_OFF.cpp @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/src/CGAL/File_header_extended_OFF.cpp b/Stream_support/src/CGAL/File_header_extended_OFF.cpp index 5514f51de70..0d9936d3e13 100644 --- a/Stream_support/src/CGAL/File_header_extended_OFF.cpp +++ b/Stream_support/src/CGAL/File_header_extended_OFF.cpp @@ -1,16 +1,16 @@ -// Copyright (c) 1997 +// Copyright (c) 1997 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Lutz Kettner diff --git a/Stream_support/test/Stream_support/vrml2.cpp b/Stream_support/test/Stream_support/vrml2.cpp index a923bd7e21f..85007c9563e 100644 --- a/Stream_support/test/Stream_support/vrml2.cpp +++ b/Stream_support/test/Stream_support/vrml2.cpp @@ -12,7 +12,7 @@ typedef CGAL::Tetrahedron_3 Tetrahedron; typedef CGAL::Sphere_3 Sphere; int main() { - Point p1(10, 15, 0), p2(0, 0, 0), + Point p1(10, 15, 0), p2(0, 0, 0), p3(-10, 0, -15), p4(15, 15, 15); Segment s1(p1, p2); Triangle t1(p1, p2, p3); diff --git a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt index a7d3b5535b1..aab170e2b6c 100644 --- a/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt +++ b/Surface_mesh/doc/Surface_mesh/Surface_mesh.txt @@ -2,7 +2,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_3D_Surface_mesh \anchor chapterSurface_mesh @@ -11,8 +11,8 @@ namespace CGAL { \image html clown_fish.jpg -The class `Surface_mesh` is an implementation of a halfedge data structure -and can be used to represent a polyhedral surface. +The class `Surface_mesh` is an implementation of a halfedge data structure +and can be used to represent a polyhedral surface. It is an alternative to the \cgal packages \ref PkgHalfedgeDS and \ref PkgPolyhedron. The main difference is that it is indexed based and not pointer based. @@ -26,12 +26,12 @@ As the indices are contiguous, they can be used as index into vectors which store properties. When elements are removed, they are only marked as removed, and a garbage -collection function must be called to really remove them. +collection function must be called to really remove them. -The class `Surface_mesh` can be used through its class member functions +The class `Surface_mesh` can be used through its class member functions as well as through the BGL API as described in the package \ref PkgBGL, as it is a model of the concepts `MutableFaceGraph` and `FaceListGraph`. -Therefore it is possible to apply the algorithms of the packages +Therefore it is possible to apply the algorithms of the packages \ref PkgSurfaceMeshSimplification, \ref PkgSurfaceMeshSegmentation, and \ref PkgSurfaceMeshDeformation on a surface mesh. @@ -47,7 +47,7 @@ represent the basic elements of the halfedge data structure: - `Surface_mesh::Edge_index` These types are just wrappers for an integer and their -main purpose is to guarantee type safety. +main purpose is to guarantee type safety. They are default constructible, which yields an *invalid* element. New elements can be added and removed to the `Surface_mesh` through a set of low-level functions which do not maintain connectivity. One @@ -82,7 +82,7 @@ by adding 2 faces, and how to check that a face is correctly added to the mesh. \cgalExample{Surface_mesh/check_orientation.cpp} -\section sectionSurfaceMeshConnectivity Connectivity +\section sectionSurfaceMeshConnectivity Connectivity A surface mesh is an edge-centered data structure capable of maintaining incidence information of vertices, edges, and faces. Each @@ -94,9 +94,9 @@ an incident halfedge is stored. Halfedges do not store the index of the opposite halfedge, as `Surface_mesh` stores opposite halfedges consecutively in memory. -The following figure illustrates the functions which allow to navigate -in a surface mesh: `Surface_mesh::opposite()`, `Surface_mesh::next()`, -`Surface_mesh::prev()`, `Surface_mesh::target()`, and +The following figure illustrates the functions which allow to navigate +in a surface mesh: `Surface_mesh::opposite()`, `Surface_mesh::next()`, +`Surface_mesh::prev()`, `Surface_mesh::target()`, and `Surface_mesh::face()`. Additionally, the functions `Surface_mesh::halfedge()` allows to obtain the halfedge associated to a vertex and to a face. @@ -106,7 +106,7 @@ defined in the package \ref PkgBGL. \cgalFigureBegin{FigSurfaceMeshConnectivity,connectivity.svg} Connectivity of halfedges and vertices in a surface mesh seen from outside. \cgalFigureEnd - + \anchor SurfaceMeshOrientation The halfedges incident to a face form a cycle. Depending on from which side we look at the surface, the sequence of @@ -124,11 +124,11 @@ The connectivity does not allow to represent faces with holes. halfedges, edges, and faces. It provides member functions returning ranges of elements which are compatible with the Boost.Range -library. +library. \subsection iterators_example Example -The following example shows how to obtain the iterator type from +The following example shows how to obtain the iterator type from a range, alternatives for obtaining the begin and end iterator, and alternatives for range-based loops. @@ -137,11 +137,11 @@ and alternatives for range-based loops. \section sectionSurfaceMesh_circulators Circulators -Circulators around faces and around vertices are provided as class templates +Circulators around faces and around vertices are provided as class templates in the package \ref PkgBGL. Circulators around faces basically call `Surface_mesh::next()` -in order to go from halfedge to halfedge counterclockwise around the face, and +in order to go from halfedge to halfedge counterclockwise around the face, and when dereferenced return the halfedge or the incident vertex or the opposite face. - `CGAL::Halfedge_around_face_circulator` @@ -164,7 +164,7 @@ of emptiness. \subsection circulators_example Example The following example shows how to enumerate the vertices around the -target of a given halfedge. The second loop shows that each of +target of a given halfedge. The second loop shows that each of these circulator types comes with an equivalent iterator and a free function to create an iterator range. @@ -191,42 +191,42 @@ directly accessed using `Surface_mesh::points()` or When an element is removed, it is only marked as removed, and it gets really removed when `Surface_mesh::collect_garbage()` is called. Garbage collection will also really remove the properties -of these elements. +of these elements. -The connectivity is also stored in properties, namely the properties named +The connectivity is also stored in properties, namely the properties named "v:connectivity", "h:connectivity", and "f:connectivity". It is quite similar for the marker of deleted element, where we have -"v:removed", "e:removed", and "f:removed". +"v:removed", "e:removed", and "f:removed". \subsection properties_example Example -This example shows how to use the most common features of the property system. +This example shows how to use the most common features of the property system. \cgalExample{Surface_mesh/sm_properties.cpp} \section sectionSurfaceMesh_borders Borders -A halfedge stores a reference to a face, its incident face. +A halfedge stores a reference to a face, its incident face. A halfedge `h` is on the border, if it has no incident face, that is if `sm.face(h) == Surface_mesh::null_face()`. An edge is on the border, if any of its halfedges is on the border. A vertex is on the border, -if any of its incident halfedges is on the border. +if any of its incident halfedges is on the border. A vertex has only one associated halfedge. If the user takes care that the associated halfedge is a border halfedge, in case the vertex is on the border, there is no need to look at all incident halfedges in the -`is_border()` function for vertices. +`is_border()` function for vertices. In order to only check if the associated halfedge is on the border the function `Surface_mesh::is_border(Vertex_index v, bool check_all_incident_halfedges = true)` -must be called with `check_all_incident_halfedges = false`. +must be called with `check_all_incident_halfedges = false`. The user is in charge to correctly set the halfedge -associated to a vertex after having applied an operation that might invalidate +associated to a vertex after having applied an operation that might invalidate this property. The functions `Surface_mesh::set_vertex_halfedge_to_border_halfedge(Vertex_index v)`, -`Surface_mesh::set_vertex_halfedge_to_border_halfedge(Halfedge_index h)`, and - `Surface_mesh::set_vertex_halfedge_to_border_halfedge()` enable to set the border +`Surface_mesh::set_vertex_halfedge_to_border_halfedge(Halfedge_index h)`, and + `Surface_mesh::set_vertex_halfedge_to_border_halfedge()` enable to set the border halfedge for a single vertex `v`, for all vertices on the boundary of the face of `h`, and for all vertices of the surface mesh, respectively. @@ -235,7 +235,7 @@ face of `h`, and for all vertices of the surface mesh, respectively. The class `Surface_mesh` is a model of the concept `IncidenceGraph` defined in the Boost Graph Library. This enables to apply algorithms such -as +as [Dijkstra shortest path](https://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html), or [Kruskal minimum spanning tree](https://www.boost.org/libs/graph/doc/kruskal_min_spanning_tree.html) directly on a surface mesh. @@ -254,7 +254,7 @@ for example It would be nicer to return the number of vertices without taking removed vertices into account, but this would interact badly with -the underlying vertex/edge index mappings. The index mapping would no longer +the underlying vertex/edge index mappings. The index mapping would no longer fall in the range `[0,num_vertices(g))` which is assumed in many of the algorithms. @@ -267,9 +267,9 @@ Again, there are similar types and functions, for example: | BGL | %Surface_mesh | | :---- | :---- | | `boost::graph_traits::%halfedge_descriptor` | `Surface_mesh::Halfedge_index` | -| `boost::graph_traits::%face_descriptor` | `Surface_mesh::Face_index` | -| `halfedges(const G& g)` | `sm.halfedges()` | -| `faces(const G& g)` | `sm.faces()` | +| `boost::graph_traits::%face_descriptor` | `Surface_mesh::Face_index` | +| `halfedges(const G& g)` | `sm.halfedges()` | +| `faces(const G& g)` | `sm.faces()` | | `hd = next(hd, g)` | `hd = sm.next(hd)` | | `hd = prev(hd, g)` | `hd = sm.prev(hd)` | | `hd = opposite(hd,g)` | `hd = sm.opposite(hd)` | @@ -292,18 +292,18 @@ for storing if a vertex has already been visited during a graph traversal. The BGL way of retrieving the vertex index property map of a graph `g` is `vipm = get(boost::vertex_index, g)`, and `get(vipm, vd)` in order then -to retrieve the index for a vertex descriptor `vd`, and it is +to retrieve the index for a vertex descriptor `vd`, and it is `get(vertex_index, g, vd)` to obtain the vertex index directly. \subsection SubsectionSurfaceMeshBglExample Example -The first example shows that we can apply Kruskal's +The first example shows that we can apply Kruskal's minimum spanning tree algorithm directly on a surface mesh. \cgalExample{Surface_mesh/sm_kruskal.cpp} -The second example shows how we can use property maps for +The second example shows how we can use property maps for algorithms such as Prim's minimum spanning tree. The algorithm internally also uses a vertex index property map calling `get(boost::vertex_index_t,sm)`. For the class `Surface_mesh` @@ -319,30 +319,30 @@ See the \ref IOstreamPolygonMeshIO section for more info. Memory management is semi-automatic. Memory grows as more elements are added to the structure but does not shrink when elements are -removed. +removed. When you add elements and the capacity of the underlying vector is exhausted, the vector reallocates memory. As descriptors are basically indices, they refer to the same element after a reallocation. When you remove an element it is only marked as removed. -Internally it is put in a free list, and when you add elements to -the surface mesh, they are taken from the free list in case it is -not empty. +Internally it is put in a free list, and when you add elements to +the surface mesh, they are taken from the free list in case it is +not empty. -For all elements we offer a function to obtain the number of +For all elements we offer a function to obtain the number of used elements, as well as the number of used and removed elements. For vertices the functions are `Surface_mesh::number_of_vertices()` -and `Surface_mesh::number_of_removed_vertices()`, respectively. -The first function is slightly different from the free function -`num_vertices(const G&)` of the BGL package. +and `Surface_mesh::number_of_removed_vertices()`, respectively. +The first function is slightly different from the free function +`num_vertices(const G&)` of the BGL package. As BGL style algorithms use the indices of elements to access data in temporary vectors of size `num_vertices()` -this function must return a number larger than the largest index of +this function must return a number larger than the largest index of the elements. Iterators such as `Surface_mesh::Vertex_iterator` only enumerate -elements that are not marked as deleted. +elements that are not marked as deleted. To really shrink the used memory, `Surface_mesh::collect_garbage()` @@ -350,8 +350,8 @@ must be called. Garbage collection also compacts the properties associated with the surface mesh. Note however that by garbage collecting elements get new indices. -In case you keep vertex descriptors they are most probably no longer -refering to the right vertices. +In case you keep vertex descriptors they are most probably no longer +refering to the right vertices. \subsection SubsectionSurfaceMeshMemoryManagementExample Example \cgalExample{Surface_mesh/sm_memory.cpp} @@ -375,8 +375,8 @@ Result of the run of the draw_surface_mesh program. A window shows the surface m As integer type for the indices we have chosen `boost::uint32_t`. On 64 bit operating systems they take only half the size of a pointer. They still allow to have meshes with 2 billion elements. -We use `std::vector` for storing properties. So by accessing the address -of the 0th element of a property map you can access the underlying +We use `std::vector` for storing properties. So by accessing the address +of the 0th element of a property map you can access the underlying raw array. This may be useful, for example for passing an array of points to OpenGL. @@ -388,10 +388,10 @@ and when iterating over elements they will not be enumerated in the insertion or \section sectionSurfaceMeshHistory Implementation History -This package is derived from an early version of Daniel Sieger and Mario Botsch package +This package is derived from an early version of Daniel Sieger and Mario Botsch package %Surface_mesh -\cgalCite{sieger2011design}, -which is inspired from the design of OpenMesh and the \cgal package +\cgalCite{sieger2011design}, +which is inspired from the design of OpenMesh and the \cgal package \ref PkgPolyhedron. Philipp Moeller and Andreas Fabri worked on the code so that iterators diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO.h b/Surface_mesh/include/CGAL/Surface_mesh/IO.h index 18d5796e7e9..dd912c945c3 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO.h @@ -60,7 +60,7 @@ namespace CGAL { /// /// @return `true`, if reading succeeded, `false` otherwise /// -#endif +#endif template bool read_mesh(Surface_mesh& mesh, const std::string& filename) { @@ -97,7 +97,7 @@ bool read_mesh(Surface_mesh& mesh, const std::string& filename) /// #endif template -bool write_mesh(const Surface_mesh& mesh, const std::string& filename) +bool write_mesh(const Surface_mesh& mesh, const std::string& filename) { // extract file extension std::string::size_type dot(filename.rfind(".")); diff --git a/Surface_mesher/doc/Surface_mesher/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h b/Surface_mesher/doc/Surface_mesher/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h index 1990e7decfb..48ca55cb9ed 100644 --- a/Surface_mesher/doc/Surface_mesher/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h +++ b/Surface_mesher/doc/Surface_mesher/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h @@ -9,13 +9,13 @@ reconstructed by `make_surface_mesh()` in the OFF file format. In case the surface is manifold the triangles can be oriented. -\tparam SurfaceMeshComplex_2InTriangulation_3 must be a model of the `SurfaceMeshComplex_2InTriangulation_3` concept. +\tparam SurfaceMeshComplex_2InTriangulation_3 must be a model of the `SurfaceMeshComplex_2InTriangulation_3` concept. \returns `true` if the surface is manifold and orientable. \param os stream in which to write. -\param c2t3 Input surface. +\param c2t3 Input surface. \param options an int that is the binary union of values of `Surface_mesher::IO_option`. \returns `true` if the surface could be written to the stream. @@ -26,9 +26,9 @@ In case the surface is manifold the triangles can be oriented. template bool output_surface_facets_to_off (std::ostream& os, - const SurfaceMeshComplex_2InTriangulation_3& c2t3, - int options = - Surface_mesher::IO_ORIENT_SURFACE); + const SurfaceMeshComplex_2InTriangulation_3& c2t3, + int options = + Surface_mesher::IO_ORIENT_SURFACE); namespace Surface_mesher { /*! @@ -38,7 +38,7 @@ bool output_surface_facets_to_off (std::ostream& os, enum IO_option { NO_OPTION = 0, IO_ORIENT_SURFACE = 1, IO_VERBOSE = 2 }; - + } /* namespace Surface_mesher */ } /* namespace CGAL */ diff --git a/Surface_mesher/doc/Surface_mesher/Surface_mesher.txt b/Surface_mesher/doc/Surface_mesher/Surface_mesher.txt index 9921831a337..ae3df79fb80 100644 --- a/Surface_mesher/doc/Surface_mesher/Surface_mesher.txt +++ b/Surface_mesher/doc/Surface_mesher/Surface_mesher.txt @@ -1,7 +1,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage User Manual \anchor Chapter_3D_Surface_Mesh_Generation \authors Laurent Rineau and Mariette Yvinec @@ -11,7 +11,7 @@ namespace CGAL { \image html segmented_head.png \image latex segmented_head.png -\section SurfaceMesher_section_intro Introduction +\section SurfaceMesher_section_intro Introduction This package provides a function template to compute a triangular mesh approximating a surface. @@ -57,7 +57,7 @@ surface, and is within a small bounded distance The algorithm can also be used for non smooth surfaces but then there is no guarantee. -\section SurfaceMesher_section_interface The Surface Mesh Generator Interface for Smooth Surfaces +\section SurfaceMesher_section_interface The Surface Mesh Generator Interface for Smooth Surfaces The meshing process is launched through a call to a function template. There are two overloaded versions of the meshing function @@ -236,7 +236,7 @@ Surface mesh of an iso-contour extracted from a gray level 3D image \cgalExample{Surface_mesher/mesh_a_3d_gray_image.cpp} -\section SurfaceMesher_section_criteria Meshing Criteria, Guarantees and Variations +\section SurfaceMesher_section_criteria Meshing Criteria, Guarantees and Variations \anchor SurfaceMesher_section_variations @@ -283,7 +283,7 @@ with the size of the mesh expected by the user, and still have a guarantee that the output mesh forms a manifold surface. The function `make_surface_mesh()` has specialized versions -for the following tag types: +for the following tag types: `Manifold_tag`: the output mesh is guaranteed to be a manifold surface without boundary. @@ -296,10 +296,10 @@ guarantees nothing else. \section Surface_mesherOutput Output -This \cgal component also provides functions to write the reconstructed surface mesh to the %Object File Format (OFF) \cgalCite{cgal:p-gmgv16-96} and to convert it to a `FaceGraph` (when it is manifold): +This \cgal component also provides functions to write the reconstructed surface mesh to the %Object File Format (OFF) \cgalCite{cgal:p-gmgv16-96} and to convert it to a `FaceGraph` (when it is manifold): -- `output_surface_facets_to_off()` -- `output_surface_facets_to_polyhedron()` +- `output_surface_facets_to_off()` +- `output_surface_facets_to_polyhedron()` - `facets_in_complex_2_to_triangle_mesh()` \section Surface_mesherUndocumented Undocumented Features Available in Demos @@ -308,12 +308,12 @@ The Polyhedron demo has a feature that allows to remesh a polyhedral surface, using the 3D Surface Mesh Generator. That has been implemented as a special model of `SurfaceMeshTraits_3`, for polyhedra. That traits class is not yet documented because its interface and code have not yet -been stabilized. +been stabilized. The Surface Mesh Generator demo allows to mesh not only gray level images, but also segmented images, when voxels are labelled with a domain index. Such images are for example the result of a segmentation of 3D -medical images. +medical images. \section Surface_mesherDesign Design and Implementation History @@ -327,6 +327,6 @@ described in \cgalCite{cgal:ry-gsddrm-06}. David Rey, Steve Oudot and Andreas Fabri have participated in the development of this package. -*/ +*/ } /* namespace CGAL */ diff --git a/Surface_mesher/include/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h b/Surface_mesher/include/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h index ec348195739..46e95566031 100644 --- a/Surface_mesher/include/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h +++ b/Surface_mesher/include/CGAL/IO/Complex_2_in_triangulation_3_file_writer.h @@ -33,7 +33,7 @@ namespace CGAL { namespace Surface_mesher { typename Tr::size_type number_of_facets_on_surface(const Tr& T); template - class Write_to_OFF_file + class Write_to_OFF_file { CGAL::File_writer_OFF off; std::ostream& os; @@ -46,13 +46,13 @@ namespace CGAL { namespace Surface_mesher { } bool write_header(const typename Tr::size_type number_of_vertices, - const typename Tr::size_type number_of_facets) + const typename Tr::size_type number_of_facets) { off.header().set_no_comments(true); off.write_header(os, - number_of_vertices, - 0, // fake number of halfedges, not used. - number_of_facets); + number_of_vertices, + 0, // fake number of halfedges, not used. + number_of_facets); return os.good(); } @@ -70,8 +70,8 @@ namespace CGAL { namespace Surface_mesher { } bool write_facet(const int index1, - const int index2, - const int index3) + const int index2, + const int index3) { off.write_facet_begin(3); off.write_facet_vertex_index(index1); @@ -89,7 +89,7 @@ namespace CGAL { namespace Surface_mesher { }; // end class Write_to_OFF_file template - class Write_to_HDS + class Write_to_HDS { CGAL::Polyhedron_incremental_builder_3 builder; @@ -101,10 +101,10 @@ namespace CGAL { namespace Surface_mesher { } bool write_header(const typename Tr::size_type number_of_vertices, - const typename Tr::size_type number_of_facets) + const typename Tr::size_type number_of_facets) { builder.begin_surface(number_of_vertices, - number_of_facets); + number_of_facets); return !builder.error(); } @@ -121,8 +121,8 @@ namespace CGAL { namespace Surface_mesher { } bool write_facet(const int index1, - const int index2, - const int index3) + const int index2, + const int index3) { int indices[3]; indices[0]=index1; @@ -140,16 +140,16 @@ namespace CGAL { namespace Surface_mesher { }; // end class Write_to_HDS enum IO_option { NO_OPTION = 0, - IO_ORIENT_SURFACE = 1, - IO_VERBOSE = 2 }; + IO_ORIENT_SURFACE = 1, + IO_VERBOSE = 2 }; } // end namespace Surface_mesher template bool output_surface_facets_to_off (std::ostream& os, - const C2t3& c2t3, - int options = - Surface_mesher::IO_ORIENT_SURFACE) + const C2t3& c2t3, + int options = + Surface_mesher::IO_ORIENT_SURFACE) { using CGAL::Surface_mesher::number_of_facets_on_surface; @@ -165,14 +165,14 @@ bool output_surface_facets_to_off (std::ostream& os, bool success = true; - Surface_mesher::Write_to_OFF_file + Surface_mesher::Write_to_OFF_file off(os, (options & Surface_mesher::IO_VERBOSE) != 0); success &= off.write_header(tr.number_of_vertices(), - c2t3.number_of_facets()); - + c2t3.number_of_facets()); + CGAL_assertion(c2t3.number_of_facets() == number_of_facets_on_surface(tr)); - + // Finite vertices coordinates. std::map V; int inum = 0; @@ -186,19 +186,19 @@ bool output_surface_facets_to_off (std::ostream& os, success &= off.begin_facets(); - if((options & Surface_mesher::IO_ORIENT_SURFACE) == 0) + if((options & Surface_mesher::IO_ORIENT_SURFACE) == 0) { for( Finite_facets_iterator fit = tr.finite_facets_begin(); - fit != tr.finite_facets_end(); ++fit) + fit != tr.finite_facets_end(); ++fit) { const typename Tr::Cell_handle cell = fit->first; const int& index = fit->second; if (cell->is_facet_on_surface(index)==true) { - const int index1 = V[cell->vertex(tr.vertex_triple_index(index, 0))]; - const int index2 = V[cell->vertex(tr.vertex_triple_index(index, 1))]; - const int index3 = V[cell->vertex(tr.vertex_triple_index(index, 2))]; - success &= off.write_facet(index1, index2, index3); + const int index1 = V[cell->vertex(tr.vertex_triple_index(index, 0))]; + const int index2 = V[cell->vertex(tr.vertex_triple_index(index, 1))]; + const int index3 = V[cell->vertex(tr.vertex_triple_index(index, 2))]; + success &= off.write_facet(index1, index2, index3); } } } @@ -213,52 +213,52 @@ bool output_surface_facets_to_off (std::ostream& os, CGAL_assertion_code(typename Tr::size_type nb_facets = 0; ) - while (oriented_set.size() != number_of_facets) + while (oriented_set.size() != number_of_facets) { - while ( fit->first->is_facet_on_surface(fit->second) == false || - oriented_set.find(*fit) != oriented_set.end() || - - oriented_set.find(c2t3.opposite_facet(*fit)) != - oriented_set.end() ) - { - ++fit; - } - oriented_set.insert(*fit); - stack.push(*fit); - while(! stack.empty() ) - { - Facet f = stack.top(); - stack.pop(); - for(int ih = 0 ; ih < 3 ; ++ih) { - const int i1 = tr.vertex_triple_index(f.second, tr. cw(ih)); - const int i2 = tr.vertex_triple_index(f.second, tr.ccw(ih)); + while ( fit->first->is_facet_on_surface(fit->second) == false || + oriented_set.find(*fit) != oriented_set.end() || - const typename C2t3::Face_status face_status - = c2t3.face_status(Edge(f.first, i1, i2)); - if(face_status == C2t3::REGULAR) { - Facet fn = c2t3.neighbor(f, ih); - if (oriented_set.find(fn) == oriented_set.end()) { - if(oriented_set.find(c2t3.opposite_facet(fn)) == oriented_set.end()) - { - oriented_set.insert(fn); - stack.push(fn); - } - else { - success = false; // non-orientable - } - } - } - else if(face_status != C2t3::BOUNDARY) { - success = false; // non manifold, thus non-orientable - } - } // end "for each neighbor of f" - } // end "stack non empty" + oriented_set.find(c2t3.opposite_facet(*fit)) != + oriented_set.end() ) + { + ++fit; + } + oriented_set.insert(*fit); + stack.push(*fit); + while(! stack.empty() ) + { + Facet f = stack.top(); + stack.pop(); + for(int ih = 0 ; ih < 3 ; ++ih) { + const int i1 = tr.vertex_triple_index(f.second, tr. cw(ih)); + const int i2 = tr.vertex_triple_index(f.second, tr.ccw(ih)); + + const typename C2t3::Face_status face_status + = c2t3.face_status(Edge(f.first, i1, i2)); + if(face_status == C2t3::REGULAR) { + Facet fn = c2t3.neighbor(f, ih); + if (oriented_set.find(fn) == oriented_set.end()) { + if(oriented_set.find(c2t3.opposite_facet(fn)) == oriented_set.end()) + { + oriented_set.insert(fn); + stack.push(fn); + } + else { + success = false; // non-orientable + } + } + } + else if(face_status != C2t3::BOUNDARY) { + success = false; // non manifold, thus non-orientable + } + } // end "for each neighbor of f" + } // end "stack non empty" } // end "oriented_set not full" - - for(typename std::set::const_iterator fit = - oriented_set.begin(); - fit != oriented_set.end(); - ++fit) + + for(typename std::set::const_iterator fit = + oriented_set.begin(); + fit != oriented_set.end(); + ++fit) { const typename Tr::Cell_handle cell = fit->first; const int& index = fit->second; @@ -288,90 +288,90 @@ bool output_surface_facets_to_off (std::ostream& os, // void operator()( HalfedgeDS& hds) { // CGAL::Polyhedron_incremental_builder_3 builder(hds, true); // const typename Tr::size_type number_of_facets = c2t3.number_of_facets(); -// builder.begin_surface(tr.number_of_vertices(), -// number_of_facets); +// builder.begin_surface(tr.number_of_vertices(), +// number_of_facets); // { -// // Finite vertices coordinates. -// std::map V; -// int inum = 0; -// for(Finite_vertices_iterator vit = tr.finite_vertices_begin(); -// vit != tr.finite_vertices_end(); -// ++vit) -// { -// V[vit] = inum++; -// Point p = static_cast(vit->point()); -// builder.add_vertex(p); -// } -// Finite_facets_iterator fit = tr.finite_facets_begin(); -// std::set oriented_set; -// std::stack stack; +// // Finite vertices coordinates. +// std::map V; +// int inum = 0; +// for(Finite_vertices_iterator vit = tr.finite_vertices_begin(); +// vit != tr.finite_vertices_end(); +// ++vit) +// { +// V[vit] = inum++; +// Point p = static_cast(vit->point()); +// builder.add_vertex(p); +// } +// Finite_facets_iterator fit = tr.finite_facets_begin(); +// std::set oriented_set; +// std::stack stack; -// CGAL_assertion_code(typename Tr::size_type nb_facets = 0; ) +// CGAL_assertion_code(typename Tr::size_type nb_facets = 0; ) -// while (oriented_set.size() != number_of_facets) { -// while ( fit->first->is_facet_on_surface(fit->second) == false || -// oriented_set.find(*fit) != oriented_set.end() || +// while (oriented_set.size() != number_of_facets) { +// while ( fit->first->is_facet_on_surface(fit->second) == false || +// oriented_set.find(*fit) != oriented_set.end() || -// oriented_set.find(c2t3.opposite_facet(*fit)) != -// oriented_set.end() ) { -// ++fit; -// } -// oriented_set.insert(*fit); -// stack.push(*fit); -// while(! stack.empty() ) { -// Facet f = stack.top(); -// stack.pop(); -// for(int ih = 0 ; ih < 3 ; ++ih) { -// const int i1 = tr.vertex_triple_index(f.second, tr. cw(ih)); -// const int i2 = tr.vertex_triple_index(f.second, tr.ccw(ih)); -// if( c2t3.face_status(Edge(f.first, i1, i2)) == C2t3::REGULAR ) { -// Facet fn = c2t3.neighbor(f, ih); -// if (oriented_set.find(fn) == oriented_set.end() && -// oriented_set.find(c2t3.opposite_facet(fn)) == oriented_set.end()) -// { -// oriented_set.insert(fn); -// stack.push(fn); -// } -// } // end "if the edge is regular" -// } // end "for each neighbor of f" -// } // end "stack non empty" -// } // end "oriented_set not full" +// oriented_set.find(c2t3.opposite_facet(*fit)) != +// oriented_set.end() ) { +// ++fit; +// } +// oriented_set.insert(*fit); +// stack.push(*fit); +// while(! stack.empty() ) { +// Facet f = stack.top(); +// stack.pop(); +// for(int ih = 0 ; ih < 3 ; ++ih) { +// const int i1 = tr.vertex_triple_index(f.second, tr. cw(ih)); +// const int i2 = tr.vertex_triple_index(f.second, tr.ccw(ih)); +// if( c2t3.face_status(Edge(f.first, i1, i2)) == C2t3::REGULAR ) { +// Facet fn = c2t3.neighbor(f, ih); +// if (oriented_set.find(fn) == oriented_set.end() && +// oriented_set.find(c2t3.opposite_facet(fn)) == oriented_set.end()) +// { +// oriented_set.insert(fn); +// stack.push(fn); +// } +// } // end "if the edge is regular" +// } // end "for each neighbor of f" +// } // end "stack non empty" +// } // end "oriented_set not full" -// for(typename std::set::const_iterator fit = -// oriented_set.begin(); -// fit != oriented_set.end(); -// ++fit) -// { -// int indices[3]; -// int index = 0; -// for (int i=0; i<3; i++) -// indices[index++] = -// V[fit->first->vertex(tr.vertex_triple_index(fit->second, i))]; -// builder.add_facet(indices+0, indices+3); -// CGAL_assertion_code(++nb_facets); -// } -// CGAL_assertion(nb_facets == number_of_facets); -// // for( Finite_facets_iterator fit = tr.finite_facets_begin(); -// // fit != tr.finite_facets_end(); ++fit) -// // if ((*fit).first->is_facet_on_surface((*fit).second)==true) -// // { -// // int indices[3]; -// // int index = 0; -// // for (int i=0; i<3; i++) -// // std::cerr << ( indices[index++] = V[(*fit).first->vertex(tr.vertex_triple_index(fit->second, i))] ) << ", "; -// // std::cerr << "\n"; -// // if( builder.test_facet(indices+0, indices+3) ) -// // builder.add_facet(indices+0, indices+3); -// // else -// // { -// // builder.begin_facet(); -// // builder.add_vertex_to_facet(indices[2]); -// // builder.add_vertex_to_facet(indices[1]); -// // builder.add_vertex_to_facet(indices[0]); -// // builder.end_facet(); -// // } -// // CGAL_assertion_code(++nb_facets); -// // } +// for(typename std::set::const_iterator fit = +// oriented_set.begin(); +// fit != oriented_set.end(); +// ++fit) +// { +// int indices[3]; +// int index = 0; +// for (int i=0; i<3; i++) +// indices[index++] = +// V[fit->first->vertex(tr.vertex_triple_index(fit->second, i))]; +// builder.add_facet(indices+0, indices+3); +// CGAL_assertion_code(++nb_facets); +// } +// CGAL_assertion(nb_facets == number_of_facets); +// // for( Finite_facets_iterator fit = tr.finite_facets_begin(); +// // fit != tr.finite_facets_end(); ++fit) +// // if ((*fit).first->is_facet_on_surface((*fit).second)==true) +// // { +// // int indices[3]; +// // int index = 0; +// // for (int i=0; i<3; i++) +// // std::cerr << ( indices[index++] = V[(*fit).first->vertex(tr.vertex_triple_index(fit->second, i))] ) << ", "; +// // std::cerr << "\n"; +// // if( builder.test_facet(indices+0, indices+3) ) +// // builder.add_facet(indices+0, indices+3); +// // else +// // { +// // builder.begin_facet(); +// // builder.add_vertex_to_facet(indices[2]); +// // builder.add_vertex_to_facet(indices[1]); +// // builder.add_vertex_to_facet(indices[0]); +// // builder.end_facet(); +// // } +// // CGAL_assertion_code(++nb_facets); +// // } // } // builder.end_surface(); // } @@ -417,17 +417,17 @@ output_oriented_surface_facets_to_off (std::ostream& os, const Tr & T) { fit != T.finite_facets_end(); ++fit) if ((*fit).first->is_facet_on_surface((*fit).second)==true) { - typename Tr::Facet f = *fit; - typename Tr::Facet opposite = T.mirror_facet(f); - CGAL_assertion (f.first->is_in_domain() != - opposite.first->is_in_domain()); - if(!f.first->is_in_domain()) - f = T.mirror_facet(f); - os << "3 " - << V[f.first->vertex(T.vertex_triple_index(f.second,0))] << " " - << V[f.first->vertex(T.vertex_triple_index(f.second,1))] << " " - << V[f.first->vertex(T.vertex_triple_index(f.second,2))] << " " - << "\n"; // without color. + typename Tr::Facet f = *fit; + typename Tr::Facet opposite = T.mirror_facet(f); + CGAL_assertion (f.first->is_in_domain() != + opposite.first->is_in_domain()); + if(!f.first->is_in_domain()) + f = T.mirror_facet(f); + os << "3 " + << V[f.first->vertex(T.vertex_triple_index(f.second,0))] << " " + << V[f.first->vertex(T.vertex_triple_index(f.second,1))] << " " + << V[f.first->vertex(T.vertex_triple_index(f.second,2))] << " " + << "\n"; // without color. } } @@ -435,8 +435,8 @@ output_oriented_surface_facets_to_off (std::ostream& os, const Tr & T) { template < class Tr> void output_surface_facets_to_ghs (std::ostream& os_points, - std::ostream& os_faces, - const Tr & T) { + std::ostream& os_faces, + const Tr & T) { typedef typename Tr::Finite_facets_iterator Finite_facets_iterator; typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator; typedef typename Tr::Vertex_handle Vertex_handle; @@ -466,15 +466,15 @@ output_surface_facets_to_ghs (std::ostream& os_points, fit != T.finite_facets_end(); ++fit) if ((*fit).first->is_facet_on_surface((*fit).second)==true) { - Facet f = *fit; - if(!f.first->is_in_domain()) - f = T.mirror_facet(f); - os_faces - << "3 " - << V[f.first->vertex(T.vertex_triple_index(f.second,0))] << " " - << V[f.first->vertex(T.vertex_triple_index(f.second,1))] << " " - << V[f.first->vertex(T.vertex_triple_index(f.second,2))] << " " - << "0 0 0 0\n"; + Facet f = *fit; + if(!f.first->is_in_domain()) + f = T.mirror_facet(f); + os_faces + << "3 " + << V[f.first->vertex(T.vertex_triple_index(f.second,0))] << " " + << V[f.first->vertex(T.vertex_triple_index(f.second,1))] << " " + << V[f.first->vertex(T.vertex_triple_index(f.second,2))] << " " + << "0 0 0 0\n"; } } @@ -485,7 +485,7 @@ int number_of_facets_in_domain(const Tr& T) { fit != T.finite_facets_end(); ++fit) { typename Tr::Cell_handle neighb = fit->first->neighbor (fit->second); if ((fit->first->is_in_domain () || neighb->is_in_domain()) && - !fit->first->is_facet_on_surface (fit->second)) + !fit->first->is_facet_on_surface (fit->second)) ++result; } return result; @@ -522,14 +522,14 @@ output_interior_facets_to_off (std::ostream& os, const Tr & T) { fit != T.finite_facets_end(); ++fit){ typename Tr::Cell_handle neighb = fit->first->neighbor (fit->second); if ((fit->first->is_in_domain () || neighb->is_in_domain()) && - !fit->first->is_facet_on_surface (fit->second)) + !fit->first->is_facet_on_surface (fit->second)) { - os << "3 "; - for (int i=0; i<4; i++) + os << "3 "; + for (int i=0; i<4; i++) if (i != (*fit).second) - os << V[(*fit).first->vertex(i)] << " "; + os << V[(*fit).first->vertex(i)] << " "; - os << "\n"; // without color. + os << "\n"; // without color. } } } diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index edf816c5903..c72cefe1a95 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -6,7 +6,7 @@ // $URL$ // $Id$ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// +// // // Author(s) : Mariette Yvinec @@ -29,7 +29,7 @@ #include #include #include - + #include #include @@ -39,11 +39,11 @@ #include -namespace CGAL { +namespace CGAL { -template < class Vb = Triangulation_ds_vertex_base_2<>, +template < class Vb = Triangulation_ds_vertex_base_2<>, class Fb = Triangulation_ds_face_base_2<> > -class Triangulation_data_structure_2 +class Triangulation_data_structure_2 :public Triangulation_cw_ccw_2 { typedef Triangulation_data_structure_2 Tds; @@ -70,7 +70,7 @@ public: typedef Vertex_base Vertex; typedef Face_base Face; - + typedef Compact_container Face_range; typedef Compact_container Vertex_range; @@ -88,7 +88,7 @@ public: typedef Iterator_range > Vertex_handles; typedef Iterator_range > Face_handles; typedef Iterator_range Edges; - + typedef Vertex_iterator Vertex_handle; typedef Face_iterator Face_handle; typedef std::pair Edge; @@ -102,7 +102,7 @@ protected: //CREATORS - DESTRUCTORS public: - Triangulation_data_structure_2(); + Triangulation_data_structure_2(); Triangulation_data_structure_2(const Tds &tds); ~Triangulation_data_structure_2(); Tds& operator= (const Tds &tds); @@ -111,7 +111,7 @@ public: //ACCESS FUNCTIONS // We need the const_cast<>s because TDS is not const-correct. Face_range& faces() { return _faces;} - Face_range& faces() const + Face_range& faces() const { return const_cast(this)->_faces;} Vertex_range& vertices() {return _vertices;} Vertex_range& vertices() const @@ -122,21 +122,21 @@ public: size_type number_of_faces() const ; size_type number_of_edges() const; size_type number_of_full_dim_faces() const; //number of faces stored by tds - + // TEST FEATURES bool is_vertex(Vertex_handle v) const; bool is_edge(Face_handle fh, int i) const; bool is_edge(Vertex_handle va, Vertex_handle vb) const; - bool is_edge(Vertex_handle va, Vertex_handle vb, - Face_handle& fr, int& i) const; + bool is_edge(Vertex_handle va, Vertex_handle vb, + Face_handle& fr, int& i) const; bool is_face(Face_handle fh) const; - bool is_face(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3) const; - bool is_face(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3, - Face_handle& fr) const; + bool is_face(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3) const; + bool is_face(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3, + Face_handle& fr) const; // ITERATORS AND CIRCULATORS public: @@ -157,7 +157,7 @@ public: if (dimension() < 2) return faces_end(); return faces().begin(); } - + Face_iterator faces_end() const { return faces().end(); } @@ -165,7 +165,7 @@ public: Face_handles face_handles() const { return make_prevent_deref_range(faces_begin(),faces_end()); } - + Vertex_iterator vertices_begin() const { return vertices().begin(); } @@ -177,7 +177,7 @@ public: Vertex_handles vertex_handles() const { return make_prevent_deref_range(vertices_begin(),vertices_end()); } - + Edge_iterator edges_begin() const { return Edge_iterator(this); } @@ -190,18 +190,18 @@ public: return Edges(edges_begin(),edges_end()); } - Face_circulator incident_faces(Vertex_handle v, - Face_handle f = Face_handle()) const{ + Face_circulator incident_faces(Vertex_handle v, + Face_handle f = Face_handle()) const{ return Face_circulator(v,f); } - Vertex_circulator incident_vertices(Vertex_handle v, - Face_handle f = Face_handle()) const - { - return Vertex_circulator(v,f); + Vertex_circulator incident_vertices(Vertex_handle v, + Face_handle f = Face_handle()) const + { + return Vertex_circulator(v,f); } - Edge_circulator incident_edges(Vertex_handle v, - Face_handle f = Face_handle()) const{ + Edge_circulator incident_edges(Vertex_handle v, + Face_handle f = Face_handle()) const{ return Edge_circulator(v,f); } @@ -209,19 +209,19 @@ public: int count = 0; Vertex_circulator vc = incident_vertices(v), done(vc); if ( ! vc.is_empty()) { - do { - count += 1; + do { + count += 1; } while (++vc != done); } return count; } - + Vertex_handle mirror_vertex(Face_handle f, int i) const { CGAL_triangulation_precondition ( f->neighbor(i) != Face_handle() - && f->dimension() >= 1); + && f->dimension() >= 1); return f->neighbor(i)->vertex(mirror_index(f,i)); } @@ -230,7 +230,7 @@ public: { // return the index of opposite vertex in neighbor(i); CGAL_triangulation_precondition (f->neighbor(i) != Face_handle() && - f->dimension() >= 1); + f->dimension() >= 1); if (f->dimension() == 1) { CGAL_assertion(i<=1); const int j = f->neighbor(i)->index(f->vertex((i==0) ? 1 : 0)); @@ -240,8 +240,8 @@ public: return ccw( f->neighbor(i)->index(f->vertex(ccw(i)))); } - Edge - mirror_edge(const Edge e) const + Edge + mirror_edge(const Edge e) const { CGAL_triangulation_precondition(e.first->neighbor(e.second) != Face_handle() && e.first->dimension() >= 1); @@ -251,17 +251,17 @@ public: // MODIFY void flip(Face_handle f, int i); - + Vertex_handle insert_first(); Vertex_handle insert_second(); Vertex_handle insert_in_face(Face_handle f); Vertex_handle insert_in_edge(Face_handle f, int i); - Vertex_handle insert_dim_up(Vertex_handle w = Vertex_handle(), - bool orient=true); + Vertex_handle insert_dim_up(Vertex_handle w = Vertex_handle(), + bool orient=true); void remove_degree_3(Vertex_handle v, Face_handle f = Face_handle()); - void remove_1D(Vertex_handle v); - + void remove_1D(Vertex_handle v); + void remove_second(Vertex_handle v); void remove_first(Vertex_handle v); void remove_dim_down(Vertex_handle v); @@ -273,45 +273,45 @@ public: // template< class EdgeIt> // Vertex_handle star_hole(EdgeIt edge_begin,EdgeIt edge_end); - + // template< class EdgeIt> // void star_hole(Vertex_handle v, EdgeIt edge_begin, EdgeIt edge_end); // template< class EdgeIt, class FaceIt> -// Vertex_handle star_hole(EdgeIt edge_begin, -// EdgeIt edge_end, -// FaceIt face_begin, -// FaceIt face_end); - +// Vertex_handle star_hole(EdgeIt edge_begin, +// EdgeIt edge_end, +// FaceIt face_begin, +// FaceIt face_end); + // template< class EdgeIt, class FaceIt> // void star_hole(Vertex_handle v, -// EdgeIt edge_begin, -// EdgeIt edge_end, -// FaceIt face_begin, -// FaceIt face_end); - +// EdgeIt edge_begin, +// EdgeIt edge_end, +// FaceIt face_begin, +// FaceIt face_end); + Vertex_handle create_vertex(); Vertex_handle create_vertex(const Vertex &v); - Vertex_handle create_vertex(Vertex_handle v); //calls copy constructor + Vertex_handle create_vertex(Vertex_handle v); //calls copy constructor Face_handle create_face(); Face_handle create_face(const Face& f); - Face_handle create_face(Face_handle f); //calls copy constructor + Face_handle create_face(Face_handle f); //calls copy constructor - Face_handle create_face(Face_handle f1, int i1, - Face_handle f2, int i2, - Face_handle f3, int i3); - Face_handle create_face(Face_handle f1, int i1, - Face_handle f2, int i2); + Face_handle create_face(Face_handle f1, int i1, + Face_handle f2, int i2, + Face_handle f3, int i3); + Face_handle create_face(Face_handle f1, int i1, + Face_handle f2, int i2); Face_handle create_face(Face_handle f1, int i1, Vertex_handle v); - Face_handle create_face(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3); - Face_handle create_face(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3, - Face_handle f1, - Face_handle f2, - Face_handle f3); + Face_handle create_face(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3); + Face_handle create_face(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3, + Face_handle f1, + Face_handle f2, + Face_handle f3); void set_adjacency(Face_handle f0, int i0, Face_handle f1, int i1) const; @@ -351,14 +351,14 @@ public: // CHECKING bool is_valid(bool verbose = false, int level = 0) const; - + // HELPING private: typedef std::pair Vh_pair; public: - void set_adjacency(Face_handle fh, - int ih, - std::map< Vh_pair, Edge>& edge_map); + void set_adjacency(Face_handle fh, + int ih, + std::map< Vh_pair, Edge>& edge_map); void reorient_faces(); private: bool dim_down_precondition(Face_handle f, int i); @@ -416,12 +416,12 @@ public: // I/O Vertex_handle file_input(std::istream& is, bool skip_first=false); void file_output(std::ostream& os, - Vertex_handle v = Vertex_handle(), - bool skip_first=false) const; + Vertex_handle v = Vertex_handle(), + bool skip_first=false) const; Vertex_handle off_file_input(std::istream& is, bool verbose=false); void vrml_output(std::ostream& os, - Vertex_handle v = Vertex_handle(), - bool skip_first=false) const; + Vertex_handle v = Vertex_handle(), + bool skip_first=false) const; // SETTING (had to make them public for use in remove from Triangulations) void set_dimension (int n) {_dimension = n ;} @@ -432,7 +432,7 @@ public: /************* START OF MODIFICATIONS ***************/ template< class FaceIt > - Vertex_handle insert_in_hole(FaceIt face_begin, FaceIt face_end) + Vertex_handle insert_in_hole(FaceIt face_begin, FaceIt face_end) { Vertex_handle newv = create_vertex(); insert_in_hole(newv, face_begin, face_end); @@ -441,7 +441,7 @@ public: template< class FaceIt > - void insert_in_hole(Vertex_handle v, FaceIt face_begin, FaceIt face_end) + void insert_in_hole(Vertex_handle v, FaceIt face_begin, FaceIt face_end) { CGAL_triangulation_precondition(dimension() == 2); @@ -462,8 +462,8 @@ public: ii = newi; } } while(!found_boundary); - // Now we have found ONE edge on the boundary. - // From that one edge we must walk on the boundary + // Now we have found ONE edge on the boundary. + // From that one edge we must walk on the boundary // of the hole until we've covered the whole thing. bool complete_walk = false; @@ -485,14 +485,14 @@ public: } while (!complete_walk); // At this point, bdry_edges contains the edges that define // the boundary of the hole with a specific ordering: for any - // two consecutive edges in the vector e1 = (f1, i1), - // e2 = (f2, i2) it holds that + // two consecutive edges in the vector e1 = (f1, i1), + // e2 = (f2, i2) it holds that // f1->vertex(cw(i1)) == f2->vertex(ccw(i2)) for (unsigned int jj = 0; jj < bdry_edges.size(); jj++) { Face_handle fh = bdry_edges[jj].first; int idx = bdry_edges[jj].second; - + Vertex_handle v1 = fh->vertex(ccw(idx)); Vertex_handle v2 = fh->vertex(cw(idx)); @@ -530,7 +530,7 @@ public: template< class EdgeIt> Vertex_handle star_hole(EdgeIt edge_begin, EdgeIt edge_end) - // creates a new vertex + // creates a new vertex // and stars from it // the hole described by the range [edge_begin,edge_end[ // the triangulation is assumed to have dim=2 @@ -540,30 +540,30 @@ public: star_hole(newv, edge_begin, edge_end); return newv; } - + template< class EdgeIt> void star_hole(Vertex_handle v, EdgeIt edge_begin, EdgeIt edge_end) // uses vertex v // to star the hole described by the range [edge_begin,edge_end[ // the triangulation is assumed to have dim=2 // the hole is supposed to be ccw oriented - { + { std::list empty_list; - star_hole(v, - edge_begin, - edge_end, - empty_list.begin(), - empty_list.end()); - return; + star_hole(v, + edge_begin, + edge_end, + empty_list.begin(), + empty_list.end()); + return; } template< class EdgeIt, class FaceIt> - Vertex_handle star_hole(EdgeIt edge_begin, - EdgeIt edge_end, - FaceIt face_begin, - FaceIt face_end) - // creates a new vertex + Vertex_handle star_hole(EdgeIt edge_begin, + EdgeIt edge_end, + FaceIt face_begin, + FaceIt face_end) + // creates a new vertex // and stars from it // the hole described by the range [edge_begin,edge_end[ // reusing the faces in the range [face_begin,face_end[ @@ -574,13 +574,13 @@ public: star_hole(newv, edge_begin, edge_end, face_begin, face_end); return newv; } - + template< class EdgeIt, class FaceIt> void star_hole(Vertex_handle newv, - EdgeIt edge_begin, - EdgeIt edge_end, - FaceIt face_begin, - FaceIt face_end) + EdgeIt edge_begin, + EdgeIt edge_end, + FaceIt face_begin, + FaceIt face_end) // uses vertex v // to star the hole described by the range [edge_begin,edge_end[ // reusing the faces in the range [face_begin,face_end[ @@ -596,7 +596,7 @@ public: fn->vertex(cw(in))->set_face(fn); Face_handle first_f = reset_or_create_face(fn, in , newv, fit, face_end); Face_handle previous_f=first_f, next_f; - ++eit; + ++eit; for( ; eit != edge_end ; eit++) { fn = (*eit).first; @@ -609,39 +609,39 @@ public: set_adjacency(next_f, 0, first_f, 1); newv->set_face(first_f); - return; + return; } private: template< class FaceIt> - Face_handle reset_or_create_face(Face_handle fn, - int in, - Vertex_handle v, - FaceIt& fit, - const FaceIt& face_end) + Face_handle reset_or_create_face(Face_handle fn, + int in, + Vertex_handle v, + FaceIt& fit, + const FaceIt& face_end) { if (fit == face_end) return create_face(fn, in, v); (*fit)->set_vertices(fn->vertex(cw(in)), fn->vertex(ccw(in)), v); (*fit)->set_neighbors(Face_handle(),Face_handle(),fn); fn->set_neighbor(in, *fit); - return *fit++; + return *fit++; } }; //for backward compatibility template < class Gt , class Vb, class Fb> -class Triangulation_default_data_structure_2 +class Triangulation_default_data_structure_2 : public Triangulation_data_structure_2 { public: typedef Triangulation_data_structure_2 Tds; typedef Triangulation_default_data_structure_2 Tdds; - typedef Gt Geom_traits; + typedef Gt Geom_traits; Triangulation_default_data_structure_2(const Geom_traits& = Geom_traits()) : Tds() {} - + Triangulation_default_data_structure_2(const Tdds &tdds) : Tds(tdds) {} }; @@ -655,15 +655,15 @@ public: typedef Triangulation_data_structure_2 Tds; typedef Triangulation_data_structure_using_list_2 Tdsul; - Triangulation_data_structure_using_list_2(): Tds() {} + Triangulation_data_structure_using_list_2(): Tds() {} Triangulation_data_structure_using_list_2(const Tdsul &tdsul) : Tds(tdsul) {} }; - + template < class Vb, class Fb> Triangulation_data_structure_2 :: -Triangulation_data_structure_2() +Triangulation_data_structure_2() : _dimension(-2) { } @@ -681,7 +681,7 @@ Triangulation_data_structure_2 :: clear(); } -//assignement +//assignement template < class Vb, class Fb> Triangulation_data_structure_2& Triangulation_data_structure_2 :: @@ -689,7 +689,7 @@ operator= (const Tds &tds) { copy_tds(tds); return *this; -} +} template < class Vb, class Fb> void @@ -716,17 +716,17 @@ swap(Tds &tds) //ACCESS FUNCTIONS template -inline +inline typename Triangulation_data_structure_2::size_type Triangulation_data_structure_2 :: -number_of_faces() const +number_of_faces() const { if (dimension() < 2) return 0; return faces().size(); } template -inline +inline typename Triangulation_data_structure_2::size_type Triangulation_data_structure_2:: number_of_edges() const @@ -737,7 +737,7 @@ number_of_edges() const default: return 0; } } - + template typename Triangulation_data_structure_2::size_type Triangulation_data_structure_2:: @@ -780,23 +780,23 @@ is_edge(Vertex_handle va, Vertex_handle vb) const Vertex_circulator vc = incident_vertices(va), done(vc); if ( vc == 0) return false; do { - if( vb == vc ) {return true;} + if( vb == vc ) {return true;} } while (++vc != done); return false; } - + template bool Triangulation_data_structure_2:: -is_edge(Vertex_handle va, Vertex_handle vb, - Face_handle &fr, int & i) const +is_edge(Vertex_handle va, Vertex_handle vb, + Face_handle &fr, int & i) const // assume va is a vertex of t // returns true (false) if the line segment ab is (is not) an edge of t // if true is returned (fr,i) is the edge ab // with face fr on the right of a->b { - Face_handle fc = va->face(); + Face_handle fc = va->face(); Face_handle start = fc; if (fc == 0) return false; int inda, indb; @@ -814,7 +814,7 @@ is_edge(Vertex_handle va, Vertex_handle vb, } template -inline bool +inline bool Triangulation_data_structure_2:: is_face(Face_handle fh) const { @@ -825,23 +825,23 @@ is_face(Face_handle fh) const } template -inline bool +inline bool Triangulation_data_structure_2:: -is_face(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3) const +is_face(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3) const { Face_handle f; return is_face(v1,v2,v3,f); } template -bool +bool Triangulation_data_structure_2:: -is_face(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3, - Face_handle &f) const +is_face(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3, + Face_handle &f) const { if (dimension() != 2) return false; int i; @@ -852,7 +852,7 @@ is_face(Vertex_handle v1, int ind1= f->index(v1); int ind2= f->index(v2); if (v3 == f->vertex(3-ind1-ind2)) { return true;} - return false; + return false; } template @@ -863,19 +863,19 @@ flip(Face_handle f, int i) CGAL_triangulation_precondition( dimension()==2); Face_handle n = f->neighbor(i); int ni = mirror_index(f,i); //ni = n->index(f); - + Vertex_handle v_cw = f->vertex(cw(i)); Vertex_handle v_ccw = f->vertex(ccw(i)); // bl == bottom left, tr == top right Face_handle tr = f->neighbor(ccw(i)); - int tri = mirror_index(f,ccw(i)); + int tri = mirror_index(f,ccw(i)); Face_handle bl = n->neighbor(ccw(ni)); - int bli = mirror_index(n,ccw(ni)); - + int bli = mirror_index(n,ccw(ni)); + f->set_vertex(cw(i), n->vertex(ni)); n->set_vertex(cw(ni), f->vertex(i)); - + // update the neighborhood relations set_adjacency(f, i, bl, bli); set_adjacency(f, ccw(i), n, ccw(ni)); @@ -884,29 +884,29 @@ flip(Face_handle f, int i) if(v_cw->face() == f) { v_cw->set_face(n); } - + if(v_ccw->face() == n) { v_ccw->set_face(f); } } - + template < class Vb, class Fb> typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_first( ) { CGAL_triangulation_precondition( number_of_vertices() == 0 && - dimension()==-2 ); + dimension()==-2 ); return insert_dim_up(); } template < class Vb, class Fb> -typename Triangulation_data_structure_2::Vertex_handle +typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_second() { CGAL_triangulation_precondition( number_of_vertices() == 1 && - dimension()==-1 ); + dimension()==-1 ); return insert_dim_up(); } @@ -924,10 +924,10 @@ insert_in_face(Face_handle f) Vertex_handle v0 = f->vertex(0); Vertex_handle v2 = f->vertex(2); Vertex_handle v1 = f->vertex(1); - + Face_handle n1 = f->neighbor(1); Face_handle n2 = f->neighbor(2); - + Face_handle f1 = create_face(v0, v, v2, f, n1, Face_handle()); Face_handle f2 = create_face(v0, v1, v, f, Face_handle(), n2); @@ -957,11 +957,11 @@ Triangulation_data_structure_2:: insert_in_edge(Face_handle f, int i) //insert in the edge opposite to vertex i of face f { - CGAL_triangulation_precondition(f != Face_handle() && dimension() >= 1); + CGAL_triangulation_precondition(f != Face_handle() && dimension() >= 1); if (dimension() == 1) {CGAL_triangulation_precondition(i == 2);} - if (dimension() == 2) {CGAL_triangulation_precondition(i == 0 || - i == 1 || - i == 2);} + if (dimension() == 2) {CGAL_triangulation_precondition(i == 0 || + i == 1 || + i == 2);} Vertex_handle v; if (dimension() == 1) { v = create_vertex(); @@ -978,7 +978,7 @@ insert_in_edge(Face_handle f, int i) Face_handle n = f->neighbor(i); int in = mirror_index(f,i); //n->index(f); v = insert_in_face(f); - flip(n,in); + flip(n,in); } return v; @@ -990,9 +990,9 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_dim_up(Vertex_handle w, bool orient) { - // the following function insert + // the following function insert // a vertex v which is outside the affine hull of Tds - // The triangulation will be starred from v and w + // The triangulation will be starred from v and w // ( geometrically w= // the infinite vertex ) // w=nullptr for first and second insertions // orient governs the orientation of the resulting triangulation @@ -1003,8 +1003,8 @@ insert_dim_up(Vertex_handle w, bool orient) Face_handle f2; const int dim = dimension(); //it is the resulting dimension - - switch (dim) { + + switch (dim) { case -1: f1 = create_face(v,Vertex_handle(),Vertex_handle()); v->set_face(f1); @@ -1019,64 +1019,64 @@ insert_dim_up(Vertex_handle w, bool orient) case 2 : { std::list faces_list; - Face_iterator ib= face_iterator_base_begin(); + Face_iterator ib= face_iterator_base_begin(); Face_iterator ib_end = face_iterator_base_end(); for (; ib != ib_end ; ++ib){ - faces_list.push_back( ib); + faces_list.push_back( ib); } - + std::list to_delete; typename std::list::iterator lfit = faces_list.begin(); Face_handle f, g; for ( ; lfit != faces_list.end() ; ++lfit) { - f = * lfit; - g = create_face(f); //calls copy constructor of face - f->set_vertex(dim,v); - g->set_vertex(dim,w); - set_adjacency(f, dim, g, dim); - if (f->has_vertex(w)) to_delete.push_back(g); // flat face to delete + f = * lfit; + g = create_face(f); //calls copy constructor of face + f->set_vertex(dim,v); + g->set_vertex(dim,w); + set_adjacency(f, dim, g, dim); + if (f->has_vertex(w)) to_delete.push_back(g); // flat face to delete } lfit = faces_list.begin(); for ( ; lfit != faces_list.end() ; ++lfit) { - f = * lfit; - g = f->neighbor(dim); - for(int j = 0; j < dim ; ++j) { - g->set_neighbor(j, f->neighbor(j)->neighbor(dim)); - } + f = * lfit; + g = f->neighbor(dim); + for(int j = 0; j < dim ; ++j) { + g->set_neighbor(j, f->neighbor(j)->neighbor(dim)); + } } // couldn't unify the code for reorientation mater - lfit = faces_list.begin() ; + lfit = faces_list.begin() ; if (dim == 1){ - if (orient) { - (*lfit)->reorient(); ++lfit ; (*lfit)->neighbor(1)->reorient(); - } - else { - (*lfit)->neighbor(1)->reorient(); ++lfit ; (*lfit)->reorient(); - } + if (orient) { + (*lfit)->reorient(); ++lfit ; (*lfit)->neighbor(1)->reorient(); + } + else { + (*lfit)->neighbor(1)->reorient(); ++lfit ; (*lfit)->reorient(); + } } else { // dimension == 2 - for( ;lfit != faces_list.end(); ++lfit ) { - if (orient) {(*lfit)->neighbor(2)->reorient();} - else { (*lfit)->reorient();} - } + for( ;lfit != faces_list.end(); ++lfit ) { + if (orient) {(*lfit)->neighbor(2)->reorient();} + else { (*lfit)->reorient();} + } } lfit = to_delete.begin(); int i1, i2; for ( ;lfit != to_delete.end(); ++lfit){ - f = *lfit ; - int j ; - if (f->vertex(0) == w) {j=0;} - else {j=1;} - f1= f->neighbor(dim); i1= mirror_index(f,dim); //f1->index(f); - f2= f->neighbor(j); i2= mirror_index(f,j); //f2->index(f); - set_adjacency(f1, i1, f2, i2); - delete_face(f); + f = *lfit ; + int j ; + if (f->vertex(0) == w) {j=0;} + else {j=1;} + f1= f->neighbor(dim); i1= mirror_index(f,dim); //f1->index(f); + f2= f->neighbor(j); i2= mirror_index(f,j); //f2->index(f); + set_adjacency(f1, i1, f2, i2); + delete_face(f); } - + v->set_face( *(faces_list.begin())); } break; @@ -1098,42 +1098,42 @@ remove_degree_3(Vertex_handle v, Face_handle f) if (f == Face_handle()) {f= v->face();} else { CGAL_triangulation_assertion( f->has_vertex(v));} - + int i = f->index(v); Face_handle left = f->neighbor(cw(i)); - int li = mirror_index(f,cw(i)); + int li = mirror_index(f,cw(i)); Face_handle right = f->neighbor(ccw(i)); - int ri = mirror_index(f,ccw(i)); + int ri = mirror_index(f,ccw(i)); Face_handle ll, rr; Vertex_handle q = left->vertex(li); CGAL_triangulation_assertion( left->vertex(li) == right->vertex(ri)); - + ll = left->neighbor(cw(li)); if(ll != Face_handle()) { - int lli = mirror_index(left,cw(li)); + int lli = mirror_index(left,cw(li)); ll->set_neighbor(lli, f); - } + } f->set_neighbor(cw(i), ll); - if (f->vertex(ccw(i))->face() == left) f->vertex(ccw(i))->set_face(f); - + if (f->vertex(ccw(i))->face() == left) f->vertex(ccw(i))->set_face(f); + rr = right->neighbor(ccw(ri)); if(rr != Face_handle()) { int rri = mirror_index(right,ccw(ri)); //rr->index(right); rr->set_neighbor(rri, f); - } + } f->set_neighbor(ccw(i), rr); - if (f->vertex(cw(i))->face() == right) f->vertex(cw(i))->set_face(f); - + if (f->vertex(cw(i))->face() == right) f->vertex(cw(i))->set_face(f); + f->set_vertex(i, q); if (q->face() == right || q->face() == left) { q->set_face(f); } delete_face(right); delete_face(left); - + delete_vertex(v); -} +} template void @@ -1143,7 +1143,7 @@ dim_down(Face_handle f, int i) CGAL_triangulation_expensive_precondition( is_valid() ); CGAL_triangulation_precondition( dimension() == 2 ); CGAL_triangulation_precondition( number_of_vertices() > 3 ); - CGAL_triangulation_precondition( degree( f->vertex(i) ) == + CGAL_triangulation_precondition( degree( f->vertex(i) ) == number_of_vertices()-1 ); Vertex_handle v = f->vertex(i); @@ -1176,12 +1176,12 @@ dim_down(Face_handle f, int i) Vertex_handle v1 = f->vertex(1); f->set_vertex(1, v); Face_handle fl = create_face(v, v1, Vertex_handle(), - n0, f, Face_handle()); + n0, f, Face_handle()); f->set_neighbor(0, fl); n0->set_neighbor(1, fl); v->set_face(f); } - + template void Triangulation_data_structure_2:: @@ -1189,7 +1189,7 @@ remove_dim_down(Vertex_handle v) { Face_handle f; switch( dimension()){ - case -1: + case -1: delete_face(v->face()); break; case 0: @@ -1199,7 +1199,7 @@ remove_dim_down(Vertex_handle v) break; case 1: case 2: -// CGAL_triangulation_precondition ( +// CGAL_triangulation_precondition ( // (dimension() == 1 && number_of_vertices() == 3) || // (dimension() == 2 && number_of_vertices() > 3) ); // the faces incident to v are down graded one dimension @@ -1217,15 +1217,15 @@ remove_dim_down(Vertex_handle v) for( ; lfit != to_downgrade.end() ; ++lfit) { f = *lfit; j = f->index(v); if (dimension() == 1) { - if (j == 0) f->reorient(); - f->set_vertex(1,Vertex_handle()); - f->set_neighbor(1, Face_handle()); + if (j == 0) f->reorient(); + f->set_vertex(1,Vertex_handle()); + f->set_neighbor(1, Face_handle()); } else { //dimension() == 2 - if (j == 0) f->cw_permute(); - else if(j == 1) f->ccw_permute(); - f->set_vertex(2, Vertex_handle()); - f->set_neighbor(2, Face_handle()); + if (j == 0) f->cw_permute(); + else if(j == 1) f->ccw_permute(); + f->set_vertex(2, Vertex_handle()); + f->set_neighbor(2, Face_handle()); } f->vertex(0)->set_face(f); } @@ -1234,7 +1234,7 @@ remove_dim_down(Vertex_handle v) for( ; lfit != to_delete.end() ; ++lfit) { delete_face(*lfit); } - } + } delete_vertex(v); set_dimension(dimension() -1); return; @@ -1242,11 +1242,11 @@ remove_dim_down(Vertex_handle v) template < class Vb, class Fb> void -Triangulation_data_structure_2:: +Triangulation_data_structure_2:: remove_1D(Vertex_handle v) { CGAL_triangulation_precondition( dimension() == 1 && - number_of_vertices() > 3); + number_of_vertices() > 3); Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} @@ -1268,21 +1268,21 @@ Triangulation_data_structure_2:: remove_second(Vertex_handle v) { CGAL_triangulation_precondition(number_of_vertices()== 2 && - dimension() == 0); + dimension() == 0); remove_dim_down(v); return; } - + template inline void Triangulation_data_structure_2:: remove_first(Vertex_handle v) { - CGAL_triangulation_precondition(number_of_vertices()== 1 && - dimension() == -1); + CGAL_triangulation_precondition(number_of_vertices()== 1 && + dimension() == -1); remove_dim_down(v); - return; + return; } template @@ -1304,9 +1304,9 @@ star_hole(Vertex_handle newv, List_edges& hole) // the triangulation is assumed to have dim=2 // hole is supposed to be ccw oriented { - + star_hole(newv, hole.begin(), hole.end()); - return; + return; } template @@ -1317,7 +1317,7 @@ make_hole(Vertex_handle v, List_edges& hole) // and return the dscription of the hole in hole { CGAL_triangulation_precondition(dimension() == 2); - std::list to_delete; + std::list to_delete; Face_handle f, fn; int i =0, in =0; @@ -1403,14 +1403,14 @@ create_face( Face_handle fh) template typename Triangulation_data_structure_2::Face_handle Triangulation_data_structure_2:: -create_face(Face_handle f1, int i1, - Face_handle f2, int i2, - Face_handle f3, int i3) +create_face(Face_handle f1, int i1, + Face_handle f2, int i2, + Face_handle f3, int i3) { Face_handle newf = faces().emplace(f1->vertex(cw(i1)), - f2->vertex(cw(i2)), - f3->vertex(cw(i3)), - f2, f3, f1); + f2->vertex(cw(i2)), + f3->vertex(cw(i3)), + f2, f3, f1); f1->set_neighbor(i1,newf); f2->set_neighbor(i2,newf); f3->set_neighbor(i3,newf); @@ -1423,9 +1423,9 @@ Triangulation_data_structure_2:: create_face(Face_handle f1, int i1, Face_handle f2, int i2) { Face_handle newf = faces().emplace(f1->vertex(cw(i1)), - f2->vertex(cw(i2)), - f2->vertex(ccw(i2)), - f2, Face_handle(), f1); + f2->vertex(cw(i2)), + f2->vertex(ccw(i2)), + f2, Face_handle(), f1); f1->set_neighbor(i1,newf); f2->set_neighbor(i2,newf); return newf; @@ -1457,7 +1457,7 @@ template typename Triangulation_data_structure_2::Face_handle Triangulation_data_structure_2:: create_face(Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, - Face_handle f1, Face_handle f2, Face_handle f3) + Face_handle f1, Face_handle f2, Face_handle f3) { Face_handle newf = faces().emplace(v1, v2, v3, f1, f2, f3); @@ -1484,7 +1484,7 @@ delete_face(Face_handle f) CGAL_triangulation_expensive_precondition( dimension() != 2 || is_face(f)); CGAL_triangulation_expensive_precondition( dimension() != 1 || is_edge(f,2)); CGAL_triangulation_expensive_precondition( dimension() != 0 || - is_vertex(f->vertex(0)) ); + is_vertex(f->vertex(0)) ); faces().erase(f); } @@ -1636,7 +1636,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) CGAL_triangulation_precondition( i >= 0 && i <= 2 ); // this methods does the "join"-operation and preserves - // the vertex v among the two vertices that define the edge (f, i) + // the vertex v among the two vertices that define the edge (f, i) Vertex_handle v1 = f->vertex( ccw(i) ); Vertex_handle v2 = f->vertex( cw(i) ); @@ -1655,7 +1655,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) remove_degree_3(v2, f->neighbor(ccw(i))); return v1; } - + /* // The following drawing corrsponds to the variables // used in this part... @@ -1671,10 +1671,10 @@ join_vertices(Face_handle f, int i, Vertex_handle v) // / \ / \ // / \ g / \ // / bl \ / br \ - // / \ / \ + // / \ / \ // *---------*---------* // ibl j=v4 ibr - // + // // The situation after the "join"-operation is as follows: // // i @@ -1687,9 +1687,9 @@ join_vertices(Face_handle f, int i, Vertex_handle v) // * v1 // /|\ // / | \ - // / | \ + // / | \ // / bl|br \ - // / | \ + // / | \ // *-----*-----* // */ @@ -1711,7 +1711,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) int ibr = mirror_index(g, cw(j) ); // we need to store the faces adjacent to v2 as well as the - // indices of v2 w.r.t. these faces, so that afterwards we can set + // indices of v2 w.r.t. these faces, so that afterwards we can set // v1 to be the vertex for these faces std::vector star_faces_of_v2; std::vector star_indices_of_v2; @@ -1742,7 +1742,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) star_faces_of_v2[k]->set_vertex( id, v1 ); } - // then make sure that all the vertices have correct pointers to + // then make sure that all the vertices have correct pointers to // faces Vertex_handle v3 = f->vertex(i); Vertex_handle v4 = g->vertex(j); @@ -1788,7 +1788,7 @@ insert_degree_2(Face_handle f, int i) // i / \ // * / \ // / \ / f \ - // / \ / _____ \ + // / \ / _____ \ // / f \ / / f1 \ \ // / \ |/ v \| // v0=ccw(i) *---------* v1=cw(i) ===> v0 *----*----* v1 @@ -1869,16 +1869,16 @@ bool Triangulation_data_structure_2:: is_valid(bool verbose, int level) const { - if(number_of_vertices() == 0){ + if(number_of_vertices() == 0){ return (dimension() == -2); } - + bool result = (dimension()>= -1); CGAL_triangulation_assertion(result); //count and test the validity of the faces (for positive dimensions) - Face_iterator ib = face_iterator_base_begin(); + Face_iterator ib = face_iterator_base_begin(); Face_iterator ib_end = face_iterator_base_end(); size_type count_stored_faces =0; for ( ; ib != ib_end ; ++ib){ @@ -1888,11 +1888,11 @@ is_valid(bool verbose, int level) const CGAL_triangulation_assertion(result); } } - + result = result && (count_stored_faces == number_of_full_dim_faces()); CGAL_triangulation_assertion( - count_stored_faces == number_of_full_dim_faces()); - + count_stored_faces == number_of_full_dim_faces()); + // vertex count size_type vertex_count = 0; for(Vertex_iterator vit = vertices_begin(); vit != vertices_end(); @@ -1904,10 +1904,10 @@ is_valid(bool verbose, int level) const } result = result && (number_of_vertices() == vertex_count); CGAL_triangulation_assertion( number_of_vertices() == vertex_count ); - + //edge count size_type edge_count = 0; - for(Edge_iterator eit = edges_begin(); eit != edges_end(); ++eit) { + for(Edge_iterator eit = edges_begin(); eit != edges_end(); ++eit) { ++edge_count; } @@ -1916,9 +1916,9 @@ is_valid(bool verbose, int level) const for(Face_iterator fit = faces_begin(); fit != faces_end(); ++fit) { ++face_count; } - + switch(dimension()) { - case -1: + case -1: result = result && vertex_count == 1 && face_count == 0 && edge_count == 0; CGAL_triangulation_assertion(result); @@ -1954,7 +1954,7 @@ copy_tds(const TDS_src& tds_src, const ConvertVertex& convert_vertex, const ConvertFace& convert_face) { - if (vert != typename TDS_src::Vertex_handle()) + if (vert != typename TDS_src::Vertex_handle()) CGAL_triangulation_precondition( tds_src.is_vertex(vert)); clear(); @@ -1963,9 +1963,9 @@ copy_tds(const TDS_src& tds_src, // Number of pointers to cell/vertex to copy per cell. int dim = (std::max)(1, dimension() + 1); - + if(n == 0) {return Vertex_handle();} - + //initializes maps Unique_hash_map vmap; Unique_hash_map fmap; @@ -1978,7 +1978,7 @@ copy_tds(const TDS_src& tds_src, convert_vertex(*vit1, *vh); } - //create faces + //create faces typename TDS_src::Face_iterator fit1 = tds_src.faces().begin(); for( ; fit1 != tds_src.faces_end(); ++fit1) { Face_handle fh = create_face( convert_face(*fit1) ); @@ -1986,7 +1986,7 @@ copy_tds(const TDS_src& tds_src, convert_face(*fit1, *fh); } - //link vertices to a cell + //link vertices to a cell vit1 = tds_src.vertices_begin(); for ( ; vit1 != tds_src.vertices_end(); vit1++) { vmap[vit1]->set_face(fmap[vit1->face()]); @@ -1996,11 +1996,11 @@ copy_tds(const TDS_src& tds_src, fit1 = tds_src.faces().begin(); for ( ; fit1 != tds_src.faces_end(); ++fit1) { for (int j = 0; j < dim ; ++j) { - fmap[fit1]->set_vertex(j, vmap[fit1->vertex(j)] ); - fmap[fit1]->set_neighbor(j, fmap[fit1->neighbor(j)]); + fmap[fit1]->set_vertex(j, vmap[fit1->vertex(j)] ); + fmap[fit1]->set_neighbor(j, fmap[fit1->neighbor(j)]); } } - + // remove the post condition because it is false when copying the // TDS of a regular triangulation because of hidden vertices // CGAL_triangulation_postcondition( is_valid() ); @@ -2015,7 +2015,7 @@ namespace internal { namespace TDS_2{ Vertex_tgt operator()(const Vertex_src& src) const { return Vertex_tgt( src.point() ); } - + void operator()(const Vertex_src&,Vertex_tgt&) const {} }; @@ -2024,27 +2024,27 @@ namespace internal { namespace TDS_2{ { Face_tgt operator()(const Face_src& /*src*/) const { return Face_tgt(); - } - + } + void operator()(const Face_src&,Face_tgt&) const {} }; - + template struct Default_vertex_converter { const Vertex& operator()(const Vertex& src) const { return src; } - + void operator()(const Vertex&,Vertex&) const {} }; - + template struct Default_face_converter{ const Face& operator()(const Face& src) const { return src; - } - + } + void operator()(const Face&,Face&) const {} }; } } //namespace internal::TDS_2 @@ -2071,7 +2071,7 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const // if non nullptr, v is the vertex to be output first // if skip_first is true, the point in the first vertex is not output // (it may be for instance the infinite vertex of the triangulation) - + size_type n = number_of_vertices(); size_type m = number_of_full_dim_faces(); if(is_ascii(os)) os << n << ' ' << m << ' ' << dimension() << std::endl; @@ -2082,7 +2082,7 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const Unique_hash_map F; - // first vertex + // first vertex int inum = 0; if ( v != Vertex_handle()) { V[v] = inum++; @@ -2092,14 +2092,14 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const if(is_ascii(os)) os << std::endl; } } - + // other vertices for( Vertex_iterator vit= vertices_begin(); vit != vertices_end() ; ++vit) { if ( v != vit ) { - V[vit] = inum++; - // os << vit->point(); - os << *vit; - if(is_ascii(os)) os << "\n"; + V[vit] = inum++; + // os << vit->point(); + os << *vit; + if(is_ascii(os)) os << "\n"; } } if(is_ascii(os)) os << "\n"; @@ -2118,7 +2118,7 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const if(is_ascii(os)) os << "\n"; } if(is_ascii(os)) os << "\n"; - + // neighbor pointers of the faces for( Face_iterator it = face_iterator_base_begin(); it != face_iterator_base_end(); ++it) { @@ -2143,7 +2143,7 @@ file_input( std::istream& is, bool skip_first) // if skip_first is true, a first vertex is added (infinite_vertex) //set this first vertex as infinite_Vertex if(number_of_vertices() != 0) clear(); - + size_type n, m; int d; is >> n >> m >> d; @@ -2165,7 +2165,7 @@ file_input( std::istream& is, bool skip_first) V[i] = create_vertex(); is >> *(V[i]); } - + // Creation of the faces int index; int dim = (dimension() == -1 ? 1 : dimension() + 1); @@ -2173,27 +2173,27 @@ file_input( std::istream& is, bool skip_first) for(i = 0; i < m; ++i) { F[i] = create_face() ; for(int j = 0; j < dim ; ++j){ - is >> index; - F[i]->set_vertex(j, V[index]); - // The face pointer of vertices is set too often, - // but otherwise we had to use a further map - V[index]->set_face(F[i]); + is >> index; + F[i]->set_vertex(j, V[index]); + // The face pointer of vertices is set too often, + // but otherwise we had to use a further map + V[index]->set_face(F[i]); } // read in non combinatorial info of the face is >> *(F[i]) ; } } - // Setting the neighbor pointers + // Setting the neighbor pointers { for(i = 0; i < m; ++i) { for(int j = 0; j < dimension()+1; ++j){ - is >> index; - F[i]->set_neighbor(j, F[index]); + is >> index; + F[i]->set_neighbor(j, F[index]); } } } - + return V[0]; } @@ -2242,11 +2242,11 @@ vrml_output( std::ostream& os, Vertex_handle v, bool skip_infinite) const // faces for(fit= faces_begin(); fit != faces_end(); ++fit) { if (!skip_infinite || !fit->has_vertex(v)) { - os << "\t\t\t"; - os << vmap[(*fit).vertex(0)] << ", "; - os << vmap[(*fit).vertex(1)] << ", "; - os << vmap[(*fit).vertex(2)] << ", "; - os << "-1, " << std::endl; + os << "\t\t\t"; + os << vmap[(*fit).vertex(0)] << ", "; + os << vmap[(*fit).vertex(1)] << ", "; + os << vmap[(*fit).vertex(2)] << ", "; + os << "-1, " << std::endl; } } os << "\t\t]" << std::endl; @@ -2270,8 +2270,8 @@ off_file_input( std::istream& is, bool verbose) if (! is) { if (scanner.verbose()) { std::cerr << " " << std::endl; - std::cerr << "TDS::off_file_input" << std::endl; - std::cerr << " input error: file format is not OFF." << std::endl; + std::cerr << "TDS::off_file_input" << std::endl; + std::cerr << " input error: file format is not OFF." << std::endl; } return vinf; } @@ -2306,10 +2306,10 @@ off_file_input( std::istream& is, bool verbose) scanner.scan_facet( no, i); if( ! is || no != 3) { if ( scanner.verbose()) { - std::cerr << " " << std::endl; - std::cerr << "TDS::off_file_input" << std::endl; - std::cerr << "facet " << i << "does not have 3 vertices." - << std::endl; + std::cerr << " " << std::endl; + std::cerr << "TDS::off_file_input" << std::endl; + std::cerr << "facet " << i << "does not have 3 vertices." + << std::endl; } is.clear( std::ios::badbit); return vinf; @@ -2323,7 +2323,7 @@ off_file_input( std::istream& is, bool verbose) } for (std::size_t ih = 0; ih < no; ++ih) { - set_adjacency(fh, ih, edge_map); + set_adjacency(fh, ih, edge_map); } } @@ -2334,9 +2334,9 @@ off_file_input( std::istream& is, bool verbose) while (!edge_map.empty()) { Face_handle fh = edge_map.begin()->second.first; int ih = edge_map.begin()->second.second; - Face_handle fn = create_face( vinf, - fh->vertex(cw(ih)), - fh->vertex(ccw(ih))); + Face_handle fn = create_face( vinf, + fh->vertex(cw(ih)), + fh->vertex(ccw(ih))); vinf->set_face(fn); set_adjacency(fn, 0, fh, ih); set_adjacency(fn, 1, inf_edge_map); @@ -2345,8 +2345,8 @@ off_file_input( std::istream& is, bool verbose) } CGAL_triangulation_assertion(inf_edge_map.empty()); } - - + + // coherent orientation reorient_faces(); return vinf; @@ -2356,16 +2356,16 @@ off_file_input( std::istream& is, bool verbose) template < class Vb, class Fb> void Triangulation_data_structure_2:: -set_adjacency(Face_handle fh, - int ih, - std::map< Vh_pair, Edge>& edge_map) +set_adjacency(Face_handle fh, + int ih, + std::map< Vh_pair, Edge>& edge_map) { // set adjacency to (fh,ih) using the the map edge_map // or insert (fh,ih) in edge map Vertex_handle vhcw = fh->vertex(cw(ih)); - Vertex_handle vhccw = fh->vertex(ccw(ih)); - Vh_pair vhp = vhcw < vhccw ? - std::make_pair(vhcw, vhccw) + Vertex_handle vhccw = fh->vertex(ccw(ih)); + Vh_pair vhp = vhcw < vhccw ? + std::make_pair(vhcw, vhccw) : std::make_pair(vhccw, vhcw) ; typename std::map::iterator emapit = edge_map.find(vhp); if (emapit == edge_map.end()) {// not found, insert edge @@ -2375,7 +2375,7 @@ set_adjacency(Face_handle fh, Edge e = emapit->second; set_adjacency( fh,ih, e.first, e.second); edge_map.erase(emapit); - } + } } @@ -2385,9 +2385,9 @@ void Triangulation_data_structure_2:: reorient_faces() { - // reorient the faces of a triangulation + // reorient the faces of a triangulation // needed for example in off_file_input - // because the genus is not known, the number of faces + // because the genus is not known, the number of faces std::set oriented_set; std::stack st; Face_iterator fit = faces_begin(); @@ -2395,7 +2395,7 @@ reorient_faces() while (0 != nf) { while ( !oriented_set.insert(fit).second ){ - ++fit; // find a germ for non oriented components + ++fit; // find a germ for non oriented components } // orient component --nf; @@ -2404,25 +2404,25 @@ reorient_faces() Face_handle fh = st.top(); st.pop(); for(int ih = 0 ; ih < 3 ; ++ih){ - Face_handle fn = fh->neighbor(ih); - if (oriented_set.insert(fn).second){ - int in = fn->index(fh); - if (fn->vertex(cw(in)) != fh->vertex(ccw(ih))) fn->reorient(); + Face_handle fn = fh->neighbor(ih); + if (oriented_set.insert(fn).second){ + int in = fn->index(fh); + if (fn->vertex(cw(in)) != fh->vertex(ccw(ih))) fn->reorient(); --nf; - st.push(fn); - } + st.push(fn); + } } } } return; } - + template < class Vb, class Fb> std::istream& -operator>>(std::istream& is, - Triangulation_data_structure_2& tds) +operator>>(std::istream& is, + Triangulation_data_structure_2& tds) { tds.file_input(is); return is; @@ -2431,14 +2431,14 @@ operator>>(std::istream& is, template < class Vb, class Fb> std::ostream& -operator<<(std::ostream& os, - const Triangulation_data_structure_2 &tds) +operator<<(std::ostream& os, + const Triangulation_data_structure_2 &tds) { tds.file_output(os); return os; } -} //namespace CGAL +} //namespace CGAL #endif //CGAL_TRIANGULATION_DATA_STRUCTURE_2_H diff --git a/Triangulation/doc/Triangulation/Triangulation.txt b/Triangulation/doc/Triangulation/Triangulation.txt index 1878f88fff0..c5216aa5c9e 100644 --- a/Triangulation/doc/Triangulation/Triangulation.txt +++ b/Triangulation/doc/Triangulation/Triangulation.txt @@ -32,12 +32,12 @@ A simplex \f$ s\in S\f$ is maximal if it is not a proper subset of some o set in \f$ S\f$. A simplex having \f$ k+1 \f$ vertices is said of dimension \f$ k \f$. An \f$ k\f$-face denotes a \f$ k\f$-dimensional simplex, i.e., a simplex with \f$ k+1\f$ -vertices. +vertices. The simplicial complex is pure if all the maximal simplices have the same dimension. -A triangulation is a simplicial complex -that is pure, connected and without boundaries nor singularities. The +A triangulation is a simplicial complex +that is pure, connected and without boundaries nor singularities. The dimension of the triangulation is the dimension of its maximal simplices. @@ -48,7 +48,7 @@ A proper face of a simplex is a strict subset of this simplex. Two faces \f$ \sigma\f$ and \f$ \sigma'\f$ are incident if and only if \f$ \sigma'\f$ is a proper face of \f$ \sigma\f$ or vice versa. -A complex has no boundaries if any proper face of a simplex is also a +A complex has no boundaries if any proper face of a simplex is also a proper face of another simplex. If the triangulation is of dimension \f$ d \f$, we use the following terminology:
      @@ -60,7 +60,7 @@ If the triangulation is of dimension \f$ d \f$, we use the following terminology
    • full cell: a \f$ d\f$-face.
    -If the vertices are embedded into Euclidean space \f$ \mathbb{R}^n\f$, +If the vertices are embedded into Euclidean space \f$ \mathbb{R}^n\f$, we deal with finite simplicial complexes, which have slightly different simplices and additional requirements: @@ -77,28 +77,28 @@ simplices (the empty set counts). This \cgal package provides four main classes for creating and manipulating triangulations. -The class `CGAL::Triangulation_data_structure` +The class `CGAL::Triangulation_data_structure` models an abstract triangulation: vertices in this class are not embedded in Euclidean space but are only of combinatorial nature. -The class `CGAL::Triangulation` +The class `CGAL::Triangulation` describes an embedded triangulation that has as vertices a given set of points. Methods are provided for the insertion of points in the triangulation, the traversal of various elements of the triangulation, as well as the location of a -query point inside the triangulation. +query point inside the triangulation. The triangulation covers the convex hull of the set of points. -The class `CGAL::Delaunay_triangulation` -builds the Delaunay triangulation of a set of points. +The class `CGAL::Delaunay_triangulation` +builds the Delaunay triangulation of a set of points. In a Delaunay triangulation, each face has the so-called Delaunay or empty-ball property: there exists a -circumscribing ball whose interior does not contain +circumscribing ball whose interior does not contain any vertex of the triangulation. -The class `CGAL::Regular_triangulation` -builds the regular triangulation --- also known as weighted Delaunay triangulation -- of a set of points. +The class `CGAL::Regular_triangulation` +builds the regular triangulation +-- also known as weighted Delaunay triangulation -- of a set of points. A detailed definition of such a triangulation is available in section \ref TriangulationSecRT. @@ -109,10 +109,10 @@ which \cgal provides one model class: `CGAL::Triangulation_data_structure`. A triangulation data structure can represent an abstract triangulation. - -The maximal dimension of a triangulation data structure is a + +The maximal dimension of a triangulation data structure is a positive integer equal to the maximum dimension a full cell can have. -This maximal dimension can be chosen by the user at the creation of the +This maximal dimension can be chosen by the user at the creation of the triangulation data structure and can then be obtained using the method `tds.maximal_dimension()`. A triangulation data structure also knows the current dimension of its full cells, which can be obtained using `tds.current_dimension()`. In the sequel, let @@ -122,8 +122,8 @@ The special meaning of negative values for \f$d\f$ is explained below. ## The Set of Faces ## -The set of faces of a triangulation data structure with -current dimension \f$ d \f$ forms a triangulation of the +The set of faces of a triangulation data structure with +current dimension \f$ d \f$ forms a triangulation of the topological sphere \f$ \mathbb{S}^d\f$. Two full cells \f$ \sigma\f$ and \f$ \sigma'\f$ sharing a facet are called @@ -134,10 +134,10 @@ Possible values of \f$d\f$ (the current dimension of the triangulation) i
    \f$d=-2\f$
    This corresponds to an empty triangulation data structure. -
    \f$d=-1\f$
    This corresponds to an abstract simplicial +
    \f$d=-1\f$
    This corresponds to an abstract simplicial complex reduced to a single vertex. -
    \f$d=0\f$
    This corresponds to an abstract simplicial +
    \f$d=0\f$
    This corresponds to an abstract simplicial complex including two vertices, each corresponding to a full cell; the two full cells being neighbors of each other. This is the unique triangulation of the \f$ 0\f$-sphere. @@ -145,7 +145,7 @@ triangulation of the \f$ 0\f$-sphere.
    \f$ 0< d \le D\f$
    This corresponds to a triangulation of the sphere \f$ \mathbb{S}^d\f$.
    - + ## The `Triangulation_data_structure` Class ## @@ -176,7 +176,7 @@ Indexing the vertices and neighbors of a full cell \f$ c\f$ in dimension \f$ d=2 \cgalFigureEnd Faces of dimension between 0 and \f$ d-1 \f$ can be accessed as -subfaces of a full cell, through the nested type `Face`. The `Face` instance +subfaces of a full cell, through the nested type `Face`. The `Face` instance corresponding to a face \f$ f \f$ stores a reference to a full cell `c` containing \f$ f \f$, and the indices of the vertices of `c` that belong to \f$ f \f$. @@ -212,7 +212,7 @@ template parameter and The last two parameters have default values and are thus not necessary, unless -the user needs custom types (see `Triangulation_data_structure`). +the user needs custom types (see `Triangulation_data_structure`). The first template parameter, `Dimensionality`, must be one of the following:
    • `CGAL::Dimension_tag` for some integer \f$ D \f$. This @@ -234,11 +234,11 @@ some nested types in `TriangulationDataStructure_`. The default values are `CGAL::Triangulation_ds_vertex` and `CGAL::Triangulation_ds_full_cell` -where `TDS` is the current class +where `TDS` is the current class `Triangulation_data_structure`. This creates a circular dependency, which we resolve in the same way as in the \cgal `Triangulation_2` and `Triangulation_3` packages (see -Chapters \ref Chapter_2D_Triangulation_Data_Structure, \ref Chapter_2D_Triangulations, +Chapters \ref Chapter_2D_Triangulation_Data_Structure, \ref Chapter_2D_Triangulations, \ref Chapter_3D_Triangulation_Data_Structure, and \ref Chapter_3D_Triangulations). In particular, models of the concepts `TriangulationDSVertex` and `TriangulationDSFullCell` must provide a nested template `Rebind_TDS` @@ -254,7 +254,7 @@ class. The user is encouraged to read the documentation of the \cgal The following examples shows how to construct a triangulation data structure by inserting vertices. Its main interest is that it demonstrates most of the API -to insert new vertices into the triangulation. +to insert new vertices into the triangulation.