*** empty log message ***

This commit is contained in:
vsr 2007-10-16 14:15:43 +00:00
parent c764c1ebb4
commit 4e7b28499d
36 changed files with 1858 additions and 2004 deletions

View File

@ -45,7 +45,7 @@
//=================================================================================
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" ) ) );

View File

@ -46,7 +46,7 @@
//=================================================================================
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" ) ) );

View File

@ -47,7 +47,7 @@
//=================================================================================
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" ) ) );

View File

@ -45,7 +45,7 @@
//=================================================================================
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" ) ) );

View File

@ -45,7 +45,7 @@
//=================================================================================
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" ) ) );

View File

@ -56,7 +56,7 @@
// 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" ) ) );

View File

@ -48,7 +48,7 @@
//=================================================================================
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" ) ) );

View File

@ -58,7 +58,7 @@
//=================================================================================
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" ) ) );

View File

@ -45,7 +45,7 @@
//=================================================================================
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" ) ) );

View File

@ -57,7 +57,7 @@
//=================================================================================
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" ) ) );

View File

@ -50,17 +50,12 @@ using namespace std;
// 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 );

View File

@ -41,6 +41,8 @@ class QPushButton;
#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
@ -48,7 +50,7 @@ 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:

View File

@ -19,33 +19,28 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header$
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#include "GenerationGUI.h"
#include "GeometryGUI.h"
#include <GeometryGUI.h>
#include "SUIT_Desktop.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 )
{
}
@ -71,12 +66,11 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* 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;
}
@ -93,7 +87,9 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
//=====================================================================================
extern "C"
{
GENERATIONGUI_EXPORT
#ifdef WIN32
__declspec( dllexport )
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return new GenerationGUI( parent );

View File

@ -19,38 +19,26 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI.h
// Author : Damien COQUERET
// Module : GEOM
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#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

View File

@ -19,27 +19,23 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_FillingDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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()
@ -49,8 +45,8 @@
// 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)
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" ) ) );
@ -58,14 +54,14 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI,
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();
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(this, "GroupPoints");
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" ) );
@ -76,7 +72,9 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI,
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" );
@ -116,41 +114,43 @@ void GenerationGUI_FillingDlg::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);
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->SpinBox_1->SetValue(myMinDeg);
GroupPoints->SpinBox_2->SetValue(myTol2D);
GroupPoints->SpinBox_3->SetValue(myNbIter);
GroupPoints->SpinBox_4->SetValue(myMaxDeg);
GroupPoints->SpinBox_5->SetValue(myTol3D);
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( 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( 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 ) ) );
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)));
// 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").toLatin1().constData());
initName( tr( "GEOM_FILLING" ) );
}
@ -206,8 +206,7 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
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 )
@ -247,8 +246,7 @@ void GenerationGUI_FillingDlg::SetEditCurrentArgument()
void GenerationGUI_FillingDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1)
{
if ( send == GroupPoints->LineEdit1 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -273,9 +271,9 @@ void GenerationGUI_FillingDlg::ActivateThisDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void GenerationGUI_FillingDlg::enterEvent(QEvent* e)
void GenerationGUI_FillingDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -288,15 +286,15 @@ void GenerationGUI_FillingDlg::ValueChangedInSpinBox(double newValue)
{
QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_1)
if ( send == GroupPoints->SpinBox1 )
myMinDeg = int( newValue );
else if(send == GroupPoints->SpinBox_2)
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();

View File

@ -19,18 +19,14 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_FillingDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_FILLING_H
#define DIALOGBOX_FILLING_H
#ifndef GENERATIONGUI_FILLINGDLG_H
#define GENERATIONGUI_FILLINGDLG_H
#include "GenerationGUI.h"
#include "GEOMBase_Skeleton.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_1Sel5Spin;
@ -38,25 +34,25 @@ class DlgRef_1Sel5Spin;
// class : GenerationGUI_FillingDlg
// purpose :
//=================================================================================
class GENERATIONGUI_EXPORT GenerationGUI_FillingDlg : public GEOMBase_Skeleton
class GenerationGUI_FillingDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 );
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
private:
GEOM::GEOM_Object_var myCompound; /* compound of curves */
Standard_Integer myMinDeg;
Standard_Integer myMaxDeg;
@ -74,7 +70,7 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);
void ValueChangedInSpinBox( double );
};
#endif // DIALOGBOX_FILLING_H
#endif // GENERATIONGUI_FILLINGDLG_H

