PAL8581. Add SmoothParametric[Object]() instead of IsParametric parameter addition

This commit is contained in:
eap 2005-05-12 08:03:34 +00:00
parent 32c49c2db1
commit bc108308ca
3 changed files with 110 additions and 14 deletions

View File

@ -541,15 +541,25 @@ module SMESH
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method,
in boolean IsParametric);
in Smooth_Method Method);
boolean SmoothObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method,
in boolean IsParametric);
in Smooth_Method Method);
boolean SmoothParametric(in long_array IDsOfElements,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
boolean SmoothParametricObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes,
in long MaxNbOfIterations,
in double MaxAspectRatio,
in Smooth_Method Method);
void RenumberNodes();

View File

@ -614,6 +614,70 @@ CORBA::Boolean
return isDone;
}
//=======================================================================
//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);
}
//=============================================================================
/*!
*
@ -621,12 +685,12 @@ CORBA::Boolean
//=============================================================================
CORBA::Boolean
SMESH_MeshEditor_i::Smooth(const SMESH::long_array & IDsOfElements,
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,
CORBA::Boolean IsParametric)
bool IsParametric)
{
SMESHDS_Mesh* aMesh = GetMeshDS();
@ -656,7 +720,8 @@ CORBA::Boolean
MaxNbOfIterations, MaxAspectRatio, IsParametric );
// Update Python script
TCollection_AsciiString str ("isDone = mesh_editor.Smooth(");
TCollection_AsciiString str ("isDone = mesh_editor.");
str += (char*) (IsParametric ? "SmoothParametric( " : "Smooth( ");
SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", ";
SMESH_Gen_i::AddArray( str, IDsOfFixedNodes ) += ", ";
str += (Standard_Integer) MaxNbOfIterations;
@ -683,15 +748,15 @@ CORBA::Boolean
//=============================================================================
CORBA::Boolean
SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
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,
CORBA::Boolean IsParametric)
bool IsParametric)
{
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = Smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations,
CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, IsParametric);
// Clear python line(s), created by Smooth()
@ -702,7 +767,8 @@ CORBA::Boolean
#endif
// Update Python script
TCollection_AsciiString str ("isDone = mesh_editor.SmoothObject(");
TCollection_AsciiString str ("isDone = mesh_editor.");
str += (char*) (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ");
SMESH_Gen_i::AddObject( str, theObject ) += ", ";
SMESH_Gen_i::AddArray( str, IDsOfFixedNodes ) += ", ";
str += (Standard_Integer) MaxNbOfIterations;

View File

@ -81,14 +81,34 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
const SMESH::long_array & IDsOfFixedNodes,
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
CORBA::Boolean IsParametric);
SMESH::SMESH_MeshEditor::Smooth_Method Method);
CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::long_array & IDsOfFixedNodes,
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method);
CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
const SMESH::long_array & IDsOfFixedNodes,
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method);
CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::long_array & IDsOfFixedNodes,
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method);
CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
const SMESH::long_array & IDsOfFixedNodes,
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
CORBA::Boolean IsParametric);
bool IsParametric);
CORBA::Boolean 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);
void RenumberNodes();
void RenumberElements();