//=======================================================================
//function : ChangeElementNodes
-//purpose :
+//purpose : Changed nodes of an element provided that nb of nodes does not change
//=======================================================================
bool SMESHDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
return anElem;
}
-SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID
- (const std::vector<const SMDS_MeshNode*>& nodes,
- const int ID)
+SMDS_MeshFace*
+SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
+ const int ID)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID);
if (anElem) {
return anElem;
}
-SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFace
- (const std::vector<const SMDS_MeshNode*>& nodes)
+SMDS_MeshFace*
+SMESHDS_Mesh::AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFace(nodes);
if (anElem) {
return anElem;
}
+
+//=======================================================================
+//function : AddQuadPolygonalFace
+//purpose :
+//=======================================================================
+SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int>& nodes_ids,
+ const int ID)
+{
+ SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes_ids, ID);
+ if (anElem) {
+ myScript->AddQuadPolygonalFace(ID, nodes_ids);
+ }
+ return anElem;
+}
+
+SMDS_MeshFace*
+SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
+ const int ID)
+{
+ SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes, ID);
+ if (anElem) {
+ int i, len = nodes.size();
+ std::vector<int> nodes_ids (len);
+ for (i = 0; i < len; i++) {
+ nodes_ids[i] = nodes[i]->GetID();
+ }
+ myScript->AddQuadPolygonalFace(ID, nodes_ids);
+ }
+ return anElem;
+}
+
+SMDS_MeshFace*
+SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes)
+{
+ SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFace(nodes);
+ if (anElem) {
+ int i, len = nodes.size();
+ std::vector<int> nodes_ids (len);
+ for (i = 0; i < len; i++) {
+ nodes_ids[i] = nodes[i]->GetID();
+ }
+ myScript->AddQuadPolygonalFace(anElem->GetID(), nodes_ids);
+ }
+ return anElem;
+}
+
+
//=======================================================================
//function : AddPolyhedralVolume
//purpose :
{
if ( n->NbInverseElements() == 0 && !(hasConstructionEdges() || hasConstructionFaces()))
{
- SMESHDS_SubMesh* subMesh = MeshElements( n->getshapeId() );
- SMESHDS_SubMeshIteratorPtr subIt;
- if ( !subMesh )
- subIt = SubMeshes();
- for ( ; !subMesh && subIt->more(); ) {
- subMesh = const_cast< SMESHDS_SubMesh* >( subIt->next() );
- if ( subMesh->IsComplexSubmesh() || !subMesh->Contains( n ))
- subMesh = 0;
- }
- RemoveFreeNode( n, subMesh, true);
+ RemoveFreeNode( n, 0, true );
return;
}
if ( elt->getshapeId() > 0 )
subMesh = MeshElements( elt->getshapeId() );
- RemoveFreeElement( elt, subMesh, true);
+ RemoveFreeElement( elt, subMesh, true );
return;
}
list<const SMDS_MeshElement *> removedElems;
list<const SMDS_MeshElement *> removedNodes;
- SMDS_Mesh::RemoveElement(elt, removedElems, removedNodes, false);
+ SMDS_Mesh::RemoveElement(elt, removedElems, removedNodes, false );
removeFromContainers( this, myGroups, removedElems, false );
}
myScript->RemoveElement(elt->GetID());
// Rm from group
- // Node can belong to several groups
+ // Element can belong to several groups
if ( fromGroups && !myGroups.empty() ) {
set<SMESHDS_GroupBase*>::iterator GrIt = myGroups.begin();
for (; GrIt != myGroups.end(); GrIt++) {
// Rm from sub-mesh
// Element should belong to only one sub-mesh
- if( subMesh )
- subMesh->RemoveElement(elt, /*deleted=*/false);
+ if ( !subMesh && elt->getshapeId() > 0 )
+ subMesh = MeshElements( elt->getshapeId() );
+ if ( subMesh )
+ subMesh->RemoveElement( elt, /*deleted=*/false );
- SMDS_Mesh::RemoveFreeElement(elt);
+ SMDS_Mesh::RemoveFreeElement( elt );
}
//================================================================================