//=======================================================================
//function : FindEqualElements
-//purpose :
+//purpose : Return list of group of elements built on the same nodes.
+// Search among theElements or in the whole mesh if theElements is empty
//=======================================================================
void SMESH_MeshEditor::FindEqualElements(set<const SMDS_MeshElement*> & theElements,
TListOfListOfElementsID & theGroupsOfElementsID)
}
//=======================================================================
-//function : MergeEqualElements
-//purpose : Remove all but one of elements built on the same nodes.
+//function : MergeElements
+//purpose : In each given group, substitute all elements by the first one.
//=======================================================================
-void SMESH_MeshEditor::MergeEqualElements(TListOfListOfElementsID & theGroupsOfElementsID)
+void SMESH_MeshEditor::MergeElements(TListOfListOfElementsID & theGroupsOfElementsID)
{
myLastCreatedElems.Clear();
myLastCreatedNodes.Clear();
Remove( rmElemIds, false );
}
+//=======================================================================
+//function : MergeEqualElements
+//purpose : Remove all but one of elements built on the same nodes.
+//=======================================================================
+
+void SMESH_MeshEditor::MergeEqualElements()
+{
+ set<const SMDS_MeshElement*> aMeshElements; /* empty input -
+ to merge equal elements in the whole mesh */
+ TListOfListOfElementsID aGroupsOfElementsID;
+ FindEqualElements(aMeshElements, aGroupsOfElementsID);
+ MergeElements(aGroupsOfElementsID);
+}
+
//=======================================================================
//function : FindFaceInSet
//purpose : Return a face having linked nodes n1 and n2 and which is
// Return list of group of elements build on the same nodes.
// Search among theElements or in the whole mesh if theElements is empty.
- void MergeEqualElements(TListOfListOfElementsID & theGroupsOfElementsID);
+ void MergeElements(TListOfListOfElementsID & theGroupsOfElementsID);
+ // In each group remove all but first of elements.
+
+ void MergeEqualElements();
// Remove all but one of elements built on the same nodes.
// Return nb of successfully merged groups.
}
//=======================================================================
-//function : MergeEqualElements
+//function : MergeElements
//purpose :
//=======================================================================
-void SMESH_MeshEditor_i::MergeEqualElements(const SMESH::array_of_long_array& GroupsOfElementsID)
+void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID)
{
initData();
TPythonDump aTPythonDump;
- aTPythonDump << this << ".MergeEqualElements( [";
+ aTPythonDump << this << ".MergeElements( [";
::SMESH_MeshEditor::TListOfListOfElementsID aListOfListOfElementsID;
}
::SMESH_MeshEditor anEditor( myMesh );
- anEditor.MergeEqualElements(aListOfListOfElementsID);
+ anEditor.MergeElements(aListOfListOfElementsID);
// Update Python script
aTPythonDump << "] )";
}
+//=======================================================================
+//function : MergeEqualElements
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::MergeEqualElements()
+{
+ initData();
+
+ ::SMESH_MeshEditor anEditor( myMesh );
+ anEditor.MergeEqualElements();
+
+ // Update Python script
+ TPythonDump() << this << ".MergeEqualElements()";
+}
+
//================================================================================
/*!
* \brief If the given ID is a valid node ID (nodeID > 0), just move this node, else
void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
void FindEqualElements(SMESH::SMESH_IDSource_ptr theObject,
SMESH::array_of_long_array_out GroupsOfElementsID);
- void MergeEqualElements(const SMESH::array_of_long_array& GroupsOfElementsID);
+ void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
+ void MergeEqualElements();
CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
CORBA::Double y,
CORBA::Double z,