From ffa52542822b49458a812f75afed40e95fcb4b51 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 20 Jan 2014 10:32:14 +0000 Subject: [PATCH] 22316: EDF 2719 SMESH: Split hexas into prisms + GeometryType GetElementShape( in long id ) + raises (SALOME::SALOME_Exception); --- idl/SMESH_Mesh.idl | 3 +++ src/SMESH_I/SMESH_Mesh_i.cxx | 19 +++++++++++++++++++ src/SMESH_I/SMESH_Mesh_i.hxx | 3 +++ 3 files changed, 25 insertions(+) diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index ff60e68ad..92a3cd3b8 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -810,6 +810,9 @@ module SMESH EntityType GetElementGeomType( in long id ) raises (SALOME::SALOME_Exception); + GeometryType GetElementShape( in long id ) + raises (SALOME::SALOME_Exception); + long_array GetSubMeshElementsId(in long ShapeID) raises (SALOME::SALOME_Exception); diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index f6beb92d5..b47ae9b19 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -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 diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 2615bef48..7b1fdc473 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -368,6 +368,9 @@ public: SMESH::EntityType GetElementGeomType( CORBA::Long id ) throw (SALOME::SALOME_Exception); + SMESH::GeometryType GetElementShape( CORBA::Long id ) + throw (SALOME::SALOME_Exception); + /*! * Returns ID of elements for given submesh */ -- 2.30.2