mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
- GroupPoints = new DlgRef_1Sel5Spin( centralWidget() );
+ GroupPoints = new DlgRef_1Sel5Spin1Check( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) );
GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) );
GroupPoints->TextLabel4->setText( tr( "GEOM_FILLING_NB_ITER" ) );
GroupPoints->TextLabel5->setText( tr( "GEOM_FILLING_MAX_DEG" ) );
GroupPoints->TextLabel6->setText( tr( "GEOM_FILLING_TOL_3D" ) );
+ GroupPoints->CheckBox1->setText( tr( "GEOM_FILLING_APPROX" ) );
GroupPoints->PushButton1->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
layout->addWidget( GroupPoints );
/***************************************************************/
- setHelpFileName( "filling.htm" );
+ setHelpFileName( "create_filling_page.html" );
/* Initialisations */
Init();
myMaxDeg = 5;
myTol3D = 0.0001;
myTol2D = 0.0001;
- myNbIter = 5;
+ myNbIter = 0;
+ myIsApprox = false;
myOkCompound = false;
globalSelection( GEOM_COMPOUND );
/* min, max, step and decimals for spin boxes & initial values */
initSpinBox( GroupPoints->SpinBox1, 2.0, MAX_NUMBER, SpecificStep1, 3 );
initSpinBox( GroupPoints->SpinBox2, 0.00001, 10000.0, SpecificStep2, 5 );
- initSpinBox( GroupPoints->SpinBox3, 1.0, MAX_NUMBER, SpecificStep1, 3 );
+ initSpinBox( GroupPoints->SpinBox3, 0.0, MAX_NUMBER, SpecificStep1, 3 );
initSpinBox( GroupPoints->SpinBox4, 1.0, MAX_NUMBER, SpecificStep1, 3 );
initSpinBox( GroupPoints->SpinBox5, 0.00001, 10000.0, SpecificStep2, 5 );
connect( GroupPoints->SpinBox4, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupPoints->SpinBox5, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
- // VSR: TODO ->>
- connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox1, SLOT( SetStep( double ) ) );
- connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox2, SLOT( SetStep( double ) ) );
- connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox3, SLOT( SetStep( double ) ) );
- connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox4, SLOT( SetStep( double ) ) );
- connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox5, SLOT( SetStep( double ) ) );
- // <<-
+ connect( GroupPoints->CheckBox1, SIGNAL( stateChanged( int ) ), this, SLOT( ApproxChanged() ) );
+
+ connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_FILLING" ) );
}
+//=================================================================================
+// function : SetDoubleSpinBoxStep()
+// purpose : Double spin box management
+//=================================================================================
+void GenerationGUI_FillingDlg::SetDoubleSpinBoxStep( double step )
+{
+ GroupPoints->SpinBox1->setSingleStep(step);
+ GroupPoints->SpinBox2->setSingleStep(step);
+ GroupPoints->SpinBox3->setSingleStep(step);
+ GroupPoints->SpinBox4->setSingleStep(step);
+ GroupPoints->SpinBox5->setSingleStep(step);
+}
+
//=================================================================================
// function : ClickOnOk()
void GenerationGUI_FillingDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText( "" );
+ myEditCurrentArgument->setText("");
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myOkCompound = false;
return;
}
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
- if ( !testResult )
+ if (!testResult)
return;
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
TopoDS_Shape S;
myOkCompound = false;
- if ( GEOMBase::GetShape(aSelectedObject, S) &&
- S.ShapeType() == TopAbs_COMPOUND ) {
- // myCompound should be a compound of edges
- for ( TopoDS_Iterator it( S ); it.More(); it.Next() )
- if ( it.Value().ShapeType() != TopAbs_EDGE )
- return;
- myCompound = aSelectedObject;
- myOkCompound = true;
- }
+ if (GEOMBase::GetShape(aSelectedObject, S) && S.ShapeType() == TopAbs_COMPOUND) {
+ // myCompound should be a compound of edges
+ for (TopoDS_Iterator it (S); it.More(); it.Next())
+ if (it.Value().ShapeType() != TopAbs_EDGE)
+ return;
+ myCompound = aSelectedObject;
+ myOkCompound = true;
+ }
}
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
displayPreview();
}
+//=================================================================================
+// function : ApproxChanged()
+// purpose :
+//=================================================================================
+void GenerationGUI_FillingDlg::ApproxChanged()
+{
+ myIsApprox = GroupPoints->CheckBox1->isChecked();
+ displayPreview();
+}
+
//=================================================================================
// function : createOperation
// purpose :
GEOM::GEOM_Object_var anObj;
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakeFilling(
- myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter );
+ myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter, myIsApprox );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );