*** empty log message ***

This commit is contained in:
vsr 2007-10-17 07:08:29 +00:00
parent b0880bc63f
commit 7acd6548a6
4 changed files with 176 additions and 187 deletions

View File

@ -37,7 +37,7 @@ class BooleanGUI : public GEOMGUI
public:
enum BooleanOperation { COMMON = 1, CUT = 2, FUSE = 3, SECTION = 4 };
BooleanGUI( GeometryGUI* parent );
BooleanGUI( GeometryGUI* );
~BooleanGUI();
bool OnGUIEvent( int, SUIT_Desktop* );

View File

@ -19,24 +19,21 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BooleanGUI_Dialog.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BooleanGUI.h"
#include "BooleanGUI_Dialog.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"
using namespace std;
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
//=================================================================================
// class : BooleanGUI_Dialog()
@ -46,14 +43,13 @@ using namespace std;
// TRUE to construct a modal dialog.
//=================================================================================
BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGeometryGUI,
QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl),
QWidget* parent, bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl ),
myOperation( theOperation )
{
QPixmap image0;
QString aTitle, aCaption;
switch ( myOperation )
{
switch ( myOperation ) {
case BooleanGUI::COMMON:
image0 = QPixmap( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_COMMON" ) ) );
aTitle = tr( "GEOM_COMMON" );
@ -84,26 +80,21 @@ BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGe
setWindowTitle( aCaption );
/***************************************************************/
GroupConstructors->setTitle( aTitle );
RadioButton1->setIcon( image0 );
RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
RadioButton2->close();
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close();
mainFrame()->GroupConstructors->setTitle( aTitle );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton2->close();
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
myGroup = new Ui::DlgRef_2Sel_QTD();
QWidget* aMyGroupWidget = new QWidget(this);
myGroup->setupUi(aMyGroupWidget);
aMyGroupWidget->setObjectName("GroupCommon");
myGroup = new DlgRef_2Sel( centralWidget() );
myGroup->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
if ( myOperation != BooleanGUI::CUT )
{
myGroup->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
myGroup->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
if ( myOperation != BooleanGUI::CUT ) {
myGroup->TextLabel1->setText( tr( "GEOM_OBJECT_I" ).arg( 1 ) );
myGroup->TextLabel2->setText( tr( "GEOM_OBJECT_I" ).arg( 2 ) );
}
else
{
else {
myGroup->TextLabel1->setText( tr( "GEOM_MAIN_OBJECT" ) );
myGroup->TextLabel2->setText( tr( "GEOM_TOOL_OBJECT" ) );
}
@ -113,7 +104,9 @@ BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGe
myGroup->LineEdit1->setReadOnly( true );
myGroup->LineEdit2->setReadOnly( true );
gridLayout1->addWidget(aMyGroupWidget, 2, 0);
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( myGroup );
/***************************************************************/
/* Initialisation */
@ -140,8 +133,8 @@ void BooleanGUI_Dialog::Init()
myEditCurrentArgument = myGroup->LineEdit1;
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( myGroup->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( myGroup->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
@ -152,7 +145,7 @@ void BooleanGUI_Dialog::Init()
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( GroupConstructors->title().toLatin1().constData() );
initName( mainFrame()->GroupConstructors->title() );
globalSelection( GEOM_ALLSHAPES );
}
@ -191,8 +184,7 @@ void BooleanGUI_Dialog::SelectionIntoArgument()
{
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 )
{
if ( IObjectCount() != 1 ) {
if ( myEditCurrentArgument == myGroup->LineEdit1 ) myObject1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == myGroup->LineEdit2 ) myObject2 = GEOM::GEOM_Object::_nil();
return;
@ -201,8 +193,7 @@ void BooleanGUI_Dialog::SelectionIntoArgument()
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes && GEOMBase::IsShape( aSelectedObject ) )
{
if ( !CORBA::is_nil( aSelectedObject ) && aRes && GEOMBase::IsShape( aSelectedObject ) ) {
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == myGroup->LineEdit1 ) myObject1 = aSelectedObject;
else if ( myEditCurrentArgument == myGroup->LineEdit2 ) myObject2 = aSelectedObject;
@ -233,8 +224,7 @@ void BooleanGUI_Dialog::SetEditCurrentArgument()
void BooleanGUI_Dialog::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == myGroup->LineEdit1 || send == myGroup->LineEdit2 )
{
if ( send == myGroup->LineEdit1 || send == myGroup->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
@ -258,9 +248,9 @@ void BooleanGUI_Dialog::ActivateThisDialog()
// function : enterEvent()
// purpose : when mouse enter onto the QWidget
//=================================================================================
void BooleanGUI_Dialog::enterEvent(QEvent * e)
void BooleanGUI_Dialog::enterEvent( QEvent* )
{
if ( !GroupConstructors->isEnabled() )
if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog();
}

View File

@ -19,49 +19,47 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : BooleanGUI_Dialog.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef BooleanGUI_Dialog_H
#define BooleanGUI_Dialog_H
#ifndef BOOLEANGUI_DIALOG_H
#define BOOLEANGUI_DIALOG_H
#include "BooleanGUI.h" //for wnt defines
#include <GEOMBase_Skeleton.h>
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel_QTD.h"
class DlgRef_2Sel;
//=================================================================================
// class : BooleanGUI_Dialog
// purpose :
//=================================================================================
class GEOM_BOOLEANGUI_EXPORT BooleanGUI_Dialog : public GEOMBase_Skeleton
class BooleanGUI_Dialog : public GEOMBase_Skeleton
{
Q_OBJECT
public:
BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGeometryGUI, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
BooleanGUI_Dialog( const int, GeometryGUI*, QWidget* = 0,
bool = false, Qt::WindowFlags = 0 );
~BooleanGUI_Dialog();
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* );
private:
int myOperation;
void Init();
void enterEvent(QEvent * e);
GEOM::GEOM_Object_var myObject1;
GEOM::GEOM_Object_var myObject2;
Ui::DlgRef_2Sel_QTD* myGroup;
DlgRef_2Sel* myGroup;
private slots:
void ClickOnOk();
@ -72,4 +70,4 @@ private slots:
void ActivateThisDialog();
};
#endif // BooleanGUI_Dialog_H
#endif // BOOLEANGUI_DIALOG_H

View File

@ -19,13 +19,10 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : Makefile.am
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
# Package : BooleanGUI
#
#
# File : Makefile.in
# Author : Damien COQUERET (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : GEOM
# $Header:
include $(top_srcdir)/adm_local/unix/make_common_starter.am
@ -36,6 +33,9 @@ lib_LTLIBRARIES = libBooleanGUI.la
# Sources files
dist_libBooleanGUI_la_SOURCES = \
BooleanGUI.h \
BooleanGUI_Dialog.h \
\
BooleanGUI.cxx \
BooleanGUI_Dialog.cxx
@ -68,6 +68,7 @@ libBooleanGUI_la_CPPFLAGS = \
-I$(srcdir)/../GEOMClient \
-I$(srcdir)/../GEOMImpl \
-I$(srcdir)/../GEOMFiltersSelection \
-I$(top_builddir)/src/DlgRef \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix