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);
This commit is contained in:
eap 2014-01-20 17:42:20 +00:00
parent e12cb3f8c3
commit 67dba15dfd
4 changed files with 7 additions and 6 deletions

View File

@ -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.

View File

@ -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();

View File

@ -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.

View File

@ -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