mirror of https://github.com/CGAL/cgal
Additions and changes to the manual
This commit is contained in:
parent
58d65e47ab
commit
bccd316fdf
|
|
@ -40,11 +40,11 @@ meaning that you can customize some aspects of the process by passing a set of {
|
|||
|
||||
A \ccc{TriangulatedSurfaceMesh} is structuraly equivalent to a \ccc{CGAL::Polyhedron_3}) whose facets are only triangles.
|
||||
|
||||
Conceptually, is similar to a \ccc{HalfedgeDS} with the restriction that all facets are triangular. In order to simplify the {\em efficient} adaptation of concrete surface types, it is {\em not} modeled exactly as a \ccc{HalfedgeDS} but as a directed graph, with its related fucntions, and a property map, as explained below:
|
||||
Conceptually, is similar to a \ccc{HalfedgeDS} with the restriction that all facets are triangular. In order to simplify the {\em efficient} adaptation of concrete surface types, it is {\em not} modeled exactly as a \ccc{HalfedgeDS} but as a directed graph, with its related functions and associated properties, as explained below:
|
||||
|
||||
A \ccc{TriangulatedSurfaceMesh} refines the \ccc{HalfedgeGraph} concept which desribes only the vertices and edges of a \ccc{HalfedgeDS}. The triangular facets are not explicitely modeled.
|
||||
A \ccc{TriangulatedSurfaceMesh} refines the \ccc{HalfedgeGraph} concept which describes only the vertices and edges of a \ccc{HalfedgeDS}. The triangular facets are not explicitely modeled.
|
||||
|
||||
An edge is normally considered to be in the boundary of the surface when it is incident upon only one facet instead of two. The algorithm here needs to indentify border edges, but the incidence between triangles and edges is not represented explicitely, so a {\sc Bgl} \ccc{EdgeIsBorderPropertyMap} is used for that.
|
||||
An edge is normally considered to be in the boundary of the surface when it is incident upon only one facet instead of two. The algorithm here needs to indentify border edges, but the incidence between triangles and edges is not represented explicitely, so the {\em properties} \ccc{Edge_is_border} and \ccc{Vertex_is_border} are associated with the edges and vertices of a surface.
|
||||
|
||||
Following the {\sc Bgl} design, operations in a \ccc{TriangulatedSurfaceMesh} are defined in terms of free (non-member) functions.
|
||||
|
||||
|
|
@ -88,9 +88,14 @@ The stop predicate is called after each edge is selected for processing, {\em be
|
|||
|
||||
\subsection{Additional Surface Properties}
|
||||
|
||||
The algorithm needs to associate with each edge an implementation-specific internal record. It could do that unintrusively with an internal map, but that would incurr the additional overhead of a lookup. To avoid that inefficieny (which could be significant, if the surface had millions of edges) the algorithm requires the user to pass in a {\sc Bgl} \ccc{PropertyMap}, \ccc{EdgeExtraPointerMap}, associating a modifiable void pointer (that is, a \ccc{"void*\&"}) to each {\em undirected} edge. The map must be initialized with null pointers for all undirected edges in the surface (or all directed edges if the concrete surface internally distinguishes between the two).
|
||||
The algorithm needs to associate with each edge an implementation-specific internal record.
|
||||
To do that efficiently, the surfaces edges must be propery indexed, so
|
||||
a \ccAnchor{http://www.boost.org/libs/property_map/ReadablePropertyMap.html}{ReadablePropertyMap}
|
||||
corresponding to the \ccc{Edge_index} property must be passed.
|
||||
|
||||
Sometimes it is desirable to keep some edges uncollapsed. This can be controlled by fixing vertices in the surface: any edge incident upon a fixed vertex will be left uncollapsed. A {\sc BGL} \ccc{PropertyMap}, \ccc{VertexIsFixedMap}, associating a bool with every vertex is passed to indicate that.
|
||||
Sometimes it is desirable to keep some edges uncollapsed. This can be controlled by fixing vertices in the surface: any edge incident upon a fixed vertex will be left uncollapsed. Again
|
||||
\ccAnchor{http://www.boost.org/libs/property_map/ReadablePropertyMap.html}{ReadablePropertyMap}
|
||||
associating a bool to each vertx is passed to indicate that.
|
||||
|
||||
\subsection{Cost Strategy}
|
||||
|
||||
|
|
@ -124,7 +129,7 @@ In conjunction, the three parameters: \ccc{SetCollapseData}, \ccc{GetCost} and \
|
|||
|
||||
\subsection{Visitor}
|
||||
|
||||
Simplifying a large surface with millions of edges can take up a lot of time (several minutes). Thus, it is important to be able to monitor the simplification progress. This can be achieved passing a visitor function object. The information passed to the visitor at each step can be used to track statistics such as the number of edges that couldn't be collapsed. The requirements of the visitor object are specified in the \ccc{TSMEdgeCollapseVisitor} concept.
|
||||
Simplifying a large surface with millions of edges can take up a lot of time (several minutes). Thus, it is important to be able to monitor the simplification progress. This can be achieved passing a visitor function object. The information passed to the visitor at each step can be used to track statistics such as the number of edges that couldn't be collapsed. The requirements of the visitor object are specified in the \ccc{EdgeCollapseSimplificationVisitor} concept.
|
||||
|
||||
\section{API}
|
||||
|
||||
|
|
@ -135,7 +140,7 @@ The simplification algorithm is implemented as a free template function taking s
|
|||
\begin{cprog}
|
||||
int r = edge_collapse(surface
|
||||
,stop_condition
|
||||
,edge_extra_ptr_map
|
||||
,edge_index_map
|
||||
,vertex_is_fixed_map
|
||||
,set_collapse_data
|
||||
,get_cost
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Cached_cost<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Cached_cost<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Cached_placement<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Cached_placement<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::Count_ratio_stop_predicate<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Count_ratio_stop_predicate<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ It returns \ccc{true} when the number of current edges drops below a certain thr
|
|||
{Returns ( $((double)current_count/ (double)initial_count) < ratio$. All other parameters ignored.}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Count_stop_predicate<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Count_stop_predicate<TSM>}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::Count_stop_predicate<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Count_stop_predicate<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ It returns \ccc{true} when the number of current edges drops below a certain thr
|
|||
{Returns \ccc{current_count} $<$ \ccc{threshold}. All other parameters ignored.}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Count_ratio_stop_predicate<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate<TSM>}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,10 @@ The several callbacks given as member functions in the visitor are called from c
|
|||
\ccTypedef{typename boost::graph_traits<TSM>::edge_descriptor edge_descriptor;}
|
||||
{A {\sc Bgl} edge-descriptor representing an {\em undirected edge} of the surface.}
|
||||
\ccGlue
|
||||
\ccTypedef{typename boost::graph_traits<TSM>::verte_descriptor vertex_descriptor;}
|
||||
{A {\sc Bgl} vertex-descriptor representing a {\em vertex} of the surface.}
|
||||
\ccTypedef{typename CGAL::embeeded_graph_traits<TSM>::Point Point;}
|
||||
{The point type of the vertex.}
|
||||
\ccGlue
|
||||
\ccNestedType{size_type}{An \ccc{IntegerType} representing the number of edges}{}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{v} %% choose variable name
|
||||
|
|
@ -43,14 +45,73 @@ The several callbacks given as member functions in the visitor are called from c
|
|||
\ccOperations
|
||||
|
||||
\ccMethod
|
||||
{void OnStarted( Surface& aSurface );}
|
||||
{}
|
||||
{void OnStarted( TSM& surface );}
|
||||
{Called before the algorithm starts.}
|
||||
|
||||
\ccMethod
|
||||
{void OnFinished ( TSM& surface ) ; }
|
||||
{Called after the algorithm finishes.}
|
||||
|
||||
\ccMethod
|
||||
{void OnStopConditionReached( TSM& surface ) ; }
|
||||
{Called when the \ccc{StopPredicate} returned true
|
||||
(but not if the algorithm terminates because the surface couldn't be simplified any futher)
|
||||
}
|
||||
|
||||
\ccMethod
|
||||
{void OnCollected( edge_descriptor const& edge
|
||||
, bool is_fixed
|
||||
, TSM& surface
|
||||
);
|
||||
}
|
||||
{Called during the {\em collecting phase} (when a cost is assigned to the edges),
|
||||
for each \ccc{edge} collected.\\
|
||||
\ccc{is_fixed} indicates whether \ccc{edge} is fixed or not.
|
||||
If it is fixed it won't be collapsed.
|
||||
}
|
||||
|
||||
\ccMethod
|
||||
{void OnSelected(edge_descriptor const& edge
|
||||
,TSM& surface
|
||||
,boost::optional<double> cost
|
||||
,size_type initial_count
|
||||
,size_type current_count
|
||||
);
|
||||
}
|
||||
{Called during the {\em processing phase} (when edges are collapsed),
|
||||
for each \ccc{edge} that is selected.\\
|
||||
This method is called {\em before} the algorithm checks
|
||||
if the edge is collapsable.\\
|
||||
\ccc{cost} indicates the current collaspe cost for the \ccc{edge}.
|
||||
If {\em absent} (meaning that it couldn't be comptuted)
|
||||
the edge won't be collapsed.\\
|
||||
\ccc{initial_count} and \ccc{current_count} refers to
|
||||
the number of edges.
|
||||
}
|
||||
|
||||
\ccMethod
|
||||
{void OnCollapsing( edge_descriptor const& edge
|
||||
, TSM& surface
|
||||
, boost::optional<Point> placement
|
||||
);
|
||||
}
|
||||
{Called when \ccc{edge} is about to be collapsed and replaced by a vertex
|
||||
whose position is \ccc{*placement}.\\
|
||||
If \ccc{placement} is absent (meaning that it couldn't be computed)
|
||||
the edge won't be collapsed.
|
||||
}
|
||||
|
||||
\ccMethod
|
||||
{void OnNonCollapsable( edge_descriptor const& edge
|
||||
, TSM& surface
|
||||
);
|
||||
}
|
||||
{Called for each selected \ccc{edge} which cannot be
|
||||
collapsed because doing so would change the topological
|
||||
type of the surface. (turn it into a non-manifold
|
||||
for instance)
|
||||
}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Cached_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Edge_length_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_cost<TSM>}.
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
% +------------------------------------------------------------------------+
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Edge_length_cost<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_length_cost<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ The concept corresponds to an empty struct with no nested types nor members.
|
|||
|
||||
\ccHasModels
|
||||
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Empty_collapse_data}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Empty_collapse_data}.
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Empty_collapse_data}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Empty_collapse_data}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ The cost and placement are stored as \ccc{boost::optional} values (i.e. they can
|
|||
\ccMethod{boost::optional<Point> placement() const;}{The cached placement.}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Full_collapse_data<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Full_collapse_data<TSM>}.
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Full_collapse_data<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Full_collapse_data<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ The cost returned is an \ccc{boost::optional} value (i.e. it can be absent). An
|
|||
}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Cached_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Edge_length_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Cached_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_length_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}.
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,9 +74,9 @@ passed collapse data, if any, or perform the actual computation.
|
|||
}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Cached_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Edge_length_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Cached_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_length_cost<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}.
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::LindstromTurk_cost<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::LindstromTurk_cost<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -49,11 +49,11 @@ as the squared length of the edge.
|
|||
{Returns the cost of collapsing \ccc{edge}.}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_full_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_cost<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_placement<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_set_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_full_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_placement<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -36,11 +36,11 @@ cost strategy (Section~\ref{SurfaceMeshSimplification:LindstromTurkStrategy})
|
|||
{Initializes an instance which stores the given weights.}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_full_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_cost<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_placement<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_set_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_full_partial_collapse_data<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_placement<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::LindstromTurk_placement<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::LindstromTurk_placement<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_full_collapse_data<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::LindstromTurk_set_full_collapse_data<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -75,10 +75,10 @@ and assigns it to \ccc{data}.
|
|||
}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_partial_collapse_data<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_cost<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_placement<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_set_partial_collapse_data<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_placement<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_partial_collapse_data<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::LindstromTurk_set_partial_collapse_data<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -78,10 +78,10 @@ though is not in the data.)
|
|||
}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_full_collapse_data<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_cost<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_placement<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_set_full_collapse_data<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_placement<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Midpoint_placement<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Midpoint_placement<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ The cached cost is stored as an \ccc{boost::optional} value (i.e., it can be abs
|
|||
\ccMethod{boost::optional<FT> cost() const;}{The cached cost.}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Partial_collapse_data<TSM>}.
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Partial_collapse_data<TSM>}.
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Partial_collapse_data<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Partial_collapse_data<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ The concrete model specifies whether \ccc{cparams} or \ccc{pparams}, when not ig
|
|||
}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Set_empty_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Set_partial_collapse_data<TSM,GetCost>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Set_empty_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Set_partial_collapse_data<TSM,GetCost>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Edge_collapse::Set_empty_collapse_data<TSM>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Set_empty_collapse_data<TSM>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -58,10 +58,10 @@ The class \ccRefName\ has one template argument: the type of surface being simpl
|
|||
\ccc{SetCollapseData}
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_partial_collapse_data<TSM,GetCost>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_partial_collapse_data_LindstromTurk<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_full_collapse_data_LindstromTurk<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_partial_collapse_data<TSM,GetCost>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_partial_collapse_data_LindstromTurk<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_full_collapse_data_LindstromTurk<TSM>}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Set_full_collapse_data<TSM,GetCost,GetPlacement>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Set_full_collapse_data<TSM,GetCost,GetPlacement>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -42,11 +42,13 @@ and must be a model of \ccc{GetPlacement}.
|
|||
representing an {\em undirected edge} of the surface.
|
||||
}
|
||||
\ccGlue
|
||||
\ccTypedef{Full_collapse_data<TSM> Collapse_data;}{A type of collapse data which caches both the cost and placement.}
|
||||
\ccTypedef{Full_collapse_data<TSM> Collapse_data;}
|
||||
{A type of collapse data which caches both the cost and placement.}
|
||||
\ccGlue
|
||||
\ccTypedef{typename GetCost::Params Cost_params;}{The type of the parameters to the \ccc{GetCost} policy.
|
||||
It must be \ccc{DefaultConstructible} so it cannot be \ccc{void}.
|
||||
}
|
||||
\ccTypedef{typename GetCost::Params Cost_params;}
|
||||
{The type of the parameters to the \ccc{GetCost} policy.
|
||||
It must be \ccc{DefaultConstructible} so it cannot be \ccc{void}.
|
||||
}
|
||||
\ccGlue
|
||||
\ccTypedef{typename GetPlacement::Params Placement_params;}{The type of the parameters to the
|
||||
\ccc{GetPlacement} policy. It must be \ccc{DefaultConstructible} so it cannot be \ccc{void}.
|
||||
|
|
@ -73,10 +75,10 @@ and must be a model of \ccc{GetPlacement}.
|
|||
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_empty_collapse_data<TSM,GetCost>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_partial_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_partial_collapse_data_LindstromTurk<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_full_collapse_data_LindstromTurk<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_empty_collapse_data<TSM,GetCost>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_partial_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_partial_collapse_data_LindstromTurk<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_full_collapse_data_LindstromTurk<TSM>}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefClass}{CGAL::Surface_mesh_simplification::Edge_collapse::Set_partial_collapse_data<TSM,GetCost>}
|
||||
\begin{ccRefClass}{Surface_mesh_simplification::Set_partial_collapse_data<TSM,GetCost>}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -68,10 +68,10 @@ be a model of the \ccc{GetCost} concept.
|
|||
|
||||
|
||||
\ccSeeAlso
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_empty_collapse_data<TSM,GetCost>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_partial_collapse_data_LindstromTurk<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Set_full_collapse_data_LindstromTurk<TSM>}
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_empty_collapse_data<TSM,GetCost>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_partial_collapse_data_LindstromTurk<TSM>}\\
|
||||
\ccc{CGAL::Surface_mesh_simplification::Set_full_collapse_data_LindstromTurk<TSM>}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ The concept \ccRefName\ describes the requirements for the predicate which indic
|
|||
\ccGlue
|
||||
\ccNestedType{FT}{A \ccc{FieldType} representing the collapse cost}{}
|
||||
\ccGlue
|
||||
\ccNestedType{size_type}{An \ccc{IntegerType} representing a number of edges}{}
|
||||
\ccNestedType{size_type}{An \ccc{IntegerType} representing the number of edges}{}
|
||||
\ccGlue
|
||||
\ccTypedef{typename boost::graph_traits<TSM>::edge_descriptor edge_descriptor;}
|
||||
{A {\sc Bgl edge-descriptor} representing an {\em undirected edge} of the surface.}
|
||||
|
|
@ -57,8 +57,8 @@ The concept \ccRefName\ describes the requirements for the predicate which indic
|
|||
}
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_collapse::Count_stop_predicate<TSM>}
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_collapse::Count_ratio_stop_predicate<TSM>}
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Count_stop_predicate<TSM>}
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate<TSM>}
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,55 +38,62 @@ The concept \ccRefName\ describes the requirements for the Triangulated Surface
|
|||
,typename boost::graph_traits<Graph>::edge_descriptor p_t
|
||||
,typename boost::graph_traits<Graph>::edge_descriptor q_b
|
||||
,Graph& surface
|
||||
);} {Collapses the undirected edge p-q replacing it with one single vertex,
|
||||
);}
|
||||
{Collapses the undirected edge p-q replacing it with one single vertex.\\
|
||||
Details below ~\ref{SurfaceMeshSimplification:CollapseOperationDetails}.
|
||||
}
|
||||
|
||||
|
||||
\ccHeading{Collape Operation Semantics}\label{SurfaceMeshSimplification:CollapseOperationDetails}
|
||||
|
||||
This function assumes the surface to be an {\em open 2-manifold} and it must
|
||||
never be called in a context were the collape would result in the surface
|
||||
becoming a {\em non-manifold}. Thus, the following preconditions hold:\\
|
||||
%
|
||||
source(p-q) $==$ source(p-t).\\
|
||||
target(p-q) $==$ source(q-b).\\
|
||||
One of p-q or q-p is not a border edge.\\
|
||||
p-t is a null edge iff p-q is a border edge.\\
|
||||
q-b is a null edge iff q-p is a border edge.\\
|
||||
if p-t is non-null, next(t-p) $==$ p-q.\\
|
||||
if q-b is non-null, next(b-q) $==$ q-p.\\
|
||||
%
|
||||
The net effect of the operation is equivalent to removing one of the vertices
|
||||
and re-triangulating the resulting facet.\\
|
||||
%
|
||||
The actual collapse operation is required to remove at most
|
||||
2 triangles, 3 {\em undirected} edges and 1 vertex, as follows:\\
|
||||
%
|
||||
The triangle above p-q is called top-triangle.\\
|
||||
The triangle below p-q is called bottom-triangle.\\
|
||||
The triangle adjacent to the top-triangle along p-t is called top-left-triangle.\\
|
||||
The triangle adjacent to the bottom-triangle along q-b is called bottom-right-triangle.\\
|
||||
%
|
||||
The preconditions guarantee that the top-left-triangle and top-bottom-triangle
|
||||
are disjoint, that t-p and p-q are both incident on the top-triangle and that
|
||||
b-q and q-p are both incident on the bottom-triangle.\\
|
||||
%
|
||||
Either p or q is removed, which in turn removes the pair of opposing egdes
|
||||
p-q and q-p (that is, the undirected edge p-q).\\
|
||||
%
|
||||
If there is a top-triangle, that is, p-q is not a border edge and p-t $!=$ null, it is removed.\\
|
||||
If there is a bottom triange, that is, q-p is not a border edge and q-b $!=$ null, it is removed.\\
|
||||
(at least one of these triangles exist so at least 1 triangle, and at most 2, are removed).\\
|
||||
%
|
||||
Removing the top-triangle neccesarily removes the pair of opposing edges p-t and t-p.\\
|
||||
Removing the bottom-triangle neccesarily removes the pair of opposing edges q-b and b-q.\\
|
||||
%
|
||||
If the bottom-triangle is removed and neither the top-triangle nor
|
||||
the bottom-right-triangle exist, the vertex removed is q. In all other
|
||||
cases, the vertex removed is p.\\
|
||||
%
|
||||
If any triangle (other than the top and bottom, which are removed) is defined by
|
||||
the removed vertex, it must be redefined with the other vertex, but it cannot
|
||||
be replaced by a new triangle. (A model must follow the as-is rule: if it really
|
||||
needs to do replace triangles, the new triangles must aquire any property
|
||||
that could be internally or externally attached to the old triangle)\\
|
||||
%
|
||||
The function returns the vertex that is not removed.}
|
||||
never be called in a context were the collape would result in the surface
|
||||
becoming a {\em non-manifold}. Thus, the following preconditions hold:
|
||||
|
||||
source(p-q) $==$ source(p-t).\\
|
||||
target(p-q) $==$ source(q-b).\\
|
||||
One of p-q or q-p is not a border edge.\\
|
||||
p-t is a null edge iff p-q is a border edge.\\
|
||||
q-b is a null edge iff q-p is a border edge.\\
|
||||
if p-t is non-null, next(t-p) $==$ p-q.\\
|
||||
if q-b is non-null, next(b-q) $==$ q-p.
|
||||
|
||||
The net effect of the operation is equivalent to removing one of the vertices
|
||||
and re-triangulating the resulting facet.
|
||||
|
||||
The actual collapse operation is required to remove at most
|
||||
2 triangles, 3 {\em undirected} edges and 1 vertex, as follows:
|
||||
|
||||
The triangle above p-q is called top-triangle.\\
|
||||
The triangle below p-q is called bottom-triangle.\\
|
||||
The triangle adjacent to the top-triangle along p-t is called top-left-triangle.\\
|
||||
The triangle adjacent to the bottom-triangle along q-b is called bottom-right-triangle.
|
||||
|
||||
The preconditions guarantee that the top-left-triangle and top-bottom-triangle
|
||||
are disjoint, that t-p and p-q are both incident on the top-triangle and that
|
||||
b-q and q-p are both incident on the bottom-triangle.
|
||||
|
||||
Either p or q is removed, which in turn removes the pair of opposing egdes
|
||||
p-q and q-p (that is, the undirected edge p-q).
|
||||
|
||||
If there is a top-triangle, that is, p-q is not a border edge and p-t $!=$ null, it is removed.\\
|
||||
If there is a bottom triange, that is, q-p is not a border edge and q-b $!=$ null, it is removed.\\
|
||||
(at least one of these triangles exist so at least 1 triangle, and at most 2, are removed).
|
||||
|
||||
Removing the top-triangle neccesarily removes the pair of opposing edges p-t and t-p.\\
|
||||
Removing the bottom-triangle neccesarily removes the pair of opposing edges q-b and b-q.
|
||||
|
||||
If the bottom-triangle is removed and neither the top-triangle nor
|
||||
the bottom-right-triangle exist, the vertex removed is q. In all other
|
||||
cases, the vertex removed is p.
|
||||
|
||||
If any triangle (other than the top and bottom, which are removed) is defined by
|
||||
the removed vertex, it must be redefined with the other vertex, but it cannot
|
||||
be replaced by a new triangle. (A model must follow the as-is rule: if it really
|
||||
needs to do replace triangles, the new triangles must aquire any property
|
||||
that could be internally or externally attached to the old triangle)
|
||||
|
||||
The function returns the vertex that is not removed.
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Polyhedron_3<Traits>}
|
||||
|
|
|
|||
|
|
@ -21,14 +21,15 @@
|
|||
|
||||
\ccDefinition
|
||||
|
||||
The concept \ccRefName\ describes the requirements of a \ccc{PropertyMap} that indicates if a surface vertex is fixed.
|
||||
The concept \ccRefName\ describes the requirements of a
|
||||
\ccAnchor{http://www.boost.org/libs/property_map/ReadablePropertyMap.html}{ReadablePropertyMap}
|
||||
associating each vertex with a bool that indicates if it is fixed.
|
||||
\ccAnchor{http://www.boost.org/libs/graph/doc/Graph.html}{Bgl Graph}.
|
||||
|
||||
\ccRefines
|
||||
\ccc{PropertyMap}
|
||||
\ccAnchor{http://www.boost.org/libs/property_map/ReadablePropertyMap.html}{ReadablePropertyMap}
|
||||
|
||||
\ccTypes
|
||||
\ccTypedef{boost::readable_property_map_tag category;}
|
||||
{Indicates that this property is read-only.}
|
||||
|
||||
\ccTypedef{bool value_type;}
|
||||
{The type of the property.}
|
||||
|
|
@ -37,7 +38,7 @@ The concept \ccRefName\ describes the requirements of a \ccc{PropertyMap} that i
|
|||
{The result type of the map operator.}
|
||||
|
||||
\ccNestedType{key_type;}
|
||||
{The type of {\sc Bgl vertex-descriptor} to which the boolean is-border property is associated.}
|
||||
{The key type. Must be a valid {\sc Bgl} vertex-descriptor.}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{pm} %% choose variable name
|
||||
|
|
@ -50,8 +51,8 @@ The concept \ccRefName\ describes the requirements of a \ccc{PropertyMap} that i
|
|||
|
||||
|
||||
\ccHasModels
|
||||
\ccRefIdfierPage{CGAL::Vertex_is_fixed_map_always_false<TSM> }\\
|
||||
\ccRefIdfierPage{CGAL::Vertex_is_fixed_map_stored<TSM> }\\
|
||||
\ccRefIdfierPage{CGAL::Vertex_is_fixed_property_map_always_false<TSM> }\\
|
||||
\ccRefIdfierPage{CGAL::Vertex_is_fixed_property_map_stored<TSM> }\\
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,17 +29,10 @@ It always returns false.
|
|||
\ccInclude{CGAL/Surface_mesh_simplification/Vertex_is_fixed_property_map_always_false.h}
|
||||
|
||||
\ccTypes
|
||||
\ccTypedef{boost::readable_property_map_tag category;}
|
||||
{Indicates that this property is read-only.}
|
||||
|
||||
\ccTypedef{bool value_type;}
|
||||
{The type of the property.}
|
||||
|
||||
\ccTypedef{bool reference;}
|
||||
{The result type of the map operator.}
|
||||
\ccNestedType{TSM}{The TSM template parameter.}
|
||||
|
||||
\ccTypedef{typename boost::graph_traits<TSM>::vertex_descriptor key_type;}
|
||||
{The key type of the property map: A {\sc Bgl vertex-descriptor.}}
|
||||
\ccTypedef{typename boost::graph_traits<TSM const>::vertex_descriptor key_type;}
|
||||
{The type of {\sc Bgl} vertex descriptor used as key.}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{pm} %% choose variable name
|
||||
|
|
|
|||
|
|
@ -29,8 +29,10 @@ It returns a flag directly stored in the surface vertex.
|
|||
\ccInclude{CGAL/Surface_mesh_simplification/Vertex_is_fixed_property_map_stored.h}
|
||||
|
||||
\ccTypes
|
||||
\ccTypedef{typename boost::graph_traits<TSM>::vertex_descriptor key_type;}
|
||||
{The key type of the property map: A {\sc Bgl vertex-descriptor}. }
|
||||
\ccNestedType{TSM}{The TSM template parameter.}
|
||||
|
||||
\ccTypedef{typename boost::graph_traits<TSM const>::vertex_descriptor key_type;}
|
||||
{The type of {\sc Bgl} vertex descriptor used as key.}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{pm} %% choose variable name
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
%% Author(s) : Fernando Cacciola <fernando_cacciola@hotmail.com>
|
||||
|
||||
|
||||
\begin{ccRefFunction}{Surface_mesh_simplification::Edge_collapse::edge_collapse}
|
||||
\begin{ccRefFunction}{Surface_mesh_simplification::edge_collapse}
|
||||
|
||||
%% add template arg's if necessary
|
||||
|
||||
|
|
@ -38,33 +38,36 @@ template<class TriangulatedSurfaceMesh
|
|||
,class GetPlacement
|
||||
,class CostParams
|
||||
,class PlacementParams
|
||||
,class Visitor
|
||||
,class EdgeCollaspeSimplificationVisitor
|
||||
>
|
||||
int edge_collapse ( TriangulatedSurfaceMesh& surface
|
||||
, StopPredicate const& should_stop
|
||||
, EdgeExtraPtrMap const& edge_extra_ptr_map
|
||||
, VertexIsFixedPropertyMap const& vertex_is_fixed_map
|
||||
, SetCollapseData const& set_collapse_data
|
||||
, GetCost const& get_cost
|
||||
, GetPlacement const& get_placement
|
||||
, CostParams const* cost_params
|
||||
, PlacementParams const* placement_params
|
||||
, Visitor* visitor
|
||||
int edge_collapse ( TriangulatedSurfaceMesh& surface
|
||||
, StopPredicate const& should_stop
|
||||
, EdgeExtraPtrMap const& edge_extra_ptr_map
|
||||
, VertexIsFixedPropertyMap const& vertex_is_fixed_map
|
||||
, SetCollapseData const& set_collapse_data
|
||||
, GetCost const& get_cost
|
||||
, GetPlacement const& get_placement
|
||||
, CostParams const* cost_params
|
||||
, PlacementParams const* placement_params
|
||||
, EdgeCollaspeSimplificationVisitor* visitor
|
||||
) ;
|
||||
}
|
||||
{Simplifies \ccc{surface} in-place by collapsing edges, and returns
|
||||
the number of edges effectively removed.\\
|
||||
%
|
||||
The process continues until the \ccc{should_stop} policy returns \ccc{true}
|
||||
or the surface cannot be simplified any furhter due to topological constraints.\\
|
||||
%
|
||||
the number of edges effectively removed.
|
||||
}
|
||||
|
||||
\ccHeading{Semantics}
|
||||
|
||||
The simplification process continues until the \ccc{should_stop} policy returns \ccc{true}
|
||||
or the surface cannot be simplified any furhter due to topological constraints.
|
||||
|
||||
\ccc{edge_extra_ptr_map} is a property map which provides access
|
||||
to a \ccc{void*&} extra-pointer per edge, as needed by the algorithm.\\
|
||||
%
|
||||
to a \ccc{void*&} extra-pointer per edge, as needed by the algorithm.
|
||||
|
||||
\ccc{vertex_is_fixed_map} is used to indicate that some edges should not be
|
||||
collapsed. The property map indicates whether a vertex is fixed or not,
|
||||
and any edge incident upon a fixed vertex is not collapsed.\\
|
||||
%
|
||||
and any edge incident upon a fixed vertex is not collapsed.
|
||||
|
||||
\ccc{set_collapse_data}, along with \ccc{get_cost} and \ccc{get_placement},
|
||||
are the policies which control the {\em cost-strategy}, that is,
|
||||
the order in which edges are collapsed and the replacement vertex positioned.\\
|
||||
|
|
@ -72,11 +75,10 @@ the order in which edges are collapsed and the replacement vertex positioned.\\
|
|||
parameters used by the these policies. They can be null pointers
|
||||
if the policies don't need them.\\
|
||||
This strategy is the driving factor that determines the accuaracy of the
|
||||
simplied surface with respect to the original.\\
|
||||
%
|
||||
simplied surface with respect to the original.
|
||||
|
||||
\ccc{visitor} is an optional object (can be null) which can be used
|
||||
to keep track of the simplification process.
|
||||
}
|
||||
|
||||
\ccHeading{Requirements}
|
||||
|
||||
|
|
@ -110,9 +112,9 @@ It must be \ccc{GetCost::Params}.
|
|||
\ccc{PlacementParams} defines the type of the parameters to the get-placement policy.
|
||||
It must be \ccc{GetPlacement::Params}.
|
||||
|
||||
\ccc{Visitor} defines the type of the visitor object that can be passed to track the
|
||||
simplification process.
|
||||
It must be a \ccc{EdgeCollapseVisitor}
|
||||
\ccc{EdgeCollaspeSimplificationVisitor} defines the type of the visitor object
|
||||
that can be passed to track the simplification process.
|
||||
It must be a \ccc{EdgeCollaspeSimplificationVisitor}
|
||||
|
||||
\ccHeading{Defaults}
|
||||
|
||||
|
|
@ -122,15 +124,15 @@ Only the first two parameters are mandatory, the rest have default values as des
|
|||
|
||||
\ccc{VertexIsFixedPropertyMap} defaults to \ccc{CGAL::Vertex_is_fixed_property_map_always_false<TriangulatedSurfaceMesh>()}.
|
||||
|
||||
\ccc{SetCollaspeData} defauls to \ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_set_partial_collapse_data<TriangulatedSurfaceMesh>}.
|
||||
\ccc{SetCollaspeData} defauls to \ccc{CGAL::Surface_mesh_simplification::LindstromTurk_set_partial_collapse_data<TriangulatedSurfaceMesh>}.
|
||||
|
||||
\ccc{GetCost} defaults to \ccc{CGAL::Surface_mesh_simplification::Edge_collapse::Cached_cost<TriangulatedSurfaceMesh>}.
|
||||
\ccc{GetCost} defaults to \ccc{CGAL::Surface_mesh_simplification::Cached_cost<TriangulatedSurfaceMesh>}.
|
||||
|
||||
\ccc{GetPlacement} defaults to \ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_placement<TriangulatedSurfaceMesh>}
|
||||
\ccc{GetPlacement} defaults to \ccc{CGAL::Surface_mesh_simplification::LindstromTurk_placement<TriangulatedSurfaceMesh>}
|
||||
|
||||
\ccc{CostParams} defaults to \ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\ccc{CostParams} defaults to \ccc{CGAL::Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
\ccc{PlacementParams} defaults to \ccc{CGAL::Surface_mesh_simplification::Edge_collapse::LindstromTurk_params}
|
||||
\ccc{PlacementParams} defaults to \ccc{CGAL::Surface_mesh_simplification::LindstromTurk_params}
|
||||
|
||||
\end{ccRefFunction}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,32 +27,32 @@ by iterative edge-collapsing.
|
|||
\ccHeading{Concepts}
|
||||
\ccRefConceptPage{TriangulatedSurfaceMesh} \\
|
||||
\ccRefConceptPage{StopPredicate} \\
|
||||
\ccRefConceptPage{CollapseData} \\
|
||||
\ccRefConceptPage{EmptyCollapseData} \\
|
||||
\ccRefConceptPage{PartialCollapseData} \\
|
||||
\ccRefConceptPage{FullCollapseData} \\
|
||||
\ccRefConceptPage{SetCollapseData} \\
|
||||
\ccRefConceptPage{GetCost} \\
|
||||
\ccRefConceptPage{GetPlacement} \\
|
||||
\ccRefConceptPage{VertexIsFixedPropertyMap}
|
||||
\ccRefConceptPage{VertexIsFixedPropertyMap} \\
|
||||
\ccRefConceptPage{EdgeCollaspeSimplificationVisitor}
|
||||
|
||||
\ccHeading{Classes}
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::edge_collapse}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_collapse::Count_stop_predicate<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_collapse::Count_ratio_stop_predicate<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Empty_collapse_data}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Partial_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Full_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Set_empty_collapse_data}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_set_partial_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_set_full_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Set_partial_collapse_data<TSM,GetCost>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Cached_cost<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Cached_placement<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_cost<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::LindstromTurk_placement<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Triangulated_surface_mesh::Simplification::Edge_collapse::Edge_length_cost<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::edge_collapse}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Count_stop_predicate<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Empty_collapse_data}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Partial_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Full_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Set_empty_collapse_data}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::LindstromTurk_set_partial_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::LindstromTurk_set_full_collapse_data<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Set_partial_collapse_data<TSM,GetCost>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Set_full_collapse_data<TSM,GetCost,GetPlacement>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Cached_cost<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Cached_placement<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::LindstromTurk_cost<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::LindstromTurk_placement<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Surface_mesh_simplification::Edge_length_cost<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Vertex_is_fixed_property_map_always_false<TSM>}\\
|
||||
\ccRefIdfierPage{CGAL::Vertex_is_fixed_property_map_stored<TSM>}\\
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
\input{Surface_mesh_simplification_ref/intro.tex}
|
||||
|
||||
\input{Surface_mesh_simplification_ref/TriangulatedSurfaceMesh.tex}
|
||||
%\input{Surface_mesh_simplification_ref/StopPredicate.tex}
|
||||
\input{Surface_mesh_simplification_ref/StopPredicate.tex}
|
||||
\input{Surface_mesh_simplification_ref/CollapseData.tex}
|
||||
\input{Surface_mesh_simplification_ref/EmptyCollapseData.tex}
|
||||
\input{Surface_mesh_simplification_ref/PartialCollapseData.tex}
|
||||
|
|
@ -17,11 +17,12 @@
|
|||
\input{Surface_mesh_simplification_ref/GetCost.tex}
|
||||
\input{Surface_mesh_simplification_ref/GetPlacement.tex}
|
||||
\input{Surface_mesh_simplification_ref/VertexIsFixedPropertyMap.tex}
|
||||
\input{Surface_mesh_simplification_ref/EdgeCollapseSimplificationVisitor.tex}
|
||||
|
||||
\input{Surface_mesh_simplification_ref/edge_collapse.tex}
|
||||
|
||||
%\input{Surface_mesh_simplification_ref/Count_stop_predicate.tex}
|
||||
%\input{Surface_mesh_simplification_ref/Count_ratio_stop_predicate.tex}
|
||||
\input{Surface_mesh_simplification_ref/Count_stop_predicate.tex}
|
||||
\input{Surface_mesh_simplification_ref/Count_ratio_stop_predicate.tex}
|
||||
\input{Surface_mesh_simplification_ref/Empty_collapse_data.tex}
|
||||
\input{Surface_mesh_simplification_ref/Partial_collapse_data.tex}
|
||||
\input{Surface_mesh_simplification_ref/Full_collapse_data.tex}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ typedef CGAL::Polyhedron_3<Kernel> Surface;
|
|||
|
||||
// === EXAMPLE SPECIFIC DETAILS BEGINS HERE ===
|
||||
|
||||
typedef Kernel::Point_3 Point ;
|
||||
|
||||
typedef Surface::Halfedge_handle Halfedge_handle ;
|
||||
typedef Surface::Vertex_handle Vertex_handle ;
|
||||
|
||||
// The following is the Visitor that keeps track of the simplification process.
|
||||
// In this example the progress is printed real-time and a few statistics are
|
||||
|
|
@ -37,6 +38,7 @@ struct Visitor
|
|||
, collapsed(0)
|
||||
, non_collapsable(0)
|
||||
, cost_uncomputable(0)
|
||||
, placement_uncomputable(0)
|
||||
{}
|
||||
|
||||
// Called on algorithm entry
|
||||
|
|
@ -56,47 +58,54 @@ struct Visitor
|
|||
{
|
||||
++ collected ;
|
||||
std::cerr << "\rEdges collected: " << collected << std::flush ;
|
||||
}
|
||||
|
||||
// Called during the processing phase for each edge processed.
|
||||
// If aVertex is a valid handle then the edge was collapsed and aVertex is the replacement.
|
||||
void OnProcessed(Halfedge_handle const& aEdge
|
||||
,Surface& aSurface
|
||||
,boost::optional<double> aCost
|
||||
,Vertex_handle const& aVertex
|
||||
)
|
||||
{
|
||||
++ processed ;
|
||||
if ( aVertex == Vertex_handle() )
|
||||
{
|
||||
if ( !aCost )
|
||||
++ cost_uncomputable ;
|
||||
else ++ non_collapsable ;
|
||||
}
|
||||
else
|
||||
{
|
||||
++ collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
// Call at each step in the processing phase (when each edge is selected for processing) before the
|
||||
// stop condition is evaluated.
|
||||
void OnStep( Halfedge_handle const& aEdge
|
||||
, Surface& aSurface
|
||||
, std::size_t aInitial
|
||||
, std::size_t aCurrent
|
||||
)
|
||||
// Called during the processing phase for each edge selected.
|
||||
// If aCost is absent the edge won't be collapsed.
|
||||
void OnSelected(Halfedge_handle const& aEdge
|
||||
,Surface& aSurface
|
||||
,boost::optional<double> aCost
|
||||
,std::size_t aInitial
|
||||
,std::size_t aCurrent
|
||||
)
|
||||
{
|
||||
++ processed ;
|
||||
if ( !aCost )
|
||||
++ cost_uncomputable ;
|
||||
|
||||
if ( aCurrent == aInitial )
|
||||
std::cerr << "\n" << std::flush ;
|
||||
std::cerr << "\r" << aCurrent << std::flush ;
|
||||
}
|
||||
|
||||
// Called during the processing phase for each edge being collapsed.
|
||||
// If aPlacement is absent the edge is left uncollapsed.
|
||||
void OnCollapsing(Halfedge_handle const& aEdge
|
||||
,Surface& aSurface
|
||||
,boost::optional<Point> aPlacement
|
||||
)
|
||||
{
|
||||
if ( aPlacement )
|
||||
++ collapsed;
|
||||
else ++ placement_uncomputable ;
|
||||
}
|
||||
|
||||
// Called for each edge which failed the so called link-condition,
|
||||
// that is, which cannot be collapsed because doing so would
|
||||
// turn the surface into a non-manifold.
|
||||
void OnNonCollapsable( Halfedge_handle const& aEdge
|
||||
, Surface& aSurface
|
||||
)
|
||||
{
|
||||
++ non_collapsable;
|
||||
}
|
||||
|
||||
std::size_t collected
|
||||
, processed
|
||||
, collapsed
|
||||
, non_collapsable
|
||||
, cost_uncomputable ;
|
||||
, cost_uncomputable
|
||||
, placement_uncomputable ;
|
||||
} ;
|
||||
|
||||
// === EXAMPLE SPECIFIC DETAILS ENDS HERE ===
|
||||
|
|
@ -147,8 +156,10 @@ int main( int argc, char** argv )
|
|||
<< std::endl
|
||||
<< "\nEdges not collapsed due to topological constrians: "
|
||||
<< visitor.non_collapsable
|
||||
<< "\nEdge not collapsed due to computational constrians: "
|
||||
<< "\nEdge not collapsed due to cost computation constrians: "
|
||||
<< visitor.cost_uncomputable
|
||||
<< "\nEdge not collapsed due to placement computation constrians: "
|
||||
<< visitor.placement_uncomputable
|
||||
<< std::endl ;
|
||||
|
||||
// === CONCRETE USAGE EXAMPLE ENDS HERE ===
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ private:
|
|||
void Collect();
|
||||
void Loop();
|
||||
bool Is_collapsable( edge_descriptor const& aEdge ) ;
|
||||
vertex_descriptor Collapse( edge_descriptor const& aEdge ) ;
|
||||
void Collapse( edge_descriptor const& aEdge ) ;
|
||||
void Update_neighbors( vertex_descriptor const& aKeptV ) ;
|
||||
|
||||
bool is_vertex_fixed ( const_vertex_descriptor const& v ) const { return get(Vertex_is_fixed_map,v) ; }
|
||||
|
|
|
|||
|
|
@ -165,13 +165,11 @@ void EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::Loop()
|
|||
{
|
||||
CGAL_TSMS_TRACE(3,"Poped " << edge_to_string(*lEdge) ) ;
|
||||
|
||||
if ( Visitor )
|
||||
Visitor->OnStep(*lEdge,mSurface,mInitialEdgeCount,mCurrentEdgeCount);
|
||||
|
||||
vertex_descriptor lVertex ;
|
||||
|
||||
Optional_cost_type lCost = get_cost(*lEdge);
|
||||
|
||||
if ( Visitor )
|
||||
Visitor->OnSelected(*lEdge,mSurface,lCost,mInitialEdgeCount,mCurrentEdgeCount);
|
||||
|
||||
if ( lCost != none )
|
||||
{
|
||||
if ( Should_stop(*lCost,*lEdge,mInitialEdgeCount,mCurrentEdgeCount) )
|
||||
|
|
@ -188,10 +186,13 @@ void EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::Loop()
|
|||
|
||||
if ( Is_collapsable(*lEdge) )
|
||||
{
|
||||
lVertex= Collapse(*lEdge);
|
||||
Collapse(*lEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Visitor )
|
||||
Visitor->OnNonCollapsable(*lEdge,mSurface);
|
||||
|
||||
CGAL_TSMS_TRACE(1,edge_to_string(*lEdge) << " NOT Collapsable" );
|
||||
}
|
||||
}
|
||||
|
|
@ -200,8 +201,6 @@ void EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::Loop()
|
|||
CGAL_TSMS_TRACE(1,edge_to_string(*lEdge) << " uncomputable cost." );
|
||||
}
|
||||
|
||||
if ( Visitor )
|
||||
Visitor->OnProcessed(*lEdge,mSurface,lCost,lVertex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -307,7 +306,7 @@ bool EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::Is_collapsable( edge_descriptor cons
|
|||
}
|
||||
|
||||
template<class M,class S,class X, class F,class D,class CF,class PF,class CP, class PP,class V>
|
||||
typename EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::vertex_descriptor EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::Collapse( edge_descriptor const& aEdgePQ )
|
||||
void EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::Collapse( edge_descriptor const& aEdgePQ )
|
||||
{
|
||||
CGAL_TSMS_TRACE(1,"S" << mStep << ". Collapsig " << edge_to_string(aEdgePQ) ) ;
|
||||
|
||||
|
|
@ -320,6 +319,10 @@ typename EdgeCollapse<M,S,X,F,D,CF,PF,CP,PP,V>::vertex_descriptor EdgeCollapse<M
|
|||
// The external function Get_new_vertex_point() is allowed to return an absent point if there is no way to place the vertex
|
||||
// satisfying its constrians. In that case the vertex-pair is simply not removed.
|
||||
Optional_placement_type lPlacement = get_placement(aEdgePQ);
|
||||
|
||||
if ( Visitor )
|
||||
Visitor->OnCollapsing(*lEdge,mSurface,lPlacement);
|
||||
|
||||
if ( lPlacement )
|
||||
{
|
||||
CGAL_TSMS_TRACE(2,"New vertex point: " << xyz_to_string(*lPlacement) ) ;
|
||||
|
|
|
|||
|
|
@ -137,11 +137,14 @@ struct Dummy_visitor
|
|||
template<class Edge, class TSM>
|
||||
void OnCollected( Edge const&, bool, TSM& ) {}
|
||||
|
||||
template<class Edge, class TSM, class Vertex>
|
||||
void OnProcessed(Edge const&, TSM&, boost::optional<double>, Vertex const& ) {}
|
||||
template<class Edge, class TSM, class OFT, class Size_type>
|
||||
void OnSelected( Edge const&, TSM&, OFT const&, Size_type, Size_type ) {}
|
||||
|
||||
template<class Edge, class TSM, class OPoint>
|
||||
void OnCollapsing(Edge const&, TSM&, OPoint const& ) {}
|
||||
|
||||
template<class Edge, class TSM>
|
||||
void OnStep(Edge const&, TSM&, std::size_t, std::size_t) {}
|
||||
void OnNonCollapsable(Edge const&, TSM& ) {}
|
||||
} ;
|
||||
|
||||
template<class TSM
|
||||
|
|
|
|||
Loading…
Reference in New Issue