+//function : Smooth
+//purpose :
+//=======================================================================
+
+CORBA::Boolean
+ SMESH_MeshEditor_i::Smooth(const SMESH::long_array & IDsOfElements,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method)
+{
+ return smooth( IDsOfElements, IDsOfFixedNodes, MaxNbOfIterations,
+ MaxAspectRatio, Method, false );
+}
+
+
+//=======================================================================
+//function : SmoothParametric
+//purpose :
+//=======================================================================
+
+CORBA::Boolean
+ SMESH_MeshEditor_i::SmoothParametric(const SMESH::long_array & IDsOfElements,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method)
+{
+ return smooth( IDsOfElements, IDsOfFixedNodes, MaxNbOfIterations,
+ MaxAspectRatio, Method, true );
+}
+
+
+//=======================================================================
+//function : SmoothObject
+//purpose :
+//=======================================================================
+
+CORBA::Boolean
+ SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method)
+{
+ return smoothObject (theObject, IDsOfFixedNodes, MaxNbOfIterations,
+ MaxAspectRatio, Method, false);
+}
+
+
+//=======================================================================
+//function : SmoothParametricObject
+//purpose :
+//=======================================================================
+
+CORBA::Boolean
+ SMESH_MeshEditor_i::SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method)
+{
+ return smoothObject (theObject, IDsOfFixedNodes, MaxNbOfIterations,
+ MaxAspectRatio, Method, true);
+}
+
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+CORBA::Boolean
+ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method,
+ bool IsParametric)
+{
+ initData();
+
+ SMESHDS_Mesh* aMesh = GetMeshDS();
+
+ TIDSortedElemSet elements;
+ arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
+
+ set<const SMDS_MeshNode*> fixedNodes;
+ for (int i = 0; i < IDsOfFixedNodes.length(); i++) {
+ CORBA::Long index = IDsOfFixedNodes[i];
+ const SMDS_MeshNode * node = aMesh->FindNode(index);
+ if ( node )
+ fixedNodes.insert( node );
+ }
+ ::SMESH_MeshEditor::SmoothMethod method = ::SMESH_MeshEditor::LAPLACIAN;
+ if ( Method != SMESH::SMESH_MeshEditor::LAPLACIAN_SMOOTH )
+ method = ::SMESH_MeshEditor::CENTROIDAL;
+
+ ::SMESH_MeshEditor anEditor( myMesh );
+ anEditor.Smooth(elements, fixedNodes, method,
+ MaxNbOfIterations, MaxAspectRatio, IsParametric );
+
+ storeResult(anEditor);
+
+ // Update Python script
+ TPythonDump() << "isDone = " << this << "."
+ << (IsParametric ? "SmoothParametric( " : "Smooth( ")
+ << IDsOfElements << ", " << IDsOfFixedNodes << ", "
+ << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << "SMESH.SMESH_MeshEditor."
+ << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
+ "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
+#ifdef _DEBUG_
+ TPythonDump() << "print 'Smooth: ', isDone";
+#endif
+
+ return true;
+}
+
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+CORBA::Boolean
+SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method,
+ bool IsParametric)
+{
+ initData();
+
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations,
+ MaxAspectRatio, Method, IsParametric);
+
+ // Clear python line(s), created by Smooth()
+ SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+ aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
+#ifdef _DEBUG_
+ aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
+#endif
+
+ // Update Python script
+ TPythonDump() << "isDone = " << this << "."
+ << (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ")
+ << theObject << ", " << IDsOfFixedNodes << ", "
+ << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << "SMESH.SMESH_MeshEditor."
+ << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
+ "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
+#ifdef _DEBUG_
+ TPythonDump() << "print 'SmoothObject: ', isDone";
+#endif
+
+ return isDone;
+}
+
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+void SMESH_MeshEditor_i::RenumberNodes()
+{
+ // Update Python script
+ TPythonDump() << this << ".RenumberNodes()";
+
+ GetMeshDS()->Renumber( true );
+}
+
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+void SMESH_MeshEditor_i::RenumberElements()
+{
+ // Update Python script
+ TPythonDump() << this << ".RenumberElements()";
+
+ GetMeshDS()->Renumber( false );
+}
+
+//=======================================================================
+ /*!
+ * \brief Return groups by their IDs
+ */
+//=======================================================================
+
+SMESH::ListOfGroups* SMESH_MeshEditor_i::getGroups(const std::list<int>* groupIDs)
+{
+ if ( !groupIDs )
+ return 0;
+ myMesh_i->CreateGroupServants();
+ return myMesh_i->GetGroups( *groupIDs );
+}
+
+//=======================================================================
+//function : rotationSweep