20885 EDF 607 SMESH: Measure tools

interface SMESH_IDSource
   {
+    SMESH_Mesh GetMesh();
This commit is contained in:
eap 2010-10-20 07:02:01 +00:00
parent 7fa71ad88e
commit bc6dc0fb30
6 changed files with 47 additions and 6 deletions

View File

@ -248,6 +248,8 @@ module SMESH
long_array elementConnectivities;
types_array elementTypes; };
interface SMESH_Mesh;
interface SMESH_IDSource
{
/*!
@ -265,6 +267,11 @@ module SMESH
* Returns types of elements it contains
*/
array_of_ElementType GetTypes();
/*!
* Returns the mesh
*/
SMESH_Mesh GetMesh();
};
interface SMESH_Group;

View File

@ -365,10 +365,12 @@ void SMESH_MeshEditor_i::initData(bool deleteSearchers)
struct _IDSource : public POA_SMESH::SMESH_IDSource
{
SMESH::long_array _ids;
SMESH::ElementType _type;
SMESH::long_array _ids;
SMESH::ElementType _type;
SMESH::SMESH_Mesh_ptr _mesh;
SMESH::long_array* GetIDs() { return new SMESH::long_array( _ids ); }
SMESH::long_array* GetMeshInfo() { return 0; }
SMESH::SMESH_Mesh_ptr GetMesh() { return SMESH::SMESH_Mesh::_duplicate( _mesh ); }
SMESH::array_of_ElementType* GetTypes()
{
SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
@ -384,6 +386,7 @@ SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_arr
_IDSource* anIDSource = new _IDSource;
anIDSource->_ids = ids;
anIDSource->_type = type;
anIDSource->_mesh = myMesh_i->_this();
SMESH::SMESH_IDSource_var anIDSourceVar = anIDSource->_this();
return anIDSourceVar._retn();

View File

@ -3581,6 +3581,16 @@ SMESH::array_of_ElementType* SMESH_Mesh_i::GetTypes()
return types._retn();
}
//=======================================================================
//function : GetMesh
//purpose : Returns self
//=======================================================================
SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetMesh()
{
return SMESH::SMESH_Mesh::_duplicate( _this() );
}
//=============================================================================
/*!
* \brief Returns statistic of mesh elements

View File

@ -521,18 +521,20 @@ public:
// =========================
virtual SMESH::long_array* GetIDs();
/*!
* Returns statistic of mesh elements
* Result array of number enityties
* Inherited from SMESH_IDSource
*/
virtual SMESH::long_array* GetMeshInfo();
/*!
* Returns types of elements it contains
*/
virtual SMESH::array_of_ElementType* GetTypes();
/*!
* Returns self
*/
virtual SMESH::SMESH_Mesh_ptr GetMesh();
std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI

View File

@ -568,3 +568,13 @@ SMESH::array_of_ElementType* SMESH_subMesh_i::GetTypes()
}
return types._retn();
}
//=======================================================================
//function : GetMesh
//purpose : interface SMESH_IDSource
//=======================================================================
SMESH::SMESH_Mesh_ptr SMESH_subMesh_i::GetMesh()
{
return GetFather();
}

View File

@ -85,19 +85,28 @@ public:
SALOME_MED::FAMILY_ptr GetFamily()
throw (SALOME::SALOME_Exception);
virtual SMESH::long_array* GetIDs();
// =========================
// interface SMESH_IDSource
// =========================
/*!
* Returns a sequence of all element IDs
*/
virtual SMESH::long_array* GetIDs();
/*!
* Returns statistic of mesh elements
* Result array of number enityties
* Inherited from SMESH_IDSource
*/
virtual SMESH::long_array* GetMeshInfo();
/*!
* Returns types of elements it contains
*/
virtual SMESH::array_of_ElementType* GetTypes();
/*!
* Returns the mesh
*/
SMESH::SMESH_Mesh_ptr GetMesh();
SMESH_Mesh_i* _mesh_i; //NRI