*** empty log message ***

This commit is contained in:
vsr 2007-10-15 10:41:03 +00:00
parent 7a04da0b3c
commit 496cc5f9ba
34 changed files with 2381 additions and 2503 deletions

View File

@ -36,14 +36,19 @@ docdir = $(datadir)/doc/@PACKAGE@
$(MOC) $< -o $@
# qm-files generation
%.qm: %.po
$(MSG2QM) $< $@
%.qm: %.ts
$(LRELEASE) $< -qm $@
# uic-files generation
ui_%.h: %.ui
$(UIC) -o $@ $<
EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po)
mostlyclean-local:
rm -f @builddir@/*_moc.cxx
rm -f @builddir@/*.qm
rm -f @builddir@/ui_*.h
# tests
tests: unittest

View File

@ -74,7 +74,7 @@ dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairie
echo
echo ---------------------------------------------
echo Coniguring production
echo Configuring production
echo ---------------------------------------------
echo
AC_ENABLE_DEBUG(yes)
@ -234,14 +234,6 @@ echo
CHECK_QT
echo
echo ---------------------------------------------
echo testing msg2qm
echo ---------------------------------------------
echo
CHECK_MSG2QM
echo
echo ---------------------------------------------
echo testing VTK
@ -304,12 +296,20 @@ fi
echo
echo ---------------------------------------------
echo Testing Kernel
echo Testing SALOME KERNEL module
echo ---------------------------------------------
echo
CHECK_KERNEL
echo
echo ---------------------------------------------
echo Testing SALOME GUI module
echo ---------------------------------------------
echo
CHECK_SALOME_GUI
echo
echo ---------------------------------------------
echo Summary
@ -317,7 +317,7 @@ echo ---------------------------------------------
echo
echo Configure
variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok"
variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok SalomeGUI_ok"
for var in $variables
do
@ -330,7 +330,7 @@ echo "Default ORB : $DEFAULT_ORB"
echo
dnl We don t need to say when we re entering directories if we re using
dnl GNU make becuase make does it for us.
dnl GNU make because make does it for us.
if test "X$GMAKE" = "Xyes"; then
AC_SUBST(SETX) SETX=":"
else

View File

@ -19,28 +19,11 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header$
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#include "BasicGUI.h"
#include "GeometryGUI.h"
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewManager.h"
#include "OCCViewer_ViewPort3d.h"
#include <BRep_Tool.hxx>
#include <ProjLib.hxx>
#include <ElSLib.hxx>
#include <TopoDS.hxx>
#include "BasicGUI_PointDlg.h" // Method POINT
#include "BasicGUI_LineDlg.h" // Method LINE
@ -53,16 +36,29 @@
#include "BasicGUI_WorkingPlaneDlg.h" // Method WORKING PLANE
#include "BasicGUI_MarkerDlg.h" // Method REPAIR
#include <QMouseEvent>
#include <GeometryGUI.h>
using namespace std;
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ViewWindow.h>
#include <OCCViewer_ViewWindow.h>
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewPort3d.h>
#include <BRep_Tool.hxx>
#include <ProjLib.hxx>
#include <ElSLib.hxx>
#include <TopoDS.hxx>
#include <QMouseEvent>
//=======================================================================
// function : BasicGUI()
// purpose : Constructor
//=======================================================================
BasicGUI::BasicGUI( GeometryGUI* parent ) :
GEOMGUI(parent)
BasicGUI::BasicGUI( GeometryGUI* parent )
: GEOMGUI( parent )
{
}
@ -84,8 +80,7 @@ bool BasicGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL;
switch ( theCommandID )
{
switch ( theCommandID ) {
case 4011: // POINT
aDlg = new BasicGUI_PointDlg( getGeometryGUI(), parent, "" );
break;
@ -139,11 +134,9 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
// Create Point dialog, OCC viewer
if ( aDlg && ( QString( aDlg->metaObject()->className() ).compare( "BasicGUI_PointDlg" ) == 0 ) &&
theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
pe->modifiers() != Qt::ControlModifier )
{
pe->modifiers() != Qt::ControlModifier ) {
BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg;
if ( aPntDlg->acceptMouseEvent() )
{
if ( aPntDlg->acceptMouseEvent() ) {
OCCViewer_Viewer* anOCCViewer =
( (OCCViewer_ViewManager*)( theViewWindow->getViewManager() ) )->getOCCViewer();
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
@ -157,14 +150,12 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
ic->Select(); // New selection
ic->InitSelected();
if ( ic->MoreSelected() )
{
if ( ic->MoreSelected() ) {
TopoDS_Shape aShape = ic->SelectedShape();
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
}
else
{
else {
OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
@ -207,7 +198,7 @@ gp_Pnt BasicGUI::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView)
//=====================================================================================
extern "C"
{
GEOM_BASICGUI_EXPORT
BASICGUI_EXPORT
GEOMGUI* GetLibGUI( GeometryGUI* parent )
{
return new BasicGUI( parent );

View File

@ -19,34 +19,32 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI.h
// Author : Damien COQUERET
// Module : GEOM
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#ifndef BASICGUI_H
#define BASICGUI_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMGUI.h"
#include <GEOMGUI.h>
#include <V3d_View.hxx>
//=================================================================================
// class : BasicGUI
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI : public GEOMGUI
class BASICGUI_EXPORT BasicGUI : public GEOMGUI
{
public:
BasicGUI( GeometryGUI* parent );
BasicGUI( GeometryGUI* );
~BasicGUI();
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
bool OnMousePress(QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow);
bool OnGUIEvent( int, SUIT_Desktop* );
bool OnMousePress( QMouseEvent*, SUIT_Desktop*, SUIT_ViewWindow* );
gp_Pnt ConvertClickToPoint( int x, int y, Handle(V3d_View) aView );
gp_Pnt ConvertClickToPoint( int, int, Handle(V3d_View) );
};
#endif
#endif // BASICGUI_H

View File

@ -19,26 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_ArcDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_ArcDlg.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 : BasicGUI_ArcDlg()
@ -49,7 +45,7 @@ using namespace std;
//=================================================================================
BasicGUI_ArcDlg::BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
@ -58,21 +54,18 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
setWindowTitle( tr( "GEOM_ARC_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_ARC"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_ARC" ) );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setIcon( image1 );
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
Group3Pnts = new Ui::DlgRef_3Sel_QTD();
QWidget* aGroup3PntsWidget = new QWidget(this);
Group3Pnts->setupUi(aGroup3PntsWidget);
aGroup3PntsWidget->setObjectName("Group3Pnts");
Group3Pnts = new DlgRef_3Sel( centralWidget() );
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_POINTS" ) );
Group3Pnts->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
Group3Pnts->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
Group3Pnts->TextLabel3->setText(tr("GEOM_POINT_I").arg("3"));
Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
Group3Pnts->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
Group3Pnts->TextLabel3->setText( tr( "GEOM_POINT_I" ).arg( 3 ) );
Group3Pnts->LineEdit1->setReadOnly( true );
Group3Pnts->LineEdit2->setReadOnly( true );
@ -83,10 +76,7 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
Group3Pnts->PushButton3->setIcon(image2);
Group3Pnts2 = new Ui::DlgRef_3Sel1Check_QTD();
QWidget* aGroup3Pnts2Widget = new QWidget(this);
Group3Pnts2->setupUi(aGroup3Pnts2Widget);
aGroup3Pnts2Widget->setObjectName("Group3Pnts2");
Group3Pnts2 = new DlgRef_3Sel1Check( centralWidget() );
Group3Pnts2->GroupBox1->setTitle( tr( "GEOM_POINTS" ) );
Group3Pnts2->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
@ -101,10 +91,12 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
Group3Pnts2->PushButton2->setIcon( image2 );
Group3Pnts2->PushButton3->setIcon( image2 );
Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
Group3Pnts2->CheckButton1->setText( tr( "GEOM_REVERSE" ) );
gridLayout1->addWidget( aGroup3PntsWidget, 2, 0 );
gridLayout1->addWidget( aGroup3Pnts2Widget, 2, 0 );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( Group3Pnts );
layout->addWidget( Group3Pnts2 );
setHelpFileName( "arc.htm" );
@ -136,17 +128,17 @@ void BasicGUI_ArcDlg::Init()
myEditCurrentArgument->setFocus();
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
Group3Pnts2->radioButton4->setChecked(FALSE);
Group3Pnts2->CheckButton1->setChecked( false );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( Group3Pnts->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group3Pnts->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
@ -164,12 +156,12 @@ void BasicGUI_ArcDlg::Init()
connect( Group3Pnts2->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( Group3Pnts2->LineEdit3, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
connect( Group3Pnts2->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( ReverseSense() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_ARC" ).toLatin1().constData() );
initName( tr( "GEOM_ARC" ) );
ConstructorsClicked( 0 );
@ -228,23 +220,19 @@ bool BasicGUI_ArcDlg::ClickOnApply()
//=================================================================================
void BasicGUI_ArcDlg::SelectionIntoArgument()
{
if ((getConstructorId() != 0) && (getConstructorId() != 1))
if ( getConstructorId() != 0 && getConstructorId() != 1 )
return;
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 ) {
switch (getConstructorId())
{
switch ( getConstructorId() ) {
case 0:
{
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
return;
break;
}
case 1:
{
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
@ -252,24 +240,18 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
break;
}
}
}
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
switch (getConstructorId())
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
switch ( getConstructorId() ) {
case 0:
{
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
break;
}
case 1:
{
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = aSelectedObject;
@ -277,7 +259,6 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
break;
}
}
}
displayPreview();
}
@ -290,23 +271,18 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
void BasicGUI_ArcDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
switch (getConstructorId())
{
switch ( getConstructorId() ) {
case 0:
{
if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
break;
}
case 1:
{
if ( send == Group3Pnts2->PushButton1 ) myEditCurrentArgument = Group3Pnts2->LineEdit1;
else if ( send == Group3Pnts2->PushButton2 ) myEditCurrentArgument = Group3Pnts2->LineEdit2;
else if ( send == Group3Pnts2->PushButton3 ) myEditCurrentArgument = Group3Pnts2->LineEdit3;
break;
}
}
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
@ -320,8 +296,7 @@ void BasicGUI_ArcDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 )
{
send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -367,9 +342,9 @@ void BasicGUI_ArcDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_ArcDlg::enterEvent(QEvent* e)
void BasicGUI_ArcDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -410,8 +385,7 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
bool res = false;
GEOM::GEOM_Object_var anObj;
switch (getConstructorId())
{
switch ( getConstructorId() ) {
case 0:
{
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
@ -422,8 +396,7 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
}
case 1:
{
bool Sense;
(Group3Pnts2->radioButton4->isChecked()) ? Sense=true : Sense = false;
bool Sense = Group3Pnts2->CheckButton1->isChecked();
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeArcCenter( myPoint1, myPoint2, myPoint3, Sense );
res = true;
@ -452,30 +425,33 @@ void BasicGUI_ArcDlg::closeEvent( QCloseEvent* e )
//=================================================================================
void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
{
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
::qobject_cast<QWidget*>( Group3Pnts->gridLayout->parent() )->show();
resize(0, 0);
::qobject_cast<QWidget*>( Group3Pnts2->gridLayout->parent() )->hide();
Group3Pnts2->hide();
Group3Pnts->show();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
break;
}
case 1:
{
::qobject_cast<QWidget*>( Group3Pnts->gridLayout->parent() )->hide();
resize(0, 0);
::qobject_cast<QWidget*>( Group3Pnts2->gridLayout->parent() )->show();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group3Pnts->hide();
Group3Pnts2->show();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -483,7 +459,7 @@ void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
// function : ReverseSense()
// purpose : Orientation of the arc
//=================================================================================
void BasicGUI_ArcDlg::ReverseSense(int sense)
void BasicGUI_ArcDlg::ReverseSense()
{
displayPreview();
}

View File

@ -19,50 +19,51 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_ArcDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_ARC_H
#define DIALOGBOX_ARC_H
#ifndef BASICGUI_ARCDLG_H
#define BASICGUI_ARCDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_3Sel_QTD.h"
#include "DlgRef_3Sel1Check_QTD.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_3Sel;
class DlgRef_3Sel1Check;
//=================================================================================
// class : BasicGUI_ArcDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_ArcDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_ArcDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0 );
BasicGUI_ArcDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_ArcDlg();
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:
int myConstructorId;
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
Ui::DlgRef_3Sel_QTD* Group3Pnts;
Ui::DlgRef_3Sel1Check_QTD* Group3Pnts2;
DlgRef_3Sel* Group3Pnts;
DlgRef_3Sel1Check* Group3Pnts2;
private slots:
void ClickOnOk();
@ -75,7 +76,7 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ReverseSense(int);
void ReverseSense();
};
#endif // DIALOGBOX_ARC_H
#endif // BASICGUI_ARCDLG_H

View File

@ -19,26 +19,23 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_CircleDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_CircleDlg.h"
#include "DlgRef_2Sel1Spin.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>
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : BasicGUI_CircleDlg()
@ -49,7 +46,7 @@
//=================================================================================
BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
@ -58,13 +55,13 @@ BasicGUI_CircleDlg::BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* par
setWindowTitle( tr( "GEOM_CIRCLE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_CIRCLE"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image2);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_CIRCLE" ) );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setIcon( image2 );
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
GroupPntVecR = new DlgRef_2Sel1Spin(this, "GroupPntVecR");
GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() );
GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
@ -76,10 +73,7 @@ BasicGUI_CircleDlg::BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* par
GroupPntVecR->LineEdit1->setReadOnly( true );
GroupPntVecR->LineEdit2->setReadOnly( true );
Group3Pnts = new Ui::DlgRef_3Sel_QTD();
QWidget* aGroup3PntsWidget = new QWidget(this);
Group3Pnts->setupUi(aGroup3PntsWidget);
aGroup3PntsWidget->setObjectName("Group3Pnts");
Group3Pnts = new DlgRef_3Sel( centralWidget() );
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_3_POINTS" ) );
Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT1" ) );
@ -93,8 +87,10 @@ BasicGUI_CircleDlg::BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* par
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
gridLayout1->addWidget( GroupPntVecR, 2, 0 );
gridLayout1->addWidget( aGroup3PntsWidget, 2, 0 );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPntVecR );
layout->addWidget( Group3Pnts );
/***************************************************************/
setHelpFileName( "circle.htm" );
@ -130,17 +126,18 @@ void BasicGUI_CircleDlg::Init()
double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
/* min, max, step and decimals for spin boxes & initial values */
GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
GroupPntVecR->SpinBox_DX->SetValue( 100 );
initSpinBox( GroupPntVecR->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 );
GroupPntVecR->SpinBox_DX->setValue( 100 );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( GroupPntVecR->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( GroupPntVecR->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
@ -152,14 +149,15 @@ void BasicGUI_CircleDlg::Init()
connect( GroupPntVecR->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( GroupPntVecR->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT(ValueChangedInSpinBox() ) );
// VSR: TODO ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPntVecR->SpinBox_DX, SLOT( SetStep( double ) ) );
// <<-
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT(SelectionIntoArgument() ) ) ;
initName( tr( "GEOM_CIRCLE" ).toLatin1().constData() );
initName( tr( "GEOM_CIRCLE" ) );
::qobject_cast<QWidget*>( Group3Pnts->gridLayout->parent() )->hide();
ConstructorsClicked( 0 );
}
@ -172,12 +170,10 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
switch ( constructorId )
{
switch ( constructorId ) {
case 0:
{
::qobject_cast<QWidget*>( Group3Pnts->gridLayout->parent() )->hide();
resize(0, 0);
Group3Pnts->hide();
GroupPntVecR->show();
myEditCurrentArgument = GroupPntVecR->LineEdit1;
@ -188,8 +184,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
case 1:
{
GroupPntVecR->hide();
resize( 0, 0 );
::qobject_cast<QWidget*>( Group3Pnts->gridLayout->parent() )->show();
Group3Pnts->show();
myEditCurrentArgument = Group3Pnts->LineEdit1;
Group3Pnts->LineEdit1->setText( "" );
@ -199,6 +194,10 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
myEditCurrentArgument->setFocus();
globalSelection( GEOM_POINT );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
@ -246,8 +245,7 @@ void BasicGUI_CircleDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 )
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
@ -259,8 +257,7 @@ void BasicGUI_CircleDlg::SelectionIntoArgument()
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) myDir = aSelectedObject;
@ -307,8 +304,7 @@ void BasicGUI_CircleDlg::LineEditReturnPressed()
send == GroupPntVecR->LineEdit2 ||
send == Group3Pnts->LineEdit1 ||
send == Group3Pnts->LineEdit2 ||
send == Group3Pnts->LineEdit3 )
{
send == Group3Pnts->LineEdit3 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -336,9 +332,9 @@ void BasicGUI_CircleDlg::ActivateThisDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_CircleDlg::enterEvent(QEvent* e)
void BasicGUI_CircleDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -367,7 +363,7 @@ void BasicGUI_CircleDlg::ValueChangedInSpinBox()
//=================================================================================
double BasicGUI_CircleDlg::getRadius() const
{
return GroupPntVecR->SpinBox_DX->GetValue();
return GroupPntVecR->SpinBox_DX->value();
}
//=================================================================================
@ -413,8 +409,7 @@ bool BasicGUI_CircleDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCirclePntVecR( myPoint, myDir, getRadius() );
res = true;
@ -439,4 +434,3 @@ void BasicGUI_CircleDlg::closeEvent( QCloseEvent* e )
{
GEOMBase_Skeleton::closeEvent( e );
}

View File

@ -19,52 +19,51 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_CircleDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_CIRCLE_H
#define DIALOGBOX_CIRCLE_H
#ifndef BASICGUI_CIRCLEDLG_H
#define BASICGUI_CIRCLEDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_3Sel_QTD.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_3Sel;
class DlgRef_2Sel1Spin;
//=================================================================================
// class : BasicGUI_CircleDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_CircleDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_CircleDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_CircleDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_CircleDlg();
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, myDir, myPoint1, myPoint2, myPoint3;
DlgRef_2Sel1Spin* GroupPntVecR;
Ui::DlgRef_3Sel_QTD* Group3Pnts;
DlgRef_3Sel* Group3Pnts;
private slots:
void ClickOnOk();
@ -82,4 +81,4 @@ private slots:
void ValueChangedInSpinBox();
};
#endif // DIALOGBOX_CIRCLE_H
#endif // BASICGUI_CIRCLEDLG_H

View File

@ -18,30 +18,25 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_CurveDlg.cxx
// Author : Nicolas REJNERI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_CurveDlg.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 "SALOME_ListIteratorOfListIO.hxx"
#include "SALOME_ListIO.hxx"
#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_ListIO.hxx>
#include "GEOMImpl_Types.hxx"
using namespace std;
#include <string>
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : BasicGUI_CurveDlg()
@ -52,25 +47,21 @@ using namespace std;
//=================================================================================
BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BEZIER" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setWindowTitle( tr( "GEOM_CURVE_TITLE" ) );
/***************************************************************/
RadioButton1->setIcon( image0 );
RadioButton2->setIcon( image3 );
RadioButton3->setIcon( image2 );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setIcon( image3 );
mainFrame()->RadioButton3->setIcon( image2 );
GroupPoints = new Ui::DlgRef_1Sel_QTD();
QWidget* aGroupPointsWidget = new QWidget(this);
GroupPoints->setupUi(aGroupPointsWidget);
aGroupPointsWidget->setObjectName("GroupPoints");
GroupPoints = new DlgRef_1Sel( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_POINTS" ) );
@ -78,7 +69,9 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* paren
GroupPoints->LineEdit1->setReadOnly( true );
gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
/***************************************************************/
setHelpFileName( "curve.htm" );
@ -111,13 +104,14 @@ void BasicGUI_CurveDlg::Init()
globalSelection( GEOM_POINT );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog( ) ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
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() ) );
@ -125,7 +119,7 @@ void BasicGUI_CurveDlg::Init()
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_CURVE" ).toLatin1().constData() );
initName( tr( "GEOM_CURVE" ) );
ConstructorsClicked( 0 );
}
@ -136,7 +130,7 @@ void BasicGUI_CurveDlg::Init()
void BasicGUI_CurveDlg::ConstructorsClicked( int id )
{
QString aTitle = tr( id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL" );
GroupConstructors->setTitle( aTitle );
mainFrame()->GroupConstructors->setTitle( aTitle );
myPoints = new GEOM::ListOfGO();
myPoints->length( 0 );
@ -220,10 +214,11 @@ static int isPointInList(list<GEOM::GEOM_Object_var>& thePoints,
return -1;
}
for(list<GEOM::GEOM_Object_var>::iterator i=thePoints.begin();i!=thePoints.end();i++)
for ( list<GEOM::GEOM_Object_var>::iterator i = thePoints.begin(); i != thePoints.end(); i++ ) {
if ( string( (*i)->GetEntry() ) == string( theObject->GetEntry() ) ) {
return 1;
}
}
return -1;
}
@ -270,11 +265,9 @@ void BasicGUI_CurveDlg::SelectionIntoArgument()
bool is_append = myPoints->length() < IOC; // if true - add point, else remove
myPoints->length( IOC ); // this length may be greater than number of objects,
// that will actually be put into myPoints
for ( SALOME_ListIteratorOfListIO anIt( selectedIO() ); anIt.More(); anIt.Next() )
{
for ( SALOME_ListIteratorOfListIO anIt( selectedIO() ); anIt.More(); anIt.Next() ) {
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
//TopoDS_Shape aPointShape;
//if ( myGeomBase->GetShape( aSelectedObject, aPointShape, TopAbs_VERTEX ) )
int pos = isPointInList(myOrderedSel, aSelectedObject);
@ -294,7 +287,8 @@ void BasicGUI_CurveDlg::SelectionIntoArgument()
int k = 0;
for ( list<GEOM::GEOM_Object_var>::iterator j = myOrderedSel.begin(); j!= myOrderedSel.end(); j++ )
myPoints[k++] = *j;
} else {
}
else {
//cout << "ERROR: Ordered sequence size != selection sequence size! ("<<myOrderedSel.size()<<"!="<<myPoints->length()<<")"<<endl;
}
if ( i )
@ -334,9 +328,9 @@ void BasicGUI_CurveDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_CurveDlg::enterEvent(QEvent* e)
void BasicGUI_CurveDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -368,8 +362,7 @@ bool BasicGUI_CurveDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakePolyline( myPoints );
res = true;

View File

@ -18,48 +18,48 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_CurveDlg.h
// Author : Alexander SLADKOV
// Module : GEOM
// Author : Alexander SLADKOV, Open CASCADE S.A.S. (alexander.sladkov@opencascade.com)
//
#ifndef BASICGUI_CURVE_H
#define BASICGUI_CURVE_H
#ifndef BASICGUI_CURVEDLG_H
#define BASICGUI_CURVEDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_1Sel_QTD.h"
#include <GEOMBase_Skeleton.h>
#include <list>
class DlgRef_1Sel;
//=================================================================================
// class : BasicGUI_CurveDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_CurveDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_CurveDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_CurveDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_CurveDlg();
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* );
Ui::DlgRef_1Sel_QTD* GroupPoints;
private:
DlgRef_1Sel* GroupPoints;
GEOM::ListOfGO_var myPoints;
list<GEOM::GEOM_Object_var> myOrderedSel; //!< This list used for managing orderes selection
@ -75,7 +75,6 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
};
#endif // BASICGUI_CURVE_H
#endif // BASICGUI_CURVEDLG_H

View File

@ -18,28 +18,23 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_EllipseDlg.cxx
// Author : Nicolas REJNERI
// Module : GEOM
// $Header$
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
#include "BasicGUI_EllipseDlg.h"
#include "DlgRef_2Sel2Spin.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 : BasicGUI_EllipseDlg()
@ -50,7 +45,7 @@ using namespace std;
//=================================================================================
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
@ -58,14 +53,14 @@ BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* p
setWindowTitle( tr( "GEOM_ELLIPSE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_ELLIPSE"));
RadioButton1->setIcon(image0);
RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
RadioButton2->close();
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_ELLIPSE" ) );
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_2Sel2Spin(this, "GroupPoints");
GroupPoints = new DlgRef_2Sel2Spin( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_CENTER" ) );
GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
@ -77,7 +72,9 @@ BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* p
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
gridLayout1->addWidget(GroupPoints, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
/***************************************************************/
setHelpFileName( "ellipse.htm" );
@ -116,18 +113,18 @@ void BasicGUI_EllipseDlg::Init()
double aMajorR( 200. ), aMinorR( 100. );
/* min, max, step and decimals for spin boxes & initial values */
GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
GroupPoints->SpinBox_DX->SetValue( aMajorR );
GroupPoints->SpinBox_DY->SetValue( aMinorR );
initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
initSpinBox( GroupPoints->SpinBox_DY, 0.001, COORD_MAX, step, 3 );
GroupPoints->SpinBox_DX->setValue( aMajorR );
GroupPoints->SpinBox_DY->setValue( aMinorR );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
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() ) );
@ -138,13 +135,15 @@ void BasicGUI_EllipseDlg::Init()
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupPoints->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
// VSR: TODO ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DY, SLOT( SetStep( double ) ) );
// <<-
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
initName( tr( "GEOM_ELLIPSE" ).toLatin1().constData() );
initName( tr( "GEOM_ELLIPSE" ) );
}
@ -197,8 +196,7 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 )
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
return;
@ -206,8 +204,7 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = aSelectedObject;
@ -244,8 +241,7 @@ void BasicGUI_EllipseDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2 )
{
send == GroupPoints->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -286,9 +282,9 @@ void BasicGUI_EllipseDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_EllipseDlg::enterEvent(QEvent* e)
void BasicGUI_EllipseDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -316,10 +312,9 @@ GEOM::GEOM_IOperations_ptr BasicGUI_EllipseDlg::createOperation()
//=================================================================================
bool BasicGUI_EllipseDlg::isValid( QString& msg )
{
double aMajorR = GroupPoints->SpinBox_DX->GetValue();
double aMinorR = GroupPoints->SpinBox_DY->GetValue();
if ( aMajorR < aMinorR )
{
double aMajorR = GroupPoints->SpinBox_DX->value();
double aMinorR = GroupPoints->SpinBox_DY->value();
if ( aMajorR < aMinorR ) {
msg = tr( "GEOM_ELLIPSE_ERROR_1" );
return false;
}
@ -332,8 +327,8 @@ bool BasicGUI_EllipseDlg::isValid( QString& msg )
//=================================================================================
bool BasicGUI_EllipseDlg::execute( ObjectList& objects )
{
double aMajorR = GroupPoints->SpinBox_DX->GetValue();
double aMinorR = GroupPoints->SpinBox_DY->GetValue();
double aMajorR = GroupPoints->SpinBox_DX->value();
double aMinorR = GroupPoints->SpinBox_DY->value();
GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse( myPoint, myDir, aMajorR, aMinorR );
if ( !anObj->_is_nil() )
@ -350,4 +345,3 @@ void BasicGUI_EllipseDlg::closeEvent( QCloseEvent* e )
{
GEOMBase_Skeleton::closeEvent( e );
}

View File

@ -18,18 +18,16 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_EllipseDlg.h
// Author : Nicolas REJNERI
// Module : GEOM
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
#ifndef BASICGUI_ELLIPSE_H
#define BASICGUI_ELLIPSE_H
#ifndef BASICGUI_ELLIPSEDLG_H
#define BASICGUI_ELLIPSEDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel2Spin;
@ -37,27 +35,28 @@ class DlgRef_2Sel2Spin;
// class : BasicGUI_EllipseDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_EllipseDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_EllipseDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_EllipseDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_EllipseDlg();
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 myPoint, myDir;
DlgRef_2Sel2Spin* GroupPoints;
@ -73,8 +72,7 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);
void ValueChangedInSpinBox( double );
};
#endif // BASICGUI_ELLIPSE_H
#endif // BASICGUI_ELLIPSEDLG_H

View File

@ -19,26 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_LineDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_LineDlg.h"
#include "GeometryGUI.h"
#include "GEOMBase.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 <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 : BasicGUI_LineDlg()
@ -49,7 +45,7 @@ using namespace std;
//=================================================================================
BasicGUI_LineDlg::BasicGUI_LineDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
@ -57,28 +53,28 @@ BasicGUI_LineDlg::BasicGUI_LineDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
setWindowTitle( tr( "GEOM_LINE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_LINE"));
RadioButton1->setIcon(image0);
RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
RadioButton2->close();
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_LINE" ) );
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_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( image1 );
GroupPoints->PushButton2->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPoints );
/***************************************************************/
setHelpFileName( "line.htm" );
@ -111,12 +107,12 @@ void BasicGUI_LineDlg::Init()
globalSelection( GEOM_POINT );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
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() ) );
@ -127,7 +123,7 @@ void BasicGUI_LineDlg::Init()
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr("GEOM_LINE").toLatin1().constData() );
initName( tr( "GEOM_LINE" ) );
}
@ -172,8 +168,7 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 )
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
return;
@ -182,8 +177,7 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
@ -256,9 +250,9 @@ void BasicGUI_LineDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_LineDlg::enterEvent(QEvent* e)
void BasicGUI_LineDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}

View File

@ -19,49 +19,49 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_LineDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_LINE_H
#define DIALOGBOX_LINE_H
#ifndef BASICGUI_LINEDLG_H
#define BASICGUI_LINEDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel_QTD.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel;
//=================================================================================
// class : BasicGUI_LineDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_LineDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_LineDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_LineDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_LineDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_LineDlg();
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;
GEOM::GEOM_Object_var myPoint2;
Ui::DlgRef_2Sel_QTD* GroupPoints;
DlgRef_2Sel* GroupPoints;
private slots:
void ClickOnOk();
@ -74,7 +74,6 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
};
#endif // DIALOGBOX_LINE_H
#endif // BASICGUI_LINEDLG_H

View File

@ -19,27 +19,24 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_MarkerDlg.cxx
// Author : Sergey LITONIN
// Module : GEOM
// $Header$
// Author : Sergey LITONIN, Open CASCADE S.A.S. (sergey.litonin@opencascade.com)
//
#include "BasicGUI_MarkerDlg.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 <QLabel>
#include "GEOMImpl_Types.hxx"
#include <GEOMImpl_Types.hxx>
// OCCT Includes
#include <BRep_Tool.hxx>
@ -69,24 +66,18 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
setWindowTitle( tr( "CAPTION" ) );
GroupConstructors->setTitle( tr( "LOCALCS" ) );
RadioButton1->setIcon( iconCS1 );
RadioButton2->setIcon( iconCS2 );
RadioButton3->setIcon( iconCS3 );
mainFrame()->GroupConstructors->setTitle( tr( "LOCALCS" ) );
mainFrame()->RadioButton1->setIcon( iconCS1 );
mainFrame()->RadioButton2->setIcon( iconCS2 );
mainFrame()->RadioButton3->setIcon( iconCS3 );
Group1 = new Ui::DlgRef_1Sel_QTD();
QWidget* aGroup1Widget = new QWidget(this);
Group1->setupUi(aGroup1Widget);
aGroup1Widget->setObjectName("Group1");
Group1 = new DlgRef_1Sel( centralWidget() );
Group1->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
Group1->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
Group1->PushButton1->setIcon( iconSelect );
Group2 = new Ui::DlgRef_3Sel_QTD();
QWidget* aGroup2Widget = new QWidget(this);
Group2->setupUi(aGroup2Widget);
aGroup2Widget->setObjectName("Group2");
Group2 = new DlgRef_3Sel( centralWidget() );
Group2->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
Group2->TextLabel1->setText( tr( "GEOM_POINT" ) );
@ -96,22 +87,23 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
Group2->PushButton2->setIcon( iconSelect );
Group2->PushButton3->setIcon( iconSelect );
aMainGrp = new QFrame( this );
aMainGrp->setFrameStyle( QFrame::NoFrame );
aMainGrp = new QFrame( centralWidget() );
aMainGrp->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
aMainGrp->setContentsMargins( 0, 0, 0, 0 );
QHBoxLayout* aMainGrpLayout = new QHBoxLayout( aMainGrp );
aMainGrpLayout->setMargin( 0 );
QGroupBox* anOriGrp = new QGroupBox( tr( "ORIGIN" ), aMainGrp );
QVBoxLayout* anOriGrpLayout = new QVBoxLayout( anOriGrp );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), anOriGrp ) );
myData[ X ] = new DlgRef_SpinBox( anOriGrp );
myData[ X ] = new QDoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ X ] );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), anOriGrp ) );
myData[ Y ] = new DlgRef_SpinBox( anOriGrp );
myData[ Y ] = new QDoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ Y ] );
anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), anOriGrp ) );
myData[ Z ] = new DlgRef_SpinBox( anOriGrp );
myData[ Z ] = new QDoubleSpinBox( anOriGrp );
anOriGrpLayout->addWidget( myData[ Z ] );
aMainGrpLayout->addWidget( anOriGrp );
@ -120,13 +112,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
QVBoxLayout* aXAxisGrpLayout = new QVBoxLayout( aXAxisGrp );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), aXAxisGrp ) );
myData[ DX1 ] = new DlgRef_SpinBox( aXAxisGrp );
myData[ DX1 ] = new QDoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DX1 ] );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), aXAxisGrp ) );
myData[ DY1 ] = new DlgRef_SpinBox( aXAxisGrp );
myData[ DY1 ] = new QDoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DY1 ] );
aXAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), aXAxisGrp ) );
myData[ DZ1 ] = new DlgRef_SpinBox( aXAxisGrp );
myData[ DZ1 ] = new QDoubleSpinBox( aXAxisGrp );
aXAxisGrpLayout->addWidget( myData[ DZ1 ] );
aMainGrpLayout->addWidget( aXAxisGrp );
@ -135,20 +127,22 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th
QVBoxLayout* anYAxisGrpLayout = new QVBoxLayout( anYAxisGrp );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), anYAxisGrp ) );
myData[ DX2 ] = new DlgRef_SpinBox( anYAxisGrp );
myData[ DX2 ] = new QDoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DX2 ] );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), anYAxisGrp ) );
myData[ DY2 ] = new DlgRef_SpinBox( anYAxisGrp );
myData[ DY2 ] = new QDoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DY2 ] );
anYAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), anYAxisGrp ) );
myData[ DZ2 ] = new DlgRef_SpinBox( anYAxisGrp );
myData[ DZ2 ] = new QDoubleSpinBox( anYAxisGrp );
anYAxisGrpLayout->addWidget( myData[ DZ2 ] );
aMainGrpLayout->addWidget( anYAxisGrp );
gridLayout1->addWidget( aMainGrp, 2, 0 );
gridLayout1->addWidget( aGroup1Widget, 2, 0 );
gridLayout1->addWidget( aGroup2Widget, 2, 0 );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( aMainGrp );
layout->addWidget( Group1 );
layout->addWidget( Group2 );
setHelpFileName( "local_coordinate_system.htm" );
@ -179,7 +173,8 @@ void BasicGUI_MarkerDlg::Init()
Group2->LineEdit2->setReadOnly( true );
Group2->LineEdit3->setReadOnly( true );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( Group1->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group2->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group2->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
@ -190,33 +185,32 @@ void BasicGUI_MarkerDlg::Init()
connect( Group2->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( Group2->LineEdit3, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( onClose() ) );
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onClose() ) );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( onOk() ) );
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( onClose() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( onOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
initName( tr( "LCS_NAME" ).toLatin1().constData() );
initName( tr( "LCS_NAME" ) );
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
{
anIter.value()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 );
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) {
initSpinBox( anIter.value(), COORD_MIN, COORD_MAX, step, 3 );
connect( anIter.value(), SIGNAL( valueChanged( double ) ),
this, SLOT( onValueChanged( double ) ) );
}
myBlockPreview = true;
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
anIter.value()->SetValue( 0 );
myData[ DX1 ]->SetValue( 1 );
myData[ DY2 ]->SetValue( 1 );
anIter.value()->setValue( 0 );
myData[ DX1 ]->setValue( 1 );
myData[ DY2 ]->setValue( 1 );
myBlockPreview = false;
ConstructorsClicked( 0 );
@ -246,8 +240,7 @@ void BasicGUI_MarkerDlg::Init()
//=================================================================================
void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
{
if ( myConstructorId == constructorId && myConstructorId == 0 )
{
if ( myConstructorId == constructorId && myConstructorId == 0 ) {
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
activate( GEOM_MARKER );
displayPreview();
@ -258,13 +251,11 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
::qobject_cast<QWidget*>( Group1->gridLayout->parent() )->hide();
::qobject_cast<QWidget*>( Group2->gridLayout->parent() )->hide();
resize(0, 0);
Group1->hide();
Group2->hide();
aMainGrp->show();
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
activate( GEOM_MARKER );
@ -272,10 +263,9 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
}
case 1:
{
::qobject_cast<QWidget*>( Group2->gridLayout->parent() )->hide();
aMainGrp->hide();
//PAL6669: resize(0, 0);
::qobject_cast<QWidget*>( Group1->gridLayout->parent() )->show();
Group2->hide();
Group1->show();
globalSelection( GEOM_ALLGEOM );
myEditCurrentArgument = Group1->LineEdit1;
@ -285,9 +275,8 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
case 2:
{
aMainGrp->hide();
::qobject_cast<QWidget*>( Group1->gridLayout->parent() )->show();
//PAL6669: resize(0, 0);
::qobject_cast<QWidget*>( Group2->gridLayout->parent() )->show();
Group1->show();
Group2->show();
globalSelection( GEOM_POINT );
myEditCurrentArgument = Group2->LineEdit1;
@ -298,6 +287,10 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
onSelectionDone();
@ -343,52 +336,45 @@ bool BasicGUI_MarkerDlg::onApply()
//=================================================================================
void BasicGUI_MarkerDlg::onSelectionDone0()
{
if ( IObjectCount() == 1 )
{
if ( IObjectCount() == 1 ) {
Standard_Boolean aRes = Standard_False;
Handle(SALOME_InteractiveObject) anIO = firstIObject();
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
if ( aRes && !aSelectedObj->_is_nil() )
{
if ( aRes && !aSelectedObj->_is_nil() ) {
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
// Existing LCS selected
if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE )
{
if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE ) {
TopoDS_Face aFace = TopoDS::Face( aShape );
Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast( BRep_Tool::Surface( aFace ) );
if ( !aPlane.IsNull() )
{
if ( !aPlane.IsNull() ) {
gp_Ax3 anAx3 = aPlane->Pln().Position();
gp_Pnt aLoc = anAx3.Location();
gp_Dir aXDir = anAx3.XDirection();
gp_Dir aYDir = anAx3.YDirection();
myData[ X ]->SetValue( aLoc.X() );
myData[ Y ]->SetValue( aLoc.Y() );
myData[ Z ]->SetValue( aLoc.Z() );
myData[ X ]->setValue( aLoc.X() );
myData[ Y ]->setValue( aLoc.Y() );
myData[ Z ]->setValue( aLoc.Z() );
myData[ DX1 ]->SetValue( aXDir.X() );
myData[ DY1 ]->SetValue( aXDir.Y() );
myData[ DZ1 ]->SetValue( aXDir.Z() );
myData[ DX1 ]->setValue( aXDir.X() );
myData[ DY1 ]->setValue( aXDir.Y() );
myData[ DZ1 ]->setValue( aXDir.Z() );
myData[ DX2 ]->SetValue( aYDir.X() );
myData[ DY2 ]->SetValue( aYDir.Y() );
myData[ DZ2 ]->SetValue( aYDir.Z() );
myData[ DX2 ]->setValue( aYDir.X() );
myData[ DY2 ]->setValue( aYDir.Y() );
myData[ DZ2 ]->setValue( aYDir.Z() );
aSelMgr->clearSelected();
}
}
else
{
else {
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( anIO, aMap );
if ( aMap.Extent() == 1 )
{
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
TopTools_IndexedMapOfShape aShapes;
TopExp::MapShapes( aShape, aShapes );
@ -396,12 +382,11 @@ void BasicGUI_MarkerDlg::onSelectionDone0()
aSelMgr->clearSelected();
}
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
{
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
myData[ X ]->SetValue( aPnt.X() );
myData[ Y ]->SetValue( aPnt.Y() );
myData[ Z ]->SetValue( aPnt.Z() );
myData[ X ]->setValue( aPnt.X() );
myData[ Y ]->setValue( aPnt.Y() );
myData[ Z ]->setValue( aPnt.Z() );
}
}
}
@ -456,17 +441,17 @@ void BasicGUI_MarkerDlg::onSelectionDone()
}
// Set values
myData[ X ]->SetValue( Ox );
myData[ Y ]->SetValue( Oy );
myData[ Z ]->SetValue( Oz );
myData[ X ]->setValue( Ox );
myData[ Y ]->setValue( Oy );
myData[ Z ]->setValue( Oz );
myData[ DX1 ]->SetValue( Xx );
myData[ DY1 ]->SetValue( Xy );
myData[ DZ1 ]->SetValue( Xz );
myData[ DX1 ]->setValue( Xx );
myData[ DY1 ]->setValue( Xy );
myData[ DZ1 ]->setValue( Xz );
myData[ DX2 ]->SetValue( Yx );
myData[ DY2 ]->SetValue( Yy );
myData[ DZ2 ]->SetValue( Yz );
myData[ DX2 ]->setValue( Yx );
myData[ DY2 ]->setValue( Yy );
myData[ DZ2 ]->setValue( Yz );
myEditCurrentArgument->setText( aName );
}
@ -489,15 +474,15 @@ void BasicGUI_MarkerDlg::onSelectionDone()
if ( myEditCurrentArgument == Group2->LineEdit1 ) {
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
myData[ X ]->SetValue( aPnt.X() );
myData[ Y ]->SetValue( aPnt.Y() );
myData[ Z ]->SetValue( aPnt.Z() );
myData[ X ]->setValue( aPnt.X() );
myData[ Y ]->setValue( aPnt.Y() );
myData[ Z ]->setValue( aPnt.Z() );
myEditCurrentArgument->setText( aName );
}
else {
myData[ X ]->SetValue( 0 );
myData[ Y ]->SetValue( 0 );
myData[ Z ]->SetValue( 0 );
myData[ X ]->setValue( 0 );
myData[ Y ]->setValue( 0 );
myData[ Z ]->setValue( 0 );
}
}
else if (myEditCurrentArgument == Group2->LineEdit2) {
@ -506,15 +491,15 @@ void BasicGUI_MarkerDlg::onSelectionDone()
gp_Pnt aP2 = BRep_Tool::Pnt( TopExp::LastVertex( TopoDS::Edge( aShape ) ) );
gp_Dir aDir( gp_Vec( aP1, aP2 ) );
myData[ DX1 ]->SetValue( aDir.X() );
myData[ DY1 ]->SetValue( aDir.Y() );
myData[ DZ1 ]->SetValue( aDir.Z() );
myData[ DX1 ]->setValue( aDir.X() );
myData[ DY1 ]->setValue( aDir.Y() );
myData[ DZ1 ]->setValue( aDir.Z() );
myEditCurrentArgument->setText( aName );
}
else {
myData[ DX1 ]->SetValue( 0 );
myData[ DY1 ]->SetValue( 0 );
myData[ DZ1 ]->SetValue( 0 );
myData[ DX1 ]->setValue( 0 );
myData[ DY1 ]->setValue( 0 );
myData[ DZ1 ]->setValue( 0 );
}
}
else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
@ -523,15 +508,15 @@ void BasicGUI_MarkerDlg::onSelectionDone()
gp_Pnt aP2 = BRep_Tool::Pnt( TopExp::LastVertex( TopoDS::Edge( aShape ) ) );
gp_Dir aDir(gp_Vec( aP1, aP2 ));
myData[ DX2 ]->SetValue( aDir.X() );
myData[ DY2 ]->SetValue( aDir.Y() );
myData[ DZ2 ]->SetValue( aDir.Z() );
myData[ DX2 ]->setValue( aDir.X() );
myData[ DY2 ]->setValue( aDir.Y() );
myData[ DZ2 ]->setValue( aDir.Z() );
myEditCurrentArgument->setText( aName );
}
else {
myData[ DX2 ]->SetValue( 0 );
myData[ DY2 ]->SetValue( 0 );
myData[ DZ2 ]->SetValue( 0 );
myData[ DX2 ]->setValue( 0 );
myData[ DY2 ]->setValue( 0 );
myData[ DZ2 ]->setValue( 0 );
}
}
}
@ -540,33 +525,33 @@ void BasicGUI_MarkerDlg::onSelectionDone()
}
else {
if ( getConstructorId() == 1 ) {
myData[ X ]->SetValue( 0 );
myData[ Y ]->SetValue( 0 );
myData[ Z ]->SetValue( 0 );
myData[ X ]->setValue( 0 );
myData[ Y ]->setValue( 0 );
myData[ Z ]->setValue( 0 );
myData[ DX1 ]->SetValue( 0 );
myData[ DY1 ]->SetValue( 0 );
myData[ DZ1 ]->SetValue( 0 );
myData[ DX1 ]->setValue( 0 );
myData[ DY1 ]->setValue( 0 );
myData[ DZ1 ]->setValue( 0 );
myData[ DX2 ]->SetValue( 0 );
myData[ DY2 ]->SetValue( 0 );
myData[ DZ2 ]->SetValue( 0 );
myData[ DX2 ]->setValue( 0 );
myData[ DY2 ]->setValue( 0 );
myData[ DZ2 ]->setValue( 0 );
}
else if ( getConstructorId() == 2 ) {
if ( myEditCurrentArgument == Group2->LineEdit1 ) {
myData[ X ]->SetValue( 0 );
myData[ Y ]->SetValue( 0 );
myData[ Z ]->SetValue( 0 );
myData[ X ]->setValue( 0 );
myData[ Y ]->setValue( 0 );
myData[ Z ]->setValue( 0 );
}
else if ( myEditCurrentArgument == Group2->LineEdit2 ) {
myData[ DX1 ]->SetValue( 0 );
myData[ DY1 ]->SetValue( 0 );
myData[ DZ1 ]->SetValue( 0 );
myData[ DX1 ]->setValue( 0 );
myData[ DY1 ]->setValue( 0 );
myData[ DZ1 ]->setValue( 0 );
}
else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
myData[ DX2 ]->SetValue( 0 );
myData[ DY2 ]->SetValue( 0 );
myData[ DZ2 ]->SetValue( 0 );
myData[ DX2 ]->setValue( 0 );
myData[ DY2 ]->setValue( 0 );
myData[ DZ2 ]->setValue( 0 );
}
}
}
@ -641,9 +626,9 @@ void BasicGUI_MarkerDlg::onDeactivate()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_MarkerDlg::enterEvent(QEvent* e)
void BasicGUI_MarkerDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
onActivate();
}
@ -663,8 +648,8 @@ GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation()
bool BasicGUI_MarkerDlg::isValid( QString& msg )
{
const int id = getConstructorId();
gp_Vec v1( myData[ DX1 ]->GetValue(), myData[ DY1 ]->GetValue(), myData[ DZ1 ]->GetValue() ),
v2( myData[ DX2 ]->GetValue(), myData[ DY2 ]->GetValue(), myData[ DZ2 ]->GetValue() );
gp_Vec v1( myData[ DX1 ]->value(), myData[ DY1 ]->value(), myData[ DZ1 ]->value() ),
v2( myData[ DX2 ]->value(), myData[ DY2 ]->value(), myData[ DZ2 ]->value() );
bool isOk = false;
// we will got exception if the magnitude of any of the 2 vectors <= gp::Resolution()
@ -675,8 +660,7 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg )
msg += tr( "VEC_PARALLEL" );
}
switch ( id )
{
switch ( id ) {
case 0:
return isOk;
case 1:
@ -696,9 +680,9 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg )
bool BasicGUI_MarkerDlg::execute( ObjectList& objects )
{
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IBasicOperations::_narrow(
getOperation() )->MakeMarker( myData[ X ]->GetValue(), myData[ Y ]->GetValue(), myData[ Z ]->GetValue(),
myData[ DX1 ]->GetValue(), myData[ DY1 ]->GetValue(), myData[ DZ1 ]->GetValue(),
myData[ DX2 ]->GetValue(), myData[ DY2 ]->GetValue(), myData[ DZ2 ]->GetValue() );
getOperation() )->MakeMarker( myData[ X ]->value(), myData[ Y ]->value(), myData[ Z ]->value(),
myData[ DX1 ]->value(), myData[ DY1 ]->value(), myData[ DZ1 ]->value(),
myData[ DX2 ]->value(), myData[ DY2 ]->value(), myData[ DZ2 ]->value() );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
@ -733,12 +717,9 @@ void BasicGUI_MarkerDlg::displayPreview ( const bool activate,
const bool toRemoveFromEngine,
const double lineWidth )
{
if ( !myBlockPreview )
{
if ( !myBlockPreview ) {
GEOMBase_Skeleton::displayPreview( activate, update, toRemoveFromEngine, lineWidth );
if ( myConstructorId == 0 )
{
GEOMBase_Skeleton::activate( GEOM_MARKER );
}
}
}

View File

@ -19,50 +19,49 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_MarkerDlg.h
// Author : Sergey LITONIN
// Module : GEOM
// Author : Sergey LITONIN, Open CASCADE S.A.S. (sergey.litonin@opencascade.com)
//
#ifndef DIALOGBOX_Marker_H
#define DIALOGBOX_Marker_H
#ifndef BASICGUI_MARKERDLG_H
#define BASICGUI_MARKERDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_1Sel_QTD.h"
#include "DlgRef_3Sel_QTD.h"
#include <GEOMBase_Skeleton.h>
#include <QMap>
class DlgRef_SpinBox;
class DlgRef_1Sel;
class DlgRef_3Sel;
class QDoubleSpinBox;
class QFrame;
class GEOM_BASICGUI_EXPORT BasicGUI_MarkerDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_MarkerDlg : public GEOMBase_Skeleton
{
Q_OBJECT
private:
enum { X, Y, Z, DX1, DY1, DZ1, DX2, DY2, DZ2 };
typedef QMap< int, DlgRef_SpinBox* > DataMap;
typedef QMap< int, QDoubleSpinBox* > DataMap;
public:
BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* );
BasicGUI_MarkerDlg( GeometryGUI*, QWidget* );
virtual ~BasicGUI_MarkerDlg();
void Init();
protected:
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
virtual void closeEvent( QCloseEvent* e );
virtual void displayPreview ( const bool activate = false,
const bool update = true,
const bool toRemoveFromEngine = true,
const double lineWidth = -1 );
virtual bool execute( ObjectList& );
virtual void closeEvent( QCloseEvent* );
virtual void displayPreview ( const bool = false,
const bool = true,
const bool = true,
const double = -1 );
private:
void enterEvent( QEvent* e );
void enterEvent( QEvent* );
void onSelectionDone0();
private slots:
@ -83,9 +82,8 @@ private:
int myBlockPreview;
QFrame* aMainGrp;
Ui::DlgRef_1Sel_QTD* Group1;
Ui::DlgRef_3Sel_QTD* Group2;
DlgRef_1Sel* Group1;
DlgRef_3Sel* Group2;
};
#endif // DIALOGBOX_Marker_H
#endif // BASICGUI_MARKERDLG_H

View File

@ -19,32 +19,25 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_PlaneDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_PlaneDlg.h"
#include "DlgRef_1Sel1Spin.h"
#include "DlgRef_2Sel1Spin.h"
#include "DlgRef_3Sel1Spin.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 <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <TColStd_MapOfInteger.hxx>
#include "GEOMImpl_Types.hxx"
using namespace std;
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : BasicGUI_PlaneDlg()
@ -55,7 +48,7 @@ using namespace std;
//=================================================================================
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
@ -65,12 +58,12 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
setWindowTitle( tr( "GEOM_PLANE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_PLANE"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setIcon(image2);
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PLANE" ) );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setIcon( image1 );
mainFrame()->RadioButton3->setIcon( image2 );
GroupPntDir = new DlgRef_2Sel1Spin(this, "GroupPointDirection");
GroupPntDir = new DlgRef_2Sel1Spin( centralWidget() );
GroupPntDir->GroupBox1->setTitle( tr( "GEOM_PLANE_PV" ) );
GroupPntDir->TextLabel1->setText( tr( "GEOM_POINT" ) );
GroupPntDir->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
@ -80,7 +73,7 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
GroupPntDir->LineEdit1->setReadOnly( true );
GroupPntDir->LineEdit2->setReadOnly( true );
Group3Pnts = new DlgRef_3Sel1Spin(this, "Group3Pnts");
Group3Pnts = new DlgRef_3Sel1Spin( centralWidget() );
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_3_POINTS" ) );
Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT1" ) );
Group3Pnts->TextLabel2->setText( tr( "GEOM_POINT2" ) );
@ -94,7 +87,7 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace");
GroupFace = new DlgRef_1Sel1Spin( centralWidget() );
GroupFace->GroupBox1->setTitle( tr( "GEOM_FACE_OR_LCS" ) );
GroupFace->TextLabel1->setText( tr( "GEOM_SELECTION" ) );
GroupFace->TextLabel2->setText( tr( "GEOM_PLANE_SIZE" ) );
@ -102,9 +95,11 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren
GroupFace->LineEdit1->setReadOnly( true );
gridLayout1->addWidget(GroupPntDir, 2, 0);
gridLayout1->addWidget(Group3Pnts, 2, 0);
gridLayout1->addWidget(GroupFace, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPntDir );
layout->addWidget( Group3Pnts );
layout->addWidget( GroupFace );
/***************************************************************/
setHelpFileName( "plane.htm" );
@ -142,21 +137,22 @@ void BasicGUI_PlaneDlg::Init()
double aTrimSize = 2000.0;
/* min, max, step and decimals for spin boxes */
GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 );
GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
GroupFace->SpinBox_DX->SetValue( aTrimSize );
initSpinBox( GroupPntDir->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 );
GroupPntDir->SpinBox_DX->setValue( aTrimSize );
initSpinBox( Group3Pnts->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 );
Group3Pnts->SpinBox_DX->setValue( aTrimSize );
initSpinBox( GroupFace->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 );
GroupFace->SpinBox_DX->setValue( aTrimSize );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( GroupPntDir->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( GroupPntDir->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
@ -176,16 +172,16 @@ void BasicGUI_PlaneDlg::Init()
connect( Group3Pnts->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupFace->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
// VSR: TODO ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPntDir->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), Group3Pnts->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupFace->SpinBox_DX, SLOT( SetStep( double ) ) );
// <<-
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_PLANE" ).toLatin1().constData() );
initName( tr( "GEOM_PLANE" ) );
Group3Pnts->hide();
GroupFace->hide();
ConstructorsClicked( 0 );
}
@ -199,18 +195,16 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = myFace = GEOM::GEOM_Object::_nil();
switch ( constructorId )
{
switch ( constructorId ) {
case 0: /* plane from a point and a direction (vector, edge...) */
{
Group3Pnts->hide();
GroupFace->hide();
resize(0, 0);
GroupPntDir->show();
myEditCurrentArgument = GroupPntDir->LineEdit1;
GroupPntDir->LineEdit1->setText(tr(""));
GroupPntDir->LineEdit2->setText(tr(""));
GroupPntDir->LineEdit1->setText( "" );
GroupPntDir->LineEdit2->setText( "" );
/* for the first argument */
globalSelection( GEOM_POINT );
@ -220,7 +214,6 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
{
GroupPntDir->hide();
GroupFace->hide();
resize(0, 0);
Group3Pnts->show();
myEditCurrentArgument = Group3Pnts->LineEdit1;
@ -236,11 +229,10 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
{
GroupPntDir->hide();
Group3Pnts->hide();
resize(0, 0);
GroupFace->show();
myEditCurrentArgument = GroupFace->LineEdit1;
GroupFace->LineEdit1->setText(tr(""));
GroupFace->LineEdit1->setText( "" );
/* for the first argument */
//globalSelection( GEOM_PLANE );
@ -252,6 +244,10 @@ void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
myEditCurrentArgument->setFocus();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
@ -300,8 +296,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText("");
if ( IObjectCount() != 1 )
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
@ -314,8 +309,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject;
@ -374,8 +368,7 @@ void BasicGUI_PlaneDlg::LineEditReturnPressed()
send == Group3Pnts->LineEdit1 ||
send == Group3Pnts->LineEdit2 ||
send == Group3Pnts->LineEdit3 ||
send == GroupFace->LineEdit1 )
{
send == GroupFace->LineEdit1 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -411,9 +404,9 @@ void BasicGUI_PlaneDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_PlaneDlg::enterEvent(QEvent* e)
void BasicGUI_PlaneDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -433,11 +426,10 @@ void BasicGUI_PlaneDlg::ValueChangedInSpinBox(double newValue)
//=================================================================================
double BasicGUI_PlaneDlg::getSize() const
{
switch ( getConstructorId() )
{
case 0 : return GroupPntDir->SpinBox_DX->GetValue();
case 1 : return Group3Pnts->SpinBox_DX->GetValue();
case 2 : return GroupFace->SpinBox_DX->GetValue();
switch ( getConstructorId() ) {
case 0 : return GroupPntDir->SpinBox_DX->value();
case 1 : return Group3Pnts->SpinBox_DX->value();
case 2 : return GroupFace->SpinBox_DX->value();
}
return 0.;
}
@ -467,8 +459,7 @@ static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje
bool BasicGUI_PlaneDlg::isValid( QString& msg )
{
const int id = getConstructorId();
if ( getSize() <= 0 )
{
if ( getSize() <= 0 ) {
msg = QString( "Please, enter size greater than 0." );
return false;
}
@ -492,8 +483,7 @@ bool BasicGUI_PlaneDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlanePntVec( myPoint, myDir, getSize() );
res = true;

View File

@ -19,18 +19,16 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_PlaneDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_PLANE_H
#define DIALOGBOX_PLANE_H
#ifndef BASICGUI_PLANEDLG_H
#define BASICGUI_PLANEDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_1Sel1Spin;
class DlgRef_2Sel1Spin;
@ -40,28 +38,29 @@ class DlgRef_3Sel1Spin;
// class : BasicGUI_PlaneDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_PlaneDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_PlaneDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_PlaneDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_PlaneDlg();
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 getSize() const;
private:
GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3, myFace;
DlgRef_2Sel1Spin* GroupPntDir;
@ -79,9 +78,8 @@ private slots:
void SelectionIntoArgument();
void LineEditReturnPressed();
void SetEditCurrentArgument();
void ConstructorsClicked(int constructorId);
void ValueChangedInSpinBox(double newValue);
void ConstructorsClicked( int );
void ValueChangedInSpinBox( double );
};
#endif // DIALOGBOX_PLANE_H
#endif // BASICGUI_PLANEDLG_H

View File

@ -19,29 +19,23 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_PointDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_PointDlg.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 "GeometryGUI.h"
#include "GEOMBase.h"
#include <GeometryGUI.h>
#include <GEOMBase.h>
#include "DlgRef_SpinBox.h"
#include "DlgRef_1Sel1Spin.h"
#include "DlgRef_3Spin.h"
#include "DlgRef_1Sel3Spin.h"
#include <GEOM_DlgRef.h>
#include "GEOMImpl_Types.hxx"
#include <GEOMImpl_Types.hxx>
#include <QApplication>
#include <QLabel>
@ -55,7 +49,6 @@
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
using namespace std;
//=================================================================================
// class : BasicGUI_PointDlg()
// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
@ -74,44 +67,33 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
setWindowTitle( tr( "GEOM_POINT_TITLE" ) );
QFrame* aFrame = new QFrame( this );
aFrame->setContentsMargins( 0, 0, 0, 0 );
aFrame->setFrameStyle( QFrame::NoFrame );
QHBoxLayout* aFrameLayout = new QHBoxLayout( aFrame );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_POINTS"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image3);
RadioButton3->setIcon(image1);
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_POINTS" ) );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setIcon( image3 );
mainFrame()->RadioButton3->setIcon( image1 );
GroupXYZ = new DlgRef_3Spin( aFrame, "GroupXYZ" );
GroupXYZ = new DlgRef_3Spin( centralWidget() );
GroupXYZ->GroupBox1->setTitle( tr( "GEOM_COORDINATES" ) );
GroupXYZ->TextLabel1->setText( tr( "GEOM_X" ) );
GroupXYZ->TextLabel2->setText( tr( "GEOM_Y" ) );
GroupXYZ->TextLabel3->setText( tr( "GEOM_Z" ) );
aFrameLayout->addWidget(GroupXYZ);
GroupOnCurve = new DlgRef_1Sel1Spin( aFrame, "GroupOnCurve" );
GroupOnCurve = new DlgRef_1Sel1Spin( centralWidget() );
GroupOnCurve->GroupBox1->setTitle( tr( "GEOM_PARAM_POINT" ) );
GroupOnCurve->TextLabel1->setText( tr( "GEOM_EDGE" ) );
GroupOnCurve->TextLabel2->setText( tr( "GEOM_PARAMETER" ) );
GroupOnCurve->PushButton1->setIcon( image2 );
aFrameLayout->addWidget(GroupOnCurve);
GroupRefPoint = new DlgRef_1Sel3Spin( aFrame, "GoupRefPoint" );
GroupRefPoint = new DlgRef_1Sel3Spin( centralWidget() );
GroupRefPoint->GroupBox1->setTitle( tr( "GEOM_REF_POINT" ) );
GroupRefPoint->TextLabel1->setText( tr( "GEOM_POINT" ) );
GroupRefPoint->PushButton1->setIcon( image2 );
GroupRefPoint->TextLabel2->setText( tr( "GEOM_DX" ) );
GroupRefPoint->TextLabel3->setText( tr( "GEOM_DY" ) );
GroupRefPoint->TextLabel4->setText( tr( "GEOM_DZ" ) );
aFrameLayout->addWidget(GroupRefPoint);
gridLayout1->addWidget( aFrame, 2, 0 );
/***************************************************************/
myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), aFrame );
myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), centralWidget() );
QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp );
myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), myCoordGrp ), 0, 0 );
myX = new QLineEdit( myCoordGrp );
@ -123,6 +105,13 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
myZ = new QLineEdit( myCoordGrp );
myCoordGrpLayout->addWidget( myZ, 2, 1 );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupXYZ );
layout->addWidget( GroupOnCurve );
layout->addWidget( GroupRefPoint );
layout->addWidget( myCoordGrp );
myX->setReadOnly( true );
myY->setReadOnly( true );
myZ->setReadOnly( true );
@ -171,32 +160,34 @@ void BasicGUI_PointDlg::Init()
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
/* min, max, step and decimals for spin boxes */
GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupXYZ->SpinBox_DX->SetValue(0.0);
GroupXYZ->SpinBox_DY->SetValue(0.0);
GroupXYZ->SpinBox_DZ->SetValue(0.0);
initSpinBox( GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 );
initSpinBox( GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
initSpinBox( GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
GroupXYZ->SpinBox_DX->setValue( 0.0 );
GroupXYZ->SpinBox_DY->setValue( 0.0 );
GroupXYZ->SpinBox_DZ->setValue( 0.0 );
GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
GroupRefPoint->SpinBox_DX->SetValue(0.0);
GroupRefPoint->SpinBox_DY->SetValue(0.0);
GroupRefPoint->SpinBox_DZ->SetValue(0.0);
initSpinBox( GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 );
initSpinBox( GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
initSpinBox( GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
GroupRefPoint->SpinBox_DX->setValue( 0.0 );
GroupRefPoint->SpinBox_DY->setValue( 0.0 );
GroupRefPoint->SpinBox_DZ->setValue( 0.0 );
step = 0.1;
GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, 3);
GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
initSpinBox( GroupOnCurve->SpinBox_DX, 0., 1., step, 3 );
GroupOnCurve->SpinBox_DX->setValue( 0.5 );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( GroupOnCurve->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( GroupOnCurve->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
@ -209,6 +200,7 @@ void BasicGUI_PointDlg::Init()
connect( GroupRefPoint->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupRefPoint->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
// VSR: TODO ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupOnCurve->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupXYZ->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupXYZ->SpinBox_DY, SLOT( SetStep( double ) ) );
@ -216,11 +208,12 @@ void BasicGUI_PointDlg::Init()
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupRefPoint->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupRefPoint->SpinBox_DY, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupRefPoint->SpinBox_DZ, SLOT( SetStep( double ) ) );
// <<-
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr("GEOM_VERTEX").toLatin1().constData() );
initName( tr( "GEOM_VERTEX" ) );
ConstructorsClicked( 0 );
}
@ -232,8 +225,7 @@ void BasicGUI_PointDlg::Init()
//=================================================================================
void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
{
switch ( constructorId )
{
switch ( constructorId ) {
case 0:
{
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
@ -241,9 +233,9 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
GroupRefPoint->hide();
GroupOnCurve->hide();
GroupXYZ->show();
myCoordGrp->hide();
GroupXYZ->show();
break;
}
case 1:
@ -336,8 +328,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
{
const int id = getConstructorId();
if ( ( id == 1 || id == 2 ) && myEditCurrentArgument != 0 )
{
if ( ( id == 1 || id == 2 ) && myEditCurrentArgument != 0 ) {
myEditCurrentArgument->setText( "" );
myX->setText( "" );
myY->setText( "" );
@ -345,30 +336,24 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
myRefPoint = myEdge = GEOM::GEOM_Object::_nil();
}
if ( IObjectCount() == 1 )
{
if ( IObjectCount() == 1 ) {
Standard_Boolean aRes = Standard_False;
Handle(SALOME_InteractiveObject) anIO = firstIObject();
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( id == 0 )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
if ( id == 0 ) {
// get CORBA reference to data object
TopoDS_Shape aShape = myGeomGUI->GetShapeReader().GetShape
( myGeomGUI->GetGeomGen(), aSelectedObject );
TopoDS_Shape aShape = myGeomGUI->GetShapeReader().GetShape( myGeomGUI->GetGeomGen(), aSelectedObject );
if ( aShape.IsNull() )
return;
if ( aShape.ShapeType() != TopAbs_VERTEX )
{
if ( aShape.ShapeType() != TopAbs_VERTEX ) {
TColStd_IndexedMapOfInteger aMap;
LightApp_Application* anApp =
(LightApp_Application*)(SUIT_Session::session()->activeApplication());
anApp->selectionMgr()->GetIndexes( anIO, aMap );
if ( aMap.Extent() == 1 )
{
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
TopTools_IndexedMapOfShape aShapes;
TopExp::MapShapes( aShape, aShapes );
@ -382,17 +367,15 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
}
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() );
GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() );
GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );
GroupXYZ->SpinBox_DZ->setValue( aPnt.Z() );
}
else if ( id == 1 )
{
else if ( id == 1 ) {
myRefPoint = aSelectedObject;
GroupRefPoint->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
}
else if ( id == 2 )
{
else if ( id == 2 ) {
myEdge = aSelectedObject;
GroupOnCurve->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
}
@ -426,15 +409,13 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
if ( send == GroupRefPoint->PushButton1 )
{
if ( send == GroupRefPoint->PushButton1 ) {
GroupRefPoint->LineEdit1->setFocus();
myEditCurrentArgument = GroupRefPoint->LineEdit1;
globalSelection( GEOM_POINT );
}
else if ( send == GroupOnCurve->PushButton1 )
{
else if ( send == GroupOnCurve->PushButton1 ) {
GroupOnCurve->LineEdit1->setFocus();
myEditCurrentArgument = GroupOnCurve->LineEdit1;
@ -447,9 +428,9 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
// function : enterEvent()
// purpose : to reactivate this dialog box when mouse enter onto the window
//=================================================================================
void BasicGUI_PointDlg::enterEvent(QEvent* e)
void BasicGUI_PointDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -492,7 +473,7 @@ void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
//=================================================================================
double BasicGUI_PointDlg::getParameter() const
{
return GroupOnCurve->SpinBox_DX->GetValue();
return GroupOnCurve->SpinBox_DX->value();
}
//=================================================================================
@ -501,11 +482,10 @@ double BasicGUI_PointDlg::getParameter() const
//=================================================================================
void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
{
if ( getConstructorId() == 0 )
{
GroupXYZ->SpinBox_DX->SetValue( thePnt.X() );
GroupXYZ->SpinBox_DY->SetValue( thePnt.Y() );
GroupXYZ->SpinBox_DZ->SetValue( thePnt.Z() );
if ( getConstructorId() == 0 ) {
GroupXYZ->SpinBox_DX->setValue( thePnt.X() );
GroupXYZ->SpinBox_DY->setValue( thePnt.Y() );
GroupXYZ->SpinBox_DZ->setValue( thePnt.Z() );
displayPreview();
}
@ -546,13 +526,12 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() )
{
switch ( getConstructorId() ) {
case 0 :
{
double x = GroupXYZ->SpinBox_DX->GetValue();
double y = GroupXYZ->SpinBox_DY->GetValue();
double z = GroupXYZ->SpinBox_DZ->GetValue();
double x = GroupXYZ->SpinBox_DX->value();
double y = GroupXYZ->SpinBox_DY->value();
double z = GroupXYZ->SpinBox_DZ->value();
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x, y, z );
res = true;
@ -560,9 +539,9 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
}
case 1 :
{
double dx = GroupRefPoint->SpinBox_DX->GetValue();
double dy = GroupRefPoint->SpinBox_DY->GetValue();
double dz = GroupRefPoint->SpinBox_DZ->GetValue();
double dx = GroupRefPoint->SpinBox_DX->value();
double dy = GroupRefPoint->SpinBox_DY->value();
double dz = GroupRefPoint->SpinBox_DZ->value();
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointWithReference( myRefPoint, dx, dy, dz );
@ -576,27 +555,22 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
break;
}
if ( getConstructorId() == 1 || getConstructorId() == 2 )
{
if ( getConstructorId() == 1 || getConstructorId() == 2 ) {
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
{
if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
myX->setText( QString( "%1" ).arg( aPnt.X() ) );
myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
}
else
{
else {
myX->setText( "" );
myY->setText( "" );
myZ->setText( "" );
}
}
if ( !anObj->_is_nil() )
{
//printf( "--> a valid point is created\n" );
if ( !anObj->_is_nil() ) {
objects.push_back( anObj._retn() );
}

View File

@ -19,18 +19,16 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_PointDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_POINT_H
#define DIALOGBOX_POINT_H
#ifndef BASICGUI_POINTDLG_H
#define BASICGUI_POINTDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_1Sel1Spin;
class DlgRef_3Spin;
@ -45,32 +43,33 @@ class gp_Pnt;
// class : BasicGUI_PointDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_PointDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_PointDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_PointDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_PointDlg();
bool acceptMouseEvent() const { return ( getConstructorId() == 0 ); };
bool acceptMouseEvent() const { return ( getConstructorId() == 0 ); }
void OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress()
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 getParameter() const;
private:
GEOM::GEOM_Object_var myEdge;
GEOM::GEOM_Object_var myRefPoint;
@ -92,8 +91,8 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ConstructorsClicked(int constructorId);
void ValueChangedInSpinBox(double newValue);
void ConstructorsClicked( int );
void ValueChangedInSpinBox( double );
};
#endif // DIALOGBOX_POINT_H
#endif // BASICGUI_POINTDLG_H

View File

@ -19,28 +19,22 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_VectorDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_VectorDlg.h"
#include "DlgRef_3Spin1Check.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 : BasicGUI_VectorDlg()
@ -60,35 +54,34 @@ BasicGUI_VectorDlg::BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* par
setWindowTitle( tr( "GEOM_VECTOR_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_VECTOR"));
RadioButton1->setIcon(image0);
RadioButton2->setIcon(image1);
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
mainFrame()->GroupConstructors->setTitle(tr("GEOM_VECTOR"));
mainFrame()->RadioButton1->setIcon(image0);
mainFrame()->RadioButton2->setIcon(image1);
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_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 );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
GroupDimensions = new DlgRef_3Spin1Check(this, "GroupDimensions");
GroupDimensions = new DlgRef_3Spin1Check( centralWidget() );
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_COORDINATES" ) );
GroupDimensions->TextLabel1->setText( tr( "GEOM_DX" ) );
GroupDimensions->TextLabel2->setText( tr( "GEOM_DY" ) );
GroupDimensions->TextLabel3->setText( tr( "GEOM_DZ" ) );
GroupDimensions->CheckBox1->setText(tr("GEOM_REVERSE_VECTOR"));
GroupDimensions->CheckButton1->setText( tr( "GEOM_REVERSE_VECTOR" ) );
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( "vector.htm" );
@ -124,25 +117,26 @@ void BasicGUI_VectorDlg::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 dx( 0. ), dy( 0. ), dz( 200. );
GroupDimensions->SpinBox_DX->SetValue( dx );
GroupDimensions->SpinBox_DY->SetValue( dy );
GroupDimensions->SpinBox_DZ->SetValue( dz );
GroupDimensions->SpinBox_DX->setValue( dx );
GroupDimensions->SpinBox_DY->setValue( dy );
GroupDimensions->SpinBox_DZ->setValue( dz );
GroupDimensions->CheckBox1->setChecked(FALSE);
GroupDimensions->CheckButton1->setChecked( false );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
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,18 +148,19 @@ void BasicGUI_VectorDlg::Init()
connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupDimensions->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
// VSR: TODO ->>
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DY, SLOT( SetStep( double ) ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DZ, SLOT( SetStep( double ) ) );
// <<-
connect(GroupDimensions->CheckBox1, SIGNAL(stateChanged(int)), this, SLOT(ReverseVector(int)));
connect( GroupDimensions->CheckButton1, SIGNAL( stateChanged( int ) ), this, SLOT( ReverseVector( int ) ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT(SelectionIntoArgument() ) );
initName( tr("GEOM_VECTOR").toLatin1().constData() );
initName( tr("GEOM_VECTOR") );
GroupDimensions->hide();
ConstructorsClicked( 0 );
}
@ -180,13 +175,11 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId )
myPoint1 = GEOM::GEOM_Object::_nil();
myPoint2 = GEOM::GEOM_Object::_nil();
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
GroupDimensions->hide();
resize(0, 0);
::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->show();
GroupPoints->show();
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setText( "" );
@ -199,20 +192,23 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId )
}
case 1:
{
::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->hide();
resize( 0, 0 );
GroupPoints->hide();
GroupDimensions->show();
double dx( 0. ), dy( 0. ), dz( 0. );
GroupDimensions->SpinBox_DX->SetValue( dx );
GroupDimensions->SpinBox_DY->SetValue( dy );
GroupDimensions->SpinBox_DZ->SetValue( dz );
GroupDimensions->SpinBox_DX->setValue( dx );
GroupDimensions->SpinBox_DY->setValue( dy );
GroupDimensions->SpinBox_DZ->setValue( dz );
GroupDimensions->CheckBox1->setChecked( FALSE );
GroupDimensions->CheckButton1->setChecked( false );
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
displayPreview();
}
@ -242,7 +238,7 @@ void BasicGUI_VectorDlg::ClickOnCancel()
//=================================================================================
bool BasicGUI_VectorDlg::ClickOnApply()
{
buttonApply->setFocus();
buttonApply()->setFocus();
if ( !onAccept() )
return false;
@ -262,8 +258,7 @@ void BasicGUI_VectorDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 )
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@ -274,8 +269,7 @@ void BasicGUI_VectorDlg::SelectionIntoArgument()
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
@ -340,9 +334,9 @@ void BasicGUI_VectorDlg::DeactivateActiveDialog()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_VectorDlg::enterEvent(QEvent* e)
void BasicGUI_VectorDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -361,13 +355,13 @@ void BasicGUI_VectorDlg::ValueChangedInSpinBox( double newValue )
//=================================================================================
void BasicGUI_VectorDlg::ReverseVector( int state )
{
double dx = -GroupDimensions->SpinBox_DX->GetValue();
double dy = -GroupDimensions->SpinBox_DY->GetValue();
double dz = -GroupDimensions->SpinBox_DZ->GetValue();
double dx = -GroupDimensions->SpinBox_DX->value();
double dy = -GroupDimensions->SpinBox_DY->value();
double dz = -GroupDimensions->SpinBox_DZ->value();
GroupDimensions->SpinBox_DX->SetValue( dx );
GroupDimensions->SpinBox_DY->SetValue( dy );
GroupDimensions->SpinBox_DZ->SetValue( dz );
GroupDimensions->SpinBox_DX->setValue( dx );
GroupDimensions->SpinBox_DY->setValue( dy );
GroupDimensions->SpinBox_DZ->setValue( dz );
displayPreview();
}
@ -402,15 +396,16 @@ bool BasicGUI_VectorDlg::execute( ObjectList& objects )
switch ( getConstructorId() ) {
case 0 :
{
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeVectorTwoPnt( myPoint1, myPoint2 );
res = true;
break;
}
case 1 :
{
double dx = GroupDimensions->SpinBox_DX->GetValue();
double dy = GroupDimensions->SpinBox_DY->GetValue();
double dz = GroupDimensions->SpinBox_DZ->GetValue();
double dx = GroupDimensions->SpinBox_DX->value();
double dy = GroupDimensions->SpinBox_DY->value();
double dz = GroupDimensions->SpinBox_DZ->value();
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeVectorDXDYDZ( dx, dy, dz );
res = true;
break;

View File

@ -19,49 +19,47 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_VectorDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_VECTOR_H
#define DIALOGBOX_VECTOR_H
#ifndef BASICGUI_VECTORDLG_H
#define BASICGUI_VECTORDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel_QTD.h"
#include <GEOMBase_Skeleton.h>
class DlgRef_2Sel;
class DlgRef_3Spin1Check;
//=================================================================================
// class : BasicGUI_VectorDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_VectorDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_VectorDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BasicGUI_VectorDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_VectorDlg();
protected:
// redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
virtual bool execute( ObjectList& );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
GEOM::GEOM_Object_var myPoint1;
GEOM::GEOM_Object_var myPoint2;
Ui::DlgRef_2Sel_QTD* GroupPoints;
DlgRef_2Sel* GroupPoints;
DlgRef_3Spin1Check* GroupDimensions;
private slots:
@ -75,10 +73,9 @@ private slots:
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ConstructorsClicked(int constructorId);
void ValueChangedInSpinBox(double newValue);
void ReverseVector(int state);
void ConstructorsClicked( int );
void ValueChangedInSpinBox( double );
void ReverseVector( int );
};
#endif // DIALOGBOX_VECTOR_H
#endif // BASICGUI_VECTORDLG_H

View File

@ -19,21 +19,20 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_WorkingPlaneDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BasicGUI_WorkingPlaneDlg.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>
// OCCT Includes
#include <BRep_Tool.hxx>
@ -47,9 +46,7 @@
// QT Includes
#include <QCheckBox>
#include "GEOMImpl_Types.hxx"
using namespace std;
#include <GEOMImpl_Types.hxx>
//=================================================================================
// class : BasicGUI_WorkingPlaneDlg()
@ -60,7 +57,7 @@ using namespace std;
//=================================================================================
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
: GEOMBase_Skeleton( theGeometryGUI, parent, name, 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" ) ) );
@ -70,25 +67,19 @@ BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(GeometryGUI* theGeometryGUI,
setWindowTitle( tr( "GEOM_WPLANE_TITLE" ) );
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_WPLANE"));
RadioButton1->setIcon(image1);
RadioButton2->setIcon(image2);
RadioButton3->setIcon(image3);
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_WPLANE" ) );
mainFrame()->RadioButton1->setIcon( image1 );
mainFrame()->RadioButton2->setIcon( image2 );
mainFrame()->RadioButton3->setIcon( image3 );
Group1 = new Ui::DlgRef_1Sel_QTD();
QWidget* aGroup1Widget = new QWidget(this);
Group1->setupUi(aGroup1Widget);
aGroup1Widget->setObjectName("Group1");
Group1 = new DlgRef_1Sel( centralWidget() );
Group1->GroupBox1->setTitle( tr( "GEOM_WPLANE_FACE" ) );
Group1->TextLabel1->setText( tr( "GEOM_SELECTION" ) );
Group1->PushButton1->setIcon( image0 );
Group1->LineEdit1->setReadOnly( true );
Group2 = new Ui::DlgRef_2Sel_QTD();
QWidget* aGroup2Widget = new QWidget(this);
Group2->setupUi(aGroup2Widget);
aGroup2Widget->setObjectName("Group2");
Group2 = new DlgRef_2Sel( centralWidget() );
Group2->GroupBox1->setTitle( tr( "GEOM_WPLANE_VECTOR" ) );
Group2->TextLabel1->setText( tr( "GEOM_WPLANE_VX" ) );
@ -98,32 +89,29 @@ BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(GeometryGUI* theGeometryGUI,
Group2->LineEdit1->setReadOnly( true );
Group2->LineEdit2->setReadOnly( true );
Group3 = new Ui::DlgRef_3Check_QTD();
QWidget* aGroup3Widget = new QWidget(this);
Group3->setupUi(aGroup3Widget);
aGroup3Widget->setObjectName("Group3");
Group3 = new DlgRef_3Check( centralWidget() );
Group3->GroupBox1->setTitle( tr( "GEOM_WPLANE_ORIGIN" ) );
Group3->RadioButton1->setText( tr( "GEOM_WPLANE_OXY" ) );
Group3->RadioButton2->setText( tr( "GEOM_WPLANE_OYZ" ) );
Group3->RadioButton3->setText( tr( "GEOM_WPLANE_OZX" ) );
gridLayout1->addWidget(aGroup1Widget, 1, 0);
gridLayout1->addWidget(aGroup2Widget, 1, 0);
gridLayout1->addWidget(aGroup3Widget, 1, 0);
/***************************************************************/
QFrame* aReverseGroupBox = new QFrame(this);
aReverseGroupBox->setObjectName("aReverseGroupBox");
aReverseGroupBox->setContentsMargins(10, 10, 10, 10);
QGroupBox* aReverseGroupBox = new QGroupBox( centralWidget() );
QHBoxLayout* aReverseGroupBoxLayout = new QHBoxLayout( aReverseGroupBox );
aReverseGroupBoxLayout->setMargin( 9 );
aReverseGroupBoxLayout->setSpacing( 6 );
myReverseCB = new QCheckBox( aReverseGroupBox );
myReverseCB->setObjectName("myReverseCB");
myReverseCB->setText( tr( "GEOM_REVERSE_PLANE" ) );
aReverseGroupBoxLayout->addWidget( myReverseCB );
gridLayout1->addWidget(aReverseGroupBox, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( Group1 );
layout->addWidget( Group2 );
layout->addWidget( Group3 );
layout->addWidget( aReverseGroupBox );
setHelpFileName( "working_plane.htm" );
@ -160,17 +148,17 @@ void BasicGUI_WorkingPlaneDlg::Init()
globalSelection( GEOM_PLANE );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( Group1->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( Group1->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group2->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( Group2->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group2->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
@ -183,7 +171,8 @@ void BasicGUI_WorkingPlaneDlg::Init()
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_WPLANE" ).toLatin1().constData() );
initName( tr( "GEOM_WPLANE" ) );
ConstructorsClicked( 0 );
}
@ -197,8 +186,7 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
disconnect( aSelMgr, 0, this, 0 );
switch (constructorId)
{
switch ( constructorId ) {
case 0:
{
//globalSelection( GEOM_PLANE );
@ -207,10 +195,9 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
::qobject_cast<QWidget*>( Group2->gridLayout->parent() )->hide();
::qobject_cast<QWidget*>( Group3->gridLayout->parent() )->hide();
resize(0, 0);
::qobject_cast<QWidget*>( Group1->gridLayout->parent() )->show();
Group2->hide();
Group3->hide();
Group1->show();
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText( "" );
@ -223,10 +210,9 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
{
globalSelection( GEOM_LINE );
::qobject_cast<QWidget*>( Group1->gridLayout->parent() )->hide();
::qobject_cast<QWidget*>( Group3->gridLayout->parent() )->hide();
resize(0, 0);
::qobject_cast<QWidget*>( Group2->gridLayout->parent() )->show();
Group1->hide();
Group3->hide();
Group2->show();
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText( "" );
@ -239,10 +225,9 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
}
case 2:
{
::qobject_cast<QWidget*>( Group1->gridLayout->parent() )->hide();
::qobject_cast<QWidget*>( Group2->gridLayout->parent() )->hide();
resize(0, 0);
::qobject_cast<QWidget*>( Group3->gridLayout->parent() )->show();
Group1->hide();
Group2->hide();
Group3->show();
Group3->RadioButton1->setChecked( true );
aOriginType = 1;
@ -250,6 +235,10 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId)
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
updateWPlane();
}
@ -279,8 +268,8 @@ void BasicGUI_WorkingPlaneDlg::ClickOnOk()
//=================================================================================
bool BasicGUI_WorkingPlaneDlg::ClickOnApply()
{
buttonApply->setFocus();
myGeomGUI->application()->putInfo(tr(""));
buttonApply()->setFocus();
myGeomGUI->application()->putInfo( "" );
if ( updateWPlane( false ) ) {
myGeomGUI->SetWorkingPlane( myWPlane );
@ -418,9 +407,9 @@ void BasicGUI_WorkingPlaneDlg::ClickOnCancel()
// function : enterEvent()
// purpose :
//=================================================================================
void BasicGUI_WorkingPlaneDlg::enterEvent(QEvent* e)
void BasicGUI_WorkingPlaneDlg::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}
@ -466,13 +455,14 @@ bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
gp_Dir aDirN ( Zx, Zy, Zz );
gp_Dir aDirX ( Xx, Xy, Xz );
myWPlane = gp_Ax3( aPnt, aDirN, aDirX );
} else {
}
else {
if ( !showPreview )
showError( "Wrong shape selected (has to be a planar face)" );
return false;
}
} else if (id == 1) { // by two vectors (Ox & Oz)
}
else if ( id == 1 ) { // by two vectors (Ox & Oz)
if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) {
if ( !showPreview )
showError( "Two vectors have to be selected" );
@ -529,7 +519,8 @@ bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
myWPlane = gp_Ax3( BRep_Tool::Pnt( VX1 ), aDirZ, aDirX );
} else if (id == 2) { // by selection from standard (OXY or OYZ, or OZX)
}
else if ( id == 2 ) { // by selection from standard (OXY or OYZ, or OZX)
gp_Ax2 anAx2;
if ( aOriginType == 1 ) anAx2 = gp::XOY();
@ -538,18 +529,17 @@ bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
myWPlane = gp_Ax3( anAx2 );
} else {
}
else {
return false;
}
if (myReverseCB->isChecked())
{
if ( myReverseCB->isChecked() ) {
myWPlane.YReverse();
myWPlane.ZReverse();
}
if (showPreview)
{
if ( showPreview ) {
GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() );
GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker( myWPlane.Location().X(), myWPlane.Location().Y(), myWPlane.Location().Z(),
myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(),

View File

@ -19,45 +19,45 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BasicGUI_WorkingPlaneDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef DIALOGBOX_WORKINGPLANE_H
#define DIALOGBOX_WORKINGPLANE_H
#ifndef BASICGUI_WORKINGPLANEDLG_H
#define BASICGUI_WORKINGPLANEDLG_H
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_1Sel_QTD.h"
#include "DlgRef_2Sel_QTD.h"
#include "DlgRef_3Check_QTD.h"
#include <GEOMBase_Skeleton.h>
#include <gp_Ax3.hxx>
class DlgRef_1Sel;
class DlgRef_2Sel;
class DlgRef_3Check;
class QCheckBox;
//=================================================================================
// class : BasicGUI_WorkingPlaneDlg
// purpose :
//=================================================================================
class GEOM_BASICGUI_EXPORT BasicGUI_WorkingPlaneDlg : public GEOMBase_Skeleton
class BASICGUI_EXPORT BasicGUI_WorkingPlaneDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0 );
BasicGUI_WorkingPlaneDlg( GeometryGUI*, QWidget* = 0,
const char* = 0, bool = false, Qt::WindowFlags = 0 );
~BasicGUI_WorkingPlaneDlg();
virtual void closeEvent( QCloseEvent* e );
protected:
virtual void closeEvent( QCloseEvent* );
private:
void Init();
void enterEvent(QEvent* e);
void enterEvent( QEvent* );
bool updateWPlane(const bool showPreview = true);
bool updateWPlane( const bool = true );
GEOM::GEOM_Object_var myFace;
GEOM::GEOM_Object_var myVectX;
@ -65,9 +65,9 @@ private:
int aOriginType;
Ui::DlgRef_1Sel_QTD* Group1;
Ui::DlgRef_2Sel_QTD* Group2;
Ui::DlgRef_3Check_QTD* Group3;
DlgRef_1Sel* Group1;
DlgRef_2Sel* Group2;
DlgRef_3Check* Group3;
QCheckBox* myReverseCB;
@ -78,8 +78,8 @@ private slots:
void ClickOnCancel();
bool ClickOnApply();
void ConstructorsClicked(int constructorId);
void GroupClicked(int groupId);
void ConstructorsClicked( int );
void GroupClicked( int );
void SetEditCurrentArgument();
void SelectionIntoArgument();
void LineEditReturnPressed();
@ -87,7 +87,6 @@ private slots:
void ActivateThisDialog();
void DeactivateActiveDialog();
};
#endif // DIALOGBOX_WORKINGPLANE_H
#endif // BASICGUI_WORKINGPLANEDLG_H

View File

@ -17,31 +17,26 @@
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_BasicGUI.hxx
// Author : Alexander A. BORODIN
// Module : GEOM
// Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
//
#ifndef _GEOM_BasicGUI_HXX_
#define _GEOM_BasicGUI_HXX_
#ifndef GEOM_BASICGUI_HXX
#define GEOM_BASICGUI_HXX
#ifdef WNT
#if defined WIN32
# if defined BASICGUI_EXPORTS
#if defined WIN32
#define GEOM_BASICGUI_EXPORT __declspec( dllexport )
# define BASICGUI_EXPORT __declspec( dllexport )
# else
#define GEOM_BASICGUI_EXPORT
# define BASICGUI_EXPORT __declspec( dllimport )
# endif
#else
#if defined WIN32
#define GEOM_BASICGUI_EXPORT __declspec( dllimport )
#else
#define GEOM_BASICGUI_EXPORT
#endif
#endif
#else
#define GEOM_BASICGUI_EXPORT
# define BASICGUI_EXPORT
#endif
#endif
#ifndef COORD_MIN
#define COORD_MIN -1e+15
#define COORD_MAX +1e+15
#endif // COORD_MIN
#endif // GEOM_BASICGUI_HXX

View File

@ -19,13 +19,9 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
#
# File : Makefile.in
# Author : Damien COQUERET (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : GEOM
# $Header:
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
@ -89,6 +85,7 @@ libBasicGUI_la_CPPFLAGS = \
-I$(srcdir)/../GEOMBase \
-I$(srcdir)/../GEOMImpl \
-I$(srcdir)/../GEOMClient \
-I$(top_builddir)/src/DlgRef \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix

View File

@ -1,6 +1,6 @@
<ui version="4.0" >
<class>DlgRef_Skeleton_QTD</class>
<widget class="QDialog" name="DlgRef_Skeleton_QTD" >
<widget class="QWidget" name="DlgRef_Skeleton_QTD" >
<property name="geometry" >
<rect>
<x>0</x>
@ -9,20 +9,9 @@
<height>170</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string/>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
@ -30,8 +19,41 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<widget class="QWidget" native="1" name="GroupMedium" />
<item row="1" column="0" >
<widget class="QGroupBox" name="DlgRef_Skeleton_QTD" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Result name</string>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="NameLabel" >
<property name="text" >
<string>Name</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="ResultName" />
</item>
</layout>
</widget>
</item>
<item row="0" column="0" >
<widget class="QGroupBox" name="GroupConstructors" >
@ -151,49 +173,20 @@
</layout>
</widget>
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="GroupBoxName" >
<property name="title" >
<string>Result name</string>
<item row="2" column="0" >
<widget class="QWidget" native="1" name="GroupMedium" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="NameLabel" >
<property name="text" >
<string>Name</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="ResultName" />
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>RadioButton1</tabstop>
<tabstop>RadioButton2</tabstop>
<tabstop>RadioButton3</tabstop>
<tabstop>RadioButton4</tabstop>
<tabstop>ResultName</tabstop>
<tabstop>buttonOk</tabstop>
<tabstop>buttonApply</tabstop>
<tabstop>buttonCancel</tabstop>
<tabstop>buttonHelp</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -522,27 +522,11 @@ DlgRef_6Sel::~DlgRef_6Sel()
//////////////////////////////////////////
DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
: QDialog( parent, f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, bool modal, Qt::WindowFlags f )
: QDialog( parent, f )
{
setupUi( this );
setModal( modal );
}
DlgRef_Skeleton::~DlgRef_Skeleton()
{
}
void DlgRef_Skeleton::initSpinBox( QDoubleSpinBox* spinBox,
double min, double max,
double step, int decimals )
{
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
spinBox->setDecimals( decimals );
}

View File

@ -572,17 +572,14 @@ public:
#include "ui_DlgRef_Skeleton_QTD.h"
class DLGREF_EXPORT DlgRef_Skeleton : public QDialog,
class DLGREF_EXPORT DlgRef_Skeleton : public QWidget,
public Ui::DlgRef_Skeleton_QTD
{
Q_OBJECT
public:
DlgRef_Skeleton( QWidget* = 0, Qt::WindowFlags = 0 );
DlgRef_Skeleton( QWidget* = 0, bool modal = false, Qt::WindowFlags = 0 );
~DlgRef_Skeleton();
void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 3 );
};
#endif // GEOM_DLGREF_H

View File

@ -85,9 +85,8 @@ MOC_FILES = \
# DlgRef_4Sel1Spin2Check_moc.cxx
# header files
salomeinclude_HEADERS = \
GEOM_DlgRef.h
#salomeinclude_HEADERS = \
# GEOM_DlgRef.h
# DlgRef_Skeleton_QTD.h \
# DlgRef_1Sel_QTD.h \
# DlgRef_2Sel_QTD.h \
@ -184,6 +183,7 @@ UIC_FILES = \
BUILT_SOURCES = $(UIC_FILES)
nodist_libDlgRef_la_SOURCES = \
GEOM_DlgRef.h \
$(MOC_FILES) \
$(UIC_FILES)

View File

@ -27,6 +27,7 @@
#include "GEOMBase.h"
#include <GeometryGUI.h>
#include <GEOM_DlgRef.h>
#include <SalomeApp_Application.h>
#include <LightApp_Application.h>
@ -37,6 +38,7 @@
#include <SUIT_MessageBox.h>
#include <QKeyEvent>
#include <QDoubleSpinBox>
using namespace std;
@ -45,7 +47,7 @@ using namespace std;
// purpose : Constructs a GEOMBase_Skeleton which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
// true to construct a modal dialog.
//=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, Qt::WindowFlags fl )
@ -54,36 +56,32 @@ GEOMBase_Skeleton::GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* paren
myGeomGUI( theGeometryGUI ),
myRBGroup( 0 )
{
setupUi(this);
if ( !name )
setObjectName( "GEOMBase_Skeleton" );
else
setObjectName( name );
setModal( modal );
setAttribute( Qt::WA_DeleteOnClose );
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
buttonOk->setText(tr("GEOM_BUT_OK"));
buttonApply->setText(tr("GEOM_BUT_APPLY"));
buttonHelp->setText(tr("GEOM_BUT_HELP"));
setModal( modal );
GroupMedium->setAttribute( Qt::WA_DeleteOnClose );
GroupMedium->close();
resize(0, 0);
myMainFrame = new DlgRef_Skeleton( this );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 0 ); topLayout->setSpacing( 0 );
topLayout->addWidget( myMainFrame );
if ( GroupConstructors != NULL ) {
myRBGroup = new QButtonGroup(GroupConstructors);
QList<QObject*> aRadioButtons = GroupConstructors->children();
QListIterator<QObject*> it( aRadioButtons );
int anId = 0;
while ( it.hasNext() )
if ( QRadioButton* aRB = ::qobject_cast<QRadioButton*>( it.next() ) ) {
myRBGroup->addButton( aRB, anId );
anId++;
}
}
buttonCancel()->setText( tr( "GEOM_BUT_CLOSE" ) );
buttonOk()->setText( tr( "GEOM_BUT_OK" )) ;
buttonApply()->setText( tr( "GEOM_BUT_APPLY" ) );
buttonHelp()->setText( tr( "GEOM_BUT_HELP" ) );
myRBGroup = new QButtonGroup( this );
myRBGroup->addButton( myMainFrame->RadioButton1, 0 );
myRBGroup->addButton( myMainFrame->RadioButton2, 1 );
myRBGroup->addButton( myMainFrame->RadioButton3, 2 );
myRBGroup->addButton( myMainFrame->RadioButton4, 4 );
connect( myRBGroup, SIGNAL( buttonClicked( int ) ), this, SIGNAL( constructorsClicked( int ) ) );
Init();
}
@ -114,23 +112,28 @@ void GEOMBase_Skeleton::Init()
myGeomGUI->SetActiveDialogBox( this );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
if (myGeomGUI)
{
connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
if ( myGeomGUI ) {
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
}
// connect help button on a private slot that displays help information
connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
connect( buttonHelp(), SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
/* displays Dialog */
RadioButton1->setChecked(TRUE);
RadioButton4->hide();
return;
myMainFrame->RadioButton1->setChecked( true );
myMainFrame->RadioButton4->hide();
}
void GEOMBase_Skeleton::initSpinBox( QDoubleSpinBox* spinBox,
double min, double max,
double step, int decimals )
{
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
spinBox->setDecimals( decimals );
}
//=================================================================================
// function : ClickOnCancel()
@ -159,8 +162,6 @@ void GEOMBase_Skeleton::LineEditReturnPressed()
if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
myEditCurrentArgument->setText( objectUserName );
return;
}
@ -174,8 +175,6 @@ void GEOMBase_Skeleton::DeactivateActiveDialog()
globalSelection();
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
if ( myGeomGUI ) myGeomGUI->SetActiveDialogBox( 0 );
return;
}
@ -211,11 +210,11 @@ void GEOMBase_Skeleton::closeEvent(QCloseEvent* e)
// function : initName()
// purpose : initialize the Name field with a string "thePrefix_X" (Vertex_3)
//=================================================================================
void GEOMBase_Skeleton::initName( const char* thePrefix )
void GEOMBase_Skeleton::initName( const QString& thePrefix )
{
if ( thePrefix )
if ( !thePrefix.isNull() )
setPrefix( thePrefix );
ResultName->setText( GEOMBase::GetDefaultName( getPrefix() ) );
myMainFrame->ResultName->setText( GEOMBase::GetDefaultName( getPrefix() ) );
}
//=================================================================================
@ -224,7 +223,7 @@ void GEOMBase_Skeleton::initName( const char* thePrefix )
//=================================================================================
const char* GEOMBase_Skeleton::getNewObjectName() const
{
return ResultName->text().toLatin1().constData();
return myMainFrame->ResultName->text().toLatin1().constData();
}
//=================================================================================
@ -274,6 +273,36 @@ void GEOMBase_Skeleton::setHelpFileName(const QString& theName)
myHelpFileName = theName;
}
DlgRef_Skeleton* GEOMBase_Skeleton::mainFrame()
{
return myMainFrame;
}
QWidget* GEOMBase_Skeleton::centralWidget()
{
return myMainFrame->GroupMedium;
}
QPushButton* GEOMBase_Skeleton::buttonCancel() const
{
return myMainFrame->buttonCancel;
}
QPushButton* GEOMBase_Skeleton::buttonOk() const
{
return myMainFrame->buttonOk;
}
QPushButton* GEOMBase_Skeleton::buttonApply() const
{
return myMainFrame->buttonApply;
}
QPushButton* GEOMBase_Skeleton::buttonHelp() const
{
return myMainFrame->buttonHelp;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
@ -284,8 +313,7 @@ void GEOMBase_Skeleton::keyPressEvent( QKeyEvent* e )
if ( e->isAccepted() )
return;
if ( e->key() == Qt::Key_F1 )
{
if ( e->key() == Qt::Key_F1 ) {
e->accept();
ClickOnHelp();
}

View File

@ -29,29 +29,35 @@
#include "GEOM_GEOMBase.hxx"
#include "GEOMBase_Helper.h"
#include <GEOM_DlgRef.h>
#include <QDialog>
class GeometryGUI;
class DlgRef_Skeleton;
class QDoubleSpinBox;
class QLineEdit;
class QButtonGroup;
class QPushButton;
class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public Ui::DlgRef_Skeleton_QTD, public GEOMBase_Helper
class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public GEOMBase_Helper
{
Q_OBJECT
public:
GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
GEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, const char* = 0, bool = false, Qt::WindowFlags = 0 );
~GEOMBase_Skeleton();
private:
void Init();
protected:
void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 3 );
void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* );
/*! initialize "Name" field with a string "thePrefix_X" (Vertex_3)
*/
void initName( const char* thePrefix = 0 );
void initName( const QString& = QString() );
/*! returns contents of "Name" field
*/
@ -63,11 +69,20 @@ protected:
void setHelpFileName( const QString& );
DlgRef_Skeleton* mainFrame();
QWidget* centralWidget();
QPushButton* buttonCancel() const;
QPushButton* buttonOk() const;
QPushButton* buttonApply() const;
QPushButton* buttonHelp() const;
protected:
QLineEdit* myEditCurrentArgument; //!< Current LineEdit
GeometryGUI* myGeomGUI; //!< reference GEOM GUI
QString myHelpFileName;
QString myHelpFileName; //!< Associated HTML help file name
QButtonGroup* myRBGroup;
QButtonGroup* myRBGroup; //!< radio button group
DlgRef_Skeleton* myMainFrame; //!< dialog box's mainframe widgetx
protected slots:
virtual void ClickOnCancel();
@ -75,6 +90,9 @@ protected slots:
void DeactivateActiveDialog();
void ActivateThisDialog();
void ClickOnHelp();
signals:
void constructorsClicked( int );
};
#endif // GEOMBASE_SKELETON_H

View File

@ -54,7 +54,9 @@ libGEOMClient_la_LDFLAGS = \
../../idl/libSalomeIDLGEOM.la \
../GEOM/libGEOMbasic.la \
$(KERNEL_LDFLAGS) -lSalomeIDLKernel -lOpUtil \
$(CAS_TKTopAlgo) \
$(CORBA_LIBS) \
$(STDLIB)
$(CAS_TKTopAlgo)
# \
# $(CORBA_LIBS) \
# #$(STDLIB)

View File

@ -93,6 +93,8 @@ libGEOMEngine_la_LDFLAGS = \
../GEOM/libGEOMbasic.la \
$(KERNEL_LDFLAGS) -lSalomeNS -lSalomeContainer -lSalomeGenericObj -lTOOLSDS \
$(CAS_DATAEXCHANGE) \
$(CAS_LDPATH) -lTKFillet -lTKOffset \
$(STDLIB) \
$(CORBA_LIBS)
$(CAS_LDPATH) -lTKFillet -lTKOffset
# \
# $(STDLIB) \
# $(CORBA_LIBS)