-// 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
//
+
// GEOM GEOMGUI : GUI for Geometry component
// File : BuildGUI_WireDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
#include <LightApp_SelectionMgr.h>
#include <TColStd_MapOfInteger.hxx>
+#include <Precision.hxx>
//=================================================================================
// class : BuildGUI_WireDlg()
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
- GroupPoints = new DlgRef_1Sel( centralWidget() );
+ GroupArgs = new DlgRef_1Sel1Spin( centralWidget() );
+
+ GroupArgs->GroupBox1->setTitle( tr( "GEOM_WIRE_CONNECT" ) );
+ GroupArgs->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
+ GroupArgs->PushButton1->setIcon( image1 );
+ GroupArgs->LineEdit1->setReadOnly( true );
- GroupPoints->GroupBox1->setTitle( tr( "GEOM_WIRE_CONNECT" ) );
- GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
- GroupPoints->PushButton1->setIcon( image1 );
- GroupPoints->LineEdit1->setReadOnly( true );
+ GroupArgs->TextLabel2->setText( tr( "GEOM_TOLERANCE" ) );
+ double SpecificStep = 0.0001;
+ double prec = Precision::Confusion();
+ initSpinBox(GroupArgs->SpinBox_DX, prec, MAX_NUMBER, SpecificStep, "len_tol_precision" );
+ GroupArgs->SpinBox_DX->setValue(prec);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
- layout->addWidget( GroupPoints );
+ layout->addWidget( GroupArgs );
/***************************************************************/
setHelpFileName( "create_wire_page.html" );
void BuildGUI_WireDlg::Init()
{
/* init variables */
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setReadOnly( true );
+ myEditCurrentArgument = GroupArgs->LineEdit1;
+ GroupArgs->LineEdit1->setReadOnly( true );
myOkEdgesAndWires = false;
/* signals and slots connections */
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupArgs->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_WIRE" ) );
}
void BuildGUI_WireDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- if ( send != GroupPoints->PushButton1 )
+ if ( send != GroupArgs->PushButton1 )
return;
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_WIRE );
aMap.Add( GEOM_EDGE );
globalSelection( aMap );
- myEditCurrentArgument = GroupPoints->LineEdit1;
+ myEditCurrentArgument = GroupArgs->LineEdit1;
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_WIRE );
aMap.Add( GEOM_EDGE );
// function : isValid
// purpose :
//=================================================================================
-bool BuildGUI_WireDlg::isValid( QString& )
+bool BuildGUI_WireDlg::isValid (QString& msg)
{
- return myOkEdgesAndWires;
+ bool ok = GroupArgs->SpinBox_DX->isValid(msg, !IsPreview());
+ return myOkEdgesAndWires && ok;
}
//=================================================================================
// function : execute
// purpose :
//=================================================================================
-bool BuildGUI_WireDlg::execute( ObjectList& objects )
+bool BuildGUI_WireDlg::execute (ObjectList& objects)
{
- GEOM::GEOM_Object_var anObj;
+ GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+ GEOM::GEOM_Object_var anObj = anOper->MakeWire(myEdgesAndWires, GroupArgs->SpinBox_DX->value());
- anObj = GEOM::GEOM_IShapesOperations::_narrow(
- getOperation() )->MakeWire( myEdgesAndWires );
-
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
return true;
}
-