-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_SmoothingDlg.cxx
// Author : Michael ZORIN, Open CASCADE S.A.S.
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
+ LineEditElements->setMaxLength(-1);
myElemFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
connect(myElemFilterBtn, SIGNAL(clicked()), this, SLOT(setElemFilters()));
LineEditNodes = new QLineEdit(GroupArguments);
LineEditNodes->setValidator(myIdValidator);
+ LineEditNodes->setMaxLength(-1);
QPushButton* filterNodeBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
connect(filterNodeBtn, SIGNAL(clicked()), this, SLOT(setNodeFilters()));
SpinBox_IterationLimit->setRange(1, 999999);
SpinBox_IterationLimit->setValue(20);
- SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, 3);
+ SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, "parametric_precision");
SpinBox_AspectRatio->SetValue(1.1);
GroupArguments->show();
if ( CheckBoxParametric->isChecked() ) {
if(CheckBoxMesh->isChecked())
- aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
- else
- aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
+ aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
+ else
+ aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
}
else {
if(CheckBoxMesh->isChecked())
- aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
- else
- aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
+ aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
+ else
+ aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
}
- myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
} catch (...) {
}
if (aResult) {
- Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
+ if ( myActor ) {
+ Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
+ SALOME_ListIO aList;
+ aList.Append(anIO);
+ mySelectionMgr->setSelectedObjects(aList, false);
+ }
- SALOME_ListIO aList;
- aList.Append(anIO);
- mySelectionMgr->setSelectedObjects(aList, false);
SMESH::UpdateView();
+ SMESHGUI::Modified();
Init();
mySelectedObject = SMESH::SMESH_IDSource::_nil();
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( anIO, true, true );
+ aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
} else if (send == LineEditNodes) {
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
- if (n)
- newIndices.Add(n->GetID());
- myNbOkNodes++;
+ const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
+ if (n)
+ newIndices.Add(n->GetID());
+ myNbOkNodes++;
}
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ aViewWindow->highlight( myActor->getIO(), true, true );
}
}
return;
myActor = SMESH::FindActorByObject(myMesh);
- if (!myActor)
+ if (!myActor && !CheckBoxMesh->isChecked())
return;
int aNbUnits = 0;
// OK
if (myEditCurrentArgument == LineEditElements)
- myNbOkElements = aNbUnits;
+ myNbOkElements = true;
else if (myEditCurrentArgument == LineEditNodes)
- myNbOkNodes = aNbUnits;
+ myNbOkNodes = true;
if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
buttonOk->setEnabled(true);
myEditCurrentArgument = LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- // mySelectionMgr->setSelectionModes(ActorSelection);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+ // mySelectionMgr->setSelectionModes(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
} else if (send == SelectNodesButton) {
- LineEditNodes->clear();
+ LineEditNodes->clear();
myEditCurrentArgument = LineEditNodes;
SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
- aViewWindow->SetSelectionMode(NodeSelection);
- }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
+ aViewWindow->SetSelectionMode(NodeSelection);
+ }
}
myEditCurrentArgument->setFocus();
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )