IPAL15344 (SMESH_MeshEditor.idl: signature of MergeEqualElements() was changed):

restore MergeEqualElements() signature;
	add MergeElements().
This commit is contained in:
akl 2007-03-27 09:30:44 +00:00
parent cb6055fef4
commit fdd333902b
4 changed files with 45 additions and 10 deletions

View File

@ -5071,7 +5071,8 @@ class SortableElement : public set <const SMDS_MeshElement*>
//=======================================================================
//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)
@ -5128,11 +5129,11 @@ void SMESH_MeshEditor::FindEqualElements(set<const SMDS_MeshElement*> & theEleme
}
//=======================================================================
//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();
@ -5164,6 +5165,20 @@ void SMESH_MeshEditor::MergeEqualElements(TListOfListOfElementsID & theGroupsOfE
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

View File

@ -322,7 +322,10 @@ public:
// 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.

View File

@ -1932,16 +1932,16 @@ void SMESH_MeshEditor_i::FindEqualElements(SMESH::SMESH_IDSource_ptr theObj
}
//=======================================================================
//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;
@ -1960,12 +1960,28 @@ void SMESH_MeshEditor_i::MergeEqualElements(const SMESH::array_of_long_array& Gr
}
::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

View File

@ -210,7 +210,8 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
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,