0020746: EDF 1274 SMESH : MergeAllNodesButNodesFromGroup feature

+  /*!
+   * Returns types of elements it contains
+   */
+  virtual SMESH::array_of_ElementType* GetTypes();
This commit is contained in:
eap 2010-09-15 11:51:57 +00:00
parent d1d0bb638c
commit e38b448770
8 changed files with 124 additions and 21 deletions

View File

@ -2206,6 +2206,21 @@ SMESH::long_array* ::Filter_i::GetMeshInfo()
return aRes._retn();
}
//================================================================================
/*!
* \brief Return GetElementType() within an array
* Implement SMESH_IDSource interface
*/
//================================================================================
SMESH::array_of_ElementType* Filter_i::GetTypes()
{
SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
types->length( 1 );
types[0] = GetElementType();
return types._retn();
}
//=======================================================================
// name : getCriteria
// Purpose : Retrieve criterions from predicate

View File

@ -790,6 +790,10 @@ namespace SMESH
SMESH::long_array*
GetMeshInfo();
virtual
SMESH::array_of_ElementType*
GetTypes();
static
void
GetElementsId( Predicate_i*,

View File

@ -426,17 +426,6 @@ SMESH::SMESH_Mesh_ptr SMESH_GroupBase_i::GetMesh()
return aMesh._retn();
}
//=============================================================================
/*!
*
*/
//=============================================================================
SMESH::long_array* SMESH_GroupBase_i::GetIDs()
{
SMESH::long_array_var aResult = GetListOfID();
return aResult._retn();
}
//=======================================================================
//function : GetShape
//purpose :
@ -543,3 +532,28 @@ SMESH::long_array* SMESH_GroupBase_i::GetMeshInfo()
SMESH_Mesh_i::CollectMeshInfo( aGrpDS->GetElements(), aRes);
return aRes._retn();
}
//=======================================================================
//function : GetIDs
//purpose : Returns ids of members
//=======================================================================
SMESH::long_array* SMESH_GroupBase_i::GetIDs()
{
SMESH::long_array_var aResult = GetListOfID();
return aResult._retn();
}
//=======================================================================
//function : GetTypes
//purpose : Returns types of elements it contains
//=======================================================================
SMESH::array_of_ElementType* SMESH_GroupBase_i::GetTypes()
{
SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
types->length( 1 );
types[0] = GetType();
return types._retn();
}

View File

@ -75,6 +75,12 @@ class SMESH_I_EXPORT SMESH_GroupBase_i:
// Inherited from SMESH_IDSource interface
virtual SMESH::long_array* GetIDs();
/*!
* Returns types of elements it contains
* Inherited from SMESH_IDSource interface
*/
virtual SMESH::array_of_ElementType* GetTypes();
// Internal C++ interface
int GetLocalID() const { return myLocalID; }
SMESH_Mesh_i* GetMeshServant() const { return myMeshServant; }

View File

@ -655,6 +655,8 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap
//Get or Create the SMESH_subMesh object implementation
int subMeshId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape );
if ( !subMeshId )
THROW_SALOME_CORBA_EXCEPTION("not sub-shape of the main shape", SALOME::BAD_PARAM);
subMesh = getSubMesh( subMeshId );
// create a new subMesh object servant if there is none for the shape
@ -3548,6 +3550,30 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
return aResult._retn();
}
//=======================================================================
//function : GetTypes
//purpose : Returns types of elements it contains
//=======================================================================
SMESH::array_of_ElementType* SMESH_Mesh_i::GetTypes()
{
SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
types->length( 4 );
int nbTypes = 0;
if (_impl->NbEdges())
types[nbTypes++] = SMESH::EDGE;
if (_impl->NbFaces())
types[nbTypes++] = SMESH::FACE;
if (_impl->NbVolumes())
types[nbTypes++] = SMESH::VOLUME;
if (_impl->Nb0DElements())
types[nbTypes++] = SMESH::ELEM0D;
types->length( nbTypes );
return types._retn();
}
//=============================================================================
/*!
* \brief Returns statistic of mesh elements

View File

@ -373,8 +373,6 @@ public:
*/
void CheckGeomGroupModif();
virtual SMESH::long_array* GetIDs();
CORBA::LongLong GetMeshPtr();
/*!
@ -502,14 +500,6 @@ public:
*/
SMESH::string_array* GetLastParameters();
/*!
* Returns statistic of mesh elements
* Result array of number enityties
* Inherited from SMESH_IDSource
*/
virtual SMESH::long_array* GetMeshInfo();
/*!
* Collect statistic of mesh elements given by iterator
*/
@ -526,6 +516,25 @@ public:
virtual ::CORBA::Boolean SetMeshOrder(const SMESH::submesh_array_array& theSubMeshArray);
// =========================
// SMESH_IDSource interface
// =========================
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();
std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI

View File

@ -545,3 +545,26 @@ SMESH::long_array* SMESH_subMesh_i::GetMeshInfo()
return aRes._retn();
}
//=======================================================================
//function : GetTypes
//purpose : Returns types of elements it contains
//=======================================================================
SMESH::array_of_ElementType* SMESH_subMesh_i::GetTypes()
{
SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
types->length( 1 );
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
switch ( ::SMESH_Gen::GetShapeDim( aSubMesh->GetSubShape() ))
{
case 0: types[0] = SMESH::ELEM0D; break;
case 1: types[0] = SMESH::EDGE; break;
case 2: types[0] = SMESH::FACE; break;
case 3: types[0] = SMESH::VOLUME; break;
default:
types->length(0);
}
return types._retn();
}

View File

@ -94,6 +94,12 @@ public:
*/
virtual SMESH::long_array* GetMeshInfo();
/*!
* Returns types of elements it contains
*/
virtual SMESH::array_of_ElementType* GetTypes();
SMESH_Mesh_i* _mesh_i; //NRI
protected: