From 15ea014cf94c80eedf2a6c436abf37630912c4a9 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 7 Feb 2020 15:18:50 +0100 Subject: [PATCH 1/5] fixed comment on Append::Mesh --- vcg/complex/append.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcg/complex/append.h b/vcg/complex/append.h index a127509b..6d50b737 100644 --- a/vcg/complex/append.h +++ b/vcg/complex/append.h @@ -313,7 +313,7 @@ static void Mesh(MeshLeft& ml, ConstMeshRight& mr, const bool selected = false, } // phase 2. - // copy data from ml to its corresponding elements in ml and adjacencies + // copy data from mr to its corresponding elements in ml and adjacencies // vertex for(VertexIteratorRight vi=mr.vert.begin();vi!=mr.vert.end();++vi) From c220b3b4157eefc289dc8872e1f79480dd9e8a26 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 7 Feb 2020 15:19:57 +0100 Subject: [PATCH 2/5] made null-initialization of FFp more explicit --- vcg/simplex/face/component.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcg/simplex/face/component.h b/vcg/simplex/face/component.h index cca7b210..ebdc3739 100644 --- a/vcg/simplex/face/component.h +++ b/vcg/simplex/face/component.h @@ -613,9 +613,9 @@ face of the ring of faces incident on a edge. template class FFAdj: public T { public: FFAdj(){ - _ffp[0]=0; - _ffp[1]=0; - _ffp[2]=0; + _ffp[0]=nullptr; // null == not initialized + _ffp[1]=nullptr; + _ffp[2]=nullptr; } typename T::FacePointer &FFp(const int j) { assert(j>=0 && j<3); return _ffp[j]; } typename T::FacePointer cFFp(const int j) const { assert(j>=0 && j<3); return _ffp[j]; } From c6f5cfb78dfe9f2bec05bfb524cd73d5ad38af8a Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 7 Feb 2020 15:22:46 +0100 Subject: [PATCH 3/5] removed weird reference-to-pointer parameters --- vcg/simplex/face/topology.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vcg/simplex/face/topology.h b/vcg/simplex/face/topology.h index 778867e1..82d3f485 100644 --- a/vcg/simplex/face/topology.h +++ b/vcg/simplex/face/topology.h @@ -289,6 +289,7 @@ void FFDetach(FaceType & f, const int e) } +// TODO: deprecate the signature of the functions below and use references /** This function attach the face (via the edge z1) to another face (via the edge z2). It's possible to use it also in non-two manifold situation. The function cannot be applicated if the adjacencies among faces aren't define. @param z1 Index of the edge @@ -296,7 +297,7 @@ void FFDetach(FaceType & f, const int e) @param z2 The edge of the face f2 */ template -void FFAttach(FaceType * &f, int z1, FaceType *&f2, int z2) +void FFAttach(FaceType * f, int z1, FaceType * f2, int z2) { //typedef FEdgePosB< FACE_TYPE > ETYPE; vcg::face::Pos< FaceType > EPB(f2,z2); @@ -336,7 +337,7 @@ void FFAttach(FaceType * &f, int z1, FaceType *&f2, int z2) @param z2 The edge of the face f2 */ template -void FFAttachManifold(FaceType * &f1, int z1, FaceType *&f2, int z2) +void FFAttachManifold(FaceType * f1, int z1, FaceType * f2, int z2) { assert(IsBorder(*f1,z1) || f1->FFp(z1)==0); assert(IsBorder(*f2,z2) || f2->FFp(z2)==0); @@ -350,7 +351,7 @@ void FFAttachManifold(FaceType * &f1, int z1, FaceType *&f2, int z2) // This one should be called only on uniitialized faces. template -void FFSetBorder(FaceType * &f1, int z1) +void FFSetBorder(FaceType * f1, int z1) { assert(f1->FFp(z1)==0 || IsBorder(*f1,z1)); From 24f02fdaa941fc14e0b3ee531ea40643646ff671 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 7 Feb 2020 15:23:27 +0100 Subject: [PATCH 4/5] null-initialization of Box3 is now explicit --- vcg/space/box3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcg/space/box3.h b/vcg/space/box3.h index 69906ce5..3bd1928e 100644 --- a/vcg/space/box3.h +++ b/vcg/space/box3.h @@ -50,7 +50,7 @@ public: /// max coordinate point Point3 max; /// The bounding box constructor - inline Box3() { min.X()= 1;max.X()= -1;min.Y()= 1;max.Y()= -1;min.Z()= 1;max.Z()= -1;} + inline Box3() { this->SetNull(); } /// Copy constructor inline Box3( const Box3 & b ) { min=b.min; max=b.max; } /// Min Max constructor From 4f5a0b72578050c1967903e7c74765288e6686f7 Mon Sep 17 00:00:00 2001 From: Luigi Malomo Date: Fri, 7 Feb 2020 15:25:11 +0100 Subject: [PATCH 5/5] added ToEigenVector function to Point3 with templated return type --- vcg/space/deprecated_point3.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcg/space/deprecated_point3.h b/vcg/space/deprecated_point3.h index 0ddb3f39..1468e9bb 100644 --- a/vcg/space/deprecated_point3.h +++ b/vcg/space/deprecated_point3.h @@ -186,6 +186,16 @@ public: b[1]=_v[1] ; b[2]=_v[2] ; } + template + inline EigenVector ToEigenVector(void) const + { + assert(EigenVector::RowsAtCompileTime == 3 || EigenVector::RowsAtCompileTime == 4); + EigenVector b = EigenVector::Zero(); + b[0]=_v[0]; + b[1]=_v[1]; + b[2]=_v[2]; + return b; + } template static inline Point3 Construct( const Point3 & b ) {