View File

@ -19,24 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_PipeDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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()
@ -46,8 +44,8 @@
// 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)
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" ) ) );
@ -55,17 +53,14 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidge
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();
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 Ui::DlgRef_2Sel_QTD();
QWidget* aGroupPointsWidget = new QWidget(this);
GroupPoints->setupUi(aGroupPointsWidget);
aGroupPointsWidget->setObjectName("GroupPoints");
GroupPoints = new DlgRef_2Sel( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_OBJECT" ) );
@ -75,7 +70,9 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidge
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" );
@ -109,8 +106,8 @@ void GenerationGUI_PipeDlg::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() ) );
@ -121,7 +118,7 @@ void GenerationGUI_PipeDlg::Init()
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 );
}
@ -235,8 +232,7 @@ void GenerationGUI_PipeDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
{
send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -247,9 +243,9 @@ void GenerationGUI_PipeDlg::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();
}

View File

@ -19,49 +19,46 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_PipeDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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
public:
GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 );
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
private:
void Init();
void enterEvent(QEvent* e);
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 */
Ui::DlgRef_2Sel_QTD* GroupPoints;
DlgRef_2Sel* GroupPoints;
private slots:
void ClickOnOk();
@ -72,4 +69,4 @@ private slots:
void SetEditCurrentArgument();
};
#endif // DIALOGBOX_PIPE_H
#endif // GENERATIONGUI_PIPEDLG_H

View File

@ -19,26 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_PrismDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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()
@ -48,8 +44,8 @@
// 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)
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" ) ) );
@ -58,13 +54,13 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
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" ) );
@ -76,21 +72,20 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
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 = 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->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);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
layout->addWidget( GroupPoints2 );
/***************************************************************/
setHelpFileName( "extrusion.htm" );
@ -133,14 +128,14 @@ void GenerationGUI_PrismDlg::Init()
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( 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() ) );
@ -149,11 +144,12 @@ void GenerationGUI_PrismDlg::Init()
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
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() ) );
@ -166,7 +162,7 @@ void GenerationGUI_PrismDlg::Init()
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 );
@ -181,14 +177,11 @@ void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
globalSelection( GEOM_POINT );
::qobject_cast<QWidget*>( GroupPoints2->gridLayout->parent() )->hide();
resize(0, 0);
GroupPoints2->hide();
GroupPoints->show();
//GroupPoints->LineEdit1->setFocus();
@ -209,8 +202,7 @@ void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
case 1:
{
GroupPoints->hide();
resize(0, 0);
::qobject_cast<QWidget*>( GroupPoints2->gridLayout->parent() )->show();
GroupPoints2->show();
myEditCurrentArgument = GroupPoints2->LineEdit1;
GroupPoints2->LineEdit1->setText( "" );
@ -224,6 +216,11 @@ void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -384,8 +381,7 @@ void GenerationGUI_PrismDlg::LineEditReturnPressed()
send == GroupPoints->LineEdit2 ||
send == GroupPoints2->LineEdit1 ||
send == GroupPoints2->LineEdit2 ||
send == GroupPoints2->LineEdit3 )
{
send == GroupPoints2->LineEdit3 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -395,9 +391,9 @@ void GenerationGUI_PrismDlg::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();
}
@ -435,7 +431,7 @@ void GenerationGUI_PrismDlg::ValueChangedInSpinBox()
//=================================================================================
double GenerationGUI_PrismDlg::getHeight() const
{
return GroupPoints->SpinBox_DX->GetValue();
return GroupPoints->SpinBox_DX->value();
}
//=================================================================================
@ -464,21 +460,16 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
{
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
MakePrismVecH( myBase, myVec, getHeight() );
break;
}
case 1 :
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
MakePrismTwoPnt( myBase, myPoint1, myPoint2 );
break;
}
}
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
@ -492,6 +483,6 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
//=================================================================================
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 );
}

View File

@ -19,46 +19,42 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_PrismDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_PRISM_H
#define DIALOGBOX_PRISM_H
#ifndef GENERATIONGUI_PRISMDLG_H
#define GENERATIONGUI_PRISMDLG_H
#include "GenerationGUI.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
public:
GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 );
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
double getHeight() const;
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 */
@ -69,7 +65,7 @@ private :
bool myOkPnt2;
DlgRef_2Sel1Spin2Check* GroupPoints;
Ui::DlgRef_3Sel_QTD* GroupPoints2; // for second layout for extrusion using 2 points
DlgRef_3Sel* GroupPoints2; // for second layout for extrusion using 2 points
private slots:
void ClickOnOk();
@ -83,4 +79,4 @@ private slots:
void onReverse();
};
#endif // DIALOGBOX_PRISM_H
#endif // GENERATIONGUI_PRISMDLG_H

View File

@ -19,27 +19,23 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_RevolDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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()
@ -49,8 +45,8 @@
// 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)
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" ) ) );
@ -58,14 +54,14 @@ GenerationGUI_RevolDlg::GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWid
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();
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(this, "GroupPoints");
GroupPoints = new DlgRef_2Sel1Spin2Check( centralWidget() );
GroupPoints->CheckButton1->hide();
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
@ -77,7 +73,9 @@ GenerationGUI_RevolDlg::GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWid
GroupPoints->LineEdit2->setReadOnly( true );
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" );
@ -112,12 +110,12 @@ void GenerationGUI_RevolDlg::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() ) );
@ -128,12 +126,14 @@ void GenerationGUI_RevolDlg::Init()
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
connect( GroupPoints->CheckButton2, SIGNAL( toggled( bool ) ), this, SLOT( onReverse() ) );
// 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() ) );
initName(tr("GEOM_REVOLUTION").toLatin1().constData());
initName( tr( "GEOM_REVOLUTION" ) );
globalSelection( GEOM_ALLSHAPES );
}
@ -264,8 +264,7 @@ void GenerationGUI_RevolDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
{
send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -291,9 +290,9 @@ void GenerationGUI_RevolDlg::ActivateThisDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void GenerationGUI_RevolDlg::enterEvent(QEvent* e)
void GenerationGUI_RevolDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -314,7 +313,7 @@ void GenerationGUI_RevolDlg::ValueChangedInSpinBox()
//=================================================================================
double GenerationGUI_RevolDlg::getAngle() const
{
return GroupPoints->SpinBox_DX->GetValue();
return GroupPoints->SpinBox_DX->value();
}
//=================================================================================
@ -359,6 +358,6 @@ bool GenerationGUI_RevolDlg::execute( ObjectList& objects )
//=================================================================================
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 );
}

View File

@ -19,18 +19,14 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : GenerationGUI_RevolDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_REVOLUTION_H
#define DIALOGBOX_REVOLUTION_H
#ifndef GENERATIONGUI_REVOLUTIONDLG_H
#define GENERATIONGUI_REVOLUTIONDLG_H
#include "GenerationGUI.h"
#include "GEOMBase_Skeleton.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel1Spin2Check;
@ -38,26 +34,26 @@ class DlgRef_2Sel1Spin2Check;
// class : GenerationGUI_RevolDlg
// purpose :
//=================================================================================
class GENERATIONGUI_EXPORT GenerationGUI_RevolDlg : public GEOMBase_Skeleton
class GenerationGUI_RevolDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 );
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
private:
void Init();
void enterEvent(QEvent* e);
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;
@ -76,4 +72,4 @@ private slots:
void onReverse();
};
#endif // DIALOGBOX_REVOLUTION_H
#endif // GENERATIONGUI_REVOLUTIONDLG_H

View File

@ -19,13 +19,10 @@
#
# 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
@ -36,6 +33,12 @@ lib_LTLIBRARIES = libGenerationGUI.la
salomeinclude_HEADERS =
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 \
@ -74,6 +77,7 @@ libGenerationGUI_la_CPPFLAGS = \
-I$(srcdir)/../GEOMClient \
-I$(srcdir)/../GEOMImpl \
-I$(srcdir)/../GEOMFiltersSelection \
-I$(top_builddir)/src/DlgRef \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix

View File

@ -1,5 +1,3 @@
# GEOM PRIMITIVEGUI :
#
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
@ -19,13 +17,11 @@
#
# 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
@ -35,6 +31,13 @@ salomeinclude_HEADERS =
lib_LTLIBRARIES = libPrimitiveGUI.la
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 \
@ -75,6 +78,7 @@ libPrimitiveGUI_la_CPPFLAGS = \
-I$(srcdir)/../GEOMClient \
-I$(srcdir)/../GEOMImpl \
-I$(srcdir)/../GEOMFiltersSelection \
-I$(top_builddir)/src/DlgRef \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix

View File

@ -19,20 +19,16 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header$
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#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
@ -40,8 +36,6 @@
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
using namespace std;
//=======================================================================
// function : PrimitiveGUI()
// purpose : Constructor
@ -58,7 +52,6 @@ PrimitiveGUI::~PrimitiveGUI()
{
}
//=======================================================================
// function : OnGUIEvent()
// purpose :
@ -72,19 +65,18 @@ bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
QDialog* aDlg = NULL;
switch (theCommandID)
{
switch ( theCommandID ) {
case 4021: // BOX
aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, "");
aDlg = new PrimitiveGUI_BoxDlg( getGeometryGUI(), parent );
break;
case 4022: // CYLINDER
aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, "");
aDlg = new PrimitiveGUI_CylinderDlg( getGeometryGUI(), parent );
break;
case 4023: // SPHERE
aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, "");
aDlg = new PrimitiveGUI_SphereDlg( getGeometryGUI(), parent );
break;
case 4024: // TORUS
aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, "");
aDlg = new PrimitiveGUI_TorusDlg( getGeometryGUI(), parent );
break;
case 4025: // CONE
aDlg = new PrimitiveGUI_ConeDlg( getGeometryGUI(), parent, "" );
@ -100,13 +92,12 @@ bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
return true;
}
//=====================================================================================
// EXPORTED METHODS
//=====================================================================================
extern "C"
{
#ifdef WNT
#ifdef WIN32
__declspec( dllexport )
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent )

View File

@ -19,17 +19,14 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI.h
// Author : Damien COQUERET
// Module : GEOM
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#ifndef PRIMITIVEGUI_H
#define PRIMITIVEGUI_H
#include "GEOMGUI.h"
#include <GEOMGUI.h>
//=================================================================================
// class : PrimitiveGUI
@ -38,10 +35,10 @@
class PrimitiveGUI : public GEOMGUI
{
public:
PrimitiveGUI(GeometryGUI* parent);
PrimitiveGUI( GeometryGUI* );
~PrimitiveGUI();
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
bool OnGUIEvent( int, SUIT_Desktop* );
};
#endif

View File

@ -19,29 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_BoxDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "PrimitiveGUI_BoxDlg.h"
#include "DlgRef_3Spin.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 "GEOMImpl_Types.hxx"
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()
@ -51,8 +44,8 @@ using namespace std;
// 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)
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" ) ));
@ -61,31 +54,29 @@ PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* p
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");
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->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 = 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" ) );
gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
gridLayout1->addWidget(GroupDimensions, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
layout->addWidget( GroupDimensions );
/***************************************************************/
setHelpFileName( "box.htm" );
@ -122,20 +113,20 @@ void PrimitiveGUI_BoxDlg::Init()
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() ) );
@ -147,14 +138,17 @@ void PrimitiveGUI_BoxDlg::Init()
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 ) ), 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() ) );
initName( tr( "GEOM_BOX" ).toLatin1().constData() );
initName( tr( "GEOM_BOX" ) );
ConstructorsClicked( 0 );
}
@ -167,15 +161,13 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ) )->selectionMgr(), 0, this, 0 );
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
globalSelection( GEOM_POINT );
GroupDimensions->hide();
resize(0, 0);
::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->show();
GroupPoints->show();
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setText( "" );
@ -188,13 +180,16 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
}
case 1:
{
::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->hide();
resize(0, 0);
GroupPoints->hide();
GroupDimensions->show();
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -236,8 +231,7 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
myEditCurrentArgument->setText( "" );
if (IObjectCount() != 1)
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@ -290,8 +284,7 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
void PrimitiveGUI_BoxDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2)
{
if ( send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -316,9 +309,9 @@ void PrimitiveGUI_BoxDlg::ActivateThisDialog()
// function : enterEvent [REDEFINED]
// purpose :
//=================================================================================
void PrimitiveGUI_BoxDlg::enterEvent(QEvent* e)
void PrimitiveGUI_BoxDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -363,8 +356,7 @@ bool PrimitiveGUI_BoxDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
{
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) ) {
@ -376,9 +368,9 @@ bool PrimitiveGUI_BoxDlg::execute( ObjectList& objects )
}
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;

View File

@ -19,20 +19,16 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_BoxDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_BOX_H
#define DIALOGBOX_BOX_H
#ifndef PRIMITIVEGUI_BOXDLG_H
#define PRIMITIVEGUI_BOXDLG_H
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel_QTD.h"
using namespace std;
#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel;
class DlgRef_3Spin;
//=================================================================================
@ -44,25 +40,25 @@ class PrimitiveGUI_BoxDlg : public GEOMBase_Skeleton
Q_OBJECT
public:
PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 bool execute( ObjectList& );
virtual void closeEvent( QCloseEvent* e );
virtual void closeEvent( QCloseEvent* );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
private:
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */
Ui::DlgRef_2Sel_QTD* GroupPoints;
DlgRef_2Sel* GroupPoints;
DlgRef_3Spin* GroupDimensions;
private slots:
@ -76,4 +72,4 @@ private slots:
void ValueChangedInSpinBox();
};
#endif // DIALOGBOX_BOX_H
#endif // PRIMITIVEGUI_BOXDLG_H

View File

@ -19,29 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_ConeDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "PrimitiveGUI_ConeDlg.h"
#include "DlgRef_2Sel3Spin.h"
#include "DlgRef_3Spin.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"
using namespace std;
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_ConeDlg()
@ -51,8 +44,8 @@ using namespace std;
// 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)
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" ) ) );
@ -61,30 +54,32 @@ PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget*
setWindowTitle( tr( "GEOM_CONE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_CONE"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
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(this, "GroupPoints");
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->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 = 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->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);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
layout->addWidget( GroupDimensions );
/***************************************************************/
setHelpFileName( "cone.htm" );
@ -121,25 +116,26 @@ void PrimitiveGUI_ConeDlg::Init()
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);
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);
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( 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() ) );
@ -154,17 +150,20 @@ void PrimitiveGUI_ConeDlg::Init()
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() ) );
initName( tr( "GEOM_CONE" ).toLatin1().constData() );
initName( tr( "GEOM_CONE" ) );
ConstructorsClicked( 0 );
}
@ -177,18 +176,16 @@ void PrimitiveGUI_ConeDlg::ConstructorsClicked(int constructorId)
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch(constructorId)
{
switch( constructorId ) {
case 0 :
{
globalSelection( GEOM_POINT );
GroupDimensions->hide();
resize(0, 0);
GroupPoints->show();
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setText(tr(""));
GroupPoints->LineEdit2->setText(tr(""));
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
myPoint = myDir = GEOM::GEOM_Object::_nil();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
@ -198,12 +195,16 @@ void PrimitiveGUI_ConeDlg::ConstructorsClicked(int constructorId)
case 1 :
{
GroupPoints->hide();
resize( 0, 0 );
GroupDimensions->show();
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -234,16 +235,6 @@ bool PrimitiveGUI_ConeDlg::ClickOnApply()
}
//=======================================================================
// function : ClickOnCancel()
// purpose :
//=======================================================================
void PrimitiveGUI_ConeDlg::ClickOnCancel()
{
GEOMBase_Skeleton::ClickOnCancel();
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
@ -253,8 +244,7 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
if ( getConstructorId() != 0 )
return;
if(IObjectCount() != 1)
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@ -310,8 +300,7 @@ void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
{
send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -346,9 +335,9 @@ void PrimitiveGUI_ConeDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void PrimitiveGUI_ConeDlg::enterEvent(QEvent* e)
void PrimitiveGUI_ConeDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -391,10 +380,8 @@ bool PrimitiveGUI_ConeDlg::execute( ObjectList& objects )
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() )->MakeConePntVecR1R2H( myPoint,
myDir,
@ -404,16 +391,13 @@ bool PrimitiveGUI_ConeDlg::execute( ObjectList& objects )
res = true;
}
break;
}
case 1 :
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConeR1R2H( getRadius1(),
getRadius2(),
getHeight() );
res = true;
break;
}
}
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
@ -440,9 +424,9 @@ double PrimitiveGUI_ConeDlg::getRadius1() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DX->GetValue();
return GroupPoints->SpinBox_DX->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DX->GetValue();
return GroupDimensions->SpinBox_DX->value();
return 0;
}
@ -455,9 +439,9 @@ double PrimitiveGUI_ConeDlg::getRadius2() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DY->GetValue();
return GroupPoints->SpinBox_DY->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DY->GetValue();
return GroupDimensions->SpinBox_DY->value();
return 0;
}
@ -470,8 +454,8 @@ double PrimitiveGUI_ConeDlg::getHeight() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DZ->GetValue();
return GroupPoints->SpinBox_DZ->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DZ->GetValue();
return GroupDimensions->SpinBox_DZ->value();
return 0;
}

View File

@ -19,16 +19,14 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_ConeDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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;
@ -42,25 +40,25 @@ class PrimitiveGUI_ConeDlg : public GEOMBase_Skeleton
Q_OBJECT
public:
PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 bool execute( ObjectList& );
virtual void closeEvent( QCloseEvent* e );
virtual void closeEvent( QCloseEvent* );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
double getRadius1() const;
double getRadius2() const;
double getHeight() const;
private:
GEOM::GEOM_Object_var myPoint, myDir;
DlgRef_2Sel3Spin* GroupPoints;
@ -69,7 +67,6 @@ private:
private slots:
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
void LineEditReturnPressed();
@ -79,4 +76,4 @@ private slots:
void ValueChangedInSpinBox();
};
#endif // DIALOGBOX_CONE_H
#endif // PRIMITIVEGUI_CONEDLG_H

View File

@ -19,29 +19,23 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_CylinderDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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()
@ -51,8 +45,8 @@ using namespace std;
// 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)
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" ) ) );
@ -61,13 +55,13 @@ PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI,
setWindowTitle( tr( "GEOM_CYLINDER_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_CYLINDER"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
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(this, "GroupPoints");
GroupPoints = new DlgRef_2Sel2Spin( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
@ -76,13 +70,15 @@ PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI,
GroupPoints->PushButton1->setIcon( image2 );
GroupPoints->PushButton2->setIcon( image2 );
GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions");
GroupDimensions = new DlgRef_2Spin( centralWidget() );
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);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
layout->addWidget( GroupDimensions );
/***************************************************************/
setHelpFileName( "cylinder.htm" );
@ -120,23 +116,24 @@ void PrimitiveGUI_CylinderDlg::Init()
/* 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() ) );
@ -149,15 +146,17 @@ void PrimitiveGUI_CylinderDlg::Init()
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() ) );
initName( tr( "GEOM_CYLINDER" ).toLatin1().constData() );
initName( tr( "GEOM_CYLINDER" ) );
ConstructorsClicked( 0 );
}
@ -170,19 +169,17 @@ void PrimitiveGUI_CylinderDlg::ConstructorsClicked(int constructorId)
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch(constructorId)
{
switch( constructorId ) {
case 0 :
{
globalSelection( GEOM_POINT );
GroupDimensions->hide();
resize(0, 0);
GroupPoints->show();
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setText(tr(""));
GroupPoints->LineEdit2->setText(tr(""));
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
myPoint = myDir = GEOM::GEOM_Object::_nil();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
@ -192,12 +189,15 @@ void PrimitiveGUI_CylinderDlg::ConstructorsClicked(int constructorId)
case 1 :
{
GroupPoints->hide();
resize( 0, 0 );
GroupDimensions->show();
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -228,16 +228,6 @@ bool PrimitiveGUI_CylinderDlg::ClickOnApply()
}
//=======================================================================
// function : ClickOnCancel()
// purpose :
//=======================================================================
void PrimitiveGUI_CylinderDlg::ClickOnCancel()
{
GEOMBase_Skeleton::ClickOnCancel();
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
@ -249,8 +239,7 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
myEditCurrentArgument->setText( "" );
if(IObjectCount() != 1)
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@ -306,8 +295,7 @@ void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
{
send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -332,9 +320,9 @@ void PrimitiveGUI_CylinderDlg::ActivateThisDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void PrimitiveGUI_CylinderDlg::enterEvent(QEvent* e)
void PrimitiveGUI_CylinderDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -388,24 +376,19 @@ bool PrimitiveGUI_CylinderDlg::execute( ObjectList& objects )
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() )->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() );
@ -431,9 +414,9 @@ double PrimitiveGUI_CylinderDlg::getRadius() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DX->GetValue();
return GroupPoints->SpinBox_DX->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DX->GetValue();
return GroupDimensions->SpinBox_DX->value();
return 0;
}
@ -446,8 +429,8 @@ double PrimitiveGUI_CylinderDlg::getHeight() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DY->GetValue();
return GroupPoints->SpinBox_DY->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DY->GetValue();
return GroupDimensions->SpinBox_DY->value();
return 0;
}

View File

@ -19,21 +19,18 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_CylinderDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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 :
@ -43,24 +40,24 @@ class PrimitiveGUI_CylinderDlg : public GEOMBase_Skeleton
Q_OBJECT
public:
PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 bool execute( ObjectList& );
virtual void closeEvent( QCloseEvent* e );
virtual void closeEvent( QCloseEvent* );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
double getRadius() const;
double getHeight() const;
private:
GEOM::GEOM_Object_var myPoint, myDir;
DlgRef_2Sel2Spin* GroupPoints;
@ -69,7 +66,6 @@ private:
private slots:
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
void LineEditReturnPressed();
@ -79,4 +75,4 @@ private slots:
void ValueChangedInSpinBox();
};
#endif // DIALOGBOX_CYLINDER_H
#endif // PRIMITIVEGUI_CYLINDERDLG_H

View File

@ -19,29 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_SphereDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "PrimitiveGUI_SphereDlg.h"
#include "DlgRef_1Sel1Spin.h"
#include "DlgRef_1Spin.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"
using namespace std;
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_SphereDlg()
@ -51,8 +44,8 @@ using namespace std;
// 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)
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" ) ) );
@ -61,24 +54,26 @@ PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWid
setWindowTitle( tr( "GEOM_SPHERE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_SPHERE"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
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(this, "GroupPoints");
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(this, "GroupDimensions");
GroupDimensions = new DlgRef_1Spin( centralWidget() );
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_SPHERE_RO" ) );
GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
gridLayout1->addWidget(GroupPoints, 2, 0);
gridLayout1->addWidget(GroupDimensions, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
layout->addWidget( GroupDimensions );
/***************************************************************/
setHelpFileName( "sphere.htm" );
@ -114,15 +109,16 @@ void PrimitiveGUI_SphereDlg::Init()
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() ) );
@ -130,13 +126,16 @@ void PrimitiveGUI_SphereDlg::Init()
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( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName(tr("GEOM_SPHERE").toLatin1().constData());
initName( tr( "GEOM_SPHERE" ) );
ConstructorsClicked( 0 );
}
@ -149,13 +148,11 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked(int constructorId)
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
globalSelection( GEOM_POINT );
GroupDimensions->hide();
resize(0, 0);
GroupPoints->show();
myEditCurrentArgument = GroupPoints->LineEdit1;
@ -169,12 +166,16 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked(int constructorId)
case 1:
{
GroupPoints->hide();
resize(0, 0);
GroupDimensions->show();
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -205,17 +206,6 @@ bool PrimitiveGUI_SphereDlg::ClickOnApply()
}
//=======================================================================
// function : ClickOnCancel()
// purpose :
//=======================================================================
void PrimitiveGUI_SphereDlg::ClickOnCancel()
{
GEOMBase_Skeleton::ClickOnCancel();
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
@ -227,8 +217,7 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
myEditCurrentArgument->setText( "" );
if(IObjectCount() != 1)
{
if ( IObjectCount() != 1 ) {
myPoint = GEOM::GEOM_Object::_nil();
return;
}
@ -254,8 +243,7 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
void PrimitiveGUI_SphereDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1)
{
if ( send == GroupPoints->LineEdit1 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -307,9 +295,9 @@ void PrimitiveGUI_SphereDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void PrimitiveGUI_SphereDlg::enterEvent(QEvent* e)
void PrimitiveGUI_SphereDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -353,8 +341,7 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
{
if ( !CORBA::is_nil( myPoint ) ) {
@ -397,8 +384,8 @@ double PrimitiveGUI_SphereDlg::getRadius() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DX->GetValue();
return GroupPoints->SpinBox_DX->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DX->GetValue();
return GroupDimensions->SpinBox_DX->value();
return 0;
}

View File

@ -19,21 +19,18 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_SphereDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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 :
@ -43,23 +40,23 @@ class PrimitiveGUI_SphereDlg : public GEOMBase_Skeleton
Q_OBJECT
public:
PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 bool execute( ObjectList& );
virtual void closeEvent( QCloseEvent* e );
virtual void closeEvent( QCloseEvent* );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
double getRadius() const;
private:
GEOM::GEOM_Object_var myPoint; /* Center point */
DlgRef_1Sel1Spin* GroupPoints;
@ -68,7 +65,6 @@ private:
private slots:
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
void LineEditReturnPressed();

View File

@ -19,29 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_TorusDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "PrimitiveGUI_TorusDlg.h"
#include "DlgRef_2Sel2Spin.h"
#include "DlgRef_2Spin.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"
using namespace std;
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
@ -51,8 +44,8 @@ using namespace std;
// 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)
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" ) ) );
@ -61,28 +54,30 @@ PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidge
setWindowTitle( tr( "GEOM_TORUS_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_TORUS"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
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(this, "GroupPoints");
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->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 = 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"));
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);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
layout->addWidget( GroupDimensions );
/***************************************************************/
setHelpFileName( "turus.htm" );
@ -119,20 +114,21 @@ void PrimitiveGUI_TorusDlg::Init()
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( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
@ -145,6 +141,7 @@ void PrimitiveGUI_TorusDlg::Init()
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 ) ) );
@ -153,7 +150,8 @@ void PrimitiveGUI_TorusDlg::Init()
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_TORUS" ).toLatin1().constData() );
initName( tr( "GEOM_TORUS" ) );
ConstructorsClicked( 0 );
}
@ -166,19 +164,17 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch(constructorId)
{
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(""));
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
myPoint = myDir = GEOM::GEOM_Object::_nil();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
@ -188,12 +184,16 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
case 1:
{
GroupPoints->hide();
resize( 0, 0 );
GroupDimensions->show();
break ;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -224,16 +224,6 @@ bool PrimitiveGUI_TorusDlg::ClickOnApply()
}
//=======================================================================
// function : ClickOnCancel()
// purpose :
//=======================================================================
void PrimitiveGUI_TorusDlg::ClickOnCancel()
{
GEOMBase_Skeleton::ClickOnCancel();
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
@ -245,8 +235,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
myEditCurrentArgument->setText( "" );
if(IObjectCount() != 1)
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@ -254,7 +243,6 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
return;
}
/* nbSel == 1 */
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
@ -302,8 +290,7 @@ void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
{
send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -328,9 +315,9 @@ void PrimitiveGUI_TorusDlg::ActivateThisDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void PrimitiveGUI_TorusDlg::enterEvent(QEvent* e)
void PrimitiveGUI_TorusDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -385,23 +372,18 @@ bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
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() );
res = true;
}
break;
}
case 1 :
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR( getRadius1(), getRadius2() );
res = true;
break;
}
}
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
@ -428,9 +410,9 @@ double PrimitiveGUI_TorusDlg::getRadius1() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DX->GetValue();
return GroupPoints->SpinBox_DX->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DX->GetValue();
return GroupDimensions->SpinBox_DX->value();
return 0;
}
@ -443,8 +425,8 @@ double PrimitiveGUI_TorusDlg::getRadius2() const
{
int aConstructorId = getConstructorId();
if ( aConstructorId == 0 )
return GroupPoints->SpinBox_DY->GetValue();
return GroupPoints->SpinBox_DY->value();
else if ( aConstructorId == 1 )
return GroupDimensions->SpinBox_DY->GetValue();
return GroupDimensions->SpinBox_DY->value();
return 0;
}

View File

@ -19,21 +19,18 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : PrimitiveGUI_TorusDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#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 :
@ -43,21 +40,20 @@ class PrimitiveGUI_TorusDlg : public GEOMBase_Skeleton
Q_OBJECT
public:
PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
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 bool execute( ObjectList& );
virtual void closeEvent( QCloseEvent* e );
virtual void closeEvent( QCloseEvent* );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
double getRadius1() const;
double getRadius2() const;
@ -69,7 +65,6 @@ private:
private slots:
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
void LineEditReturnPressed();
@ -79,4 +74,4 @@ private:
void ValueChangedInSpinBox();
};
#endif // DIALOGBOX_TORUS_H
#endif // PRIMITIVEGUI_TORUSDLG_H