diff --git a/Triangulation/doc/Triangulation/CGAL/Delaunay_triangulation.h b/Triangulation/doc/Triangulation/CGAL/Delaunay_triangulation.h index dc8324be834..774d12ff6d3 100644 --- a/Triangulation/doc/Triangulation/CGAL/Delaunay_triangulation.h +++ b/Triangulation/doc/Triangulation/CGAL/Delaunay_triangulation.h @@ -23,7 +23,7 @@ structure. `TriangulationDataStructure` must be a model of the concept be defined by specifying only the first parameter, or by using the tag `CGAL::Default` as the second parameter. In both cases, `TriangulationDataStructure` defaults to -`Triangulation_data_structure::type, Triangulation_vertex, Triangulation_full_cell>`. +`Triangulation_data_structure, Triangulation_full_cell>`. The class `Delaunay_triangulation` inherits all the types defined in the base class `Triangulation`. Additionally, it diff --git a/Triangulation/doc/Triangulation/CGAL/Triangulation.h b/Triangulation/doc/Triangulation/CGAL/Triangulation.h index f079b11c59e..f437ae41ae8 100644 --- a/Triangulation/doc/Triangulation/CGAL/Triangulation.h +++ b/Triangulation/doc/Triangulation/CGAL/Triangulation.h @@ -22,7 +22,7 @@ structure. `TriangulationDataStructure` must be a model of the concept be defined by specifying only the first parameter, or by using the tag `CGAL::Default` as the second parameter. In both cases, `TriangulationDataStructure` defaults to -`Triangulation_data_structure::type, Triangulation_vertex, Triangulation_full_cell>`. +`Triangulation_data_structure, Triangulation_full_cell>`. Input/Output -------------- diff --git a/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h b/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h index 516851302ef..60abe05b5f2 100644 --- a/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h +++ b/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h @@ -73,9 +73,7 @@ The `is_valid` method is only minimally defined in the precisely here, for the model `Triangulation_ds_full_cell`. \cgalAdvanced Implements the validity checks required by the concept -`TriangulationDSFullCell`. In addition, it is checked that there is no -`NULL` handle to vertices in the middle of non-`NULL` ones, that is, -that the internal memory layout is not corrupted. +`TriangulationDSFullCell`. */ bool is_valid(bool verbose=false) const; diff --git a/Triangulation/doc/Triangulation/CGAL/Triangulation_full_cell.h b/Triangulation/doc/Triangulation/CGAL/Triangulation_full_cell.h index 90cdbbac35a..2f8278cbaef 100644 --- a/Triangulation/doc/Triangulation/CGAL/Triangulation_full_cell.h +++ b/Triangulation/doc/Triangulation/CGAL/Triangulation_full_cell.h @@ -60,10 +60,8 @@ typedef Data Data; /*! Sets the maximum possible dimension of the cell to `dmax`. -The parameter `t` is passed to the `Data` constructor. */ -template< typename T> Triangulation_full_cell(int dmax, const T -& t); +template< typename T> Triangulation_full_cell(int dmax); /// @} diff --git a/Triangulation/doc/Triangulation/Concepts/TriangulationDSFace.h b/Triangulation/doc/Triangulation/Concepts/TriangulationDSFace.h index 2db0d877ce9..a39af43210c 100644 --- a/Triangulation/doc/Triangulation/Concepts/TriangulationDSFace.h +++ b/Triangulation/doc/Triangulation/Concepts/TriangulationDSFace.h @@ -63,10 +63,10 @@ Triangulation_face(Full_cell_handle c); /*! Setup the `Face` knowing -the maximal dimension `ad`. Sets the `Face`'s full cell to the +the maximal dimension `md`. Sets the `Face`'s full cell to the default-constructed one. */ -Triangulation_face(const int ad); +Triangulation_face(const int md); /// @} diff --git a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h index 7e322e86a7a..eacac8f6452 100644 --- a/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h +++ b/Triangulation/doc/Triangulation/Concepts/TriangulationDataStructure.h @@ -267,7 +267,7 @@ full cells are also good. The argument `tp` is a predicate, i.e.\ a function or a functor providing `operator()`, that takes as argument a `Facet` -whose defining `Full_cell` is good. +whose `Full_cell` is good. The predicate must return `true` if the traversal of that `Facet` leads to a good full cell. @@ -330,8 +330,7 @@ Returns a handle to the `i`-th `Vertex` of the `Full_cell` `c`. Vertex_handle vertex(Full_cell_handle c, const int i) const; /*! -Returns the index of the vertex mirror of the `i`-th vertex of `c`. -Equivalently, returns the index of `c` as a neighbor of its `i`-th neighbor. +Returns the index of `c` as a neighbor of its `i`-th neighbor. \pre \f$0 \leq i \leq \f$`tds`.`current_dimension`() and `c!=Full_cell_handle()`. @@ -339,8 +338,7 @@ and `c!=Full_cell_handle()`. int mirror_index(Full_cell_handle c, int i) const; /*! -Returns the vertex mirror of the `i`-th vertex of `c`. -Equivalently, returns the vertex of the `i`-th neighbor of `c` +Returns the vertex of the `i`-th neighbor of `c` that is not vertex of `c`. \pre \f$0 \leq i \leq \f$`tds`.`current_dimension`() @@ -472,7 +470,7 @@ does not, with `f=(c,i)`. \f$ H\f$ the union of full cells in \f$ C\f$ is simply connected and its boundary \f$ \partial H\f$ is a combinatorial triangulation of the sphere \f$ \mathcal S^{d-1}\f$. -All vertices of the triangulation are on \f$ \partial H\f$. +All vertices of cells of \f$ C\f$ are on \f$ \partial H\f$. \cgalFigureBegin{triangulationfiginserthole,insert-in-hole.png} Insertion in a hole, \f$ d=2\f$ @@ -504,9 +502,9 @@ full cell is such that, if `f` was a full cell of maximal dimension in the initial complex, then `(f,v)`, in this order, is the corresponding full cell in the updated triangulation. A handle to `v` is returned (see Figure \cgalFigureRef{triangulationfiginsertincreasedim}). -\pre `tds`. +\pre If the current dimension is -2 (empty triangulation), then `star` -has to be omitted, otherwise +can be omitted (it is ignored), otherwise the current dimension must be strictly less than the maximal dimension and `star` must be a vertex of `tds`. @@ -629,6 +627,9 @@ neighbors as its number of facets (`current_dimension()+1`). vertices with each of its neighbor. +When `verbose` is set to `true`, messages are printed to give +a precise indication on the kind of invalidity encountered. + Returns `true` if all the tests pass, `false` if any test fails. See the documentation for the models of this concept to see the additionnal (if any) validity checks that they implement. diff --git a/Triangulation/doc/Triangulation/PackageDescription.txt b/Triangulation/doc/Triangulation/PackageDescription.txt index b7bb0250421..afeedec760f 100644 --- a/Triangulation/doc/Triangulation/PackageDescription.txt +++ b/Triangulation/doc/Triangulation/PackageDescription.txt @@ -19,8 +19,8 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -A triangulation is a pure simplicial complex which is connected and has no -singularities. Its faces are such that two of them either do not +A triangulation is a pure manifold simplicial complex which is connected and has no +boundaries. Its faces are such that two of them either do not intersect or share a common face. The basic triangulation class of \cgal is primarily designed to diff --git a/Triangulation/doc/Triangulation/Triangulation.txt b/Triangulation/doc/Triangulation/Triangulation.txt index 57a3c314c0f..c34eb539410 100644 --- a/Triangulation/doc/Triangulation/Triangulation.txt +++ b/Triangulation/doc/Triangulation/Triangulation.txt @@ -41,6 +41,12 @@ In the sequel, we will call these maximal simplices full cells. A face of a simplex is a subset of it. A proper face of a simplex is a strict subset of it. +\cgalModifBegin +A complex has no boundaries if any proper face of a simplex is also a +proper face of another simplex. A pure complex is manifold if all faces +of dimension \f$ d-1 \f$ are proper faces of exactly two simplices. +\cgalModifEnd + If the vertices are embedded into Euclidean space \f$ \R^d\f$, we deal with finite simplicial complexes which have slightly different simplices and additional requirements: @@ -56,8 +62,8 @@ entry for more about simplicial complexes. ## What's in this package? ## -This \cgal package deals with pure simplicial complexes which are connected -and have no singularities, which +This \cgal package deals with pure manifold simplicial complexes which are connected +and have no boundaries, which we will simply call in the sequel triangulations. It provides three main classes for creating and manipulating triangulations. @@ -65,9 +71,12 @@ The class `CGAL::Triangulation_data_structure` embeds an abstract -triangulation in Euclidean space, thus forming a geometric -triangulation. Methods are +\cgalModifBegin +The class `CGAL::Triangulation` +describes an embedded triangulation that has as vertices a given set of points +and which fills the convex hull of these points. +\cgalModifEnd +Methods are provided for the insertion of points in the triangulation, the traversal of various elements of the triangulation, as well as the localization of a query point inside the triangulation. @@ -332,6 +341,10 @@ The template parameter `TriangulationTraits` must be a model of the concept `TriangulationTraits` which provides the geometric `Point` type as well as various geometric predicates used by the `Triangulation` class. +\cgalModifBegin +The dimension of the predicates provided by `TriangulationTraits` must match +the dimension of the `TriangulationDataStructure`. +\cgalModifEnd \cgalModifBegin The template parameter `TriangulationDataStructure` must be a model of the concept @@ -451,6 +464,8 @@ triangulation, and sorts the points with spatial sort to insert a set of points. Thus the theoretical complexity are \f$ O(n\log n)\f$ for inserting \f$ n\f$ random points and \f$ O(n^{\frac{1}{d}})\f$ for inserting one point in a triangulation of \f$ n\f$ random points. +In the worst case, the expected complexity is +\f$ O(n^{\lceil\frac{d}{2}\rceil}+n\log n)\f$. The actual timing are the following: diff --git a/Triangulation/examples/Triangulation/triangulation.cpp b/Triangulation/examples/Triangulation/triangulation.cpp index 2f16043e2b9..ea499fb7189 100644 --- a/Triangulation/examples/Triangulation/triangulation.cpp +++ b/Triangulation/examples/Triangulation/triangulation.cpp @@ -28,7 +28,9 @@ int main() // collect faces of dimension 1 (edges) incident to the infinite vertex std::cout << "There are " << edges.size() << " vertices on the convex hull." << std::endl; -#include "triangulation1.cpp" -#include "triangulation2.cpp" + +#include "triangulation1.cpp" // See below +#include "triangulation2.cpp" + return 0; } diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index ca9ee26e91d..4a02ad29d53 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -1140,10 +1140,6 @@ Triangulation_data_structure CGAL_precondition( Vertex_handle() != star ); CGAL_expensive_precondition(is_vertex(star)); } - else - { - CGAL_precondition( Vertex_handle() == star ); - } set_current_dimension(prev_cur_dim + 1); Vertex_handle v = new_vertex(); diff --git a/Triangulation/include/CGAL/Triangulation_full_cell.h b/Triangulation/include/CGAL/Triangulation_full_cell.h index 634477cb3b5..6238278370a 100644 --- a/Triangulation/include/CGAL/Triangulation_full_cell.h +++ b/Triangulation/include/CGAL/Triangulation_full_cell.h @@ -57,14 +57,10 @@ public: typedef typename Base::template Rebind_TDS::Other TDSFullCell2; typedef Triangulation_full_cell Other; }; - + Triangulation_full_cell(const int d) : Base(d), data_() {} - template< typename T > - Triangulation_full_cell(const int d, const T & t) - : Base(d), data_(t) {} - Triangulation_full_cell(const Self & s) : Base(s), data_(s.data_) {}