Merge branch 'Weights-v2.0-GF-5.5.x' into Weights-v2.0-GF-master

This commit is contained in:
Mael Rouxel-Labbé 2022-11-22 17:53:26 +01:00
commit 491a77397c
4 changed files with 23 additions and 33 deletions

View File

@ -13,6 +13,8 @@
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
#include <CGAL/boost/graph/properties.h> #include <CGAL/boost/graph/properties.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Kernel_traits.h>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#ifndef OPEN_MESH_CLASS #ifndef OPEN_MESH_CLASS
@ -231,8 +233,8 @@ public:
#if defined(CGAL_USE_OM_POINTS) #if defined(CGAL_USE_OM_POINTS)
const_cast<OpenMesh&>(*pm.sm_).set_point(v,p); const_cast<OpenMesh&>(*pm.sm_).set_point(v,p);
#else #else
const_cast<OpenMesh&>(*pm.sm_).set_point typedef typename CGAL::Kernel_traits<typename OpenMesh::Point>::type FT;
(v, typename OpenMesh::Point((float)p[0], (float)p[1], (float)p[2])); const_cast<OpenMesh&>(*pm.sm_).set_point(v, typename OpenMesh::Point(FT(p[0]), FT(p[1]), FT(p[2])));
#endif #endif
} }

View File

@ -22,19 +22,10 @@ public:
mesh.request_face_normals(); mesh.request_face_normals();
} }
private: private:
typedef OpenMesh::TriMesh_ArrayKernelT<OpenMesh::DefaultTraitsDouble> Mesh;
struct MyTraits : public OpenMesh::DefaultTraits
{
typedef OpenMesh::Vec3d Point;
typedef OpenMesh::Vec3d Normal;
};
typedef OpenMesh::TriMesh_ArrayKernelT<MyTraits> Mesh;
Mesh mesh; Mesh mesh;
private: private:
void display_info() void display_info()
{ {

View File

@ -13,17 +13,10 @@
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
struct DoubleTraits : public OpenMesh::DefaultTraits typedef OpenMesh::PolyMesh_ArrayKernelT<OpenMesh::DefaultTraitsDouble> Mesh;
{ typedef Mesh::Point Point;
typedef OpenMesh::Vec3d Point; typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
typedef OpenMesh::Vec3d Normal; typedef boost::graph_traits<Mesh>::vertex_iterator vertex_iterator;
};
typedef OpenMesh::PolyMesh_ArrayKernelT<DoubleTraits> Mesh;
typedef Mesh::Point Point;
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<Mesh>::vertex_iterator vertex_iterator;
typedef CGAL::Surface_mesh_deformation<Mesh, CGAL::Default, CGAL::Default, CGAL::ORIGINAL_ARAP> Deform_mesh_arap; typedef CGAL::Surface_mesh_deformation<Mesh, CGAL::Default, CGAL::Default, CGAL::ORIGINAL_ARAP> Deform_mesh_arap;
typedef CGAL::Surface_mesh_deformation<Mesh, CGAL::Default, CGAL::Default, CGAL::SPOKES_AND_RIMS> Deform_mesh_spoke; typedef CGAL::Surface_mesh_deformation<Mesh, CGAL::Default, CGAL::Default, CGAL::SPOKES_AND_RIMS> Deform_mesh_spoke;

View File

@ -193,6 +193,9 @@ public:
// Surface_mesh_deformation -> Surface_mesh_deformation.h (default version) // Surface_mesh_deformation -> Surface_mesh_deformation.h (default version)
// Surface_mesh_parameterizer -> Orbifold_Tutte_parameterizer_3.h (default version) // Surface_mesh_parameterizer -> Orbifold_Tutte_parameterizer_3.h (default version)
// Surface_mesh_skeletonization -> Mean_curvature_flow_skeletonization.h (clamped version) // Surface_mesh_skeletonization -> Mean_curvature_flow_skeletonization.h (clamped version)
//
// The API is a bit awkward: the template parameters VertexPointMap and GeomTraits
// are only meaningful in the API that calls the operator with a single parameter.
template<typename PolygonMesh, template<typename PolygonMesh,
typename VertexPointMap = typename GetVertexPointMap<PolygonMesh>::type, typename VertexPointMap = typename GetVertexPointMap<PolygonMesh>::type,
typename GeomTraits = typename Kernel_traits< typename GeomTraits = typename Kernel_traits<
@ -202,8 +205,6 @@ class Cotangent_weight
using vertex_descriptor = typename boost::graph_traits<PolygonMesh>::vertex_descriptor; using vertex_descriptor = typename boost::graph_traits<PolygonMesh>::vertex_descriptor;
using halfedge_descriptor = typename boost::graph_traits<PolygonMesh>::halfedge_descriptor; using halfedge_descriptor = typename boost::graph_traits<PolygonMesh>::halfedge_descriptor;
using FT = typename GeomTraits::FT;
private: private:
// These class members are used only when the constructor initializing them // These class members are used only when the constructor initializing them
// is used, but Surface_mesh_deformation has its own weight API locked // is used, but Surface_mesh_deformation has its own weight API locked
@ -224,12 +225,14 @@ public:
// Common API whether mesh/vpm/traits are initialized in the constructor, // Common API whether mesh/vpm/traits are initialized in the constructor,
// or passed in the operator() // or passed in the operator()
template <typename VPM, typename GT> template <typename VPM, typename GT>
FT operator()(const halfedge_descriptor he, typename GT::FT
const PolygonMesh& pmesh, operator()(const halfedge_descriptor he,
const VPM vpm, const PolygonMesh& pmesh,
const GT& traits) const const VPM vpm,
const GT& traits) const
{ {
using Point_ref = typename boost::property_traits<VPM>::reference; using Point_ref = typename boost::property_traits<VPM>::reference;
using FT = typename GT::FT;
if(is_border(he, pmesh)) if(is_border(he, pmesh))
return FT{0}; return FT{0};
@ -265,9 +268,10 @@ public:
// That is the API called by Surface_mesh_deformation // That is the API called by Surface_mesh_deformation
template <typename VPM> template <typename VPM>
FT operator()(const halfedge_descriptor he, auto // kernel_traits<VPM::value_type>::type::FT
const PolygonMesh& pmesh, operator()(const halfedge_descriptor he,
const VPM vpm) const const PolygonMesh& pmesh,
const VPM vpm) const
{ {
using Point = typename boost::property_traits<VPM>::value_type; using Point = typename boost::property_traits<VPM>::value_type;
using GT = typename Kernel_traits<Point>::type; using GT = typename Kernel_traits<Point>::type;
@ -286,7 +290,7 @@ public:
m_bound_from_below(bound_from_below) m_bound_from_below(bound_from_below)
{ } { }
FT operator()(const halfedge_descriptor he) const typename GeomTraits::FT operator()(const halfedge_descriptor he) const
{ {
CGAL_precondition(m_pmesh_ptr != nullptr); CGAL_precondition(m_pmesh_ptr != nullptr);
return this->operator()(he, *m_pmesh_ptr, m_vpm, m_traits); return this->operator()(he, *m_pmesh_ptr, m_vpm, m_traits);