Fixed last occurences of non-free-function usage (at least as far as covered by the tests).

This commit is contained in:
Christian Mattes
2018-04-12 15:16:50 +02:00
parent 57e2e07432
commit 377562d11a
7 changed files with 26 additions and 14 deletions

View File

@@ -139,9 +139,9 @@ PolyMeshT<Kernel>::calc_face_normal_impl(FaceHandle _fh, PointIs3DTag) const
// Due to traits, the value types of normals and points can be different.
// Therefore we cast them here.
n[0] += static_cast<typename Normal::value_type>(a[1] * b[2]);
n[1] += static_cast<typename Normal::value_type>(a[2] * b[0]);
n[2] += static_cast<typename Normal::value_type>(a[0] * b[1]);
n[0] += static_cast<typename vector_traits<Normal>::value_type>(a[1] * b[2]);
n[1] += static_cast<typename vector_traits<Normal>::value_type>(a[2] * b[0]);
n[2] += static_cast<typename vector_traits<Normal>::value_type>(a[0] * b[1]);
}
const typename vector_traits<Normal>::value_type length = norm(n);
@@ -228,7 +228,7 @@ PolyMeshT<Kernel>::
calc_face_centroid(FaceHandle _fh) const
{
Point _pt;
_pt.vectorize(0);
vectorize(_pt, 0);
Scalar valence = 0.0;
for (ConstFaceVertexIter cfv_it = this->cfv_iter(_fh); cfv_it.is_valid(); ++cfv_it, valence += 1.0)
{
@@ -401,7 +401,7 @@ template <class Kernel>
void PolyMeshT<Kernel>::
calc_vertex_normal_correct(VertexHandle _vh, Normal& _n) const
{
_n.vectorize(0.0);
vectorize(_n, 0.0);
ConstVertexIHalfedgeIter cvih_it = this->cvih_iter(_vh);
if (! cvih_it.is_valid() )
{//don't crash on isolated vertices

View File

@@ -359,9 +359,9 @@ public:
VertexHandle p2 = this->to_vertex_handle(he2);
// Calculate midpoint coordinates
const Point new0 = (this->point(p0) + this->point(p2)) * static_cast< typename Point::value_type >(0.5);
const Point new1 = (this->point(p0) + this->point(p1)) * static_cast< typename Point::value_type >(0.5);
const Point new2 = (this->point(p1) + this->point(p2)) * static_cast< typename Point::value_type >(0.5);
const Point new0 = (this->point(p0) + this->point(p2)) * static_cast<typename vector_traits<Point>::value_type >(0.5);
const Point new1 = (this->point(p0) + this->point(p1)) * static_cast<typename vector_traits<Point>::value_type >(0.5);
const Point new2 = (this->point(p1) + this->point(p2)) * static_cast<typename vector_traits<Point>::value_type >(0.5);
// Add vertices at midpoint coordinates
VertexHandle v0 = this->add_vertex(new0);