//=================================================================================
BasicGUI_ArcDlg::BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_ArcDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
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" ) ) );
//=================================================================================
BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_CircleDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PV" ) ) );
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PNTS" ) ) );
//=================================================================================
BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_CurveDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POLYLINE" ) ) );
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPLINE" ) ) );
//=================================================================================
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_EllipseDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ELLIPSE_PV" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
//=================================================================================
BasicGUI_LineDlg::BasicGUI_LineDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_LineDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_LINE_2P" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
// purpose : Constructor
//=================================================================================
BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent )
- : GEOMBase_Skeleton( theGeometryGUI, theParent, "BasicGUI_MarkerDlg", false,
+ : GEOMBase_Skeleton( theGeometryGUI, theParent, false,
Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
QPixmap iconCS1 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) );
//=================================================================================
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_PlaneDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_PV" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_3PNTS" ) ) );
//=================================================================================
BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_PointDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_EDGE" ) ) );
//=================================================================================
BasicGUI_VectorDlg::BasicGUI_VectorDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_VectorDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_2P" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_DXYZ" ) ) );
//=================================================================================
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl )
- : GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_WorkingPlaneDlg", modal, fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_WPLANE_FACE" ) ) );
// true to construct a modal dialog.
//=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl )
- : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ bool modal, Qt::WindowFlags fl )
+ : QDialog( parent, fl ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( theGeometryGUI ),
myRBGroup( 0 )
{
- if ( !name )
- setObjectName( "GEOMBase_Skeleton" );
- else
- setObjectName( name );
-
setAttribute( Qt::WA_DeleteOnClose );
setModal( modal );
#ifndef COORD_MIN
# define COORD_MIN -1e+15
# define COORD_MAX +1e+15
+# define MAX_NUMBER 100000
+# define DBL_DIGITS_DISPLAY 16
#endif // COORD_MIN
class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public GEOMBase_Helper
Q_OBJECT
public:
- GEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, const char* = 0, bool = false, Qt::WindowFlags = 0 );
+ GEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
~GEOMBase_Skeleton();
private:
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI.cxx
+// Author : Damien COQUERET, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
#include "GenerationGUI.h"
-#include "GeometryGUI.h"
-
-#include "SUIT_Desktop.h"
+#include <GeometryGUI.h>
-#include "SalomeApp_Application.h"
+#include <SUIT_Desktop.h>
+#include <SalomeApp_Application.h>
#include "GenerationGUI_PrismDlg.h" // Method PRISM
#include "GenerationGUI_RevolDlg.h" // Method REVOL
#include "GenerationGUI_FillingDlg.h" // Method FILLING
#include "GenerationGUI_PipeDlg.h" // Method PIPE
-using namespace std;
-
//=======================================================================
// function : GenerationGUI()
// purpose : Constructor
//=======================================================================
-GenerationGUI::GenerationGUI(GeometryGUI* parent) : GEOMGUI(parent)
+GenerationGUI::GenerationGUI( GeometryGUI* parent )
+ : GEOMGUI( parent )
{
}
QDialog* aDlg = NULL;
- switch (theCommandID)
- {
- case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent, ""); break;
- case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent, ""); break;
- case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break;
- case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent, ""); break;
+ switch ( theCommandID ) {
+ case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent ); break;
+ case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent ); break;
+ case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent ); break;
+ case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent ); break;
- default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
+ default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
}
- if (aDlg != NULL)
+ if (aDlg != NULL )
aDlg->show();
return true;
//=====================================================================================
extern "C"
{
-GENERATIONGUI_EXPORT
- GEOMGUI* GetLibGUI(GeometryGUI* parent)
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
- return new GenerationGUI(parent);
+ return new GenerationGUI( parent );
}
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI.h
+// Author : Damien COQUERET, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI.h
-// Author : Damien COQUERET
-// Module : GEOM
#ifndef GENERATIONGUI_H
#define GENERATIONGUI_H
-#ifdef WNT
-# if defined GENERATIONGUI_EXPORTS
-# define GENERATIONGUI_EXPORT __declspec( dllexport )
-# else
-# define GENERATIONGUI_EXPORT __declspec( dllimport )
-# endif
-#else
-# define GENERATIONGUI_EXPORT
-#endif
-
-#include "GEOMGUI.h"
+#include <GEOMGUI.h>
//=================================================================================
// class : GenerationGUI
// purpose :
//=================================================================================
-class GENERATIONGUI_EXPORT GenerationGUI : public GEOMGUI
+class GenerationGUI : public GEOMGUI
{
public:
- GenerationGUI(GeometryGUI* parent);
+ GenerationGUI( GeometryGUI* );
~GenerationGUI();
- bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
+ bool OnGUIEvent( int, SUIT_Desktop* );
};
#endif
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_FillingDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_FillingDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "GenerationGUI_FillingDlg.h"
-#include "DlgRef_1Sel5Spin.h"
-#include "DlgRef_SpinBox.h"
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
#include <TopoDS_Iterator.hxx>
-#include "GEOMImpl_Types.hxx"
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : GenerationGUI_FillingDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+GenerationGUI_FillingDlg::GenerationGUI_FillingDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FILLING")));
- QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FILLING" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_FILLING_TITLE"));
+ setWindowTitle( tr( "GEOM_FILLING_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_FILLING"));
- RadioButton1->setIcon(image0);
- RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton2->close();
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new DlgRef_1Sel5Spin(this, "GroupPoints");
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_FILLING_COMPOUND"));
- GroupPoints->TextLabel2->setText(tr("GEOM_FILLING_MIN_DEG"));
- GroupPoints->TextLabel3->setText(tr("GEOM_FILLING_TOL_2D"));
- 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->PushButton1->setIcon(image1);
+ mainFrame()->GroupConstructors->setTitle( tr ( "GEOM_FILLING" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_1Sel5Spin( centralWidget() );
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) );
+ GroupPoints->TextLabel3->setText( tr( "GEOM_FILLING_TOL_2D" ) );
+ 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->PushButton1->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
- gridLayout1->addWidget(GroupPoints, 2, 0);
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
/***************************************************************/
- setHelpFileName("filling.htm");
+ setHelpFileName( "filling.htm" );
/* Initialisations */
Init();
double SpecificStep1 = 1;
double SpecificStep2 = 0.0001;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_1->RangeStepAndValidator(2.0, MAX_NUMBER, SpecificStep1, 3);
- GroupPoints->SpinBox_2->RangeStepAndValidator(0.00001, 10000.0, SpecificStep2, 5);
- GroupPoints->SpinBox_3->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep1, 3);
- GroupPoints->SpinBox_4->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep1, 3);
- GroupPoints->SpinBox_5->RangeStepAndValidator(0.00001, 10000.0, SpecificStep2, 5);
-
- GroupPoints->SpinBox_1->SetValue(myMinDeg);
- GroupPoints->SpinBox_2->SetValue(myTol2D);
- GroupPoints->SpinBox_3->SetValue(myNbIter);
- GroupPoints->SpinBox_4->SetValue(myMaxDeg);
- GroupPoints->SpinBox_5->SetValue(myTol3D);
+ 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->SpinBox4, 1.0, MAX_NUMBER, SpecificStep1, 3 );
+ initSpinBox( GroupPoints->SpinBox5, 0.00001, 10000.0, SpecificStep2, 5 );
+
+ GroupPoints->SpinBox1->setValue( myMinDeg );
+ GroupPoints->SpinBox2->setValue( myTol2D );
+ GroupPoints->SpinBox3->setValue( myNbIter );
+ GroupPoints->SpinBox4->setValue( myMaxDeg );
+ GroupPoints->SpinBox5->setValue( myTol3D );
/* 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(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
- connect(GroupPoints->SpinBox_1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(GroupPoints->SpinBox_2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(GroupPoints->SpinBox_3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(GroupPoints->SpinBox_4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(GroupPoints->SpinBox_5, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_1, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_2, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_3, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_4, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_5, SLOT(SetStep(double)));
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
-
- initName(tr("GEOM_FILLING").toLatin1().constData());
+ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
+
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+
+ connect( GroupPoints->SpinBox1, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
+ connect( GroupPoints->SpinBox2, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
+ connect( GroupPoints->SpinBox3, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
+ 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( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+
+ initName( tr( "GEOM_FILLING" ) );
}
void GenerationGUI_FillingDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText("");
+ myEditCurrentArgument->setText( "" );
- if(IObjectCount() != 1) {
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
+ if ( IObjectCount() != 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( firstIObject(), 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)
- {
+ 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 )
QPushButton* send = (QPushButton*)sender();
globalSelection( GEOM_ALLSHAPES );
- if(send == GroupPoints->PushButton1) {
+ if ( send == GroupPoints->PushButton1 ) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_COMPOUND );
void GenerationGUI_FillingDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
void GenerationGUI_FillingDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_COMPOUND );
displayPreview();
}
// function : enterEvent()
// purpose :
//=================================================================================
-void GenerationGUI_FillingDlg::enterEvent(QEvent* e)
+void GenerationGUI_FillingDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
-void GenerationGUI_FillingDlg::ValueChangedInSpinBox(double newValue)
+void GenerationGUI_FillingDlg::ValueChangedInSpinBox( double newValue )
{
QObject* send = (QObject*)sender();
- if(send == GroupPoints->SpinBox_1)
- myMinDeg = int(newValue);
- else if(send == GroupPoints->SpinBox_2)
+ if ( send == GroupPoints->SpinBox1 )
+ myMinDeg = int( newValue );
+ else if ( send == GroupPoints->SpinBox2 )
myTol2D = newValue;
- else if(send == GroupPoints->SpinBox_3)
+ else if ( send == GroupPoints->SpinBox3 )
myNbIter = int(newValue);
- else if(send == GroupPoints->SpinBox_4)
+ else if ( send == GroupPoints->SpinBox4 )
myMaxDeg = int(newValue);
- else if(send == GroupPoints->SpinBox_5)
+ else if ( send == GroupPoints->SpinBox5 )
myTol3D = newValue;
displayPreview();
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_FillingDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_FillingDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-
-#ifndef DIALOGBOX_FILLING_H
-#define DIALOGBOX_FILLING_H
-#include "GenerationGUI.h"
+#ifndef GENERATIONGUI_FILLINGDLG_H
+#define GENERATIONGUI_FILLINGDLG_H
-#include "GEOMBase_Skeleton.h"
+#include <GEOMBase_Skeleton.h>
class DlgRef_1Sel5Spin;
// class : GenerationGUI_FillingDlg
// purpose :
//=================================================================================
-class GENERATIONGUI_EXPORT GenerationGUI_FillingDlg : public GEOMBase_Skeleton
+class GenerationGUI_FillingDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~GenerationGUI_FillingDlg();
+ GenerationGUI_FillingDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~GenerationGUI_FillingDlg();
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& msg );
- virtual bool execute( ObjectList& objects );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
private:
- void Init();
- void enterEvent(QEvent* e);
+ void Init();
+ void enterEvent( QEvent* );
- GEOM::GEOM_Object_var myCompound; /* compound of curves */
- Standard_Integer myMinDeg;
- Standard_Integer myMaxDeg;
- Standard_Real myTol3D;
- Standard_Real myTol2D;
- Standard_Integer myNbIter;
- bool myOkCompound; /* to check when curv. compound is defined */
-
- DlgRef_1Sel5Spin* GroupPoints;
+private:
+ GEOM::GEOM_Object_var myCompound; /* compound of curves */
+ Standard_Integer myMinDeg;
+ Standard_Integer myMaxDeg;
+ Standard_Real myTol3D;
+ Standard_Real myTol2D;
+ Standard_Integer myNbIter;
+ bool myOkCompound; /* to check when curv. compound is defined */
+ DlgRef_1Sel5Spin* GroupPoints;
+
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ValueChangedInSpinBox(double newValue);
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ValueChangedInSpinBox( double );
};
-#endif // DIALOGBOX_FILLING_H
+#endif // GENERATIONGUI_FILLINGDLG_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_PipeDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_PipeDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "GenerationGUI_PipeDlg.h"
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "GEOMImpl_Types.hxx"
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : GenerationGUI_PipeDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+GenerationGUI_PipeDlg::GenerationGUI_PipeDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PIPE")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PIPE" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_PIPE_TITLE"));
+ setWindowTitle( tr( "GEOM_PIPE_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_PIPE"));
- RadioButton1->setIcon(image0);
- RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton2->close();
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new Ui::DlgRef_2Sel_QTD();
- QWidget* aGroupPointsWidget = new QWidget(this);
- GroupPoints->setupUi(aGroupPointsWidget);
- aGroupPointsWidget->setObjectName("GroupPoints");
-
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_BASE_OBJECT"));
- GroupPoints->TextLabel2->setText(tr("GEOM_PATH_OBJECT"));
- GroupPoints->PushButton1->setIcon(image1);
- GroupPoints->PushButton2->setIcon(image1);
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PIPE" ) );
+ mainFrame()->RadioButton1->setIcon(image0);
+ mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_2Sel( centralWidget() );
+
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_OBJECT" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_PATH_OBJECT" ) );
+ GroupPoints->PushButton1->setIcon( image1 );
+ GroupPoints->PushButton2->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
- gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
/***************************************************************/
- setHelpFileName("pipe_creation.htm");
+ setHelpFileName( "pipe_creation.htm" );
/* Initialisations */
Init();
myOkBase = myOkPath = false;
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName(tr("GEOM_PIPE").toLatin1().constData());
+ initName( tr( "GEOM_PIPE" ) );
globalSelection( GEOM_ALLSHAPES );
}
void GenerationGUI_PipeDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText("");
+ myEditCurrentArgument->setText( "" );
- if(IObjectCount() != 1) {
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
+ if ( IObjectCount() != 1 ) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myOkBase = false;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
myOkPath = 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( firstIObject(), testResult );
- if (!testResult)
+ if ( !testResult )
return;
TopoDS_Shape S;
- if(myEditCurrentArgument == GroupPoints->LineEdit1) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
myOkBase = false;
- if(!GEOMBase::GetShape(aSelectedObject, S) ||
- S.ShapeType() == TopAbs_COMPSOLID ||
- S.ShapeType() == TopAbs_COMPOUND ||
- S.ShapeType() == TopAbs_SOLID ||
- S.ShapeType() == TopAbs_SHAPE)
+ if ( !GEOMBase::GetShape( aSelectedObject, S ) ||
+ S.ShapeType() == TopAbs_COMPSOLID ||
+ S.ShapeType() == TopAbs_COMPOUND ||
+ S.ShapeType() == TopAbs_SOLID ||
+ S.ShapeType() == TopAbs_SHAPE )
return;
myBase = aSelectedObject;
myOkBase = true;
}
- else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
myOkPath = false;
- if(!GEOMBase::GetShape(aSelectedObject, S) ||
- !(S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE) )
+ if ( !GEOMBase::GetShape( aSelectedObject, S ) ||
+ !( S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) )
return;
myPath = aSelectedObject;
{
QPushButton* send = (QPushButton*)sender();
- if(send == GroupPoints->PushButton1) {
+ if ( send == GroupPoints->PushButton1 ) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
}
- else if(send == GroupPoints->PushButton2) {
+ else if ( send == GroupPoints->PushButton2 ) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
}
void GenerationGUI_PipeDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
// function : enterEvent()
// purpose : when mouse enter onto the QWidget
//=================================================================================
-void GenerationGUI_PipeDlg::enterEvent(QEvent* e)
+void GenerationGUI_PipeDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
{
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT(SelectionIntoArgument() ) );
displayPreview();
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_PipeDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_PipeDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-#ifndef DIALOGBOX_PIPE_H
-#define DIALOGBOX_PIPE_H
+#ifndef GENERATIONGUI_PIPEDLG_H
+#define GENERATIONGUI_PIPEDLG_H
-#include "GenerationGUI.h"
+#include <GEOMBase_Skeleton.h>
-#include "GEOMBase_Skeleton.h"
-#include "DlgRef_2Sel_QTD.h"
+class DlgRef_2Sel;
//=================================================================================
// class : GenerationGUI_PipeDlg
// purpose :
//=================================================================================
-class GENERATIONGUI_EXPORT GenerationGUI_PipeDlg : public GEOMBase_Skeleton
+class GenerationGUI_PipeDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~GenerationGUI_PipeDlg();
-
+ GenerationGUI_PipeDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~GenerationGUI_PipeDlg();
+
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& msg );
- virtual bool execute( ObjectList& objects );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
private:
- void Init();
- void enterEvent(QEvent* e);
-
- GEOM::GEOM_Object_var myBase; /* Base shape */
- GEOM::GEOM_Object_var myPath; /* Shape, defining the path */
- bool myOkBase;
- bool myOkPath; /* to check when arguments are defined */
-
- Ui::DlgRef_2Sel_QTD* GroupPoints;
+ void Init();
+ void enterEvent( QEvent* );
+
+private:
+ GEOM::GEOM_Object_var myBase; /* Base shape */
+ GEOM::GEOM_Object_var myPath; /* Shape, defining the path */
+ bool myOkBase;
+ bool myOkPath; /* to check when arguments are defined */
+
+ DlgRef_2Sel* GroupPoints;
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
};
-#endif // DIALOGBOX_PIPE_H
+#endif // GENERATIONGUI_PIPEDLG_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_PrismDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_PrismDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "GenerationGUI_PrismDlg.h"
-#include "DlgRef_2Sel1Spin2Check.h"
-#include "DlgRef_SpinBox.h"
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "GEOMImpl_Types.hxx"
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : GenerationGUI_PrismDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+GenerationGUI_PrismDlg::GenerationGUI_PrismDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM_2P")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+ QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM_2P" ) ) );
- setWindowTitle(tr("GEOM_EXTRUSION_TITLE"));
+ setWindowTitle( tr( "GEOM_EXTRUSION_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_EXTRUSION"));
- RadioButton1->setIcon(image0);
- RadioButton2->setIcon(image2);
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_EXTRUSION" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setIcon( image2 );
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
- GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
+ GroupPoints = new DlgRef_2Sel1Spin2Check( centralWidget() );
GroupPoints->CheckButton1->hide();
- GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
- GroupPoints->TextLabel1->setText(tr("GEOM_BASE"));
- GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
- GroupPoints->TextLabel3->setText(tr("GEOM_HEIGHT"));
- GroupPoints->PushButton1->setIcon(image1);
- GroupPoints->PushButton2->setIcon(image1);
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_EXTRUSION_BSV" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_BASE" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
+ GroupPoints->TextLabel3->setText( tr( "GEOM_HEIGHT" ) );
+ GroupPoints->PushButton1->setIcon( image1 );
+ GroupPoints->PushButton2->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
- GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
-
- GroupPoints2 = new Ui::DlgRef_3Sel_QTD();
- QWidget* aGroupPoints2Widget = new QWidget(this);
- GroupPoints2->setupUi(aGroupPoints2Widget);
- aGroupPoints2Widget->setObjectName("GroupPoints2");
-
- GroupPoints2->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P"));
- GroupPoints2->TextLabel1->setText(tr("GEOM_BASE"));
- GroupPoints2->TextLabel2->setText(tr("GEOM_POINT_I").arg("1"));
- GroupPoints2->TextLabel3->setText(tr("GEOM_POINT_I").arg("2"));
- GroupPoints2->PushButton1->setIcon(image1);
- GroupPoints2->PushButton2->setIcon(image1);
- GroupPoints2->PushButton3->setIcon(image1);
-
- gridLayout1->addWidget(GroupPoints, 2, 0);
- gridLayout1->addWidget(aGroupPoints2Widget, 2, 0);
+ GroupPoints->CheckButton2->setText( tr( "GEOM_REVERSE" ) );
+
+ GroupPoints2 = new DlgRef_3Sel( centralWidget() );
+
+ GroupPoints2->GroupBox1->setTitle( tr( "GEOM_EXTRUSION_BSV_2P" ) );
+ GroupPoints2->TextLabel1->setText( tr( "GEOM_BASE" ) );
+ GroupPoints2->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
+ GroupPoints2->TextLabel3->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
+ GroupPoints2->PushButton1->setIcon( image1 );
+ GroupPoints2->PushButton2->setIcon( image1 );
+ GroupPoints2->PushButton3->setIcon( image1 );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
+ layout->addWidget( GroupPoints2 );
/***************************************************************/
- setHelpFileName("extrusion.htm");
+ setHelpFileName( "extrusion.htm" );
/* Initialisations */
Init();
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
+ 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->SetValue(100.0);
+ initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 );
+ GroupPoints->SpinBox_DX->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( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
+ connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ // VSR: TODO ->>
+ connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
+ // <<-
+ connect( GroupPoints->CheckButton2, SIGNAL( toggled( bool ) ), this, SLOT( onReverse() ) );
- connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( GroupPoints2->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints2->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints2->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints2->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints2->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints2->LineEdit3, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName(tr("GEOM_EXTRUSION").toLatin1().constData());
+ initName( tr( "GEOM_EXTRUSION" ) );
globalSelection( GEOM_ALLSHAPES );
- ConstructorsClicked(0);
+ ConstructorsClicked( 0 );
}
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
-void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
+void GenerationGUI_PrismDlg::ConstructorsClicked( int constructorId )
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+ disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
- switch (constructorId)
+ switch ( constructorId ) {
+ case 0:
{
- case 0:
- {
- globalSelection( GEOM_POINT );
-
- ::qobject_cast<QWidget*>( GroupPoints2->gridLayout->parent() )->hide();
- resize(0, 0);
- GroupPoints->show();
-
- //GroupPoints->LineEdit1->setFocus();
- //myEditCurrentArgument = GroupPoints->LineEdit1;
- //displayPreview();
-
- 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:
- {
- GroupPoints->hide();
- resize(0, 0);
- ::qobject_cast<QWidget*>( GroupPoints2->gridLayout->parent() )->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_POINT );
+ GroupPoints2->hide();
+ GroupPoints->show();
+
+ //GroupPoints->LineEdit1->setFocus();
+ //myEditCurrentArgument = GroupPoints->LineEdit1;
+ //displayPreview();
+
+ 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:
+ {
+ GroupPoints->hide();
+ 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;
+ }
+ }
+
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
+
displayPreview();
}
void GenerationGUI_PrismDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText("");
+ myEditCurrentArgument->setText( "" );
- if ( getConstructorId()==0 ) {
+ if ( getConstructorId() == 0 ) {
- if (IObjectCount() != 1) {
- if (myEditCurrentArgument == GroupPoints->LineEdit1)
+ if ( IObjectCount() != 1 ) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myOkBase = false;
- else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
myOkVec = false;
return;
}
GEOM::GEOM_Object_ptr aSelectedObject =
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
- if (!testResult)
+ if ( !testResult )
return;
- if (myEditCurrentArgument == GroupPoints->LineEdit1) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
myBase = aSelectedObject;
myOkBase = true;
}
- else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
myVec = aSelectedObject;
myOkVec = true;
}
else { // getConstructorId()==1 - extrusion using 2 points
- if (IObjectCount() != 1) {
- if (myEditCurrentArgument == GroupPoints2->LineEdit1)
+ if ( IObjectCount() != 1 ) {
+ if ( myEditCurrentArgument == GroupPoints2->LineEdit1 )
myOkBase = false;
- else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
+ else if ( myEditCurrentArgument == GroupPoints2->LineEdit2 ) {
myPoint1 = GEOM::GEOM_Object::_nil();
myOkPnt1 = false;
}
- else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
+ else if ( myEditCurrentArgument == GroupPoints2->LineEdit3 ) {
myPoint2 = GEOM::GEOM_Object::_nil();
myOkPnt2 = false;
}
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
- if (!testResult || CORBA::is_nil( aSelectedObject ))
+ if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
- if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
+ if ( myEditCurrentArgument == GroupPoints2->LineEdit1 ) {
myBase = aSelectedObject;
myOkBase = true;
}
- else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
+ else if ( myEditCurrentArgument == GroupPoints2->LineEdit2 ) {
myPoint1 = aSelectedObject;
myOkPnt1 = true;
}
- else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
+ else if ( myEditCurrentArgument == GroupPoints2->LineEdit3 ) {
myPoint2 = aSelectedObject;
myOkPnt2 = true;
}
QPushButton* send = (QPushButton*)sender();
globalSelection( GEOM_ALLSHAPES );
- if(send == GroupPoints->PushButton1) {
+ if ( send == GroupPoints->PushButton1 ) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
}
- else if(send == GroupPoints->PushButton2) {
+ else if ( send == GroupPoints->PushButton2 ) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_LINE );
}
- else if(send == GroupPoints2->PushButton1) {
+ else if ( send == GroupPoints2->PushButton1 ) {
GroupPoints2->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit1;
}
- else if(send == GroupPoints2->PushButton2) {
+ else if ( send == GroupPoints2->PushButton2 ) {
GroupPoints2->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit2;
globalSelection( GEOM_POINT );
}
- else if(send == GroupPoints2->PushButton3) {
+ else if ( send == GroupPoints2->PushButton3 ) {
GroupPoints2->LineEdit3->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit3;
globalSelection( GEOM_POINT );
void GenerationGUI_PrismDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2 ||
- send == GroupPoints2->LineEdit1 ||
- send == GroupPoints2->LineEdit2 ||
- send == GroupPoints2->LineEdit3 )
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ||
+ send == GroupPoints2->LineEdit1 ||
+ send == GroupPoints2->LineEdit2 ||
+ send == GroupPoints2->LineEdit3 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
//=================================================================================
// function : enterEvent()
// purpose : when mouse enter onto the QWidget
//=================================================================================
-void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
+void GenerationGUI_PrismDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
{
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
//GroupPoints->LineEdit1->setFocus();
//myEditCurrentArgument = GroupPoints->LineEdit1;
//displayPreview();
//=================================================================================
double GenerationGUI_PrismDlg::getHeight() const
{
- return GroupPoints->SpinBox_DX->GetValue();
+ return GroupPoints->SpinBox_DX->value();
}
//=================================================================================
{
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
+ switch ( getConstructorId() ) {
case 0 :
- {
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
- MakePrismVecH(myBase, myVec, getHeight());
- break;
- }
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakePrismVecH( myBase, myVec, getHeight() );
+ break;
case 1 :
- {
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
- MakePrismTwoPnt(myBase, myPoint1, myPoint2);
- break;
- }
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakePrismTwoPnt( myBase, myPoint1, myPoint2 );
+ break;
}
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
//=================================================================================
void GenerationGUI_PrismDlg::onReverse()
{
- double anOldValue = GroupPoints->SpinBox_DX->GetValue();
- GroupPoints->SpinBox_DX->SetValue( -anOldValue );
+ double anOldValue = GroupPoints->SpinBox_DX->value();
+ GroupPoints->SpinBox_DX->setValue( -anOldValue );
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_PrismDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_PrismDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-
-#ifndef DIALOGBOX_PRISM_H
-#define DIALOGBOX_PRISM_H
-#include "GenerationGUI.h"
+#ifndef GENERATIONGUI_PRISMDLG_H
+#define GENERATIONGUI_PRISMDLG_H
-#include "GEOMBase_Skeleton.h"
-#include "DlgRef_3Sel_QTD.h"
+#include <GEOMBase_Skeleton.h>
+class DlgRef_3Sel;
class DlgRef_2Sel1Spin2Check;
//=================================================================================
// class : GenerationGUI_PrismDlg
// purpose :
//=================================================================================
-class GENERATIONGUI_EXPORT GenerationGUI_PrismDlg : public GEOMBase_Skeleton
+class GenerationGUI_PrismDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~GenerationGUI_PrismDlg();
-
+ GenerationGUI_PrismDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~GenerationGUI_PrismDlg();
+
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& msg );
- virtual bool execute( ObjectList& objects );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
-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 */
+private:
+ void Init();
+ void enterEvent( QEvent* );
+ double getHeight() const;
- bool myOkBase;
- bool myOkVec;
- bool myOkPnt1;
- bool myOkPnt2;
-
- DlgRef_2Sel1Spin2Check* GroupPoints;
- Ui::DlgRef_3Sel_QTD* GroupPoints2; // for second layout for extrusion using 2 points
-
+private:
+ 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 */
+
+ bool myOkBase;
+ bool myOkVec;
+ bool myOkPnt1;
+ bool myOkPnt2;
+
+ DlgRef_2Sel1Spin2Check* GroupPoints;
+ DlgRef_3Sel* GroupPoints2; // for second layout for extrusion using 2 points
+
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int);
- void ValueChangedInSpinBox();
- void onReverse();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked( int );
+ void ValueChangedInSpinBox();
+ void onReverse();
};
-#endif // DIALOGBOX_PRISM_H
+#endif // GENERATIONGUI_PRISMDLG_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_RevolDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_RevolDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "GenerationGUI_RevolDlg.h"
-#include "DlgRef_2Sel1Spin2Check.h"
-#include "DlgRef_SpinBox.h"
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
#include <TopExp_Explorer.hxx>
-#include "GEOMImpl_Types.hxx"
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : GenerationGUI_RevolDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-GenerationGUI_RevolDlg::GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+GenerationGUI_RevolDlg::GenerationGUI_RevolDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_REVOL")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_REVOL" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_REVOLUTION_TITLE"));
+ setWindowTitle( tr( "GEOM_REVOLUTION_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_REVOLUTION"));
- RadioButton1->setIcon(image0);
- RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton2->close();
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_REVOLUTION" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_2Sel1Spin2Check( centralWidget() );
GroupPoints->CheckButton1->hide();
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_OBJECT"));
- GroupPoints->TextLabel2->setText(tr("GEOM_AXIS"));
- GroupPoints->TextLabel3->setText(tr("GEOM_ANGLE"));
- GroupPoints->PushButton1->setIcon(image1);
- GroupPoints->PushButton2->setIcon(image1);
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_AXIS" ) );
+ GroupPoints->TextLabel3->setText( tr( "GEOM_ANGLE" ) );
+ GroupPoints->PushButton1->setIcon( image1 );
+ GroupPoints->PushButton2->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
- GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
+ GroupPoints->CheckButton2->setText( tr( "GEOM_REVERSE" ) );
- gridLayout1->addWidget(GroupPoints, 2, 0);
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
/***************************************************************/
- setHelpFileName("revolution.htm");
+ setHelpFileName( "revolution.htm" );
/* Initialisations */
Init();
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->SetValue(45.0);
+ initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, SpecificStep, 3 );
+ GroupPoints->SpinBox_DX->setValue( 45.0 );
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
+ connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupPoints->CheckButton2, SIGNAL( toggled( bool ) ), this, SLOT( onReverse() ) );
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ // VSR: TODO ->>
+ connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
+ // <<-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName(tr("GEOM_REVOLUTION").toLatin1().constData());
+ initName( tr( "GEOM_REVOLUTION" ) );
globalSelection( GEOM_ALLSHAPES );
}
//purpose : return true if theBase can be used as algo argument
//=======================================================================
-static bool isAcceptableBase(const TopoDS_Shape& theBase)
+static bool isAcceptableBase( const TopoDS_Shape& theBase )
{
switch ( theBase.ShapeType() ) {
case TopAbs_VERTEX:
case TopAbs_COMPSOLID:
return false;
case TopAbs_COMPOUND: {
- TopExp_Explorer exp( theBase, TopAbs_SOLID);
+ TopExp_Explorer exp( theBase, TopAbs_SOLID );
return !exp.More();
}
default:
void GenerationGUI_RevolDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText("");
+ myEditCurrentArgument->setText( "" );
- if(IObjectCount() != 1) {
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
+ if ( IObjectCount() != 1 ) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myOkBase = false;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
myOkAxis = false;
return;
}
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
- if (!testResult)
+ if ( !testResult )
return;
- if(myEditCurrentArgument == GroupPoints->LineEdit1) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
TopoDS_Shape S;
myOkBase = false;
myBase = aSelectedObject;
myOkBase = true;
}
- else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
myAxis = aSelectedObject;
myOkAxis = true;
}
QPushButton* send = (QPushButton*)sender();
globalSelection( GEOM_ALLSHAPES );
- if(send == GroupPoints->PushButton1) {
+ if ( send == GroupPoints->PushButton1 ) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
}
- else if(send == GroupPoints->PushButton2) {
+ else if ( send == GroupPoints->PushButton2 ) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_LINE );
void GenerationGUI_RevolDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
{
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument() ) );
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
displayPreview();
// function : enterEvent()
// purpose :
//=================================================================================
-void GenerationGUI_RevolDlg::enterEvent(QEvent* e)
+void GenerationGUI_RevolDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
//=================================================================================
double GenerationGUI_RevolDlg::getAngle() const
{
- return GroupPoints->SpinBox_DX->GetValue();
+ return GroupPoints->SpinBox_DX->value();
}
//=================================================================================
//=================================================================================
void GenerationGUI_RevolDlg::onReverse()
{
- double anOldValue = GroupPoints->SpinBox_DX->GetValue();
- GroupPoints->SpinBox_DX->SetValue( -anOldValue );
+ double anOldValue = GroupPoints->SpinBox_DX->value();
+ GroupPoints->SpinBox_DX->setValue( -anOldValue );
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : GenerationGUI_RevolDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : GenerationGUI_RevolDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-
-#ifndef DIALOGBOX_REVOLUTION_H
-#define DIALOGBOX_REVOLUTION_H
-#include "GenerationGUI.h"
+#ifndef GENERATIONGUI_REVOLUTIONDLG_H
+#define GENERATIONGUI_REVOLUTIONDLG_H
-#include "GEOMBase_Skeleton.h"
+#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel1Spin2Check;
// class : GenerationGUI_RevolDlg
// purpose :
//=================================================================================
-class GENERATIONGUI_EXPORT GenerationGUI_RevolDlg : public GEOMBase_Skeleton
+class GenerationGUI_RevolDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~GenerationGUI_RevolDlg();
+ GenerationGUI_RevolDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~GenerationGUI_RevolDlg();
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& msg );
- virtual bool execute( ObjectList& objects );
-
-private :
- void Init();
- void enterEvent(QEvent* e);
- double getAngle() const;
-
- GEOM::GEOM_Object_var myBase; /* Base shape */
- GEOM::GEOM_Object_var myAxis; /* Axis of the revolution */
- bool myOkBase;
- bool myOkAxis;
-
- DlgRef_2Sel1Spin2Check* GroupPoints;
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+private:
+ void Init();
+ void enterEvent( QEvent* );
+ double getAngle() const;
+
+private:
+ GEOM::GEOM_Object_var myBase; /* Base shape */
+ GEOM::GEOM_Object_var myAxis; /* Axis of the revolution */
+ bool myOkBase;
+ bool myOkAxis;
+
+ DlgRef_2Sel1Spin2Check* GroupPoints;
+
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ValueChangedInSpinBox();
- void onReverse();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ValueChangedInSpinBox();
+ void onReverse();
};
-#endif // DIALOGBOX_REVOLUTION_H
+#endif // GENERATIONGUI_REVOLUTIONDLG_H
-# GEOM GENERATIONGUI :
+# GEOM GENERATIONGUI :
#
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# 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
#
+# File : Makefile.am
+# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
+# Package : GenerationGUI
#
-#
-# File : Makefile.in
-# Author : Damien COQUERET (OCC)
-# Modified by : Alexander BORODIN (OCN) - autotools usage
-# Module : GEOM
-# $Header:
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files
salomeinclude_HEADERS =
-dist_libGenerationGUI_la_SOURCES = \
- GenerationGUI.cxx \
- GenerationGUI_PrismDlg.cxx \
- GenerationGUI_RevolDlg.cxx \
- GenerationGUI_FillingDlg.cxx \
+dist_libGenerationGUI_la_SOURCES = \
+ GenerationGUI.h \
+ GenerationGUI_PrismDlg.h \
+ GenerationGUI_RevolDlg.h \
+ GenerationGUI_FillingDlg.h \
+ GenerationGUI_PipeDlg.h \
+ \
+ GenerationGUI.cxx \
+ GenerationGUI_PrismDlg.cxx \
+ GenerationGUI_RevolDlg.cxx \
+ GenerationGUI_FillingDlg.cxx \
GenerationGUI_PipeDlg.cxx
-MOC_FILES = \
- GenerationGUI_PrismDlg_moc.cxx \
- GenerationGUI_RevolDlg_moc.cxx \
- GenerationGUI_FillingDlg_moc.cxx \
+MOC_FILES = \
+ GenerationGUI_PrismDlg_moc.cxx \
+ GenerationGUI_RevolDlg_moc.cxx \
+ GenerationGUI_FillingDlg_moc.cxx \
GenerationGUI_PipeDlg_moc.cxx
-nodist_libGenerationGUI_la_SOURCES= \
+nodist_libGenerationGUI_la_SOURCES = \
$(MOC_FILES)
#LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
# additionnal information to compil and link file
-libGenerationGUI_la_CPPFLAGS = \
- $(QT_INCLUDES) \
- $(VTK_INCLUDES) \
- $(CAS_CPPFLAGS) \
- $(PYTHON_INCLUDES) \
- $(BOOST_CPPFLAGS) \
- $(KERNEL_CXXFLAGS) \
- $(GUI_CXXFLAGS) \
- $(CORBA_CXXFLAGS) \
- $(CORBA_INCLUDES) \
- -I$(srcdir)/../GEOMGUI \
- -I$(srcdir)/../DlgRef \
- -I$(srcdir)/../GEOMBase \
- -I$(srcdir)/../OBJECT \
- -I$(srcdir)/../GEOMClient \
- -I$(srcdir)/../GEOMImpl \
- -I$(srcdir)/../GEOMFiltersSelection \
- -I$(top_builddir)/idl \
+libGenerationGUI_la_CPPFLAGS = \
+ $(QT_INCLUDES) \
+ $(VTK_INCLUDES) \
+ $(CAS_CPPFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(BOOST_CPPFLAGS) \
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS) \
+ $(CORBA_CXXFLAGS) \
+ $(CORBA_INCLUDES) \
+ -I$(srcdir)/../GEOMGUI \
+ -I$(srcdir)/../DlgRef \
+ -I$(srcdir)/../GEOMBase \
+ -I$(srcdir)/../OBJECT \
+ -I$(srcdir)/../GEOMClient \
+ -I$(srcdir)/../GEOMImpl \
+ -I$(srcdir)/../GEOMFiltersSelection \
+ -I$(top_builddir)/src/DlgRef \
+ -I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
-libGenerationGUI_la_LDFLAGS = \
- ../GEOMFiltersSelection/libGEOMFiltersSelection.la \
- ../GEOMBase/libGEOMBase.la \
+libGenerationGUI_la_LDFLAGS = \
+ ../GEOMFiltersSelection/libGEOMFiltersSelection.la \
+ ../GEOMBase/libGEOMBase.la \
$(CAS_LDPATH) -lTKOffset
-# GEOM PRIMITIVEGUI :
-#
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# 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
#
+# File : Makefile.am
+# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
+# Package : PrimitiveGUI
#
-#
-# File : Makefile.in
-# Author : Damien COQUERET (OCC)
-# Modified by : Alexander BORODIN (OCN) - autotools usage
-# Module : GEOM
-# $Header:
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files
# Libraries targets
lib_LTLIBRARIES = libPrimitiveGUI.la
-dist_libPrimitiveGUI_la_SOURCES = \
- PrimitiveGUI.cxx \
- PrimitiveGUI_BoxDlg.cxx \
- PrimitiveGUI_CylinderDlg.cxx \
- PrimitiveGUI_SphereDlg.cxx \
- PrimitiveGUI_TorusDlg.cxx \
+dist_libPrimitiveGUI_la_SOURCES = \
+ PrimitiveGUI.h \
+ PrimitiveGUI_BoxDlg.h \
+ PrimitiveGUI_ConeDlg.h \
+ PrimitiveGUI_CylinderDlg.h \
+ PrimitiveGUI_SphereDlg.h \
+ PrimitiveGUI_TorusDlg.h \
+ \
+ PrimitiveGUI.cxx \
+ PrimitiveGUI_BoxDlg.cxx \
+ PrimitiveGUI_CylinderDlg.cxx \
+ PrimitiveGUI_SphereDlg.cxx \
+ PrimitiveGUI_TorusDlg.cxx \
PrimitiveGUI_ConeDlg.cxx
-MOC_FILES = \
- PrimitiveGUI_BoxDlg_moc.cxx \
- PrimitiveGUI_CylinderDlg_moc.cxx \
- PrimitiveGUI_SphereDlg_moc.cxx \
- PrimitiveGUI_TorusDlg_moc.cxx \
+MOC_FILES = \
+ PrimitiveGUI_BoxDlg_moc.cxx \
+ PrimitiveGUI_CylinderDlg_moc.cxx \
+ PrimitiveGUI_SphereDlg_moc.cxx \
+ PrimitiveGUI_TorusDlg_moc.cxx \
PrimitiveGUI_ConeDlg_moc.cxx
-nodist_libPrimitiveGUI_la_SOURCES= \
+nodist_libPrimitiveGUI_la_SOURCES = \
$(MOC_FILES)
#LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
# additionnal information to compil and link file
-libPrimitiveGUI_la_CPPFLAGS = \
- $(QT_INCLUDES) \
- $(VTK_INCLUDES) \
- $(CAS_CPPFLAGS) \
- $(PYTHON_INCLUDES) \
- $(BOOST_CPPFLAGS) \
- $(KERNEL_CXXFLAGS) \
- $(GUI_CXXFLAGS) \
- $(CORBA_CXXFLAGS) \
- $(CORBA_INCLUDES) \
- -I$(srcdir)/../GEOMGUI \
- -I$(srcdir)/../DlgRef \
- -I$(srcdir)/../GEOMBase \
- -I$(srcdir)/../OBJECT \
- -I$(srcdir)/../GEOMClient \
- -I$(srcdir)/../GEOMImpl \
- -I$(srcdir)/../GEOMFiltersSelection \
- -I$(top_builddir)/idl \
+libPrimitiveGUI_la_CPPFLAGS = \
+ $(QT_INCLUDES) \
+ $(VTK_INCLUDES) \
+ $(CAS_CPPFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(BOOST_CPPFLAGS) \
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS) \
+ $(CORBA_CXXFLAGS) \
+ $(CORBA_INCLUDES) \
+ -I$(srcdir)/../GEOMGUI \
+ -I$(srcdir)/../DlgRef \
+ -I$(srcdir)/../GEOMBase \
+ -I$(srcdir)/../OBJECT \
+ -I$(srcdir)/../GEOMClient \
+ -I$(srcdir)/../GEOMImpl \
+ -I$(srcdir)/../GEOMFiltersSelection \
+ -I$(top_builddir)/src/DlgRef \
+ -I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
-libPrimitiveGUI_la_LDFLAGS = \
- ../GEOMFiltersSelection/libGEOMFiltersSelection.la \
+libPrimitiveGUI_la_LDFLAGS = \
+ ../GEOMFiltersSelection/libGEOMFiltersSelection.la \
../GEOMBase/libGEOMBase.la
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI.cxx
+// Author : Damien COQUERET, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
#include "PrimitiveGUI.h"
-#include "GeometryGUI.h"
-#include "SUIT_Desktop.h"
+#include <GeometryGUI.h>
-#include "SalomeApp_Application.h"
+#include <SUIT_Desktop.h>
+#include <SalomeApp_Application.h>
#include "PrimitiveGUI_BoxDlg.h" // Method BOX
#include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
-using namespace std;
-
//=======================================================================
// function : PrimitiveGUI()
// purpose : Constructor
//=======================================================================
-PrimitiveGUI::PrimitiveGUI(GeometryGUI* parent) : GEOMGUI(parent)
+PrimitiveGUI::PrimitiveGUI( GeometryGUI* parent ) : GEOMGUI( parent )
{
}
{
}
-
//=======================================================================
// function : OnGUIEvent()
// purpose :
//=======================================================================
-bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
+bool PrimitiveGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
- if (!app) return false;
+ if ( !app ) return false;
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
- switch (theCommandID)
- {
- case 4021: // BOX
- aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, "");
- break;
- case 4022: // CYLINDER
- aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, "");
- break;
- case 4023: // SPHERE
- aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, "");
- break;
- case 4024: // TORUS
- aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, "");
- break;
- case 4025: // CONE
- aDlg = new PrimitiveGUI_ConeDlg(getGeometryGUI(), parent, "");
- break;
- default:
- app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
- break;
- }
+ switch ( theCommandID ) {
+ case 4021: // BOX
+ aDlg = new PrimitiveGUI_BoxDlg( getGeometryGUI(), parent );
+ break;
+ case 4022: // CYLINDER
+ aDlg = new PrimitiveGUI_CylinderDlg( getGeometryGUI(), parent );
+ break;
+ case 4023: // SPHERE
+ aDlg = new PrimitiveGUI_SphereDlg( getGeometryGUI(), parent );
+ break;
+ case 4024: // TORUS
+ aDlg = new PrimitiveGUI_TorusDlg( getGeometryGUI(), parent );
+ break;
+ case 4025: // CONE
+ aDlg = new PrimitiveGUI_ConeDlg( getGeometryGUI(), parent, "" );
+ break;
+ default:
+ app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
+ break;
+ }
- if (aDlg != NULL)
+ if ( aDlg != NULL )
aDlg->show();
return true;
}
-
//=====================================================================================
// EXPORTED METHODS
//=====================================================================================
extern "C"
{
-#ifdef WNT
- __declspec( dllexport )
+#ifdef WIN32
+ __declspec( dllexport )
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI.h
+// Author : Damien COQUERET, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI.h
-// Author : Damien COQUERET
-// Module : GEOM
#ifndef PRIMITIVEGUI_H
#define PRIMITIVEGUI_H
-#include "GEOMGUI.h"
-
+#include <GEOMGUI.h>
//=================================================================================
// class : PrimitiveGUI
class PrimitiveGUI : public GEOMGUI
{
public:
- PrimitiveGUI(GeometryGUI* parent);
+ PrimitiveGUI( GeometryGUI* );
~PrimitiveGUI();
- bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
+ bool OnGUIEvent( int, SUIT_Desktop* );
};
#endif
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_BoxDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_BoxDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "PrimitiveGUI_BoxDlg.h"
-#include "DlgRef_3Spin.h"
-#include "DlgRef_SpinBox.h"
-
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
-#include "GEOMImpl_Types.hxx"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-using namespace std;
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_BoxDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BOX_2P" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BOX_DXYZ" ) ));
+ QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_BOX_TITLE"));
+ setWindowTitle( tr( "GEOM_BOX_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_BOX"));
- RadioButton1->setIcon(image0);
- RadioButton2->setIcon(image1);
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new Ui::DlgRef_2Sel_QTD();
- QWidget* aGroupPointsWidget = new QWidget(this);
- GroupPoints->setupUi(aGroupPointsWidget);
- aGroupPointsWidget->setObjectName("GroupPoints");
-
- GroupPoints->GroupBox1->setTitle(tr("GEOM_DIAGONAL_POINTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
- GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
- GroupPoints->PushButton1->setIcon(image2);
- GroupPoints->PushButton2->setIcon(image2);
-
- GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions");
- GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
- GroupDimensions->TextLabel1->setText(tr("GEOM_DX"));
- GroupDimensions->TextLabel2->setText(tr("GEOM_DY"));
- GroupDimensions->TextLabel3->setText(tr("GEOM_DZ"));
-
- gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
- gridLayout1->addWidget(GroupDimensions, 2, 0);
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BOX" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setIcon( image1 );
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_2Sel( centralWidget() );
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_DIAGONAL_POINTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
+ GroupPoints->PushButton1->setIcon( image2 );
+ GroupPoints->PushButton2->setIcon( image2 );
+
+ GroupDimensions = new DlgRef_3Spin( centralWidget() );
+ GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
+ GroupDimensions->TextLabel1->setText( tr( "GEOM_DX" ) );
+ GroupDimensions->TextLabel2->setText( tr( "GEOM_DY" ) );
+ GroupDimensions->TextLabel3->setText( tr( "GEOM_DZ" ) );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
+ layout->addWidget( GroupDimensions );
/***************************************************************/
- setHelpFileName("box.htm");
+ setHelpFileName( "box.htm" );
Init();
}
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
+ 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);
+ initSpinBox( GroupDimensions->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
double initValue = 200.0;
- GroupDimensions->SpinBox_DX->SetValue(initValue);
- GroupDimensions->SpinBox_DY->SetValue(initValue);
- GroupDimensions->SpinBox_DZ->SetValue(initValue);
+ GroupDimensions->SpinBox_DX->setValue( initValue );
+ GroupDimensions->SpinBox_DY->setValue( initValue );
+ GroupDimensions->SpinBox_DZ->setValue( initValue );
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
+ connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
+ // VSR: TODO ->>
+ connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
+ connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DY, SLOT( SetStep( double ) ) );
+ connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DZ, SLOT( SetStep( double ) ) );
+ // <<-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName( tr( "GEOM_BOX" ).toLatin1().constData() );
- ConstructorsClicked(0);
+ initName( tr( "GEOM_BOX" ) );
+
+ ConstructorsClicked( 0 );
}
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
-void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
+void PrimitiveGUI_BoxDlg::ConstructorsClicked( int constructorId )
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+ disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ) )->selectionMgr(), 0, this, 0 );
- switch (constructorId)
+ switch ( constructorId ) {
+ case 0:
{
- case 0:
- {
- globalSelection( GEOM_POINT );
-
- GroupDimensions->hide();
- resize(0, 0);
- ::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->show();
-
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setText("");
- GroupPoints->LineEdit2->setText("");
- myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- break;
- }
- case 1:
- {
- ::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->hide();
- resize(0, 0);
- GroupDimensions->show();
-
- break;
- }
+ globalSelection( GEOM_POINT );
+
+ GroupDimensions->hide();
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText( "" );
+ GroupPoints->LineEdit2->setText( "" );
+ myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
+
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ break;
+ }
+ case 1:
+ {
+ GroupPoints->hide();
+ GroupDimensions->show();
+ break;
}
+ }
+
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
+
displayPreview();
}
if ( getConstructorId() != 0 )
return;
- myEditCurrentArgument->setText("");
+ myEditCurrentArgument->setText( "" );
- if (IObjectCount() != 1)
- {
- if (myEditCurrentArgument == GroupPoints->LineEdit1)
- myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2)
- myPoint2 = GEOM::GEOM_Object::_nil();
- return;
- }
+ if ( IObjectCount() != 1 ) {
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ myPoint1 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ myPoint2 = GEOM::GEOM_Object::_nil();
+ return;
+ }
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
+ 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 )
myPoint1 = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
myPoint2 = aSelectedObject;
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
{
QPushButton* send = (QPushButton*)sender();
- if(send == GroupPoints->PushButton1)
+ if ( send == GroupPoints->PushButton1 )
myEditCurrentArgument = GroupPoints->LineEdit1;
- else if(send == GroupPoints->PushButton2)
+ else if ( send == GroupPoints->PushButton2 )
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_POINT );
void PrimitiveGUI_BoxDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
void PrimitiveGUI_BoxDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// function : enterEvent [REDEFINED]
// purpose :
//=================================================================================
-void PrimitiveGUI_BoxDlg::enterEvent(QEvent* e)
+void PrimitiveGUI_BoxDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
//=================================================================================
bool PrimitiveGUI_BoxDlg::isValid( QString& msg )
{
- return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : true;
+ return getConstructorId() == 0 ? !( myPoint1->_is_nil() || myPoint2->_is_nil() ) : true;
}
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
+ switch ( getConstructorId() ) {
case 0 :
{
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) ) {
}
case 1 :
{
- double x = GroupDimensions->SpinBox_DX->GetValue();
- double y = GroupDimensions->SpinBox_DY->GetValue();
- double z = GroupDimensions->SpinBox_DZ->GetValue();
+ double x = GroupDimensions->SpinBox_DX->value();
+ double y = GroupDimensions->SpinBox_DY->value();
+ double z = GroupDimensions->SpinBox_DZ->value();
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeBoxDXDYDZ( x, y, z );
res = true;
// function : closeEvent
// purpose :
//=================================================================================
-void PrimitiveGUI_BoxDlg::closeEvent( QCloseEvent* e )
+void PrimitiveGUI_BoxDlg::closeEvent( QCloseEvent* e )
{
GEOMBase_Skeleton::closeEvent( e );
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_BoxDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_BoxDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-
-#ifndef DIALOGBOX_BOX_H
-#define DIALOGBOX_BOX_H
-#include "GEOMBase_Skeleton.h"
-#include "DlgRef_2Sel_QTD.h"
+#ifndef PRIMITIVEGUI_BOXDLG_H
+#define PRIMITIVEGUI_BOXDLG_H
-using namespace std;
+#include <GEOMBase_Skeleton.h>
+class DlgRef_2Sel;
class DlgRef_3Spin;
//=================================================================================
//=================================================================================
class PrimitiveGUI_BoxDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~PrimitiveGUI_BoxDlg();
-
+ PrimitiveGUI_BoxDlg( GeometryGUI*, QWidget* = 0, bool modal = false, Qt::WindowFlags = 0 );
+ ~PrimitiveGUI_BoxDlg();
+
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& );
- virtual bool execute( ObjectList& objects );
-
- virtual void closeEvent( QCloseEvent* e );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+
+ virtual void closeEvent( QCloseEvent* );
-private :
- void Init();
- void enterEvent(QEvent* e);
+private:
+ void Init();
+ void enterEvent( QEvent* );
- GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */
-
- Ui::DlgRef_2Sel_QTD* GroupPoints;
- DlgRef_3Spin* GroupDimensions;
+private:
+ GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */
+
+ DlgRef_2Sel* GroupPoints;
+ DlgRef_3Spin* GroupDimensions;
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int);
- void ValueChangedInSpinBox();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked( int );
+ void ValueChangedInSpinBox();
};
-#endif // DIALOGBOX_BOX_H
+#endif // PRIMITIVEGUI_BOXDLG_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_ConeDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_ConeDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "PrimitiveGUI_ConeDlg.h"
-#include "DlgRef_2Sel3Spin.h"
-#include "DlgRef_3Spin.h"
-#include "DlgRef_SpinBox.h"
-
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "GEOMImpl_Types.hxx"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-using namespace std;
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_ConeDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_PV")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_DXYZ")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CONE_PV" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CONE_DXYZ" ) ) );
+ QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_CONE_TITLE"));
+ setWindowTitle( tr( "GEOM_CONE_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_CONE"));
- RadioButton1->setIcon(image0);
- RadioButton2->setIcon(image1);
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new DlgRef_2Sel3Spin(this, "GroupPoints");
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
- GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
- GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1"));
- GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2"));
- GroupPoints->TextLabel5->setText(tr("GEOM_HEIGHT"));
- GroupPoints->PushButton1->setIcon(image2);
- GroupPoints->PushButton2->setIcon(image2);
-
- GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions");
- GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
- GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1"));
- GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2"));
- GroupDimensions->TextLabel3->setText(tr("GEOM_HEIGHT"));
-
- gridLayout1->addWidget(GroupPoints, 2, 0);
- gridLayout1->addWidget(GroupDimensions, 2, 0);
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_CONE" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setIcon( image1 );
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_2Sel3Spin( centralWidget() );
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
+ GroupPoints->TextLabel3->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
+ GroupPoints->TextLabel4->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
+ GroupPoints->TextLabel5->setText( tr( "GEOM_HEIGHT" ) );
+ GroupPoints->PushButton1->setIcon( image2 );
+ GroupPoints->PushButton2->setIcon( image2 );
+
+ GroupDimensions = new DlgRef_3Spin( centralWidget() );
+ GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
+ GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
+ GroupDimensions->TextLabel2->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
+ GroupDimensions->TextLabel3->setText( tr( "GEOM_HEIGHT" ) );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
+ layout->addWidget( GroupDimensions );
/***************************************************************/
setHelpFileName( "cone.htm" );
//=================================================================================
PrimitiveGUI_ConeDlg::~PrimitiveGUI_ConeDlg()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, Qt does it all for us
}
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
+ 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);
-
- double aRadius1(100.0), aRadius2(0.0), aHeight(300.0);
- GroupPoints->SpinBox_DX->SetValue(aRadius1);
- GroupPoints->SpinBox_DY->SetValue(aRadius2);
- GroupPoints->SpinBox_DZ->SetValue(aHeight);
- GroupDimensions->SpinBox_DX->SetValue(aRadius1);
- GroupDimensions->SpinBox_DY->SetValue(aRadius2);
- GroupDimensions->SpinBox_DZ->SetValue(aHeight);
+ initSpinBox( GroupPoints->SpinBox_DX, 0.000, COORD_MAX, step, 3 );
+ initSpinBox( GroupPoints->SpinBox_DY, 0.000, COORD_MAX, step, 3 );
+ initSpinBox( GroupPoints->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DX, 0.000, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DY, 0.000, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
+
+ double aRadius1( 100.0 ), aRadius2( 0.0 ), aHeight( 300.0 );
+ GroupPoints->SpinBox_DX->setValue( aRadius1 );
+ GroupPoints->SpinBox_DY->setValue( aRadius2 );
+ GroupPoints->SpinBox_DZ->setValue( aHeight );
+ GroupDimensions->SpinBox_DX->setValue( aRadius1 );
+ GroupDimensions->SpinBox_DY->setValue( aRadius2 );
+ GroupDimensions->SpinBox_DZ->setValue( aHeight );
/* 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(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
- connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DZ, 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)), GroupPoints->SpinBox_DZ, 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, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
+ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
+
+ connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
+
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+
+ connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupPoints->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupPoints->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+
+ // VSR: TODO ->>
+ 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 ) ), GroupPoints->SpinBox_DZ, 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, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DZ, SLOT( SetStep( double ) ) );
+ // <<-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName( tr( "GEOM_CONE" ).toLatin1().constData() );
- ConstructorsClicked(0);
+ initName( tr( "GEOM_CONE" ) );
+
+ ConstructorsClicked( 0 );
}
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
-void PrimitiveGUI_ConeDlg::ConstructorsClicked(int constructorId)
+void PrimitiveGUI_ConeDlg::ConstructorsClicked( int constructorId )
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+ disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
- switch(constructorId)
+ switch( constructorId ) {
+ case 0 :
+ {
+ globalSelection( GEOM_POINT );
+ GroupDimensions->hide();
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText( "" );
+ GroupPoints->LineEdit2->setText( "" );
+ myPoint = myDir = GEOM::GEOM_Object::_nil();
+
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ break;
+ }
+ case 1 :
{
- 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(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- break;
- }
- case 1 :
- {
- GroupPoints->hide();
- resize( 0, 0 );
- GroupDimensions->show();
-
- break;
- }
+ GroupPoints->hide();
+ GroupDimensions->show();
+
+ break;
}
+ }
+
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
+
displayPreview();
}
}
-//=======================================================================
-// function : ClickOnCancel()
-// purpose :
-//=======================================================================
-void PrimitiveGUI_ConeDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
if ( getConstructorId() != 0 )
return;
- 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;
{
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 );
}
void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
void PrimitiveGUI_ConeDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// function : enterEvent()
// purpose :
//=================================================================================
-void PrimitiveGUI_ConeDlg::enterEvent(QEvent* e)
+void PrimitiveGUI_ConeDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
+ switch ( getConstructorId() ) {
case 0 :
- {
- if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) ){
+ if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) ) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConePntVecR1R2H( myPoint,
myDir,
getRadius1(),
getRadius2(),
- getHeight());
+ getHeight() );
res = true;
}
break;
- }
case 1 :
- {
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConeR1R2H( getRadius1(),
- getRadius2(),
- getHeight());
- res = true;
- break;
- }
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConeR1R2H( getRadius1(),
+ getRadius2(),
+ getHeight() );
+ res = true;
+ break;
}
if ( !anObj->_is_nil() )
double PrimitiveGUI_ConeDlg::getRadius1() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DX->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DX->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DX->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DX->value();
return 0;
}
double PrimitiveGUI_ConeDlg::getRadius2() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DY->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DY->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DY->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DY->value();
return 0;
}
double PrimitiveGUI_ConeDlg::getHeight() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DZ->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DZ->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DZ->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DZ->value();
return 0;
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_ConeDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_ConeDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-#ifndef DIALOGBOX_CONE_H
-#define DIALOGBOX_CONE_H
+#ifndef PRIMITIVEGUI_CONEDLG_H
+#define PRIMITIVEGUI_CONEDLG_H
-#include "GEOMBase_Skeleton.h"
+#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel3Spin;
class DlgRef_3Spin;
//=================================================================================
class PrimitiveGUI_ConeDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~PrimitiveGUI_ConeDlg();
-
+ PrimitiveGUI_ConeDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~PrimitiveGUI_ConeDlg();
+
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& );
- virtual bool execute( ObjectList& objects );
-
- virtual void closeEvent( QCloseEvent* e );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+
+ virtual void closeEvent( QCloseEvent* );
private:
- void Init();
- void enterEvent(QEvent* e);
- double getRadius1() const;
- double getRadius2() const;
- double getHeight() const;
+ void Init();
+ void enterEvent( QEvent* );
+ double getRadius1() const;
+ double getRadius2() const;
+ double getHeight() const;
- GEOM::GEOM_Object_var myPoint, myDir;
-
- DlgRef_2Sel3Spin* GroupPoints;
- DlgRef_3Spin* GroupDimensions;
+private:
+ GEOM::GEOM_Object_var myPoint, myDir;
+
+ DlgRef_2Sel3Spin* GroupPoints;
+ DlgRef_3Spin* GroupDimensions;
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void ActivateThisDialog();
- void DeactivateActiveDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int);
- void ValueChangedInSpinBox();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void DeactivateActiveDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked( int );
+ void ValueChangedInSpinBox();
};
-#endif // DIALOGBOX_CONE_H
+#endif // PRIMITIVEGUI_CONEDLG_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_CylinderDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_CylinderDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "PrimitiveGUI_CylinderDlg.h"
-#include "DlgRef_2Sel2Spin.h"
-#include "DlgRef_2Spin.h"
-#include "DlgRef_SpinBox.h"
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
+#include <GEOM_DlgRef.h>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "GEOMImpl_Types.hxx"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-using namespace std;
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_CylinderDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_PV")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_DXYZ")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CYLINDER_PV" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CYLINDER_DXYZ" ) ) );
+ QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_CYLINDER_TITLE"));
+ setWindowTitle( tr( "GEOM_CYLINDER_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_CYLINDER"));
- RadioButton1->setIcon(image0);
- RadioButton2->setIcon(image1);
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
- GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
- GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
- GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT"));
- GroupPoints->PushButton1->setIcon(image2);
- GroupPoints->PushButton2->setIcon(image2);
-
- GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions");
- GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
- GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
- GroupDimensions->TextLabel2->setText(tr("GEOM_HEIGHT"));
-
- gridLayout1->addWidget(GroupPoints, 2, 0);
- gridLayout1->addWidget(GroupDimensions, 2, 0);
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_CYLINDER" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setIcon( image1 );
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_2Sel2Spin( centralWidget() );
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
+ GroupPoints->TextLabel3->setText( tr( "GEOM_RADIUS" ) );
+ GroupPoints->TextLabel4->setText( tr( "GEOM_HEIGHT" ) );
+ GroupPoints->PushButton1->setIcon( image2 );
+ GroupPoints->PushButton2->setIcon( image2 );
+
+ GroupDimensions = new DlgRef_2Spin( centralWidget() );
+ GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
+ GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
+ GroupDimensions->TextLabel2->setText( tr( "GEOM_HEIGHT" ) );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
+ layout->addWidget( GroupDimensions );
/***************************************************************/
- setHelpFileName("cylinder.htm");
+ setHelpFileName( "cylinder.htm" );
Init();
}
//=================================================================================
PrimitiveGUI_CylinderDlg::~PrimitiveGUI_CylinderDlg()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, Qt does it all for us
}
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
+ double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
/* min, max, step and decimals for spin boxes & initial values */
/* First constructor : radius */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
/* First constructor : algebric height */
- GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ initSpinBox( GroupPoints->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
/* Second constructor : radius */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
/* Second constructor : algebric height */
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ initSpinBox( GroupDimensions->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
- GroupPoints->SpinBox_DX->SetValue(100.0);
- GroupPoints->SpinBox_DY->SetValue(300.0);
- GroupDimensions->SpinBox_DX->SetValue(100.0);
- GroupDimensions->SpinBox_DY->SetValue(300.0);
+ GroupPoints->SpinBox_DX->setValue( 100.0 );
+ GroupPoints->SpinBox_DY->setValue( 300.0 );
+ GroupDimensions->SpinBox_DX->setValue( 100.0 );
+ GroupDimensions->SpinBox_DY->setValue( 300.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( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
+
+ connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect( GroupPoints->SpinBox_DX, SIGNAL(valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupPoints->SpinBox_DY, SIGNAL(valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ 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)));
+ // VSR: TODO ->>
+ 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( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName( tr( "GEOM_CYLINDER" ).toLatin1().constData() );
- ConstructorsClicked(0);
+ initName( tr( "GEOM_CYLINDER" ) );
+ ConstructorsClicked( 0 );
}
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
-void PrimitiveGUI_CylinderDlg::ConstructorsClicked(int constructorId)
+void PrimitiveGUI_CylinderDlg::ConstructorsClicked( int constructorId )
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+ disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
- switch(constructorId)
+ switch( constructorId ) {
+ case 0 :
+ {
+ globalSelection( GEOM_POINT );
+
+ GroupDimensions->hide();
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText( "" );
+ GroupPoints->LineEdit2->setText( "" );
+ myPoint = myDir = GEOM::GEOM_Object::_nil();
+
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ break;
+ }
+ case 1 :
{
- 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(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- break;
- }
- case 1 :
- {
- GroupPoints->hide();
- resize( 0, 0 );
- GroupDimensions->show();
-
- break;
- }
+ GroupPoints->hide();
+ GroupDimensions->show();
+ break;
}
+ }
+
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
+
displayPreview();
}
}
-//=======================================================================
-// function : ClickOnCancel()
-// purpose :
-//=======================================================================
-void PrimitiveGUI_CylinderDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
if ( getConstructorId() != 0 )
return;
- myEditCurrentArgument->setText("");
+ 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 ) );
{
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 );
}
void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
void PrimitiveGUI_CylinderDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// function : enterEvent()
// purpose :
//=================================================================================
-void PrimitiveGUI_CylinderDlg::enterEvent(QEvent* e)
+void PrimitiveGUI_CylinderDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
// function : execute
// purpose :
//=================================================================================
-bool PrimitiveGUI_CylinderDlg::execute( ObjectList& objects )
+bool PrimitiveGUI_CylinderDlg::execute( ObjectList& objects )
{
bool res = false;
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
- case 0 :
- {
- if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )) {
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
- res = true;
- }
- break;
- }
- case 1 :
- {
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderRH(getRadius(), getHeight());
- res = true;
-
- break;
- }
+ switch ( getConstructorId() ) {
+ case 0 :
+ if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) ) {
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderPntVecRH( myPoint, myDir, getRadius(), getHeight() );
+ res = true;
}
+ break;
+ case 1 :
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderRH( getRadius(), getHeight() );
+ res = true;
+
+ break;
+ }
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
double PrimitiveGUI_CylinderDlg::getRadius() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DX->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DX->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DX->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DX->value();
return 0;
}
double PrimitiveGUI_CylinderDlg::getHeight() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DY->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DY->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DY->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DY->value();
return 0;
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_CylinderDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_CylinderDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-#ifndef DIALOGBOX_CYLINDER_H
-#define DIALOGBOX_CYLINDER_H
+#ifndef PRIMITIVEGUI_CYLINDERDLG_H
+#define PRIMITIVEGUI_CYLINDERDLG_H
-#include "GEOMBase_Skeleton.h"
+#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel2Spin;
class DlgRef_2Spin;
-
//=================================================================================
// class : PrimitiveGUI_CylinderDlg
// purpose :
//=================================================================================
class PrimitiveGUI_CylinderDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~PrimitiveGUI_CylinderDlg();
+ PrimitiveGUI_CylinderDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~PrimitiveGUI_CylinderDlg();
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& );
- virtual bool execute( ObjectList& objects );
-
- virtual void closeEvent( QCloseEvent* e );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+
+ virtual void closeEvent( QCloseEvent* );
private:
- void Init();
- void enterEvent(QEvent* e);
- double getRadius() const;
- double getHeight() const;
-
- GEOM::GEOM_Object_var myPoint, myDir;
-
- DlgRef_2Sel2Spin* GroupPoints;
- DlgRef_2Spin* GroupDimensions;
+ void Init();
+ void enterEvent( QEvent* );
+ double getRadius() const;
+ double getHeight() const;
+
+private:
+ GEOM::GEOM_Object_var myPoint, myDir;
+
+ DlgRef_2Sel2Spin* GroupPoints;
+ DlgRef_2Spin* GroupDimensions;
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void ActivateThisDialog();
- void DeactivateActiveDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int);
- void ValueChangedInSpinBox();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void DeactivateActiveDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked( int );
+ void ValueChangedInSpinBox();
};
-#endif // DIALOGBOX_CYLINDER_H
+#endif // PRIMITIVEGUI_CYLINDERDLG_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_SphereDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_SphereDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "PrimitiveGUI_SphereDlg.h"
-#include "DlgRef_1Sel1Spin.h"
-#include "DlgRef_1Spin.h"
-#include "DlgRef_SpinBox.h"
-
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "GEOMImpl_Types.hxx"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-using namespace std;
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_SphereDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
- const char* name, bool modal, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ :GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl )
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_P")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_DXYZ")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPHERE_P" ) ) );
+ QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPHERE_DXYZ" ) ) );
+ QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
- setWindowTitle(tr("GEOM_SPHERE_TITLE"));
+ setWindowTitle( tr( "GEOM_SPHERE_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_SPHERE"));
- RadioButton1->setIcon(image0);
- RadioButton2->setIcon(image1);
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new DlgRef_1Sel1Spin(this, "GroupPoints");
- GroupPoints->GroupBox1->setTitle(tr("GEOM_SPHERE_CR"));
- GroupPoints->TextLabel1->setText(tr("GEOM_CENTER"));
- GroupPoints->TextLabel2->setText(tr("GEOM_RADIUS"));
- GroupPoints->PushButton1->setIcon(image2);
-
- GroupDimensions = new DlgRef_1Spin(this, "GroupDimensions");
- GroupDimensions->GroupBox1->setTitle(tr("GEOM_SPHERE_RO"));
- GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
-
- gridLayout1->addWidget(GroupPoints, 2, 0);
- gridLayout1->addWidget(GroupDimensions, 2, 0);
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_SPHERE" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setIcon( image1 );
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_1Sel1Spin( centralWidget() );
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_SPHERE_CR" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_CENTER" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_RADIUS" ) );
+ GroupPoints->PushButton1->setIcon( image2 );
+
+ GroupDimensions = new DlgRef_1Spin( centralWidget() );
+ GroupDimensions->GroupBox1->setTitle( tr( "GEOM_SPHERE_RO" ) );
+ GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
+ layout->addWidget( GroupDimensions );
/***************************************************************/
- setHelpFileName("sphere.htm");
+ setHelpFileName( "sphere.htm" );
Init();
}
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
+ 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->SetValue(100.0);
- GroupDimensions->SpinBox_DX->SetValue(100.0);
+ initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
+ GroupPoints->SpinBox_DX->setValue( 100.0 );
+ GroupDimensions->SpinBox_DX->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( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
+
+ connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
+
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
- connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ // VSR: TODO ->>
+ connect(myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
+ connect(myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
+ // <<-
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ initName( tr( "GEOM_SPHERE" ) );
- initName(tr("GEOM_SPHERE").toLatin1().constData());
- ConstructorsClicked(0);
+ ConstructorsClicked( 0 );
}
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
-void PrimitiveGUI_SphereDlg::ConstructorsClicked(int constructorId)
+void PrimitiveGUI_SphereDlg::ConstructorsClicked( int constructorId )
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+ disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
- switch (constructorId)
+ switch ( constructorId ) {
+ case 0:
{
- case 0:
- {
- globalSelection( GEOM_POINT );
- GroupDimensions->hide();
- resize(0, 0);
- GroupPoints->show();
-
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setText("");
- myPoint = 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;
- }
+ globalSelection( GEOM_POINT );
+ GroupDimensions->hide();
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText( "" );
+ myPoint = GEOM::GEOM_Object::_nil();
+
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ break;
+ }
+ case 1:
+ {
+ GroupPoints->hide();
+ GroupDimensions->show();
+
+ break;
}
+ }
+
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
+
displayPreview();
}
}
-
-//=======================================================================
-// function : ClickOnCancel()
-// purpose :
-//=======================================================================
-void PrimitiveGUI_SphereDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
if ( getConstructorId() != 0 )
return;
- myEditCurrentArgument->setText("");
+ myEditCurrentArgument->setText( "" );
- if(IObjectCount() != 1)
- {
- myPoint = GEOM::GEOM_Object::_nil();
- return;
- }
+ if ( IObjectCount() != 1 ) {
+ myPoint = GEOM::GEOM_Object::_nil();
+ return;
+ }
/* nbSel == 1 ! */
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
- if (!testResult || CORBA::is_nil( aSelectedObject ))
+ if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
myPoint = aSelectedObject;
void PrimitiveGUI_SphereDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
{
QPushButton* send = (QPushButton*)sender();
- if(send == GroupPoints->PushButton1) {
+ if ( send == GroupPoints->PushButton1 ) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_POINT );
void PrimitiveGUI_SphereDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// function : enterEvent()
// purpose :
//=================================================================================
-void PrimitiveGUI_SphereDlg::enterEvent(QEvent* e)
+void PrimitiveGUI_SphereDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
// function : execute
// purpose :
//=================================================================================
-bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
+bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
{
bool res = false;
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
+ switch ( getConstructorId() ) {
case 0 :
{
if ( !CORBA::is_nil( myPoint ) ) {
double PrimitiveGUI_SphereDlg::getRadius() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DX->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DX->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DX->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DX->value();
return 0;
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_SphereDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_SphereDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-#ifndef DIALOGBOX_SPHERE_H
-#define DIALOGBOX_SPHERE_H
+#ifndef PRIMITIVEGUI_SPHEREDLG_H
+#define PRIMITIVEGUI_SPHEREDLG_H
-#include "GEOMBase_Skeleton.h"
+#include <GEOMBase_Skeleton.h>
class DlgRef_1Sel1Spin;
class DlgRef_1Spin;
-
//=================================================================================
// class : PrimitiveGUI_SphereDlg
// purpose :
//=================================================================================
class PrimitiveGUI_SphereDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~PrimitiveGUI_SphereDlg();
+ PrimitiveGUI_SphereDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~PrimitiveGUI_SphereDlg();
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& );
- virtual bool execute( ObjectList& objects );
-
- virtual void closeEvent( QCloseEvent* e );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+
+ virtual void closeEvent( QCloseEvent* );
private:
- void Init();
- void enterEvent(QEvent* e);
- double getRadius() const;
-
- GEOM::GEOM_Object_var myPoint; /* Center point */
-
- DlgRef_1Sel1Spin* GroupPoints;
- DlgRef_1Spin* GroupDimensions;
+ void Init();
+ void enterEvent( QEvent* );
+ double getRadius() const;
+
+private:
+ GEOM::GEOM_Object_var myPoint; /* Center point */
+
+ DlgRef_1Sel1Spin* GroupPoints;
+ DlgRef_1Spin* GroupDimensions;
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void ActivateThisDialog();
- void DeactivateActiveDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int);
- void ValueChangedInSpinBox();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void DeactivateActiveDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked( int );
+ void ValueChangedInSpinBox();
};
#endif // DIALOGBOX_SPHERE_H
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_TorusDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_TorusDlg.cxx
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-// $Header$
#include "PrimitiveGUI_TorusDlg.h"
-#include "DlgRef_2Sel2Spin.h"
-#include "DlgRef_2Spin.h"
-#include "DlgRef_SpinBox.h"
-
-#include "GeometryGUI.h"
-#include "GEOMBase.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <GEOM_DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
-#include "GEOMImpl_Types.hxx"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-using namespace std;
+#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
// 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, Qt::WindowFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
+ bool modal, Qt::WindowFlags fl )
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- 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")));
+ 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" ) ) );
- setWindowTitle(tr("GEOM_TORUS_TITLE"));
+ setWindowTitle( tr( "GEOM_TORUS_TITLE" ) );
/***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_TORUS"));
- RadioButton1->setIcon(image0);
- RadioButton2->setIcon(image1);
- RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- RadioButton3->close();
-
- GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
- GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
- GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
- GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1"));
- GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2"));
- GroupPoints->PushButton1->setIcon(image2);
- GroupPoints->PushButton2->setIcon(image2);
-
- GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions");
- GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
- GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1"));
- GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2"));
-
- gridLayout1->addWidget(GroupPoints, 2, 0);
- gridLayout1->addWidget(GroupDimensions, 2, 0);
+ mainFrame()->GroupConstructors->setTitle( tr( "GEOM_TORUS" ) );
+ mainFrame()->RadioButton1->setIcon( image0 );
+ mainFrame()->RadioButton2->setIcon( image1 );
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ GroupPoints = new DlgRef_2Sel2Spin( centralWidget() );
+ GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
+ GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
+ GroupPoints->TextLabel3->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
+ GroupPoints->TextLabel4->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
+ GroupPoints->PushButton1->setIcon( image2 );
+ GroupPoints->PushButton2->setIcon( image2 );
+
+ GroupDimensions = new DlgRef_2Spin( centralWidget() );
+ GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
+ GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
+ GroupDimensions->TextLabel2->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+ layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupPoints );
+ layout->addWidget( GroupDimensions );
/***************************************************************/
- setHelpFileName("turus.htm");
+ setHelpFileName( "turus.htm" );
Init();
}
//=================================================================================
PrimitiveGUI_TorusDlg::~PrimitiveGUI_TorusDlg()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, Qt does it all for us
}
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
+ 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);
+ initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
+ initSpinBox( GroupPoints->SpinBox_DY, 0.001, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
+ initSpinBox( GroupDimensions->SpinBox_DY, 0.001, COORD_MAX, step, 3 );
- GroupPoints->SpinBox_DX->SetValue(300.0);
- GroupPoints->SpinBox_DY->SetValue(100.0);
- GroupDimensions->SpinBox_DX->SetValue(300.0);
- GroupDimensions->SpinBox_DY->SetValue(100.0);
+ GroupPoints->SpinBox_DX->setValue( 300.0 );
+ GroupPoints->SpinBox_DY->setValue( 100.0 );
+ GroupDimensions->SpinBox_DX->setValue( 300.0 );
+ GroupDimensions->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( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
- connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+ connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
- 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( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupPoints->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+
+ // VSR: TODO ->>
+ 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( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- initName( tr( "GEOM_TORUS" ).toLatin1().constData() );
- ConstructorsClicked(0);
+ initName( tr( "GEOM_TORUS" ) );
+
+ ConstructorsClicked( 0 );
}
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
-void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
+void PrimitiveGUI_TorusDlg::ConstructorsClicked( int constructorId )
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
+ 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 ;
- }
+ switch( constructorId ) {
+ case 0 :
+ {
+ globalSelection( GEOM_LINE );
+
+ GroupDimensions->hide();
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText( "" );
+ GroupPoints->LineEdit2->setText( "" );
+ myPoint = myDir = GEOM::GEOM_Object::_nil();
+
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ break;
+ }
+ case 1:
+ {
+ GroupPoints->hide();
+ GroupDimensions->show();
+
+ break ;
}
+ }
+
+ qApp->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
+
displayPreview();
}
}
-//=======================================================================
-// 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;
- }
+ 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;
+ }
/* 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 ) );
{
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 );
}
void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if ( send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ) {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
void PrimitiveGUI_TorusDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
ConstructorsClicked( getConstructorId() );
}
// function : enterEvent()
// purpose :
//=================================================================================
-void PrimitiveGUI_TorusDlg::enterEvent(QEvent* e)
+void PrimitiveGUI_TorusDlg::enterEvent( QEvent* )
{
- if ( !GroupConstructors->isEnabled() )
+ if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
+ switch ( getConstructorId() ) {
case 0 :
- {
if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )){
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR( myPoint, myDir, getRadius1(), getRadius2() );
res = true;
}
break;
- }
case 1 :
- {
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR(getRadius1(), getRadius2());
- res = true;
- break;
- }
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR( getRadius1(), getRadius2() );
+ res = true;
+ break;
}
if ( !anObj->_is_nil() )
double PrimitiveGUI_TorusDlg::getRadius1() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DX->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DX->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DX->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DX->value();
return 0;
}
double PrimitiveGUI_TorusDlg::getRadius2() const
{
int aConstructorId = getConstructorId();
- if (aConstructorId == 0)
- return GroupPoints->SpinBox_DY->GetValue();
- else if (aConstructorId == 1)
- return GroupDimensions->SpinBox_DY->GetValue();
+ if ( aConstructorId == 0 )
+ return GroupPoints->SpinBox_DY->value();
+ else if ( aConstructorId == 1 )
+ return GroupDimensions->SpinBox_DY->value();
return 0;
}
-// GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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
//
+// File : PrimitiveGUI_TorusDlg.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : PrimitiveGUI_TorusDlg.h
-// Author : Lucien PIGNOLONI
-// Module : GEOM
-#ifndef DIALOGBOX_TORUS_H
-#define DIALOGBOX_TORUS_H
+#ifndef PRIMITIVEGUI_TORUSDLG_H
+#define PRIMITIVEGUI_TORUSDLG_H
-#include "GEOMBase_Skeleton.h"
+#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel2Spin;
class DlgRef_2Spin;
-
//=================================================================================
// class : PrimitiveGUI_TorusDlg
// purpose :
//=================================================================================
class PrimitiveGUI_TorusDlg : public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
- ~PrimitiveGUI_TorusDlg();
-
+ PrimitiveGUI_TorusDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+ ~PrimitiveGUI_TorusDlg();
+
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& );
- virtual bool execute( ObjectList& objects );
-
- virtual void closeEvent( QCloseEvent* e );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+
+ virtual void closeEvent( QCloseEvent* );
private:
- void Init();
- void enterEvent(QEvent* e);
- double getRadius1() const;
- double getRadius2() const;
-
- GEOM::GEOM_Object_var myPoint, myDir;
-
- DlgRef_2Sel2Spin* GroupPoints;
- DlgRef_2Spin* GroupDimensions;
-
- private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void ActivateThisDialog();
- void DeactivateActiveDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void ConstructorsClicked(int);
- void ValueChangedInSpinBox();
+ void Init();
+ void enterEvent( QEvent* );
+ double getRadius1() const;
+ double getRadius2() const;
+
+ GEOM::GEOM_Object_var myPoint, myDir;
+
+ DlgRef_2Sel2Spin* GroupPoints;
+ DlgRef_2Spin* GroupDimensions;
+
+private slots:
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void DeactivateActiveDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ConstructorsClicked( int );
+ void ValueChangedInSpinBox();
};
-#endif // DIALOGBOX_TORUS_H
+#endif // PRIMITIVEGUI_TORUSDLG_H