// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include <qlabel.h>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <GC_MakeArcOfCircle.hxx>
-#include <Geom_TrimmedCurve.hxx>
-#include <Precision.hxx>
-
#include "GEOMImpl_Types.hxx"
#include "utilities.h"
-using namespace std;
-
//=================================================================================
// class : BasicGUI_ArcDlg()
// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
: GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
+ QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
+ QPixmap image2(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_ARC_TITLE"));
Group3Pnts2->PushButton1->setPixmap(image2);
Group3Pnts2->PushButton2->setPixmap(image2);
Group3Pnts2->PushButton3->setPixmap(image2);
-
+
Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
Layout1->addWidget( Group3Pnts, 2, 0 );
Layout1->addWidget( Group3Pnts2, 2, 0 );
+ /***************************************************************/
setHelpFileName("arc.htm");
void BasicGUI_ArcDlg::Init()
{
/* init variables */
- // myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
-
- myConstructorId = -1;
myEditCurrentArgument = Group3Pnts->LineEdit1;
- myEditCurrentArgument->setFocus();
-
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
Group3Pnts2->radioButton4->setChecked(FALSE);
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
+
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
-
+
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(Group3Pnts->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
+
connect(Group3Pnts2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3Pnts2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3Pnts2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3Pnts2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
+
connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- initName( tr( "GEOM_ARC" ));
-
-
+ initName( tr( "GEOM_ARC" ));
ConstructorsClicked( 0 );
}
//=================================================================================
-// function : ClickOnOk()
-// purpose :
+// function : ConstructorsClicked()
+// purpose : Radio button management
//=================================================================================
-void BasicGUI_ArcDlg::ClickOnOk()
+void BasicGUI_ArcDlg::ConstructorsClicked (int constructorId)
{
- if ( ClickOnApply() )
- ClickOnCancel();
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+ switch (constructorId)
+ {
+ case 0:
+ {
+ globalSelection( GEOM_POINT );
+
+ Group3Pnts->show();
+ resize(0, 0);
+ Group3Pnts2->hide();
+
+ Group3Pnts->LineEdit1->setText(Group3Pnts2->LineEdit1->text());
+ Group3Pnts->LineEdit2->setText(Group3Pnts2->LineEdit2->text());
+ Group3Pnts->LineEdit3->setText(Group3Pnts2->LineEdit3->text());
+
+ myEditCurrentArgument = Group3Pnts->LineEdit1;
+
+ break;
+ }
+ case 1:
+ {
+ globalSelection( GEOM_POINT );
+
+ Group3Pnts->hide();
+ resize(0, 0);
+ Group3Pnts2->show();
+
+ Group3Pnts2->LineEdit1->setText(Group3Pnts->LineEdit1->text());
+ Group3Pnts2->LineEdit2->setText(Group3Pnts->LineEdit2->text());
+ Group3Pnts2->LineEdit3->setText(Group3Pnts->LineEdit3->text());
+
+ myEditCurrentArgument = Group3Pnts2->LineEdit1;
+
+ break;
+ }
+ }
+
+ myEditCurrentArgument->setFocus();
+ connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+
+ if (CORBA::is_nil(myPoint1))
+ SelectionIntoArgument();
+
+ displayPreview();
}
+
//=================================================================================
-// function : ClickOnCancel()
+// function : ClickOnOk()
// purpose :
//=================================================================================
-void BasicGUI_ArcDlg::ClickOnCancel()
+void BasicGUI_ArcDlg::ClickOnOk()
{
- GEOMBase_Skeleton::ClickOnCancel();
+ if ( ClickOnApply() )
+ ClickOnCancel();
}
//=================================================================================
return false;
initName();
-
- // reset
- myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
- Group3Pnts->LineEdit1->setText( "" );
- Group3Pnts->LineEdit2->setText( "" );
- Group3Pnts->LineEdit3->setText( "" );
- Group3Pnts2->LineEdit1->setText( "" );
- Group3Pnts2->LineEdit2->setText( "" );
- Group3Pnts2->LineEdit3->setText( "" );
- if (getConstructorId() == 0) myEditCurrentArgument = Group3Pnts->LineEdit1;
- if (getConstructorId() == 1) myEditCurrentArgument = Group3Pnts2->LineEdit1;
-
- ConstructorsClicked( getConstructorId() );
return true;
}
{
if ((getConstructorId() != 0) && (getConstructorId() != 1))
return;
-
+
myEditCurrentArgument->setText("");
- if ( IObjectCount() != 1 ){
+
+ if ( IObjectCount() != 1 )
+ {
switch (getConstructorId())
{
- case 0:
- {
- if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
- return;
- break;
+ case 0:
+ {
+ if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
+ return;
+ break;
}
- case 1:
- {
+ case 1:
+ {
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
break;
}
}
- }
+ }
+
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
}
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void BasicGUI_ArcDlg::LineEditReturnPressed()
+{
+ QLineEdit* send = (QLineEdit*)sender();
+ if (send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
+ send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3)
+ {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
+}
+
+
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
}
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void BasicGUI_ArcDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if ( send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
- send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 )
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
-}
-
-
//=================================================================================
// function : ActivateThisDialog()
// purpose :
void BasicGUI_ArcDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
- // myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
-
- myEditCurrentArgument = Group3Pnts->LineEdit1;
- myEditCurrentArgument->setFocus();
- Group3Pnts->LineEdit1->setText( "" );
- Group3Pnts->LineEdit2->setText( "" );
- Group3Pnts->LineEdit3->setText( "" );
- myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
-
}
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose : public slot to deactivate if active
-//=================================================================================
-void BasicGUI_ArcDlg::DeactivateActiveDialog()
-{
- // myGeomGUI->SetState( -1 );
- GEOMBase_Skeleton::DeactivateActiveDialog();
-}
//=================================================================================
// function : enterEvent()
//=================================================================================
void BasicGUI_ArcDlg::enterEvent(QEvent* e)
{
- if ( !GroupConstructors->isEnabled() )
+ if (!GroupConstructors->isEnabled())
ActivateThisDialog();
}
+
//=================================================================================
// function : createOperation
// purpose :
switch (getConstructorId())
{
- case 0:
+ case 0:
+ {
+ if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
{
- if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
- anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
- res = true;
- }
- break;
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
+ MakeArc(myPoint1, myPoint2, myPoint3);
+ res = true;
}
- case 1:
- {
- bool Sense;
- (Group3Pnts2->radioButton4->isChecked()) ? Sense=true : Sense = false;
- if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
- anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArcCenter(myPoint1, myPoint2, myPoint3,Sense);
- res = true;
- }
- break;
- }
- }
- if ( !anObj->_is_nil() ){
- objects.push_back( anObj._retn() );
- }
- return res;
-}
-
-//=================================================================================
-// function : closeEvent
-// purpose :
-//=================================================================================
-void BasicGUI_ArcDlg::closeEvent( QCloseEvent* e )
-{
- GEOMBase_Skeleton::closeEvent( e );
-}
-
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
-{
-
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-
- switch (constructorId)
- {
- case 0:
- {
- Group3Pnts->show();
- resize(0, 0);
- Group3Pnts2->hide();
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
- case 1:
+ case 1:
{
- Group3Pnts->hide();
- resize(0, 0);
- Group3Pnts2->show();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+ bool Sense;
+ (Group3Pnts2->radioButton4->isChecked()) ? Sense = true : Sense = false;
+ if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
+ {
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
+ MakeArcCenter(myPoint1, myPoint2, myPoint3, Sense);
+ res = true;
+ }
break;
}
}
- displayPreview();
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+
+ return res;
}
//=================================================================================
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#else
#define BASICGUI_WNT_EXPORT
#endif
+
//=================================================================================
// class : BasicGUI_ArcDlg
// purpose :
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
- virtual void closeEvent( QCloseEvent* e );
-
-private :
+private:
void Init();
void enterEvent(QEvent* e);
- int myConstructorId;
+
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
DlgRef_3Sel_QTD* Group3Pnts;
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
-
+
void ActivateThisDialog();
- void DeactivateActiveDialog();
- void ConstructorsClicked( int );
+ void ConstructorsClicked(int);
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+ GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
GroupPntVecR->SpinBox_DX->SetValue( 100 );
/* signals and slots connections */
double aMajorR( 200. ), aMinorR( 100. );
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
- GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
+ GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+ GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
GroupPoints->SpinBox_DX->SetValue( aMajorR );
GroupPoints->SpinBox_DY->SetValue( aMinorR );
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
{
- anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 );
+ anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
connect( anIter.data(), SIGNAL( valueChanged( double ) ),
this, SLOT( onValueChanged( double ) ) );
}
double aTrimSize = 2000.0;
/* min, max, step and decimals for spin boxes */
- GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 );
+ GroupPntDir->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
- Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+ Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
- GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+ GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
GroupFace->SpinBox_DX->SetValue( aTrimSize );
/* signals and slots connections */
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
double dx( 0. ), dy( 0. ), dz( 200. );
GroupDimensions->SpinBox_DX->SetValue( dx );
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
//=================================================================================
// class : GenerationGUI_PrismDlg()
-// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
+// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
GenerationGUI_PrismDlg::~GenerationGUI_PrismDlg()
-{
+{
// no need to delete child widgets, Qt does it all for us
}
GroupPoints2->LineEdit2->setReadOnly( true );
GroupPoints2->LineEdit3->setReadOnly( true );
+ myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
-
+
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
/* signals and slots connections */
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
- connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
+ connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName(tr("GEOM_EXTRUSION"));
ConstructorsClicked(0);
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
switch (constructorId)
+ {
+ case 0:
{
- case 0:
- {
- globalSelection( GEOM_POINT );
-
- GroupPoints2->hide();
- resize(0, 0);
- GroupPoints->show();
-
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setText("");
- GroupPoints->LineEdit2->setText("");
- GroupPoints2->LineEdit1->setText("");
- GroupPoints2->LineEdit2->setText("");
- GroupPoints2->LineEdit3->setText("");
- myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
- myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
-
- break;
- }
- case 1:
- {
- globalSelection( GEOM_ALLSHAPES );
-
- GroupPoints->hide();
- resize(0, 0);
- GroupPoints2->show();
-
- myEditCurrentArgument = GroupPoints2->LineEdit1;
- GroupPoints2->LineEdit1->setText("");
- GroupPoints2->LineEdit2->setText("");
- GroupPoints2->LineEdit3->setText("");
- myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
- myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
- GroupPoints->LineEdit1->setText("");
- GroupPoints->LineEdit2->setText("");
-
- break;
- }
+ globalSelection( GEOM_ALLSHAPES );
+
+ GroupPoints2->hide();
+ resize(0, 0);
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText(GroupPoints2->LineEdit1->text()); // keep base
+ GroupPoints->LineEdit2->setText("");
+ myVec = GEOM::GEOM_Object::_nil();
+ myOkVec = false;
+
+ break;
}
+ case 1:
+ {
+ globalSelection( GEOM_ALLSHAPES );
+
+ GroupPoints->hide();
+ resize(0, 0);
+ GroupPoints2->show();
+
+ myEditCurrentArgument = GroupPoints2->LineEdit1;
+ GroupPoints2->LineEdit1->setText(GroupPoints->LineEdit1->text()); // keep base
+ GroupPoints2->LineEdit2->setText("");
+ GroupPoints2->LineEdit3->setText("");
+ myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
+ myOkPnt1 = myOkPnt2 = false;
+
+ break;
+ }
+ }
myEditCurrentArgument->setFocus();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ if (!myOkBase)
+ SelectionIntoArgument();
}
}
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
- displayPreview();
}
else // getConstructorId()==1 - extrusion using 2 points
{
}
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
- displayPreview();
}
+
+ displayPreview();
}
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
//=================================================================================
bool GenerationGUI_PrismDlg::isValid( QString& )
{
- return myOkBase && ( myOkVec || (myOkPnt1 && myOkPnt2) );
+ if (getConstructorId() == 0)
+ // by vector and height
+ return (myOkBase && myOkVec);
+
+ // by two points
+ return (myOkBase && myOkPnt1 && myOkPnt2);
}
//=================================================================================
{
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
case 0:
- {
+ {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakePrismVecH(myBase, myVec, getHeight());
break;
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
virtual bool isValid( QString& msg );
virtual bool execute( ObjectList& objects );
-private :
+private:
void Init();
void enterEvent(QEvent* e);
double getHeight() const;
-
+
GEOM::GEOM_Object_var myBase; /* Base shape */
GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */
- GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
-
+ GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
+
bool myOkBase;
bool myOkVec;
bool myOkPnt1;
private slots:
void ClickOnOk();
bool ClickOnApply();
+
void ActivateThisDialog();
+ void ConstructorsClicked(int);
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
- void ConstructorsClicked(int);
void ValueChangedInSpinBox();
void onReverse();
};
double SpecificStep = 5;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(45.0);
/* signals and slots connections */
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
double initValue = 200.0;
GroupDimensions->SpinBox_DX->SetValue(initValue);
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
double aRadius1(100.0), aRadius2(0.0), aHeight(300.0);
GroupPoints->SpinBox_DX->SetValue(aRadius1);
/* min, max, step and decimals for spin boxes & initial values */
/* First constructor : radius */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
/* First constructor : algebric height */
- GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
/* Second constructor : radius */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
/* Second constructor : algebric height */
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
GroupPoints->SpinBox_DY->SetValue(300.0);
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
GroupDimensions->SpinBox_DX->SetValue(100.0);
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "utilities.h"
-using namespace std;
-
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
-// purpose : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the
+// purpose : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_PV")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_PV")));
+ QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_DXYZ")));
+ QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
setCaption(tr("GEOM_TORUS_TITLE"));
Layout1->addWidget(GroupDimensions, 2, 0);
/***************************************************************/
- setHelpFileName("turus.htm");
-
+ setHelpFileName("turus.htm");
+
Init();
}
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
-
+
myPoint = myDir = GEOM::GEOM_Object::_nil();
/* Get setting of step value from file configuration */
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(300.0);
GroupPoints->SpinBox_DY->SetValue(100.0);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
-
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
initName( tr( "GEOM_TORUS" ) );
ConstructorsClicked(0);
}
//=================================================================================
void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-
- switch(constructorId)
- {
- case 0 :
- {
- globalSelection( GEOM_LINE );
-
- GroupDimensions->hide();
- resize(0, 0);
- GroupPoints->show();
-
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setText(tr(""));
- GroupPoints->LineEdit2->setText(tr(""));
- myPoint = myDir = GEOM::GEOM_Object::_nil();
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- break ;
- }
- case 1 :
- {
- GroupPoints->hide();
- resize( 0, 0 );
- GroupDimensions->show();
-
- break ;
- }
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+ switch (constructorId)
+ {
+ case 0:
+ {
+ globalSelection( GEOM_POINT );
+
+ GroupDimensions->hide();
+ resize(0, 0);
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText(tr(""));
+ GroupPoints->LineEdit2->setText(tr(""));
+ myPoint = myDir = GEOM::GEOM_Object::_nil();
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ SelectionIntoArgument();
+
+ break;
+ }
+ case 1:
+ {
+ GroupPoints->hide();
+ resize(0, 0);
+ GroupDimensions->show();
+
+ break;
}
+ }
+
displayPreview();
}
return false;
initName();
- ConstructorsClicked( getConstructorId() );
return true;
}
-//=======================================================================
-// function : ClickOnCancel()
-// purpose :
-//=======================================================================
-void PrimitiveGUI_TorusDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
{
if ( getConstructorId() != 0 )
return;
-
+
myEditCurrentArgument->setText("");
-
- if(IObjectCount() != 1)
- {
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
- myPoint = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
- myDir = GEOM::GEOM_Object::_nil();
- return;
- }
-
-
+
+ if (IObjectCount() != 1)
+ {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
+ myPoint = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+ myDir = GEOM::GEOM_Object::_nil();
+ return;
+ }
+
/* nbSel == 1 */
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if(!testResult || CORBA::is_nil( aSelectedObject ))
+
+ if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
-
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myDir = aSelectedObject;
-
+
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
displayPreview();
}
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
+{
+ QLineEdit* send = (QLineEdit*)sender();
+ if (send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2)
+ {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
+}
+
+
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
- if(send == GroupPoints->PushButton1) {
+
+ if (send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_POINT );
}
- else if(send == GroupPoints->PushButton2) {
+ else if (send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_LINE );
}
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
-}
-
-
//=================================================================================
// function : ActivateThisDialog()
// purpose :
void PrimitiveGUI_TorusDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+
ConstructorsClicked( getConstructorId() );
}
}
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose : public slot to deactivate if active
-//=================================================================================
-void PrimitiveGUI_TorusDlg::DeactivateActiveDialog()
-{
- GEOMBase_Skeleton::DeactivateActiveDialog();
-}
-
-
//=================================================================================
// function : ValueChangedInSpinBox
// purpose :
bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
- case 0 :
+ switch ( getConstructorId() )
{
- if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )){
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
- res = true;
+ case 0:
+ {
+ if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ))
+ {
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
+ res = true;
+ }
+ break;
}
- break;
- }
- case 1 :
+ case 1:
{
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR(getRadius1(), getRadius2());
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakeTorusRR(getRadius1(), getRadius2());
res = true;
break;
}
}
-//=================================================================================
-// function : closeEvent
-// purpose :
-//=================================================================================
-void PrimitiveGUI_TorusDlg::closeEvent( QCloseEvent* e )
-{
- GEOMBase_Skeleton::closeEvent( e );
-}
-
-
//=================================================================================
// function : getRadius1()
// purpose :
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
- virtual void closeEvent( QCloseEvent* e );
-
private:
void Init();
void enterEvent(QEvent* e);
+
double getRadius1() const;
double getRadius2() const;
DlgRef_2Sel2Spin* GroupPoints;
DlgRef_2Spin* GroupDimensions;
- private slots:
+private slots:
void ClickOnOk();
bool ClickOnApply();
- void ClickOnCancel();
+
void ActivateThisDialog();
- void DeactivateActiveDialog();
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();