Salome HOME
22359: Body Fitting algorithm: grid orientation
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.cxx
index f6beb92d5de1d36f109f00675350b6a200a2cd4b..139262a6f38b4f5c2b2938f5bfc29b00ab2535d4 100644 (file)
@@ -3467,6 +3467,25 @@ SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id )
   return ( SMESH::EntityType ) e->GetEntityType();
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id )
+  throw (SALOME::SALOME_Exception)
+{
+  if ( _preMeshInfo )
+    _preMeshInfo->FullLoadFromFile();
+
+  const SMDS_MeshElement* e = _impl->GetMeshDS()->FindElement(id);
+  if ( !e )
+    THROW_SALOME_CORBA_EXCEPTION( "invalid element id", SALOME::BAD_PARAM );
+
+  return ( SMESH::GeometryType ) e->GetGeomType();
+}
+
 //=============================================================================
 /*!
  * Returns ID of elements for given submesh
@@ -4029,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();
@@ -4039,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();