mirror of https://github.com/CGAL/cgal
pass, user manual reviewer 1
This commit is contained in:
parent
c922c1b474
commit
a995ebf6ff
|
|
@ -18,7 +18,7 @@ singular of which is \textbf{simplex}).
|
|||
%
|
||||
A simplex $s\in S$ is \textbf{maximal} if it is not a proper subset of some other
|
||||
set in $S$. The simplicial complex is \textbf{pure} %(or \textbf{homogeneous})
|
||||
if all the maximal simplices have the same cardinality, \emph{i.e.}, they have the same
|
||||
if all the maximal simplices have the same cardinality, i.e., they have the same
|
||||
number of vertices.
|
||||
In the sequel, we will call these maximal simplices \textbf{(full) cells}.
|
||||
A \textbf{face} of a simplex is a subset of it.
|
||||
|
|
@ -138,7 +138,7 @@ It always holds that $-2\leq\cd\leq\ad$ and $0<\ad$.
|
|||
|
||||
In a first approximation, a \tds\ can be viewed as
|
||||
a \emph{triangulation} of the topological sphere $\sphere^\cd$,
|
||||
\emph{i.e.}, its faces can be embedded to form a partition of
|
||||
i.e., its faces can be embedded to form a partition of
|
||||
$\sphere^\cd$ into $\cd$-simplices. When a
|
||||
\tds\ is used as the combinatorial part of a geometric triangulation, one
|
||||
special vertex of the \tds\ plays the role of the \textbf{vertex at
|
||||
|
|
@ -463,58 +463,26 @@ insertion}
|
|||
When using a cell type containing additional custom information, it may be
|
||||
useful to get an efficient access to the cells that are going to be erased
|
||||
upon the insertion of a new point in the Delaunay triangulation, and to the newly
|
||||
created cells. The code example below shows how one can have efficient
|
||||
created cells. The second part of code example below shows how one can have efficient
|
||||
access to both the conflict zone and the created cells, while still
|
||||
retaining an efficient update of the Delaunay triangulation.
|
||||
|
||||
(\textbf{Remark}: the code below will not compile unless you provide the
|
||||
missing \ccc{typedef}s and variables declarations.)
|
||||
\ccIncludeExampleCode{Triangulation/triangulation.cpp}
|
||||
|
||||
\begin{ccExampleCode}
|
||||
Delaunay_triangulation t;
|
||||
Vertex_handle v;
|
||||
// Conflict zones in dimension 0 or 1 are pretty boring.
|
||||
assert( 2 <= t.current_dimension() );
|
||||
|
||||
// We insert the points stored in the vector |points|.
|
||||
for( pit = points.begin(); pit != points.end(); ++pit )
|
||||
{
|
||||
Face f = t.make_empty_face();
|
||||
Facet ft;
|
||||
Full_cell_handle c;
|
||||
Locate_type lt;
|
||||
|
||||
c = t.locate(*pit, lt, f, ft, v);
|
||||
|
||||
if( lt == Delaunay_triangulation::ON_VERTEX
|
||||
|| lt == Delaunay_triangulation::OUTSIDE_AFFINE_HULL )
|
||||
{
|
||||
// There is, a priori, no full_cell of interest here.
|
||||
v = t.insert(*pit, lt, f, ft, s);
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef std::vector<Full_cell_handle> Full_cells;
|
||||
Full_cells zone, new_full_cells;
|
||||
std::back_insert_iterator<Full_cells> out(zone);
|
||||
Facet ftc = t.compute_conflict_zone(*pit, s, out);
|
||||
/*----------------------------------------------------\
|
||||
| Here, do something with the conflict zone cells |
|
||||
| stored in |zone|. |
|
||||
| DO NOT MODIFY the vector |zone|. |
|
||||
\----------------------------------------------------*/
|
||||
out = std::back_inserter(new_full_cells);
|
||||
v = t.insert_in_hole(p, zone.begin(), zone.end(), ftc, out);
|
||||
/*----------------------------------------------------\
|
||||
| Here, do something with the newly created cells |
|
||||
| stored in |new_full_cells|. |
|
||||
\----------------------------------------------------*/
|
||||
}
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
\section{Complexity and Performances}
|
||||
|
||||
The current implementation locate points by walking in the
|
||||
triangulation, and sort the points with spatial sort to insert a
|
||||
set of points. Thus the theoretical complexity are
|
||||
$O(n\log n)$ for inserting $n$ random points and $O(n^{\frac{1}{\cd}}$
|
||||
for inserting one point in a triangulation of $n$ random points.
|
||||
|
||||
The actual timing are the following:
|
||||
|
||||
% insert here the table produce by script in directory benchmark
|
||||
% (code to be done) !
|
||||
|
||||
\note{todo}
|
||||
|
||||
This section will be completed, when the code will be fully ready (and
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ to its bounded side.
|
|||
\ccc{Point_dimension_d(*it)} is $D$ for all \ccc{it} in
|
||||
\ccc{[start,end)}. \ccc{Point_dimension_d(p)} is also $D$
|
||||
The points in range
|
||||
\ccc{[start,end)} must be affinely independent, \emph{i.e.,} the simplex must
|
||||
\ccc{[start,end)} must be affinely independent, i.e., the simplex must
|
||||
not be flat.}
|
||||
|
||||
\ccNestedType{In_flat_side_of_oriented_sphere_d}{A predicate object that must
|
||||
|
|
@ -63,7 +63,7 @@ points used to construct \ccc{orient}.
|
|||
\ccc{Point_dimension_d(*it)} is $D$ for all \ccc{it} in
|
||||
\ccc{[start,end)}. \ccc{Point_dimension_d(p)} is also $D$.
|
||||
The points in range
|
||||
\ccc{[start,end)} must be affinely independent, \emph{i.e.,} the simplex must
|
||||
\ccc{[start,end)} must be affinely independent, {i.e.,} the simplex must
|
||||
not be flat.
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ not be flat.
|
|||
% constructs the center of the sphere circumscribing the points in
|
||||
% the range \ccc{R=[start, end)}. \ccPrecond The number of points in the range
|
||||
% must be equal to one more than the dimension of the Euclidean space the points
|
||||
% live in, \emph{i.e.}, \ccc{std::distance(start,end)} is equal to \ccc{start->dimension()+1}.}
|
||||
% live in, {i.e.}, \ccc{std::distance(start,end)} is equal to \ccc{start->dimension()+1}.}
|
||||
|
||||
|
||||
\ccCreation
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ must be in conflict with the full cell \ccc{c}.}
|
|||
|
||||
\ccMethod{bool conflict(const Point & p, Full_cell_const_handle c)
|
||||
const;}{Returns \ccc{true} if and only if the point \ccc{p} is in (Delaunay)
|
||||
conflict with cell \ccc{c} (\emph{i.e.}, the circumscribing ball of
|
||||
conflict with cell \ccc{c} ({i.e.}, the circumscribing ball of
|
||||
$c$ contains $p$ in its interior).
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ unbounded side of \ccc{S}. If the simplex is negatively oriented, the
|
|||
correspondance is inverted. \\ The range's size must of course be one more
|
||||
than the dimension of the Euclidean space the points live in: \ccPrecond
|
||||
\ccc{std::distance(start,end)==start->dimension()+1}. The points in range
|
||||
\ccc{[start,end)} must be affinely independent, \emph{i.e.,} the simplex must
|
||||
\ccc{[start,end)} must be affinely independent, {i.e.,} the simplex must
|
||||
not be flat.}
|
||||
|
||||
\ccNestedType{Side_of_oriented_orthogonal_subphere_d}{A predicate object that
|
||||
|
|
@ -50,7 +50,7 @@ range \ccc{[start,end)}) living in a same affine subspace.\\
|
|||
instance of the predicate around as long as one is sure that the affine
|
||||
subspace Aff doesn't change. \ccPrecond \ccc{std::distance(start,end)>=3} and
|
||||
\ccc{std::distance(start,end)<=start->dimension()+1}. The points in range
|
||||
\ccc{[start,end)} must be affinely independent in Aff, \emph{i.e.,} the
|
||||
\ccc{[start,end)} must be affinely independent in Aff, {i.e.,} the
|
||||
simplex must not be flat in Aff.}
|
||||
|
||||
\ccCreation
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ should always return \ccGlobalScope\ccc{POSITIVE}.
|
|||
\ccMethod{template< typename OutputIterator > OutputIterator
|
||||
incident_full_cells(Vertex_const_handle v, OutputIterator out) const;}
|
||||
{Insert in \ccc{out} all the cells that are incident to the vertex
|
||||
\ccc{v}, \emph{i.e.}, the cells that have the \ccc{Vertex v} as a vertex.
|
||||
\ccc{v}, {i.e.}, the cells that have the \ccc{Vertex v} as a vertex.
|
||||
Returns the (modified) output iterator.
|
||||
%\ccPrecond\ccc{is_full_cell(f.full_cell())}.
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ Returns the (modified) output iterator.
|
|||
\ccMethod{template< typename OutputIterator > OutputIterator
|
||||
incident_full_cells(const Face & f, OutputIterator out) const;}
|
||||
{Insert in \ccc{out} all the cells that are incident to the face \ccc{f},
|
||||
\emph{i.e.}, the cells that have the \ccc{Face f} as a subface.
|
||||
{i.e.}, the cells that have the \ccc{Face f} as a subface.
|
||||
Returns the (probably modified) output iterator.
|
||||
%\ccPrecond\ccc{is_full_cell(f.full_cell())}.
|
||||
}
|
||||
|
|
@ -405,7 +405,7 @@ the \ccc{query} point is returned. \end{itemize}}
|
|||
\ccMethod{Vertex_handle collapse_face(const Point & p, const Face & f);}
|
||||
{Contracts the \ccc{Face f} to a single vertex at position \ccc{p}. Returns a
|
||||
handle to that vertex. \ccPrecond The contracted triangulation must be valid
|
||||
(\emph{i.e.}, be a triangulation of a sphere of dimension
|
||||
({i.e.}, be a triangulation of a sphere of dimension
|
||||
\ccVar.\ccc{current_dimension()}).}
|
||||
|
||||
\end{ccAdvanced}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ incident cell. \ccPrecond \ccc{c} must not be the default-constructed
|
|||
|
||||
\ccMethod{bool is_valid(bool verbose=false, int level=0) const;}{Performs any
|
||||
desired test on a vertex. Al least, checks that the pointer to an incident
|
||||
cell is not the default constructed handle (\emph{i.e.}, is not
|
||||
cell is not the default constructed handle ({i.e.}, is not
|
||||
\ccc{NULL}). The parameter \ccc{level} is not used, but can be used in derived
|
||||
classes.}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,12 +191,12 @@ All the good cells are outputted into the last argument \ccc{out}.}
|
|||
\ccMethod{template< typename OutputIterator > OutputIterator
|
||||
incident_full_cells(Vertex_handle v, OutputIterator out) const;}
|
||||
{Insert in \ccc{out} all the cells that are incident to the vertex
|
||||
\ccc{v}, \emph{i.e.}, the full cells that have the \ccc{Vertex v} as a vertex.
|
||||
\ccc{v}, {i.e.}, the full cells that have the \ccc{Vertex v} as a vertex.
|
||||
Returns the (modified) output iterator.}
|
||||
\ccMethod{template< typename OutputIterator > OutputIterator
|
||||
incident_full_cells(const Face & f, OutputIterator out) const;}
|
||||
{Insert in \ccc{out} all the cells that are incident to the face \ccc{f},
|
||||
\emph{i.e.}, the full cells that have the \ccc{Face f} as a subface.
|
||||
{i.e.}, the full cells that have the \ccc{Face f} as a subface.
|
||||
Returns the (probably modified) output iterator.
|
||||
%\ccPrecond\ccc{is_full_cell(f.full_cell())}.
|
||||
}
|
||||
|
|
@ -450,7 +450,7 @@ what you are doing.
|
|||
|
||||
\ccMethod{Vertex_handle collapse_face(const Face & f);} {Contracts the
|
||||
\ccc{Face f} to a single vertex. Returns a handle to that vertex. \ccPrecond
|
||||
The contracted triangulation must be valid (\emph{i.e.}, be a triangulation of
|
||||
The contracted triangulation must be valid ({i.e.}, be a triangulation of
|
||||
a sphere of dimension \ccVar.\ccc{current_dimension()}).}
|
||||
|
||||
\ccMethod{void remove_decrease_dimension(Vertex_handle v, Vertex_handle
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ A \ccRefName\ simply describes a \ccc{k}-face \ccc{f} in a triangulation.
|
|||
It gives access to a handle to a full cell \ccc{c} containing the face
|
||||
\ccc{f} in its boundary, as well as the indices of the vertices of \ccc{f} in
|
||||
\ccc{c}. It must hold that \ccc{f} is a \textbf{proper} face of cell
|
||||
\ccc{c}, \emph{i.e.}, the dimension of \ccc{f} is strictly less than
|
||||
\ccc{c}, {i.e.}, the dimension of \ccc{f} is strictly less than
|
||||
the dimension of \ccc{c}.
|
||||
|
||||
\ccTypes
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ concepts) when the \ccc{TriangulationVertex} is used in the class
|
|||
\ccHeading{Input/Output}
|
||||
|
||||
\ccFunction{istream & operator>>(istream & is, TriangulationVertex & v);}%
|
||||
{Inputs the non-combinatorial information given by the vertex, \emph{i.e.},
|
||||
{Inputs the non-combinatorial information given by the vertex, {i.e.},
|
||||
the point and other possible information.}
|
||||
|
||||
\ccFunction{ostream & operator<<(ostream & os, const TriangulationVertex & v);}%
|
||||
{Outputs the non-combinatorial information given by the vertex, \emph{i.e.},
|
||||
{Outputs the non-combinatorial information given by the vertex, {i.e.},
|
||||
the point and other possible information.}
|
||||
|
||||
\ccSeeAlso
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ TDSFullCell>}.
|
|||
This class does not contain any geometric information but only combinatorial
|
||||
(adjacency) information. Thus, if the \ccc{Triangulation_data_structure} is
|
||||
used as a parameter of a (embedded) \ccc{Triangulation}, then its vertex template parameter
|
||||
has to fulfill additional geometric requirements, \emph{i.e.}, it has to be a
|
||||
has to fulfill additional geometric requirements, {i.e.}, it has to be a
|
||||
model of the refined concept \ccc{TriangulationVertex}.
|
||||
|
||||
This class can be used directly or can serve as a base to derive other classes
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ The parameter \ccc{t} is passed to the \ccc{Data} constructor.}
|
|||
\ccHeading{Input/Output}
|
||||
|
||||
\ccFunction{istream & operator>>(istream & is, Triangulation_full_cell & v);}%
|
||||
{Inputs the non-combinatorial information given by the cell, \emph{i.e.},
|
||||
{Inputs the non-combinatorial information given by the cell, {i.e.},
|
||||
the point and other possible information. The data of type \ccc{Data} is
|
||||
\textbf{also} read.}
|
||||
|
||||
\ccFunction{ostream & operator<<(ostream & os, const Triangulation_full_cell & v);}%
|
||||
{Outputs the non-combinatorial information given by the cell, \emph{i.e.},
|
||||
{Outputs the non-combinatorial information given by the cell, {i.e.},
|
||||
the point and other possible information. The data of type \ccc{Data} is
|
||||
\textbf{also} written.}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,12 +67,12 @@ passed to the \ccc{Data} constructor.}
|
|||
\ccHeading{Input/Output}
|
||||
|
||||
\ccFunction{istream & operator>>(istream & is, Triangulation_vertex & v);}%
|
||||
{Inputs the non-combinatorial information given by the vertex, \emph{i.e.},
|
||||
{Inputs the non-combinatorial information given by the vertex, {i.e.},
|
||||
the point and other possible information. The data of type \ccc{Data} is
|
||||
\textbf{also} read.}
|
||||
|
||||
\ccFunction{ostream & operator<<(ostream & os, const Triangulation_vertex & v);}%
|
||||
{Outputs the non-combinatorial information given by the vertex, \emph{i.e.},
|
||||
{Outputs the non-combinatorial information given by the vertex, {i.e.},
|
||||
the point and other possible information. The data of type \ccc{Data} is
|
||||
\textbf{also} written.}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include <CGAL/Cartesian_d.h>
|
||||
#include <CGAL/Filtered_kernel_d.h>
|
||||
//#include <CGAL/Filtered_kernel_d.h>
|
||||
#include <CGAL/point_generators_d.h>
|
||||
#include <CGAL/Delaunay_triangulation.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
|
@ -8,35 +8,29 @@
|
|||
#include <iterator>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
const int D=5;
|
||||
|
||||
typedef CGAL::Cartesian_d<double> K;
|
||||
/*
|
||||
typedef CGAL::Cartesian_d<double> K;//D;
|
||||
//typedef CGAL::Filtered_kernel_d<KD> K;
|
||||
typedef CGAL::Triangulation_ds_vertex< void > TDS_vertex;
|
||||
typedef CGAL::Triangulation_vertex< K, int, TDS_vertex > Vertex;
|
||||
typedef CGAL::Triangulation_ds_full_cell
|
||||
< void, CGAL::TDS_full_cell_default_storage_policy > TDS_cell;
|
||||
typedef CGAL::Triangulation_full_cell< K, int, TDS_cell > Cell;
|
||||
typedef CGAL::Triangulation_data_structure<
|
||||
// CGAL::Ambient_dimension< K::Point_d >::type , Vertex, Cell > TDS;
|
||||
CGAL::Dynamic_dimension_tag<5> , Vertex, Cell > TDS;
|
||||
typedef CGAL::Delaunay_triangulation<K, TDS> T;
|
||||
*/
|
||||
typedef CGAL::Triangulation_data_structure<
|
||||
CGAL::Dynamic_dimension_tag<5> > TDS;
|
||||
CGAL::Dimension_tag<D> , Vertex, Cell > TDS;
|
||||
typedef CGAL::Delaunay_triangulation<K,TDS> T;
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int D = 5; if( argc > 1 )D = atoi(argv[1]); // space dimension
|
||||
int N = 100; if( argc > 2 )N = atoi(argv[2]); // number of points
|
||||
int N = 100; if( argc > 2 )N = atoi(argv[1]); // number of points
|
||||
CGAL::Timer cost; // timer
|
||||
|
||||
// Instanciate a random point generator
|
||||
CGAL::Random rng;
|
||||
CGAL::Random rng(0);
|
||||
typedef CGAL::Random_points_in_cube_d<T::Point> Random_points_iterator;
|
||||
Random_points_iterator rand_it(D, 1.0, rng);
|
||||
|
||||
// Generate N random points
|
||||
std::vector<T::Point> points;
|
||||
CGAL::copy_n(rand_it, N, std::back_inserter(points));
|
||||
|
|
@ -50,5 +44,32 @@ int main(int argc, char **argv)
|
|||
t.insert(points.begin(), points.end());
|
||||
std::cout << " done in "<<cost.time()<<" seconds." << std::endl;
|
||||
assert( t.is_valid() );
|
||||
|
||||
// insert with special operations in conflict zone and new created cells
|
||||
cost.reset();
|
||||
std::cout << " adding "<<N<<" other points "<< std::endl;
|
||||
for(int i=0; i<N; ++i){
|
||||
T::Vertex_handle v;
|
||||
T::Face f = t.make_empty_face();
|
||||
T::Facet ft;
|
||||
T::Full_cell_handle c;
|
||||
T::Locate_type lt;
|
||||
typedef std::vector<T::Full_cell_handle> Full_cells;
|
||||
Full_cells zone, new_full_cells;
|
||||
std::back_insert_iterator<Full_cells> out(zone);
|
||||
c = t.locate(*++rand_it, lt, f, ft, v);
|
||||
T::Facet ftc = t.compute_conflict_zone(*rand_it, c, out);
|
||||
std::cout<<i<<" conflict zone of size "<<zone.size()<<" -> "<<std::flush;
|
||||
out = std::back_inserter(new_full_cells);
|
||||
std::cout<<" locate type "<<lt<<std::flush;
|
||||
v = t.insert_in_hole(*rand_it, zone.begin(), zone.end(), ftc, out);
|
||||
std::cout<<new_full_cells.size()<<" new cells"<<std::endl;
|
||||
// for (Full_cells::iterator it=new_full_cells.begin();
|
||||
// it!=new_full_cells.end(); ++it) (*it)->data() = zone.size();
|
||||
}
|
||||
std::cout << " done in "<<cost.time()<<" seconds." << std::endl;
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include <CGAL/Cartesian_d.h>
|
||||
#include <CGAL/Filtered_kernel_d.h>
|
||||
#include <CGAL/point_generators_d.h>
|
||||
#include <CGAL/Triangulation.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue