-Standard_Integer SMESHDS_Mesh::AddVolume(const Standard_Integer idnode1,
- const Standard_Integer idnode2,
- const Standard_Integer idnode3,
- const Standard_Integer idnode4,
- const Standard_Integer idnode5,
- const Standard_Integer idnode6,
- const Standard_Integer idnode7,
- const Standard_Integer idnode8)
-{
- Standard_Integer ID = SMDS_Mesh::AddVolume(idnode1,idnode2,idnode3,idnode4,idnode5,idnode6,idnode7,idnode8);
- myScript->AddVolume (ID,idnode1,idnode2,idnode3,idnode4,idnode5,idnode6,idnode7,idnode8);
- return ID;
-}
-
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID)
+{
+ SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID);
+ if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8);
+ return anElem;
+}
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ int ID)
+{
+ return AddVolumeWithID(n1->GetID(),
+ n2->GetID(),
+ n3->GetID(),
+ n4->GetID(),
+ n5->GetID(),
+ n6->GetID(),
+ n7->GetID(),
+ n8->GetID(),
+ ID);
+}
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8)
+{
+ SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
+ if(anElem) myScript->AddVolume(anElem->GetID(),
+ n1->GetID(),
+ n2->GetID(),
+ n3->GetID(),
+ n4->GetID(),
+ n5->GetID(),
+ n6->GetID(),
+ n7->GetID(),
+ n8->GetID());
+ return anElem;
+}
+//=======================================================================
+//function : removeFromContainers
+//purpose :
+//=======================================================================
+
+static void removeFromContainers (map<int,SMESHDS_SubMesh*> & theSubMeshes,
+ set<SMESHDS_GroupBase*>& theGroups,
+ list<const SMDS_MeshElement *> & theElems,
+ const bool isNode)
+{
+ if ( theElems.empty() )
+ return;
+
+ // Rm from group
+ // Element can belong to several groups
+ if ( !theGroups.empty() )
+ {
+ set<SMESHDS_GroupBase*>::iterator GrIt = theGroups.begin();
+ for ( ; GrIt != theGroups.end(); GrIt++ )
+ {
+ SMESHDS_Group* group = dynamic_cast<SMESHDS_Group*>( *GrIt );
+ if ( !group || group->IsEmpty() ) continue;
+
+ list<const SMDS_MeshElement *>::iterator elIt = theElems.begin();
+ for ( ; elIt != theElems.end(); elIt++ )
+ {
+ group->SMDSGroup().Remove( *elIt );
+ if ( group->IsEmpty() ) break;
+ }
+ }
+ }