Merge pull request #6547 from afabri/Skeletoniation-HDS-GF

Skeletonization: Replace internally Polyhedron by HDS
This commit is contained in:
Sebastien Loriot 2022-07-08 20:24:58 +02:00 committed by GitHub
commit 4b9032f8c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 575 additions and 622 deletions

View File

@ -63,25 +63,28 @@ num_edges(const HalfedgeDS_default<T,I,A>& p)
template<class T, class I, class A>
typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::degree_size_type
degree(typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::vertex_descriptor v
, const HalfedgeDS_default<T,I,A>&)
, const HalfedgeDS_default<T,I,A>& hds)
{
return v->vertex_degree();
if(halfedge(v,hds) == boost::graph_traits<HalfedgeDS_default<T,I,A> const>::null_halfedge()){
return 0;
}
return halfedges_around_target(v,hds).size();
}
template<class T, class I, class A>
typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::degree_size_type
out_degree(typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::vertex_descriptor v
, const HalfedgeDS_default<T,I,A>&)
, const HalfedgeDS_default<T,I,A>& hds)
{
return v->vertex_degree();
return degree(v, hds);
}
template<class T, class I, class A>
typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::degree_size_type
in_degree(typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::vertex_descriptor v
, const HalfedgeDS_default<T,I,A>&)
, const HalfedgeDS_default<T,I,A>& hds)
{
return v->vertex_degree();
return degree(v,hds);
}
template<class T, class I, class A>
@ -448,29 +451,6 @@ num_faces(const HalfedgeDS_default<T,I,A>& p)
return p.size_of_faces();
}
template <class T>
struct HDS_property_map;
template <>
struct HDS_property_map<vertex_point_t>
{
template<class T, class I, class A>
struct bind_
{
typedef internal::Point_accessor<
typename boost::graph_traits<
HalfedgeDS_default<T, I, A>
>::vertex_descriptor,
typename T::Point_3, typename T::Point_3&> type;
typedef internal::Point_accessor<
typename boost::graph_traits<
HalfedgeDS_default<T, I, A>
>::vertex_descriptor,
typename T::Point_3, const typename T::Point_3&> const_type;
};
};
template<class T, class I, class A>
void reserve(HalfedgeDS_default<T,I,A>& p,
typename boost::graph_traits< HalfedgeDS_default<T,I,A> const>::vertices_size_type nv,
@ -481,37 +461,7 @@ void reserve(HalfedgeDS_default<T,I,A>& p,
}
}// namespace CGAL
namespace boost {
#define CGAL_PM_SPECIALIZATION(TAG) \
template<class T, class I, class A> \
struct property_map<CGAL::HalfedgeDS_default<T,I,A>, TAG> \
{\
typedef typename CGAL::HDS_property_map<TAG>:: \
template bind_<T,I,A> map_gen; \
typedef typename map_gen::type type; \
typedef typename map_gen::const_type const_type; \
};
#include <CGAL/boost/graph/properties_HalfedgeDS_default.h>
CGAL_PM_SPECIALIZATION(vertex_point_t)
#undef CGAL_PM_SPECIALIZATION
} // namespace boost
namespace CGAL {
// generalized 2-ary get functions
template<class Gt, class I, class A, class PropertyTag>
typename boost::property_map< CGAL::HalfedgeDS_default<Gt,I,A>, PropertyTag >::const_type
get(PropertyTag, CGAL::HalfedgeDS_default<Gt,I,A> const&)
{ return typename boost::property_map< CGAL::HalfedgeDS_default<Gt,I,A>, PropertyTag >::const_type(); }
template<class Gt, class I, class A, class PropertyTag>
typename boost::property_map< CGAL::HalfedgeDS_default<Gt,I,A>, PropertyTag >::type
get(PropertyTag, CGAL::HalfedgeDS_default<Gt,I,A>&)
{ return typename boost::property_map< CGAL::HalfedgeDS_default<Gt,I,A>, PropertyTag >::type(); }
} // namespace CGAL
#endif

View File

