Fix after rebase

This commit is contained in:
Maxime Gimeno 2017-05-12 09:07:17 +02:00
parent fcc081f95d
commit 95960c3b58
9 changed files with 109 additions and 80 deletions

View File

@ -29,6 +29,7 @@
#include <CGAL/Polygon_mesh_processing/Detect_features_in_polyhedra_fwd.h>
#include <CGAL/Compare_handles_with_or_without_timestamps.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Polygon_mesh_processing/properties.h>
#include <set>
namespace CGAL {
@ -37,7 +38,7 @@ namespace Polygon_mesh_processing {
template <typename Polyhedron, typename FT, typename Patch_id>
void detect_features(Polyhedron& p,
FT angle_in_deg,
typename boost::property_map<Polyhedron, face_patch_id_t<Patch_id> >::type pid_map)
typename boost::property_map<Polyhedron, CGAL::face_patch_id_t<Patch_id> >::type pid_map)
{
Detect_features_in_polyhedra<Polyhedron, Patch_id> go;
// AF todo: Add overload for the next three functions so that we use the pid_map

View File

@ -39,7 +39,7 @@ struct Polyhedral_mesh_domain_selector<SMwgd>
{}
};
template<class Mesh>
Meshing_thread* cgal_code_mesh_3(const Mesh* pMesh,
Meshing_thread* cgal_code_mesh_3_templated(const Mesh* pMesh,
const Polylines_container& polylines,
QString filename,
const double facet_angle,
@ -150,7 +150,7 @@ Meshing_thread* cgal_code_mesh_3(const Polyhedron* pMesh,
const bool surface_only,
CGAL::Three::Scene_interface* scene)
{
return cgal_code_mesh_3(pMesh,
return cgal_code_mesh_3_templated(pMesh,
polylines,
filename,
facet_angle,
@ -181,7 +181,7 @@ Meshing_thread* cgal_code_mesh_3(const SMwgd* pMesh,
const bool surface_only,
CGAL::Three::Scene_interface* scene)
{
return cgal_code_mesh_3(pMesh,
return cgal_code_mesh_3_templated(pMesh,
polylines,
filename,
facet_angle,

View File

@ -155,7 +155,7 @@ public Q_SLOTS:
{
#ifdef USE_SURFACE_MESH
typedef boost::graph_traits<FaceGraph>::vertices_size_type size_type;
size_type h = reinterpret_cast<size_type>(void_ptr);
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(void_ptr));
process_selection( static_cast<fg_vertex_descriptor>(h) );
#else
process_selection( static_cast<Polyhedron::Vertex*>(void_ptr)->halfedge()->vertex() );
@ -171,7 +171,7 @@ public Q_SLOTS:
{
#ifdef USE_SURFACE_MESH
typedef boost::graph_traits<FaceGraph>::faces_size_type size_type;
size_type h = reinterpret_cast<size_type>(void_ptr);
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(void_ptr));
process_selection( static_cast<fg_face_descriptor>(h) );
#else
process_selection( static_cast<Polyhedron::Facet*>(void_ptr)->halfedge()->facet() );
@ -186,7 +186,7 @@ public Q_SLOTS:
{
#ifdef USE_SURFACE_MESH
typedef boost::graph_traits<FaceGraph>::edges_size_type size_type;
size_type h = reinterpret_cast<size_type>(void_ptr);
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(void_ptr));
process_selection( static_cast<fg_edge_descriptor>(h) );
#else
process_selection( edge(static_cast<Polyhedron::Halfedge*>(void_ptr)->opposite()->opposite(), *poly_item->polyhedron()) );

View File

@ -25,9 +25,9 @@ namespace CGAL
// Detect edges in current polyhedron
typedef typename boost::property_map<Polyhedron,CGAL::face_patch_id_t<int> >::type PatchID;
CGAL::Polygon_mesh_processing::Detect_features_in_polyhedra<Polyhedron,PatchID>
detect_features(get(CGAL::face_patch_id_t<int>(), *pMesh));
detect_features.detect_sharp_edges(*pMesh, angle);
CGAL::Polygon_mesh_processing::Detect_features_in_polyhedra<Polyhedron,PatchID> features_detector;
features_detector.detect_sharp_edges(*pMesh, angle);
}
}//end namespace CGAL

View File

@ -195,6 +195,35 @@ public:
};
#include "Polyhedron_type_fwd.h"
#include <CGAL/Polygon_mesh_processing/properties.h>
inline
boost::property_map<Polyhedron, boost::vertex_index_t>::type
get(CGAL::vertex_selection_t, const Polyhedron& p)
{
return get(boost::vertex_index,p);
}
inline
boost::property_map<Polyhedron, boost::face_index_t>::type
get(CGAL::face_selection_t, const Polyhedron& p)
{
return get(boost::face_index,p);
}
namespace boost
{
template <>
struct property_map<Polyhedron, CGAL::vertex_selection_t>
{
typedef boost::property_map<Polyhedron,boost::vertex_index_t>::type type;
typedef boost::property_map<Polyhedron,boost::vertex_index_t>::const_type const_type;
};
template <>
struct property_map<Polyhedron, CGAL::face_selection_t>
{
typedef boost::property_map<Polyhedron,boost::face_index_t>::type type;
typedef boost::property_map<Polyhedron,boost::face_index_t>::const_type const_type;
};
}//boost
// surface mesh
typedef Polyhedron_demo_items<Patch_id> Polyhedron_items;

View File

@ -80,6 +80,33 @@ inline get(CGAL::vertex_selection_t, SMesh& smesh)
typedef boost::graph_traits<SMesh >::vertex_descriptor vertex_descriptor;
return smesh.add_property_map<vertex_descriptor,std::set<int> >("v:ip").first;
}
SMesh::Property_map< boost::graph_traits<SMesh >::vertex_descriptor,std::size_t>
inline get(CGAL::vertex_time_stamp_t, SMesh & smesh)
{
typedef boost::graph_traits<SMesh>::vertex_descriptor vertex_descriptor;
return smesh.add_property_map<vertex_descriptor,std::size_t>("v:time_stamp").first;
}
SMesh::Property_map< boost::graph_traits<SMesh>::halfedge_descriptor,std::size_t>
inline get(CGAL::halfedge_time_stamp_t, SMesh& smesh)
{
typedef boost::graph_traits<SMesh>::halfedge_descriptor halfedge_descriptor;
return smesh.add_property_map<halfedge_descriptor,std::size_t>("h:time_stamp").first;
}
SMesh::Property_map< boost::graph_traits<SMesh>::face_descriptor,std::size_t>
inline get(CGAL::face_time_stamp_t, SMesh& smesh)
{
typedef boost::graph_traits<SMesh>::face_descriptor face_descriptor;
return smesh.add_property_map<face_descriptor,std::size_t>("v:time_stamp").first;
}
}
namespace boost
{
@ -89,6 +116,7 @@ struct property_map<SMesh, CGAL::halfedge_is_feature_t>
typedef boost::graph_traits<SMesh>::halfedge_descriptor halfedge_descriptor;
typedef SMesh::Property_map<halfedge_descriptor, bool> type;
typedef type const_type;
};
template<typename I>
@ -97,6 +125,7 @@ struct property_map<SMesh, CGAL::face_patch_id_t<I> >
typedef boost::graph_traits<SMesh>::face_descriptor face_descriptor;
typedef SMesh::Property_map<face_descriptor, I> type;
typedef type const_type;
};
template <>
@ -117,6 +146,7 @@ struct property_map<SMesh, CGAL::vertex_selection_t>
typedef boost::graph_traits<SMesh>::vertex_descriptor vertex_descriptor;
typedef SMesh::Property_map<vertex_descriptor, int> type;
typedef type const_type;
};
template<>
@ -126,6 +156,7 @@ struct property_map<SMesh, CGAL::face_selection_t>
typedef boost::graph_traits<SMesh>::face_descriptor face_descriptor;
typedef SMesh::Property_map<face_descriptor, int> type;
typedef type const_type;
};
template<>
@ -145,6 +176,40 @@ struct property_map<SMesh, CGAL::vertex_incident_patches_t<Patch_ID>>
typedef boost::graph_traits<SMesh>::vertex_descriptor vertex_descriptor;
typedef SMesh::Property_map<vertex_descriptor, std::set<int>> type;
typedef type const_type;
};
template<>
struct property_map<SMesh, CGAL::vertex_time_stamp_t>
{
typedef boost::graph_traits<SMesh>::vertex_descriptor vertex_descriptor;
typedef SMesh::Property_map<vertex_descriptor, std::size_t> type;
typedef type const_type;
};
template<>
struct property_map<SMesh, CGAL::halfedge_time_stamp_t>
{
typedef boost::graph_traits<SMesh >::halfedge_descriptor halfedge_descriptor;
typedef SMesh::Property_map<halfedge_descriptor, std::size_t> type;
typedef type const_type;
};
template<>
struct property_map<SMesh, CGAL::face_time_stamp_t>
{
typedef boost::graph_traits<SMesh >::face_descriptor face_descriptor;
typedef SMesh::Property_map<face_descriptor, std::size_t> type;
typedef type const_type;
};
} //boost

View File

@ -192,7 +192,7 @@ public Q_SLOTS:
void sm_vertex_has_been_selected(void* v)
{
typedef boost::graph_traits<SMesh>::vertices_size_type size_type;
size_type h = reinterpret_cast<size_type>(v);
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(v));
is_active=true;
if(active_handle_type == Active_handle::VERTEX || active_handle_type == Active_handle::PATH)
process_selection( sm_vertex_descriptor(h) );
@ -201,7 +201,7 @@ public Q_SLOTS:
void sm_facet_has_been_selected(void* v)
{
typedef boost::graph_traits<SMesh>::vertices_size_type size_type;
size_type h = reinterpret_cast<size_type>(v);
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(v));
is_active=true;
if (active_handle_type == Active_handle::FACET
|| active_handle_type == Active_handle::CONNECTED_COMPONENT)
@ -211,7 +211,7 @@ public Q_SLOTS:
void sm_edge_has_been_selected(void* v)
{
typedef boost::graph_traits<SMesh>::edges_size_type size_type;
size_type h = reinterpret_cast<size_type>(v);
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(v));
is_active=true;
if(active_handle_type == Active_handle::EDGE)
process_selection(sm_edge_descriptor(h) );

View File

@ -9,6 +9,7 @@
#include "Scene_surface_mesh_item.h"
#else
#include "Polyhedron_type.h"
#include <CGAL/boost/graph/PMP_properties_Polyhedron_3.h>
#endif
#include "Scene_polyhedron_item_decorator.h"
#include <CGAL/property_map.h>

