From 18d44c13e734df2ba8ea0d28b8cb02823d9fcaba Mon Sep 17 00:00:00 2001 From: Hans-Christian Ebke Date: Sat, 11 Jan 2014 22:52:16 +0000 Subject: [PATCH] Added more convenient versions of calc_edge_vector to PolyMeshT. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@986 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Core/Mesh/PolyMeshT.hh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.hh b/src/OpenMesh/Core/Mesh/PolyMeshT.hh index 06ae35b0..0f6d1f02 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT.hh +++ b/src/OpenMesh/Core/Mesh/PolyMeshT.hh @@ -316,14 +316,30 @@ public: /** Calculates the edge vector as the vector defined by the halfedge with id #0 (see below) */ void calc_edge_vector(EdgeHandle _eh, Normal& _edge_vec) const - { calc_edge_vector( this->halfedge_handle(_eh,0), _edge_vec); } + { + _edge_vec = calc_edge_vector(_eh); + } + + /** Calculates the edge vector as the vector defined by + the halfedge with id #0 (see below) */ + Normal calc_edge_vector(EdgeHandle _eh) const + { + return calc_edge_vector(this->halfedge_handle(_eh,0)); + } /** Calculates the edge vector as the difference of the the points defined by to_vertex_handle() and from_vertex_handle() */ void calc_edge_vector(HalfedgeHandle _heh, Normal& _edge_vec) const { - _edge_vec = this->point(this->to_vertex_handle(_heh)); - _edge_vec -= this->point(this->from_vertex_handle(_heh)); + _edge_vec = calc_edge_vector(_heh); + } + + /** Calculates the edge vector as the difference of the + the points defined by to_vertex_handle() and from_vertex_handle() */ + Normal calc_edge_vector(HalfedgeHandle _heh) const + { + return this->point(this->to_vertex_handle(_heh)) - + this->point(this->from_vertex_handle(_heh)); } // Calculates the length of the edge _eh