@ -0,0 +1,494 @@
// Copyright (c) 2007 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Andreas Fabri, Fernando Cacciola
// note only the properties below are protected by the macro,
// the rest of the file is the shared implementation of properties for
// Polyhedron and HalfedgeDS_default
#ifndef CGAL_BOOST_GRAPH_PROPERTIES_HALFEDGEDS_BASE_H
#define CGAL_BOOST_GRAPH_PROPERTIES_HALFEDGEDS_BASE_H
#include <CGAL/boost/graph/properties.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/number_utils.h>
#include <memory>
#include <CGAL/boost/graph/internal/Has_member_id.h>
#include <CGAL/Distance_3/Point_3_Point_3.h>
namespace CGAL {
namespace internal {
template<class Handle>
class HDS_index_map_external
: public boost::put_get_helper<std::size_t&, HDS_index_map_external<Handle> >
{
public:
typedef boost::lvalue_property_map_tag category;
typedef std::size_t value_type;
typedef std::size_t& reference;
typedef Handle key_type;
private:
typedef CGAL::Unique_hash_map<key_type,std::size_t> Map;
public:
template <typename InputIterator>
HDS_index_map_external(InputIterator begin, InputIterator end, std::size_t max)
: map_(new Map(begin, end, 0, std::size_t(-1), max)) {}
reference operator[](const key_type& k) const { return (*map_)[k]; }
private:
std::shared_ptr<Map> map_;
};
// Special case for edges.
template<class Polyhedron>
class HDS_edge_index_map_external
: public boost::put_get_helper<std::size_t&, HDS_edge_index_map_external<Polyhedron> >
{
public:
typedef boost::lvalue_property_map_tag category;
typedef std::size_t value_type;
typedef std::size_t& reference;
typedef typename boost::graph_traits<Polyhedron>::edge_descriptor key_type;
private:
typedef CGAL::Unique_hash_map<key_type,std::size_t> Map;
public:
HDS_edge_index_map_external(Polyhedron& p)
: map_(new Map(std::size_t(-1), num_halfedges(p)))
{
unsigned int data = 0;
typename boost::graph_traits<Polyhedron>::edge_iterator it, end;
for(boost::tie(it, end) = edges(p); it != end; ++it, ++data)
(*map_)[*it] = data;
}
reference operator[](const key_type& k) const { return (*map_)[k]; }
private:
std::shared_ptr<Map> map_;
};
template<typename Handle, typename FT>
struct HDS_wrap_squared
{
typedef FT value_type;
typedef FT reference;
typedef Handle key_type;
typedef boost::readable_property_map_tag category;
template<typename E>
FT operator[](const E& e) const {
return approximate_sqrt(CGAL::squared_distance(e.halfedge()->vertex()->point(),
e.halfedge()->opposite()->vertex()->point()));
}
friend inline
value_type get(const HDS_wrap_squared& m, const key_type k)
{
return m[k];
}
};
}
// the tag we dispatch on from property_map<G, Property>
template <class HDS, class Tag>
struct HDS_property_map {};
} // end of CGAL::internal namespace
#endif // CGAL_BOOST_GRAPH_PROPERTIES_HALFEDGEDS_BASE_H
#if !defined(CGAL_HDS_TMPLT) || ! defined(CGAL_HDS_CLASS)
#error CGAL_HDS_TMPLT or CGAL_HDS_CLASS is not defined
#endif
namespace CGAL {
// generalized 2-ary get functions
template<class CGAL_HDS_TMPLT, class PropertyTag>
typename boost::property_map<CGAL_HDS_CLASS, PropertyTag >::const_type
get(PropertyTag,CGAL_HDS_CLASS const&)
{ return typename boost::property_map<CGAL_HDS_CLASS, PropertyTag >::const_type(); }
template<class CGAL_HDS_TMPLT, class PropertyTag>
typename boost::property_map<CGAL_HDS_CLASS, PropertyTag >::type
get(PropertyTag,CGAL_HDS_CLASS&)
{ return typename boost::property_map<CGAL_HDS_CLASS, PropertyTag >::type(); }
// generalized 3-ary get functions
template<class CGAL_HDS_TMPLT, class PropertyTag, class Key>
typename boost::property_traits< typename boost::property_map<CGAL_HDS_CLASS, PropertyTag >::type >::reference
get(PropertyTag p,CGAL_HDS_CLASS& g, const Key& key)
{ return get(get(p, g), key); }
template<class CGAL_HDS_TMPLT, class PropertyTag, class Key>
typename boost::property_traits< typename boost::property_map<CGAL_HDS_CLASS, PropertyTag >::const_type >::reference
get(PropertyTag p,CGAL_HDS_CLASS const& g, const Key& key)
{ return get(get(p, g), key); }
#define DECLARE_HDS_DYNAMIC_PM(TAG, DESCRIPTOR) \
template <typename CGAL_HDS_TMPLT, class T> \
typename boost::property_map<CGAL_HDS_CLASS, TAG >::const_type \
get(const TAG&, const CGAL_HDS_CLASS&) \
{ \
typedef typename boost::graph_traits< CGAL_HDS_CLASS >::DESCRIPTOR descriptor; \
return internal::Dynamic_property_map<descriptor,T>(); \
}
DECLARE_HDS_DYNAMIC_PM(dynamic_vertex_property_t<T>, vertex_descriptor)
DECLARE_HDS_DYNAMIC_PM(dynamic_halfedge_property_t<T>, halfedge_descriptor)
DECLARE_HDS_DYNAMIC_PM(dynamic_edge_property_t<T>, edge_descriptor)
DECLARE_HDS_DYNAMIC_PM(dynamic_face_property_t<T>, face_descriptor)
#undef DECLARE_HDS_DYNAMIC_PM
// generalized put
template<class CGAL_HDS_TMPLT, class PropertyTag, class Key,class Value>
void put(PropertyTag p,CGAL_HDS_CLASS& g, const Key& key, const Value& value)
{
typedef typename boost::property_map<CGAL_HDS_CLASS, PropertyTag>::type Map;
Map pmap = get(p, g);
put(pmap, key, value);
}
// specialization needs to be repeated for halfedge, vertex, face
#define DECLARE_HDS_INDEX_PM(ENTITY, TAG, ACCESSOR) \
template<class CGAL_HDS_TMPLT> \
struct HDS_property_map<CGAL_HDS_CLASS, \
boost::ENTITY##TAG> { \
struct bind_ { \
typedef internal::ACCESSOR##_accessor< \
CGAL_HDS_CLASS, \
typename boost::graph_traits< CGAL_HDS_CLASS \
>::ENTITY##_descriptor > type;\
typedef type const_type; \
}; \
};
DECLARE_HDS_INDEX_PM(halfedge, _index_t, Index)
DECLARE_HDS_INDEX_PM(vertex, _index_t, Index)
DECLARE_HDS_INDEX_PM(face, _index_t, Index)
} // end of CGAL namespace
#undef DECLARE_HDS_INDEX_PM
namespace CGAL {
// not done with macros, because HDS_edge::id does not return a
// reference
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS, boost::edge_index_t>
{
struct bind_
{
typedef internal::Edge_index_accessor<
typename boost::graph_traits<
CGAL_HDS_CLASS
>::edge_descriptor > type;
typedef type const_type;
};
};
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS, boost::edge_weight_t>
{
struct bind_
{
typedef typename CGAL_HDS_CLASS::Traits::FT FT;
typedef typename boost::graph_traits<CGAL_HDS_CLASS >::edge_descriptor edge_descriptor;
typedef internal::HDS_wrap_squared<edge_descriptor,FT> type;
typedef type const_type;
};
};
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS,vertex_point_t>
{
struct bind_
{
typedef internal::Point_accessor<
typename boost::graph_traits<
CGAL_HDS_CLASS
>::vertex_descriptor,
typename Gt::Point_3, typename Gt::Point_3&> type;
typedef internal::Point_accessor<
typename boost::graph_traits<
CGAL_HDS_CLASS
>::vertex_descriptor,
typename Gt::Point_3, const typename Gt::Point_3&> const_type;
};
};
//
// external indices
//
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS, edge_external_index_t>
{
struct bind_
{
typedef internal::HDS_edge_index_map_external<
CGAL_HDS_CLASS
> type;
typedef type const_type;
};
};
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS, halfedge_external_index_t>
{
struct bind_
{
typedef internal::HDS_index_map_external<
typename boost::graph_traits<
CGAL_HDS_CLASS
>::halfedge_descriptor > type;
typedef type const_type;
};
};
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS, vertex_external_index_t>
{
struct bind_
{
typedef internal::HDS_index_map_external<
typename boost::graph_traits<
CGAL_HDS_CLASS
>::vertex_descriptor > type;
typedef type const_type;
};
};
template<class CGAL_HDS_TMPLT>
struct HDS_property_map<CGAL_HDS_CLASS, face_external_index_t>
{
struct bind_
{
typedef internal::HDS_index_map_external<
typename boost::graph_traits<
CGAL_HDS_CLASS
>::face_descriptor > type;
typedef type const_type;
};
};
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::edge_external_index_t >::const_type
get(boost::edge_external_index_t,CGAL_HDS_CLASS const& p)
{
return typename boost::property_map<CGAL_HDS_CLASS, boost::edge_external_index_t >::const_type(
const_cast<CGAL_HDS_CLASS& >(p));
}
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::halfedge_external_index_t >::const_type
get(boost::halfedge_external_index_t,CGAL_HDS_CLASS const& p)
{
CGAL_HDS_CLASS& ncp = const_cast<CGAL_HDS_CLASS&>(p);
return typename boost::property_map<CGAL_HDS_CLASS, boost::halfedge_external_index_t >::const_type(
ncp.halfedges_begin(), ncp.halfedges_end(), ncp.size_of_halfedges());
}
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::vertex_external_index_t >::const_type
get(boost::vertex_external_index_t,CGAL_HDS_CLASS const& p)
{
CGAL_HDS_CLASS& ncp = const_cast<CGAL_HDS_CLASS&>(p);
return typename boost::property_map<CGAL_HDS_CLASS, boost::vertex_external_index_t >::const_type(
ncp.vertices_begin(), ncp.vertices_end(), ncp.size_of_vertices());
}
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::face_external_index_t >::const_type
get(boost::face_external_index_t,CGAL_HDS_CLASS const& p)
{
CGAL_HDS_CLASS& ncp = const_cast<CGAL_HDS_CLASS&>(p);
return typename boost::property_map<CGAL_HDS_CLASS, boost::face_external_index_t >::const_type(
ncp.facets_begin(), ncp.facets_end(), ncp.size_of_facets());
}
// the same blurb for non-const
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::edge_external_index_t >::type
get(boost::edge_external_index_t,CGAL_HDS_CLASS& p)
{
return typename boost::property_map<CGAL_HDS_CLASS, boost::edge_external_index_t >::type(
p);
}
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::halfedge_external_index_t >::type
get(boost::halfedge_external_index_t,CGAL_HDS_CLASS & ncp)
{
return typename boost::property_map<CGAL_HDS_CLASS, boost::halfedge_external_index_t >::type(
ncp.halfedges_begin(), ncp.halfedges_end(), ncp.size_of_halfedges());
}
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::vertex_external_index_t >::type
get(boost::vertex_external_index_t,CGAL_HDS_CLASS & ncp)
{
return typename boost::property_map<CGAL_HDS_CLASS, boost::vertex_external_index_t >::type(
ncp.vertices_begin(), ncp.vertices_end(), ncp.size_of_vertices());
}
template<class CGAL_HDS_TMPLT>
typename boost::property_map<CGAL_HDS_CLASS, boost::face_external_index_t >::type
get(boost::face_external_index_t,CGAL_HDS_CLASS & ncp)
{
return typename boost::property_map<CGAL_HDS_CLASS, boost::face_external_index_t >::type(
ncp.facets_begin(), ncp.facets_end(), ncp.size_of_facets());
}
} // end of CGAL namespace
namespace boost {
// property_map dispatcher into Polyhedron
template<class CGAL_HDS_TMPLT, class Tag>
struct property_map<CGAL_HDS_CLASS, Tag>
{
typedef typename CGAL::HDS_property_map<CGAL_HDS_CLASS, Tag>::
bind_ map_gen;
typedef typename map_gen::type type;
typedef typename map_gen::const_type const_type;
};
// property_map dispatcher into const Polyhedron
template<class CGAL_HDS_TMPLT, class Tag>
struct property_map<const CGAL_HDS_CLASS, Tag>
{
typedef typename CGAL::HDS_property_map<CGAL_HDS_CLASS, Tag>::
bind_ map_gen;
typedef typename map_gen::type type;
typedef typename map_gen::const_type const_type;
};
template<class CGAL_HDS_TMPLT, class T>
struct property_map<CGAL_HDS_CLASS, CGAL::dynamic_vertex_property_t<T> >
{
typedef CGAL_HDS_CLASS G;
typedef typename boost::graph_traits<G>::vertex_descriptor vertex_descriptor;
typedef CGAL::internal::Dynamic_property_map<vertex_descriptor,T> type;
typedef type const_type;
};
template<class CGAL_HDS_TMPLT, class T>
struct property_map<CGAL_HDS_CLASS, CGAL::dynamic_halfedge_property_t<T> >
{
typedef CGAL_HDS_CLASS G;
typedef typename boost::graph_traits<G>::halfedge_descriptor halfedge_descriptor;
typedef CGAL::internal::Dynamic_property_map<halfedge_descriptor,T> type;
typedef type const_type;
};
template<class CGAL_HDS_TMPLT, class T>
struct property_map<CGAL_HDS_CLASS, CGAL::dynamic_edge_property_t<T> >
{
typedef CGAL_HDS_CLASS G;
typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor;
typedef CGAL::internal::Dynamic_property_map<edge_descriptor,T> type;
typedef type const_type;
};
template<class CGAL_HDS_TMPLT, class T>
struct property_map<CGAL_HDS_CLASS, CGAL::dynamic_face_property_t<T> >
{
typedef CGAL_HDS_CLASS G;
typedef typename boost::graph_traits<G>::face_descriptor face_descriptor;
typedef CGAL::internal::Dynamic_property_map<face_descriptor,T> type;
typedef type const_type;
};
// What are those needed for ???
template<class CGAL_HDS_TMPLT>
struct edge_property_type<CGAL_HDS_CLASS >
{
typedef edge_weight_t type;
};
template<class CGAL_HDS_TMPLT>
struct vertex_property_type<CGAL_HDS_CLASS >
{
typedef CGAL::vertex_point_t type;
};
template<class CGAL_HDS_TMPLT>
struct vertex_property_type<const CGAL_HDS_CLASS >
{
typedef CGAL::vertex_point_t type;
};
} // end of boost namespace
namespace CGAL{
template<class CGAL_HDS_TMPLT>
struct graph_has_property<CGAL_HDS_CLASS, boost::vertex_point_t>
: CGAL::Tag_true {};
template<class CGAL_HDS_TMPLT>
struct graph_has_property<CGAL_HDS_CLASS, boost::edge_weight_t>
: CGAL::Tag_true {};
template<class CGAL_HDS_TMPLT>
struct graph_has_property<CGAL_HDS_CLASS, boost::edge_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename boost::graph_traits<CGAL_HDS_CLASS >::edge_descriptor
>::value
>
{};
template<class CGAL_HDS_TMPLT>
struct graph_has_property<CGAL_HDS_CLASS, boost::face_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename CGAL_HDS_CLASS::Facet
>::value
>
{};
template<class CGAL_HDS_TMPLT>
struct graph_has_property<CGAL_HDS_CLASS, boost::halfedge_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename CGAL_HDS_CLASS::Halfedge
>::value
>
{};
template<class CGAL_HDS_TMPLT>
struct graph_has_property<CGAL_HDS_CLASS, boost::vertex_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename CGAL_HDS_CLASS::Vertex
>::value
>
{};
}// end of CGAL namespace
#undef CGAL_HDS_TMPLT
#undef CGAL_HDS_CLASS

