Fixed last occurences of non-free-function usage (at least as far as covered by the tests).
This commit is contained in:
@@ -745,6 +745,19 @@ VectorT<Scalar, DIM>& normalize(VectorT<Scalar, DIM>& _v) {
|
||||
return _v.normalize();
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member maximize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& maximize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
|
||||
return _v1.maximize(_v2);
|
||||
}
|
||||
|
||||
/// \relates OpenMesh::VectorT
|
||||
/// non-member minimize
|
||||
template<typename Scalar, int DIM>
|
||||
VectorT<Scalar, DIM>& minimize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
|
||||
return _v1.minimize(_v2);
|
||||
}
|
||||
|
||||
//== TYPEDEFS =================================================================
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -95,7 +95,6 @@ inline void vector_cast( const src_t & /*_src*/, dst_t & /*_dst*/, GenProg::Int2
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template <typename src_t, typename dst_t, int n>
|
||||
inline void vector_copy( const src_t &_src, dst_t &_dst, GenProg::Int2Type<n> )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user