SMESH_Group: interface of group object. More...
import "SMESH_Group.idl";

Public Member Functions | |
| void | Clear () |
| Clears the group's contents. | |
| long | Add (in long_array elem_ids) |
| Adds elements or nodes with specified identifiers to the group. | |
| long | AddByPredicate (in Predicate thePredicate) |
| Adds elements or nodes that match specified predicate to the group. | |
| long | AddFrom (in SMESH_IDSource theSource) |
| Add all elements or nodes from the specified source to the group. | |
| long | Remove (in long_array elem_ids) |
| Removes elements or nodes with specified identifiers from the group. | |
| long | RemoveByPredicate (in Predicate thePredicate) |
| Removes elements or nodes that match specified predicate from the group. | |
| void | SetName (in string name) |
| Sets group name. | |
| string | GetName () |
| Returns group name. | |
| ElementType | GetType () |
| Returns group type (type of elements in the group) | |
| long | Size () |
| Returns the number of elements in the group. | |
| boolean | IsEmpty () |
| Returns true if the group does not contain any elements. | |
| boolean | Contains (in long elem_id) |
| returns true if the group contains an element with ID == <elem_id> | |
| long | GetID (in long elem_index) |
| Returns ID of an element at position <elem_index> | |
| long_array | GetListOfID () |
| Returns a sequence of all element IDs in the group. | |
| void | SetColor (in SALOMEDS::Color theColor) |
| Sets group color. | |
| SALOMEDS::Color | GetColor () |
| Returns group color. | |
| void | SetColorNumber (in long color) |
| Sets group color number (corresponds to the "hue" parameter of the color - must be in range [0, 360]) | |
| long | GetColorNumber () |
| Returns group color number (obsolete - use GetColor instead) (corresponds to the "hue" parameter of the color - must be in range [0, 360]) | |
| long_array | GetIDs () |
| Returns a sequence of all element IDs. | |
| long_array | GetMeshInfo () |
| Returns statistic of mesh elements Result array of number enityties. | |
| array_of_ElementType | GetTypes () |
| Returns types of elements it contains. | |
| SMESH_Mesh | GetMesh () |
| Returns the mesh. | |
SMESH_Group: interface of group object.
Definition at line 111 of file SMESH_Group.idl.
| long SMESH.SMESH_Group.Add | ( | in long_array | elem_ids | ) |
Adds elements or nodes with specified identifiers to the group.
| long SMESH.SMESH_Group.AddByPredicate | ( | in Predicate | thePredicate | ) |
Adds elements or nodes that match specified predicate to the group.
| long SMESH.SMESH_Group.AddFrom | ( | in SMESH_IDSource | theSource | ) |
Add all elements or nodes from the specified source to the group.
| void SMESH.SMESH_Group.Clear | ( | ) |
Clears the group's contents.
| boolean SMESH.SMESH_GroupBase.Contains | ( | in long | elem_id | ) | [inherited] |
returns true if the group contains an element with ID == <elem_id>
| SALOMEDS::Color SMESH.SMESH_GroupBase.GetColor | ( | ) | [inherited] |
Returns group color.
| long SMESH.SMESH_GroupBase.GetColorNumber | ( | ) | [inherited] |
Returns group color number (obsolete - use GetColor instead) (corresponds to the "hue" parameter of the color - must be in range [0, 360])
| long SMESH.SMESH_GroupBase.GetID | ( | in long | elem_index | ) | [inherited] |
Returns ID of an element at position <elem_index>
| long_array SMESH.SMESH_IDSource.GetIDs | ( | ) | [inherited] |
Returns a sequence of all element IDs.
| long_array SMESH.SMESH_GroupBase.GetListOfID | ( | ) | [inherited] |
Returns a sequence of all element IDs in the group.
| SMESH_Mesh SMESH.SMESH_IDSource.GetMesh | ( | ) | [inherited] |
Returns the mesh.
| long_array SMESH.SMESH_IDSource.GetMeshInfo | ( | ) | [inherited] |
Returns statistic of mesh elements Result array of number enityties.
| string SMESH.SMESH_GroupBase.GetName | ( | ) | [inherited] |
Returns group name.
Referenced by SMESH.SMESH_Mesh.HasDuplicatedGroupNamesMED().
| ElementType SMESH.SMESH_GroupBase.GetType | ( | ) | [inherited] |
Returns group type (type of elements in the group)
Referenced by SMESH.SMESH_Mesh.HasDuplicatedGroupNamesMED().
| array_of_ElementType SMESH.SMESH_IDSource.GetTypes | ( | ) | [inherited] |
Returns types of elements it contains.
It's empty if the SMESH_IDSource contains no IDs
| bool SMESH_subMesh::IsEmpty | ( | ) | [inherited] |
Returns true if the group does not contain any elements.
Return true if no mesh entities is bound to the submesh.
Definition at line 198 of file SMESH_subMesh.cxx.
{
if (SMESHDS_SubMesh * subMeshDS = ((SMESH_subMesh*)this)->GetSubMeshDS())
return (!subMeshDS->NbElements() && !subMeshDS->NbNodes());
return true;
}
| int SMESH_MeshEditor::Remove | ( | in long_array | elem_ids | ) |
Removes elements or nodes with specified identifiers from the group.
Definition at line 290 of file SMESH_MeshEditor.cxx.
References cast2Node, SMDS_Mesh.FindElement(), SMDS_Mesh.FindNode(), SMDS_MeshNode.GetPosition(), SMDS_MeshElement.getshapeId(), SMDS_Position.GetTypeOfPosition(), SMESH_subMesh.MESH_ENTITY_REMOVED, SMESHDS_Mesh.RemoveElement(), SMESHDS_Mesh.RemoveNode(), and SMDS_TOP_VERTEX.
{
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
SMESHDS_Mesh* aMesh = GetMeshDS();
set< SMESH_subMesh *> smmap;
int removed = 0;
list<int>::const_iterator it = theIDs.begin();
for ( ; it != theIDs.end(); it++ ) {
const SMDS_MeshElement * elem;
if ( isNodes )
elem = aMesh->FindNode( *it );
else
elem = aMesh->FindElement( *it );
if ( !elem )
continue;
// Notify VERTEX sub-meshes about modification
if ( isNodes ) {
const SMDS_MeshNode* node = cast2Node( elem );
if ( node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX )
if ( int aShapeID = node->getshapeId() )
if ( SMESH_subMesh * sm = GetMesh()->GetSubMeshContaining( aShapeID ) )
smmap.insert( sm );
}
// Find sub-meshes to notify about modification
// SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
// while ( nodeIt->more() ) {
// const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
// const SMDS_PositionPtr& aPosition = node->GetPosition();
// if ( aPosition.get() ) {
// if ( int aShapeID = aPosition->GetShapeId() ) {
// if ( SMESH_subMesh * sm = GetMesh()->GetSubMeshContaining( aShapeID ) )
// smmap.insert( sm );
// }
// }
// }
// Do remove
if ( isNodes )
aMesh->RemoveNode( static_cast< const SMDS_MeshNode* >( elem ));
else
aMesh->RemoveElement( elem );
removed++;
}
// Notify sub-meshes about modification
if ( !smmap.empty() ) {
set< SMESH_subMesh *>::iterator smIt;
for ( smIt = smmap.begin(); smIt != smmap.end(); smIt++ )
(*smIt)->ComputeStateEngine( SMESH_subMesh::MESH_ENTITY_REMOVED );
}
// // Check if the whole mesh becomes empty
// if ( SMESH_subMesh * sm = GetMesh()->GetSubMeshContaining( 1 ) )
// sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
return removed;
}
| long SMESH.SMESH_Group.RemoveByPredicate | ( | in Predicate | thePredicate | ) |
Removes elements or nodes that match specified predicate from the group.
| void SMESH.SMESH_GroupBase.SetColor | ( | in SALOMEDS::Color | theColor | ) | [inherited] |
Sets group color.
| void SMESH.SMESH_GroupBase.SetColorNumber | ( | in long | color | ) | [inherited] |
Sets group color number (corresponds to the "hue" parameter of the color - must be in range [0, 360])
| void SMESH.SMESH_GroupBase.SetName | ( | in string | name | ) | [inherited] |
Sets group name.
| long SMESH.SMESH_GroupBase.Size | ( | ) | [inherited] |
Returns the number of elements in the group.