View File

@ -0,0 +1,20 @@
// Copyright (c) 2007 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Andreas Fabri, Fernando Cacciola
#ifndef CGAL_BOOST_GRAPH_PROPERTIES_HALFEDGEDS_DEFAULT_H
#define CGAL_BOOST_GRAPH_PROPERTIES_HALFEDGEDS_DEFAULT_H
#define CGAL_HDS_TMPLT Gt, class I, class A
#define CGAL_HDS_CLASS CGAL::HalfedgeDS_default<Gt,I,A>
#include <CGAL/boost/graph/properties_HalfedgeDS_base.h>
#endif // CGAL_BOOST_GRAPH_PROPERTIES_HALFEDGEDS_DEFAULT_H

View File

@ -1,6 +1,7 @@
Algebraic_foundations
BGL
Circulator
Distance_3
HalfedgeDS
Hash_map
Installation

View File

@ -12,7 +12,6 @@
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/Timer.h>
#include<boost/range/iterator_range.hpp>

View File

@ -50,7 +50,6 @@
#include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/Nef_3/SNC_point_locator.h>
#include <CGAL/assertions.h>

View File

@ -3,7 +3,6 @@
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/boost/graph/property_maps.h>

View File

@ -14,8 +14,6 @@
#include <CGAL/iterator.h>
#include <CGAL/Polygon_mesh_processing/remesh.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
#include <CGAL/utility.h>
#include <CGAL/property_map.h>

