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
SMESH::long_array*
GetMeshInfo();
+ virtual
+ SMESH::array_of_ElementType*
+ GetTypes();
+
static
void
GetElementsId( Predicate_i*,
return aMesh._retn();
}
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-SMESH::long_array* SMESH_GroupBase_i::GetIDs()
-{
- SMESH::long_array_var aResult = GetListOfID();
- return aResult._retn();
-}
-
//=======================================================================
//function : GetShape
//purpose :
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();
+}
+
// 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; }
//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
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
*/
void CheckGeomGroupModif();
- virtual SMESH::long_array* GetIDs();
-
CORBA::LongLong GetMeshPtr();
/*!
*/
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
*/
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
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();
+}
*/
virtual SMESH::long_array* GetMeshInfo();
+ /*!
+ * Returns types of elements it contains
+ */
+ virtual SMESH::array_of_ElementType* GetTypes();
+
+
SMESH_Mesh_i* _mesh_i; //NRI
protected: