mirror of https://github.com/CGAL/cgal
rename
This commit is contained in:
parent
f708fe81c1
commit
e0317d4678
|
|
@ -37,7 +37,7 @@ namespace internal
|
||||||
template <typename TriangleMesh,
|
template <typename TriangleMesh,
|
||||||
typename FacetSegmentMap,
|
typename FacetSegmentMap,
|
||||||
typename ApproximationTraits>
|
typename ApproximationTraits>
|
||||||
class VSA
|
class VSA_approximation
|
||||||
{
|
{
|
||||||
// type definitions
|
// type definitions
|
||||||
private:
|
private:
|
||||||
|
|
@ -96,7 +96,7 @@ public:
|
||||||
* @param _mesh `CGAL TriangleMesh` on which approximation operate.
|
* @param _mesh `CGAL TriangleMesh` on which approximation operate.
|
||||||
* @param _appx_trait approximation traits object.
|
* @param _appx_trait approximation traits object.
|
||||||
*/
|
*/
|
||||||
VSA(const TriangleMesh &_mesh, const ApproximationTraits &_appx_trait)
|
VSA_approximation(const TriangleMesh &_mesh, const ApproximationTraits &_appx_trait)
|
||||||
: mesh(_mesh),
|
: mesh(_mesh),
|
||||||
fit_error(_appx_trait.construct_fit_error_functor()),
|
fit_error(_appx_trait.construct_fit_error_functor()),
|
||||||
proxy_fitting(_appx_trait.construct_proxy_fitting_functor()) {
|
proxy_fitting(_appx_trait.construct_proxy_fitting_functor()) {
|
||||||
|
|
@ -417,7 +417,7 @@ private:
|
||||||
}
|
}
|
||||||
return sum_error;
|
return sum_error;
|
||||||
}
|
}
|
||||||
}; // end class VSA
|
}; // end class VSA_approximation
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Main class for Variational Shape Approximation mesh extraction algorithm.
|
* @brief Main class for Variational Shape Approximation mesh extraction algorithm.
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,10 @@ namespace CGAL
|
||||||
* This function approximate the input triangulated mesh by fitting it with proxies.
|
* This function approximate the input triangulated mesh by fitting it with proxies.
|
||||||
*
|
*
|
||||||
* @tparam TriangleMesh model of `FaceGraph`.
|
* @tparam TriangleMesh model of `FaceGraph`.
|
||||||
* @tparam SegmentPropertyMap a property map containing the approximated facet patch id,
|
* @tparam FacetProxyMap a property map containing the approximated facet patch id,
|
||||||
and `boost::graph_traits<TriangleMesh>::%face_descriptor` as key type,
|
and `boost::graph_traits<TriangleMesh>::%face_descriptor` as key type,
|
||||||
std::size_t as value type
|
std::size_t as value type
|
||||||
* @tparam PointPropertyMap a property map containing the input mesh vertex point map,
|
* @tparam VertexPointMap a property map containing the input mesh vertex point map,
|
||||||
and `boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key type,
|
and `boost::graph_traits<TriangleMesh>::%vertex_descriptor` as key type,
|
||||||
`TriangleMesh::Point_3` as value type
|
`TriangleMesh::Point_3` as value type
|
||||||
* @tparam FacetAreaMap a property map containing the input mesh area map,
|
* @tparam FacetAreaMap a property map containing the input mesh area map,
|
||||||
|
|
@ -32,9 +32,9 @@ namespace CGAL
|
||||||
* @param tm a triangle mesh
|
* @param tm a triangle mesh
|
||||||
* @param number_of_segments target number of approximation patches
|
* @param number_of_segments target number of approximation patches
|
||||||
* @param number_of_iterations number of fitting iterations
|
* @param number_of_iterations number of fitting iterations
|
||||||
* @param segment_ids facet proxy patch id property map
|
* @param f_proxy_pmap facet proxy patch id property map
|
||||||
* @param ppmap mesh vertex point property map
|
* @param v_point_pmap mesh vertex point property map
|
||||||
* @param area_pmap facet area property map
|
* @param f_area_pmap facet area property map
|
||||||
* @param tris approximation indexed triangle soup
|
* @param tris approximation indexed triangle soup
|
||||||
* @param pos anchor position container
|
* @param pos anchor position container
|
||||||
* @param vtx anchor vertex container
|
* @param vtx anchor vertex container
|
||||||
|
|
@ -43,8 +43,8 @@ namespace CGAL
|
||||||
* @param traits kernel traits
|
* @param traits kernel traits
|
||||||
*/
|
*/
|
||||||
template<typename TriangleMesh,
|
template<typename TriangleMesh,
|
||||||
typename SegmentPropertyMap,
|
typename FacetProxyMap,
|
||||||
typename PointPropertyMap,
|
typename VertexPointMap,
|
||||||
typename FacetAreaMap,
|
typename FacetAreaMap,
|
||||||
typename AnchorIndexContainer,
|
typename AnchorIndexContainer,
|
||||||
typename AnchorPositionContainer,
|
typename AnchorPositionContainer,
|
||||||
|
|
@ -57,9 +57,9 @@ template<typename TriangleMesh,
|
||||||
const TriangleMesh &tm,
|
const TriangleMesh &tm,
|
||||||
const std::size_t number_of_segments,
|
const std::size_t number_of_segments,
|
||||||
const std::size_t number_of_iterations,
|
const std::size_t number_of_iterations,
|
||||||
SegmentPropertyMap segment_ids,
|
FacetProxyMap f_proxy_pmap,
|
||||||
const PointPropertyMap &ppmap,
|
const VertexPointMap &v_point_pmap,
|
||||||
const FacetAreaMap &area_pmap,
|
const FacetAreaMap &f_area_pmap,
|
||||||
AnchorIndexContainer &tris,
|
AnchorIndexContainer &tris,
|
||||||
AnchorPositionContainer &pos,
|
AnchorPositionContainer &pos,
|
||||||
AnchorVertexContainer &vtx,
|
AnchorVertexContainer &vtx,
|
||||||
|
|
@ -68,33 +68,33 @@ template<typename TriangleMesh,
|
||||||
GeomTraits traits) {
|
GeomTraits traits) {
|
||||||
// CGAL_precondition(is_pure_triangle(tm));
|
// CGAL_precondition(is_pure_triangle(tm));
|
||||||
|
|
||||||
typedef CGAL::internal::VSA<
|
typedef CGAL::internal::VSA_approximation<
|
||||||
TriangleMesh,
|
TriangleMesh,
|
||||||
SegmentPropertyMap,
|
FacetProxyMap,
|
||||||
ApproximationTrait> VSA;
|
ApproximationTrait> VSA_approximation;
|
||||||
|
|
||||||
VSA algorithm(tm, app_trait);
|
VSA_approximation algorithm(tm, app_trait);
|
||||||
|
|
||||||
switch (init) {
|
switch (init) {
|
||||||
case VSA::RandomInit:
|
case VSA_approximation::RandomInit:
|
||||||
algorithm.partition(number_of_segments, number_of_iterations, segment_ids);
|
algorithm.partition(number_of_segments, number_of_iterations, f_proxy_pmap);
|
||||||
break;
|
break;
|
||||||
case VSA::IncrementalInit:
|
case VSA_approximation::IncrementalInit:
|
||||||
algorithm.partition_incre(number_of_segments, number_of_iterations, segment_ids);
|
algorithm.partition_incre(number_of_segments, number_of_iterations, f_proxy_pmap);
|
||||||
break;
|
break;
|
||||||
case VSA::HierarchicalInit:
|
case VSA_approximation::HierarchicalInit:
|
||||||
algorithm.partition_hierarchical(number_of_segments, number_of_iterations, segment_ids);
|
algorithm.partition_hierarchical(number_of_segments, number_of_iterations, f_proxy_pmap);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef CGAL::internal::VSA_mesh_extraction<
|
typedef CGAL::internal::VSA_mesh_extraction<
|
||||||
TriangleMesh,
|
TriangleMesh,
|
||||||
ApproximationTrait,
|
ApproximationTrait,
|
||||||
PointPropertyMap,
|
VertexPointMap,
|
||||||
SegmentPropertyMap,
|
FacetProxyMap,
|
||||||
FacetAreaMap> VSA_mesh_extraction;
|
FacetAreaMap> VSA_mesh_extraction;
|
||||||
|
|
||||||
VSA_mesh_extraction extractor(tm, app_trait, ppmap, segment_ids, area_pmap);
|
VSA_mesh_extraction extractor(tm, app_trait, v_point_pmap, f_proxy_pmap, f_area_pmap);
|
||||||
|
|
||||||
extractor.extract_mesh(tris);
|
extractor.extract_mesh(tris);
|
||||||
BOOST_FOREACH(const typename VSA_mesh_extraction::Anchor &a, extractor.collect_anchors()) {
|
BOOST_FOREACH(const typename VSA_mesh_extraction::Anchor &a, extractor.collect_anchors()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue