Use DontAlign property for garland heckbert matrices

See discussion in: https://github.com/CGAL/cgal/pull/4279

Initial warning: https://cgal.geometryfactory.com/CGAL/testsuite/results-5.1-Ic-11.shtml#Surface_mesh_simplification_Examples
This commit is contained in:
Mael Rouxel-Labbé 2019-11-29 09:29:48 +01:00
parent c9836ce5d7
commit 55bb46a383
2 changed files with 11 additions and 3 deletions

View File

@ -159,7 +159,8 @@ public:
typedef GeomTraits Geom_traits; typedef GeomTraits Geom_traits;
typedef typename Geom_traits::FT FT; typedef typename Geom_traits::FT FT;
typedef typename Eigen::Matrix<FT, 4, 4> Cost_matrix; typedef typename internal::GarlandHeckbert_matrix_type<TriangleMesh,
GeomTraits>::type Cost_matrix;
typedef CGAL::dynamic_vertex_property_t<Cost_matrix> Cost_property; typedef CGAL::dynamic_vertex_property_t<Cost_matrix> Cost_property;
typedef typename boost::property_map<TriangleMesh, Cost_property>::type Vertex_cost_map; typedef typename boost::property_map<TriangleMesh, Cost_property>::type Vertex_cost_map;

View File

@ -24,6 +24,13 @@ namespace CGAL {
namespace Surface_mesh_simplification { namespace Surface_mesh_simplification {
namespace internal { namespace internal {
template<class TM_, typename GT_>
struct GarlandHeckbert_matrix_type
{
typedef typename GT_::FT FT;
typedef Eigen::Matrix<FT, 4, 4, Eigen::DontAlign> type;
};
template<class TM_, class VPM_, typename GT_> template<class TM_, class VPM_, typename GT_>
struct GarlandHeckbert_core struct GarlandHeckbert_core
{ {
@ -43,7 +50,7 @@ struct GarlandHeckbert_core
typedef typename Geom_traits::Plane_3 Plane_3; typedef typename Geom_traits::Plane_3 Plane_3;
typedef typename Geom_traits::Vector_3 Vector_3; typedef typename Geom_traits::Vector_3 Vector_3;
typedef Eigen::Matrix<FT, 4, 4> Matrix4x4; typedef typename GarlandHeckbert_matrix_type<TM_, GT_>::type Matrix4x4;
typedef Eigen::Matrix<FT, 1, 4> Row4; typedef Eigen::Matrix<FT, 1, 4> Row4;
typedef Eigen::Matrix<FT, 4, 1> Col4; typedef Eigen::Matrix<FT, 4, 1> Col4;
@ -170,7 +177,7 @@ struct GarlandHeckbert_core
const Geom_traits& gt, const Geom_traits& gt,
const FT discontinuity_multiplier = FT(100)) const FT discontinuity_multiplier = FT(100))
{ {
Matrix4x4 nq = Eigen::Matrix<FT, 4, 4>::Zero(); Matrix4x4 nq = Matrix4x4::Zero();
for(vertex_descriptor v : vertices(tmesh)) for(vertex_descriptor v : vertices(tmesh))
put(vcm, v, nq); // @todo is that necessary ? put(vcm, v, nq); // @todo is that necessary ?