View File

@ -203,13 +203,6 @@ struct Polyhedron_property_map<CGAL::halfedge_is_feature_t>
};
};
// template <typename Gt, typename Patch_id>
// inline Is_feature_pmap<Gt,Patch_id>
// get(halfedge_is_feature_t,
// const Polyhedron_3<Gt, Mesh_3::Mesh_polyhedron_items<Patch_id> >&)
// {
// return Is_feature_pmap<Gt,Patch_id> ();
// }
template <typename Patch_id>
@ -246,69 +239,9 @@ struct Polyhedron_property_map<CGAL::vertex_incident_patches_t<Patch_id> >
};
};
// template <typename Gt, typename Patch_id>
// inline vertex_incident_patches_pmap<Gt,Patch_id>
// get(CGAL::vertex_incident_patches_t<Patch_id>,
// const Polyhedron_3<Gt, Mesh_3::Mesh_polyhedron_items<Patch_id> >&)
// {
// return vertex_incident_patches_pmap<Gt,Patch_id>();
// }
} // end namespace CGAL
namespace boost {
// template <class Gt, class I, CGAL_HDS_PARAM_, class A>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::vertex_time_stamp_t>
// {
// typedef CGAL::Polyhedron_face_time_stamp_pmap type;
// };
// template <class Gt, class I, CGAL_HDS_PARAM_, class A>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::halfedge_time_stamp_t>
// {
// typedef CGAL::Polyhedron_face_time_stamp_pmap type;
// };
// template <class Gt, class I, CGAL_HDS_PARAM_, class A>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::face_time_stamp_t>
// {
// typedef CGAL::Polyhedron_face_time_stamp_pmap type;
// };
// template <class Gt, class I, CGAL_HDS_PARAM_, class A, typename Patch_id>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::face_patch_id_t<Patch_id> >
// {
// typedef CGAL::Polyhedron_face_patch_id_pmap<Patch_id> type;
// };
// template <class Gt, class I, CGAL_HDS_PARAM_, class A>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::vertex_num_feature_edges_t>
// {
// typedef CGAL::Polyhedron_num_feature_edges_pmap type;
// };
// template <class Gt, class I, CGAL_HDS_PARAM_, class A>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::halfedge_is_feature_t>
// {
// typedef CGAL::Polyhedron_is_feature_edge_pmap type;
// };
// template <class Gt, class I, CGAL_HDS_PARAM_, class A, typename Patch_id>
// struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>,
// CGAL::vertex_incident_patches_t<Patch_id> >
// {
// typedef CGAL::Polyhedron_incident_patches_pmap<Patch_id> type;
// };
} // namespace boost
#undef CGAL_HDS_PARAM_
#endif // CGAL_PMP_PROPERTIES_POLYHEDRON_3_H