From 67dba15dfdd0b7f7a2671a70ad831a080a9c0487 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 20 Jan 2014 17:42:20 +0000 Subject: [PATCH] 22244: [CEA] Method to compute the normal to a mesh face - double_array GetFaceNormal(in long faceId); + double_array GetFaceNormal(in long faceId, in boolean normalized); --- idl/SMESH_Mesh.idl | 2 +- src/SMESH_I/SMESH_Mesh_i.cxx | 5 +++-- src/SMESH_I/SMESH_Mesh_i.hxx | 2 +- src/SMESH_SWIG/smeshBuilder.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 92a3cd3b8..abce2bb25 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -931,7 +931,7 @@ module SMESH /*! * Returns three components of normal of given mesh face (or an empty array in KO case) */ - double_array GetFaceNormal(in long faceId); + double_array GetFaceNormal(in long faceId, in boolean normalized); /*! * Returns an element based on all given nodes. diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index b47ae9b19..139262a6f 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -4048,7 +4048,8 @@ SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId, //purpose : Returns three components of normal of given mesh face. //======================================================================= -SMESH::double_array* SMESH_Mesh_i::GetFaceNormal(CORBA::Long elemId) +SMESH::double_array* SMESH_Mesh_i::GetFaceNormal(CORBA::Long elemId, + CORBA::Boolean normalized) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4058,7 +4059,7 @@ SMESH::double_array* SMESH_Mesh_i::GetFaceNormal(CORBA::Long elemId) if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() ) { gp_XYZ normal; - if ( SMESH_MeshAlgos::FaceNormal( mesh->FindElement(elemId), normal, /*normalized=*/true )) + if ( SMESH_MeshAlgos::FaceNormal( mesh->FindElement(elemId), normal, normalized )) { aResult->length( 3 ); aResult[ 0 ] = normal.X(); diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 7b1fdc473..f83347539 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -538,7 +538,7 @@ public: /*! * Returns three components of normal of given mesh face (or an empty array in KO case) */ - SMESH::double_array* GetFaceNormal(CORBA::Long faceId); + SMESH::double_array* GetFaceNormal(CORBA::Long faceId, CORBA::Boolean normalized); /*! * Returns an element based on all given nodes. diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 4e7c418e4..41791ff77 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -2431,8 +2431,8 @@ class Mesh: ## Returns three components of normal of given mesh face # (or an empty array in KO case) # @ingroup l1_meshinfo - def GetFaceNormal(self, faceId): - return self.mesh.GetFaceNormal(faceId) + def GetFaceNormal(self, faceId, normalized=False): + return self.mesh.GetFaceNormal(faceId,normalized) ## Returns an element based on all given nodes. # @ingroup l1_meshinfo