View File

@ -18,7 +18,6 @@
#include <CGAL/boost/graph/copy_face_graph.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/property_map.h>
#include <boost/iterator/function_output_iterator.hpp>

View File

@ -38,13 +38,6 @@
namespace PMP = CGAL::Polygon_mesh_processing;
typedef Scene_surface_mesh_item Scene_face_graph_item;
namespace CGAL {
template<>
void set_halfedgeds_items_id (Scene_face_graph_item::Face_graph&)
{}
} // namespace CGAL
typedef Scene_face_graph_item::Face_graph Face_graph;
@ -363,8 +356,6 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionSegment()
QElapsedTimer time;
time.start();
// init the polyhedron simplex indices
CGAL::set_halfedgeds_items_id(*item->input_triangle_mesh);
boost::property_map<Face_graph, boost::vertex_index_t>::type
vimap = get(boost::vertex_index, *item->input_triangle_mesh);

View File

@ -7,8 +7,6 @@
#include "Scene_polyhedron_selection_item.h"
#include <CGAL/iterator.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/utility.h>
#include <CGAL/Polygon_mesh_processing/random_perturbation.h>

View File

@ -11,8 +11,6 @@
#include "Plugins/PMP/Scene_facegraph_item_k_ring_selection.h"
#include "Travel_isolated_components.h"
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/boost/graph/iterator.h>
#include <iostream>

View File

@ -25,7 +25,6 @@
#include <boost/property_map/vector_property_map.hpp>
#include <CGAL/boost/graph/selection.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/Euler_operations.h>
#include <CGAL/Qt/manipulatedFrame.h>

View File

@ -1,6 +1,5 @@
#include "Scene_textured_polyhedron_item.h"
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <QApplication>
#include "Textured_polyhedron_type.h"

View File

@ -1,6 +1,5 @@
#include "Scene_textured_surface_mesh_item.h"
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Three/Triangle_container.h>
#include <CGAL/Three/Edge_container.h>

View File

@ -491,8 +491,9 @@ namespace boost {
#endif //CGAL_NO_DEPRECATED_CODE
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h>
#include <CGAL/boost/graph/properties_Polyhedron_3_features.h>
#undef CGAL_HDS_PARAM_
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#endif // CGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYHEDRON_3_H

View File

@ -12,499 +12,9 @@
#ifndef CGAL_BOOST_GRAPH_PROPERTIES_POLYHEDRON_3_H
#define CGAL_BOOST_GRAPH_PROPERTIES_POLYHEDRON_3_H
#include <CGAL/boost/graph/properties.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/number_utils.h>
#include <memory>
#include <CGAL/boost/graph/internal/Has_member_id.h>
#include <CGAL/Distance_3/Point_3_Point_3.h>
#define CGAL_HDS_TMPLT Gt, class I, CGAL_HDS_PARAM_, class A
#define CGAL_HDS_CLASS CGAL::Polyhedron_3<Gt,I,HDS,A>
#define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS
namespace CGAL {
namespace internal {
template<class Handle>
class Polyhedron_index_map_external
: public boost::put_get_helper<std::size_t&, Polyhedron_index_map_external<Handle> >
{
public:
typedef boost::lvalue_property_map_tag category;
typedef std::size_t value_type;
typedef std::size_t& reference;
typedef Handle key_type;
private:
typedef CGAL::Unique_hash_map<key_type,std::size_t> Map;
public:
template <typename InputIterator>
Polyhedron_index_map_external(InputIterator begin, InputIterator end, std::size_t max)
: map_(new Map(begin, end, 0, std::size_t(-1), max)) {}
reference operator[](const key_type& k) const { return (*map_)[k]; }
private:
std::shared_ptr<Map> map_;
};
// Special case for edges.
template<class Polyhedron>
class Polyhedron_edge_index_map_external
: public boost::put_get_helper<std::size_t&, Polyhedron_edge_index_map_external<Polyhedron> >
{
public:
typedef boost::lvalue_property_map_tag category;
typedef std::size_t value_type;
typedef std::size_t& reference;
typedef typename boost::graph_traits<Polyhedron>::edge_descriptor key_type;
private:
typedef CGAL::Unique_hash_map<key_type,std::size_t> Map;
public:
Polyhedron_edge_index_map_external(Polyhedron& p)
: map_(new Map(std::size_t(-1), num_halfedges(p)))
{
unsigned int data = 0;
typename boost::graph_traits<Polyhedron>::edge_iterator it, end;
for(boost::tie(it, end) = edges(p); it != end; ++it, ++data)
(*map_)[*it] = data;
}
reference operator[](const key_type& k) const { return (*map_)[k]; }
private:
std::shared_ptr<Map> map_;
};
template<typename Handle, typename FT>
struct Wrap_squared
{
typedef FT value_type;
typedef FT reference;
typedef Handle key_type;
typedef boost::readable_property_map_tag category;
template<typename E>
FT operator[](const E& e) const {
return approximate_sqrt(CGAL::squared_distance(e.halfedge()->vertex()->point(),
e.halfedge()->opposite()->vertex()->point()));
}
friend inline
value_type get(const Wrap_squared& m, const key_type k)
{
return m[k];
}
};
} // internal
// the tag we dispatch on from property_map<G, Property>
template <class Tag>
struct Polyhedron_property_map {};
} // namespace CGAL
namespace CGAL {
// generalized 2-ary get functions
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class PropertyTag>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag >::const_type
get(PropertyTag, CGAL::Polyhedron_3<Gt,I,HDS,A> const&)
{ return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag >::const_type(); }
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class PropertyTag>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag >::type
get(PropertyTag, CGAL::Polyhedron_3<Gt,I,HDS,A>&)
{ return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag >::type(); }
// generalized 3-ary get functions
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class PropertyTag, class Key>
typename boost::property_traits< typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag >::type >::reference
get(PropertyTag p, CGAL::Polyhedron_3<Gt,I,HDS,A>& g, const Key& key)
{ return get(get(p, g), key); }
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class PropertyTag, class Key>
typename boost::property_traits< typename boost::property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag >::const_type >::reference
get(PropertyTag p, CGAL::Polyhedron_3<Gt,I,HDS,A> const& g, const Key& key)
{ return get(get(p, g), key); }
#define CGAL_POLYHEDRON_DYNAMIC_PM(TAG, DESCRIPTOR) \
template <typename T, typename Gt, typename I, CGAL_HDS_PARAM_, typename A> \
typename boost::property_map<Polyhedron_3<Gt,I,HDS,A>, TAG >::const_type \
get(const TAG&, const Polyhedron_3<Gt,I,HDS,A>&) \
{ \
typedef typename boost::graph_traits< Polyhedron_3<Gt,I,HDS,A> >::DESCRIPTOR descriptor; \
return internal::Dynamic_property_map<descriptor,T>(); \
}
CGAL_POLYHEDRON_DYNAMIC_PM(dynamic_vertex_property_t<T>, vertex_descriptor)
CGAL_POLYHEDRON_DYNAMIC_PM(dynamic_halfedge_property_t<T>, halfedge_descriptor)
CGAL_POLYHEDRON_DYNAMIC_PM(dynamic_edge_property_t<T>, edge_descriptor)
CGAL_POLYHEDRON_DYNAMIC_PM(dynamic_face_property_t<T>, face_descriptor)
#undef CGAL_POLYHEDRON_DYNAMIC_PM
// generalized put
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class PropertyTag, class Key,class Value>
void put(PropertyTag p, CGAL::Polyhedron_3<Gt,I,HDS,A>& g, const Key& key, const Value& value)
{
typedef typename boost::property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, PropertyTag>::type Map;
Map pmap = get(p, g);
put(pmap, key, value);
}
} // CGAL
// specialization needs to be repeated for halfedge, vertex, face
#define CGAL_POLYHEDRON_INDEX_PM(ENTITY, TAG, ACCESSOR) \
namespace CGAL { \
template<> struct Polyhedron_property_map<boost::ENTITY##TAG> { \
template<class Gt, class I, CGAL_HDS_PARAM_, class A> \
struct bind_ { \
typedef internal::ACCESSOR##_accessor< \
CGAL::Polyhedron_3<Gt, I, HDS, A>, \
typename boost::graph_traits< CGAL::Polyhedron_3<Gt, I, HDS, A> \
>::ENTITY##_descriptor > type; \
typedef type const_type; \
}; \
}; \
} //CGAL
CGAL_POLYHEDRON_INDEX_PM(halfedge, _index_t, Index)
CGAL_POLYHEDRON_INDEX_PM(vertex, _index_t, Index)
CGAL_POLYHEDRON_INDEX_PM(face, _index_t, Index)
#undef CGAL_POLYHEDRON_INDEX_PM
namespace CGAL {
// not done with macros, because HDS_edge::id does not return a
// reference
template <>
struct Polyhedron_property_map<boost::edge_index_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef internal::Edge_index_accessor<
typename boost::graph_traits<
CGAL::Polyhedron_3<Gt, I, HDS, A>
>::edge_descriptor > type;
typedef type const_type;
};
};
template <>
struct Polyhedron_property_map<boost::edge_weight_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef typename CGAL::Polyhedron_3<Gt, I, HDS, A>::Traits::FT FT;
typedef typename boost::graph_traits<CGAL::Polyhedron_3<Gt, I, HDS, A> >::edge_descriptor edge_descriptor;
typedef internal::Wrap_squared<edge_descriptor,FT> type;
typedef type const_type;
};
};
template <>
struct Polyhedron_property_map<vertex_point_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef internal::Point_accessor<
typename boost::graph_traits<
CGAL::Polyhedron_3<Gt, I, HDS, A>
>::vertex_descriptor,
typename Gt::Point_3, typename Gt::Point_3&> type;
typedef internal::Point_accessor<
typename boost::graph_traits<
CGAL::Polyhedron_3<Gt, I, HDS, A>
>::vertex_descriptor,
typename Gt::Point_3, const typename Gt::Point_3&> const_type;
};
};
//
// external indices
//
template <>
struct Polyhedron_property_map<edge_external_index_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef internal::Polyhedron_edge_index_map_external<
CGAL::Polyhedron_3<Gt, I, HDS, A>
> type;
typedef type const_type;
};
};
template <>
struct Polyhedron_property_map<halfedge_external_index_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef internal::Polyhedron_index_map_external<
typename boost::graph_traits<
CGAL::Polyhedron_3<Gt, I, HDS, A>
>::halfedge_descriptor > type;
typedef type const_type;
};
};
template <>
struct Polyhedron_property_map<vertex_external_index_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef internal::Polyhedron_index_map_external<
typename boost::graph_traits<
CGAL::Polyhedron_3<Gt, I, HDS, A>
>::vertex_descriptor > type;
typedef type const_type;
};
};
template <>
struct Polyhedron_property_map<face_external_index_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef internal::Polyhedron_index_map_external<
typename boost::graph_traits<
CGAL::Polyhedron_3<Gt, I, HDS, A>
>::face_descriptor > type;
typedef type const_type;
};
};
} // CGAL
namespace CGAL {
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::edge_external_index_t >::const_type
get(boost::edge_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::edge_external_index_t >::const_type(
const_cast<CGAL::Polyhedron_3<Gt,I,HDS,A>& >(p));
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::halfedge_external_index_t >::const_type
get(boost::halfedge_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_3<Gt,I,HDS,A>& ncp = const_cast<CGAL::Polyhedron_3<Gt,I,HDS,A>&>(p);
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::halfedge_external_index_t >::const_type(
ncp.halfedges_begin(), ncp.halfedges_end(), ncp.size_of_halfedges());
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::vertex_external_index_t >::const_type
get(boost::vertex_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_3<Gt,I,HDS,A>& ncp = const_cast<CGAL::Polyhedron_3<Gt,I,HDS,A>&>(p);
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::vertex_external_index_t >::const_type(
ncp.vertices_begin(), ncp.vertices_end(), ncp.size_of_vertices());
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::face_external_index_t >::const_type
get(boost::face_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_3<Gt,I,HDS,A>& ncp = const_cast<CGAL::Polyhedron_3<Gt,I,HDS,A>&>(p);
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::face_external_index_t >::const_type(
ncp.facets_begin(), ncp.facets_end(), ncp.size_of_facets());
}
// the same blurb for non-const
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::edge_external_index_t >::type
get(boost::edge_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A>& p)
{
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::edge_external_index_t >::type(
p);
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::halfedge_external_index_t >::type
get(boost::halfedge_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> & ncp)
{
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::halfedge_external_index_t >::type(
ncp.halfedges_begin(), ncp.halfedges_end(), ncp.size_of_halfedges());
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::vertex_external_index_t >::type
get(boost::vertex_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> & ncp)
{
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::vertex_external_index_t >::type(
ncp.vertices_begin(), ncp.vertices_end(), ncp.size_of_vertices());
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::face_external_index_t >::type
get(boost::face_external_index_t, CGAL::Polyhedron_3<Gt,I,HDS,A> & ncp)
{
return typename boost::property_map< CGAL::Polyhedron_3<Gt,I,HDS,A>, boost::face_external_index_t >::type(
ncp.facets_begin(), ncp.facets_end(), ncp.size_of_facets());
}
} // namespace CGAL
namespace boost {
// property_map dispatcher into Polyhedron
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class Tag>
struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, Tag>
{
typedef typename CGAL::Polyhedron_property_map<Tag>::
template bind_<Gt,I,HDS,A> map_gen;
typedef typename map_gen::type type;
typedef typename map_gen::const_type const_type;
};
// property_map dispatcher into const Polyhedron
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class Tag>
struct property_map<const CGAL::Polyhedron_3<Gt,I,HDS,A>, Tag>
{
typedef typename CGAL::Polyhedron_property_map<Tag>::
template bind_<Gt,I,HDS,A> map_gen;
typedef typename map_gen::type type;
typedef typename map_gen::const_type const_type;
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class T>
struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, CGAL::dynamic_vertex_property_t<T> >
{
typedef CGAL::Polyhedron_3<Gt,I,HDS,A> G;
typedef typename boost::graph_traits<G>::vertex_descriptor vertex_descriptor;
typedef CGAL::internal::Dynamic_property_map<vertex_descriptor,T> type;
typedef type const_type;
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class T>
struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, CGAL::dynamic_halfedge_property_t<T> >
{
typedef CGAL::Polyhedron_3<Gt,I,HDS,A> G;
typedef typename boost::graph_traits<G>::halfedge_descriptor halfedge_descriptor;
typedef CGAL::internal::Dynamic_property_map<halfedge_descriptor,T> type;
typedef type const_type;
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class T>
struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, CGAL::dynamic_edge_property_t<T> >
{
typedef CGAL::Polyhedron_3<Gt,I,HDS,A> G;
typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor;
typedef CGAL::internal::Dynamic_property_map<edge_descriptor,T> type;
typedef type const_type;
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class T>
struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, CGAL::dynamic_face_property_t<T> >
{
typedef CGAL::Polyhedron_3<Gt,I,HDS,A> G;
typedef typename boost::graph_traits<G>::face_descriptor face_descriptor;
typedef CGAL::internal::Dynamic_property_map<face_descriptor,T> type;
typedef type const_type;
};
// What are those needed for ???
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct edge_property_type<CGAL::Polyhedron_3<Gt,I,HDS,A> >
{
typedef edge_weight_t type;
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct vertex_property_type<CGAL::Polyhedron_3<Gt,I,HDS,A> >
{
typedef CGAL::vertex_point_t type;
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct vertex_property_type<const CGAL::Polyhedron_3<Gt,I,HDS,A> >
{
typedef CGAL::vertex_point_t type;
};
} // namespace boost
namespace CGAL{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct graph_has_property<CGAL::Polyhedron_3<Gt, I, HDS, A>, boost::vertex_point_t>
: CGAL::Tag_true {};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct graph_has_property<CGAL::Polyhedron_3<Gt, I, HDS, A>, boost::edge_weight_t>
: CGAL::Tag_true {};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct graph_has_property<CGAL::Polyhedron_3<Gt, I, HDS, A>, boost::edge_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename boost::graph_traits<CGAL::Polyhedron_3<Gt, I, HDS, A> >::edge_descriptor
>::value
>
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct graph_has_property<CGAL::Polyhedron_3<Gt, I, HDS, A>, boost::face_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename CGAL::Polyhedron_3<Gt, I, HDS, A>::Facet
>::value
>
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct graph_has_property<CGAL::Polyhedron_3<Gt, I, HDS, A>, boost::halfedge_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename CGAL::Polyhedron_3<Gt, I, HDS, A>::Halfedge
>::value
>
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct graph_has_property<CGAL::Polyhedron_3<Gt, I, HDS, A>, boost::vertex_index_t>
: CGAL::Boolean_tag<
CGAL::internal::Has_member_id<
typename CGAL::Polyhedron_3<Gt, I, HDS, A>::Vertex
>::value
>
{};
}// end CGAL
#undef CGAL_HDS_PARAM_
#include <CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h>
#include <CGAL/boost/graph/properties_Polyhedron_3_features.h>
#include <CGAL/boost/graph/properties_HalfedgeDS_base.h>
#endif // CGAL_BOOST_GRAPH_PROPERTIES_POLYHEDRON_3_H

View File

@ -55,10 +55,9 @@ void put(Polyhedron_face_patch_id_pmap<Patch_id>, Handle_type h, Patch_id pid)
h->set_patch_id(pid);
}
template <typename Patch_id>
struct Polyhedron_property_map<CGAL::face_patch_id_t<Patch_id> >
template <class Gt, class I, CGAL_HDS_PARAM_, class A, typename Patch_id>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::face_patch_id_t<Patch_id> >
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef Polyhedron_face_patch_id_pmap<Patch_id> type;
@ -79,10 +78,9 @@ get(CGAL::face_patch_id_t<void>, const Polyhedron_3<Gt,I,HDS,A>&)
return Pmap( std::pair<int,int>(0,1) );
}
template <>
struct Polyhedron_property_map<CGAL::face_patch_id_t<void> >
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::face_patch_id_t<void> >
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef typename internal::Get_static_property_map<Gt,I,HDS,A>::type type;
@ -93,10 +91,9 @@ struct Polyhedron_property_map<CGAL::face_patch_id_t<void> >
// Compatibility: when the `Patch_id` template argument of
// `Polyhedron_mesh_domain` is `Tag_true` (because that argument was named
// `UsePatchId` in previous versions of CGAL.
template <>
struct Polyhedron_property_map<CGAL::face_patch_id_t<CGAL::Tag_true> >
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::face_patch_id_t<CGAL::Tag_true> >
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef Polyhedron_3<Gt,I,HDS,A> Polyhedron;
@ -108,9 +105,9 @@ struct Polyhedron_property_map<CGAL::face_patch_id_t<CGAL::Tag_true> >
// Compatibility: when the `Patch_id` template argument of
// `Polyhedron_mesh_domain` is `Tag_false` (because that argument was named
// `UsePatchId` in previous versions of CGAL.
template <>
struct Polyhedron_property_map<CGAL::face_patch_id_t<CGAL::Tag_false> >
: public Polyhedron_property_map<CGAL::face_patch_id_t<void> >
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::face_patch_id_t<CGAL::Tag_false> >
: public HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::face_patch_id_t<void> >
{
};
@ -144,10 +141,9 @@ void put(Polyhedron_num_feature_edges_pmap, Handle_type h, int n)
}
template <>
struct Polyhedron_property_map<CGAL::vertex_feature_degree_t>
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::vertex_feature_degree_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef Polyhedron_num_feature_edges_pmap type;
@ -177,10 +173,9 @@ void put(Polyhedron_is_feature_edge_pmap, Handle_type e, bool b)
e.halfedge()->opposite()->set_feature_edge(b);
}
template <>
struct Polyhedron_property_map<CGAL::edge_is_feature_t>
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::edge_is_feature_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef Polyhedron_is_feature_edge_pmap type;
@ -220,10 +215,9 @@ void put(Polyhedron_incident_patches_pmap<Patch_id>,
h->add_incident_patch(n);
}
template <typename Patch_id>
struct Polyhedron_property_map<CGAL::vertex_incident_patches_t<Patch_id> >
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class Patch_id>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::vertex_incident_patches_t<Patch_id> >
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef Polyhedron_incident_patches_pmap<Patch_id> type;

View File

@ -38,10 +38,9 @@ void put(Polyhedron_face_time_stamp_pmap, Handle_type h, std::size_t ts)
h->set_time_stamp(ts);
}
template <>
struct Polyhedron_property_map<CGAL::vertex_time_stamp_t>
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::vertex_time_stamp_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_
{
typedef Polyhedron_face_time_stamp_pmap type;
@ -49,14 +48,14 @@ struct Polyhedron_property_map<CGAL::vertex_time_stamp_t>
};
};
template <>
struct Polyhedron_property_map<CGAL::halfedge_time_stamp_t>
: public Polyhedron_property_map<CGAL::vertex_time_stamp_t>
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::halfedge_time_stamp_t>
: public HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::vertex_time_stamp_t>
{};
template <>
struct Polyhedron_property_map<CGAL::face_time_stamp_t>
: public Polyhedron_property_map<CGAL::vertex_time_stamp_t>
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::face_time_stamp_t>
: public HDS_property_map<CGAL::Polyhedron_3<Gt, I, HDS, A>, CGAL::vertex_time_stamp_t>
{};

View File

@ -4,7 +4,6 @@
#include <CGAL/IO/Polyhedron_iostream.h>
// HalfedgeGraph adapters for Polyhedron_3
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
// #define CGAL_DEFORM_MESH_USE_EXPERIMENTAL_SR_ARAP
#include <CGAL/Surface_mesh_deformation.h>

View File

@ -4,7 +4,6 @@
#include <algorithm>
#include <CGAL/boost/graph/properties.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Random.h>

View File

@ -19,9 +19,13 @@
#include <CGAL/Timer.h>
#include <CGAL/Default.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/HalfedgeDS_default.h>
#include <CGAL/HalfedgeDS_vertex_max_base_with_id.h>
#include <CGAL/HalfedgeDS_halfedge_max_base_with_id.h>
#include <CGAL/HalfedgeDS_face_max_base_with_id.h>
#include <CGAL/boost/graph/graph_traits_HalfedgeDS_default.h>
#include <CGAL/boost/graph/properties_HalfedgeDS_default.h>
#include <CGAL/boost/graph/copy_face_graph.h>
#include <boost/graph/graph_traits.hpp>
@ -91,12 +95,20 @@ struct Skel_HDS_vertex_type : public HalfedgeDS_vertex_max_base_with_id<Refs, Po
};
template <class vertex_descriptor>
struct Skel_polyhedron_items_3: CGAL::Polyhedron_items_with_id_3 {
struct Skel_polyhedron_items_3 {
template < class Refs, class Traits>
struct Vertex_wrapper {
typedef typename Traits::Point_3 Point;
typedef Skel_HDS_vertex_type< Refs, Point, std::size_t, vertex_descriptor> Vertex;
};
template < class Refs, class Traits>
struct Halfedge_wrapper {
typedef HalfedgeDS_halfedge_max_base_with_id<Refs, std::size_t> Halfedge;
};
template < class Refs, class Traits>
struct Face_wrapper {
typedef HalfedgeDS_face_max_base_with_id< Refs, Tag_false, std::size_t> Face;
};
};
} //end of namespace internal
@ -192,7 +204,7 @@ public:
typedef typename Traits::Vector_3 Vector;
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor Input_vertex_descriptor;
typedef CGAL::Polyhedron_3<Traits,internal::Skel_polyhedron_items_3<Input_vertex_descriptor> > mTriangleMesh;
typedef CGAL::HalfedgeDS_default<Traits,internal::Skel_polyhedron_items_3<Input_vertex_descriptor> > mTriangleMesh;
typedef typename boost::property_map<mTriangleMesh, CGAL::vertex_point_t>::type mVertexPointMap;
typedef typename boost::property_map<mTriangleMesh, boost::vertex_index_t>::type VertexIndexMap;
typedef typename boost::property_map<mTriangleMesh, boost::halfedge_index_t>::type HalfedgeIndexMap;
@ -1193,7 +1205,7 @@ private:
vertex_descriptor vk = target(ek, m_tmesh);
// split the edge
halfedge_descriptor en = m_tmesh.split_edge(ei);
halfedge_descriptor en = Euler::split_edge(ei, m_tmesh);
// split the incident faces
Euler::split_face(en, next(ei,m_tmesh), m_tmesh);
if (! is_border(ej,m_tmesh))

View File

@ -214,16 +214,16 @@ private:
MCFSKEL_DEBUG( std::cerr <<"init" << std::endl; )
int nb_edges = static_cast<int>(num_edges(hg));
int num_faces = static_cast<int>(hg.size_of_facets());
int nb_faces = static_cast<int>(num_faces(hg));
int nb_vertices = static_cast<int>(num_vertices(hg));
edge_to_face.resize(nb_edges);
edge_to_vertex.resize(nb_edges);
vertex_to_edge.resize(nb_vertices);
face_to_edge.resize(num_faces);
face_to_edge.resize(nb_faces);
is_vertex_deleted.resize(nb_vertices, false);
is_edge_deleted.resize(nb_edges, false);
is_face_deleted.resize(num_faces, false);
is_face_deleted.resize(nb_faces, false);
record.resize(nb_vertices);
for (size_t i = 0; i < record.size(); ++i)

View File

@ -15,8 +15,6 @@
#include <CGAL/license/Surface_mesh_skeletonization.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#ifdef CGAL_EIGEN3_ENABLED
#include <CGAL/Eigen_solver_traits.h> // for sparse linear system solver
#endif

View File

@ -17,11 +17,9 @@ Intersections_3
Interval_support
Kernel_23
Kernel_d
Modifier
Modular_arithmetic
Number_types
Polygon_mesh_processing
Polyhedron
Profiling_tools
Property_map
Random_numbers