*** empty log message ***

This commit is contained in:
vsr 2007-10-23 14:08:53 +00:00
parent c115a0bf0c
commit 652535d466
14 changed files with 1163 additions and 1215 deletions

View File

@ -1,29 +1,26 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BooleanGUI.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BooleanGUI.cxx
// Author : Julia DOOVSKIKH
// Module : GEOM
// $Header$
#include "BlocksGUI.h" #include "BlocksGUI.h"
@ -33,20 +30,19 @@
#include "BlocksGUI_ExplodeDlg.h" #include "BlocksGUI_ExplodeDlg.h"
#include "BlocksGUI_PropagateDlg.h" #include "BlocksGUI_PropagateDlg.h"
#include "GeometryGUI.h" #include <GeometryGUI.h>
#include "SUIT_Desktop.h" #include <SUIT_Desktop.h>
#include "SUIT_MessageBox.h" #include <SUIT_MessageBox.h>
#include "SUIT_Session.h" #include <SUIT_Session.h>
#include <SalomeApp_Application.h>
#include "SalomeApp_Application.h"
//======================================================================= //=======================================================================
// function : BlocksGUI() // function : BlocksGUI()
// purpose : Constructor // purpose : Constructor
//======================================================================= //=======================================================================
BlocksGUI::BlocksGUI( GeometryGUI* parent ) BlocksGUI::BlocksGUI( GeometryGUI* parent )
: GEOMGUI( parent ) : GEOMGUI( parent )
{ {
} }
@ -66,22 +62,24 @@ bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
{ {
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL; QDialog* aDlg = 0;
switch (theCommandID) switch ( theCommandID ) {
{ case 9999: aDlg = new BlocksGUI_BlockDlg ( getGeometryGUI(), parent ); break;
case 9999: aDlg = new BlocksGUI_BlockDlg (getGeometryGUI(), parent); break; case 9998: aDlg = new BlocksGUI_TrsfDlg ( getGeometryGUI(), parent ); break;
case 9998: aDlg = new BlocksGUI_TrsfDlg (getGeometryGUI(), parent); break; case 9997: aDlg = new BlocksGUI_QuadFaceDlg ( getGeometryGUI(), parent ); break;
case 9997: aDlg = new BlocksGUI_QuadFaceDlg (getGeometryGUI(), parent); break; case 9995: aDlg = new BlocksGUI_ExplodeDlg ( getGeometryGUI(), parent ); break;
case 9995: aDlg = new BlocksGUI_ExplodeDlg (getGeometryGUI(), parent); break; case 99991: aDlg = new BlocksGUI_PropagateDlg( getGeometryGUI(), parent ); break;
case 99991: aDlg = new BlocksGUI_PropagateDlg (getGeometryGUI(), parent); break; default:
default: getGeometryGUI()->getApp()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break;
break;
} }
if (aDlg != NULL) if ( aDlg ) {
aDlg->updateGeometry();
aDlg->resize( aDlg->minimumSize() );
aDlg->show(); aDlg->show();
}
return true; return true;
} }
@ -91,7 +89,9 @@ bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
//===================================================================================== //=====================================================================================
extern "C" extern "C"
{ {
GEOM_BLOCKSGUI_EXPORT #ifdef WIN32
__declspec( dllexport )
#endif
GEOMGUI* GetLibGUI( GeometryGUI* parent ) GEOMGUI* GetLibGUI( GeometryGUI* parent )
{ {
return new BlocksGUI( parent ); return new BlocksGUI( parent );

View File

@ -1,47 +1,43 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BuildGUI.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BuildGUI.h
// Author : Julia DOROVSKIKH
// Module : GEOM
#ifndef BLOCKSGUI_H #ifndef BLOCKSGUI_H
#define BLOCKSGUI_H #define BLOCKSGUI_H
#include "GEOM_BlocksGUI.hxx" #include <GEOMGUI.h>
#include "GEOMGUI.h"
//================================================================================= //=================================================================================
// class : BlocksGUI // class : BlocksGUI
// purpose : // purpose :
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI : public GEOMGUI class BlocksGUI : public GEOMGUI
{ {
public: public:
BlocksGUI( GeometryGUI* parent ); BlocksGUI( GeometryGUI* );
~BlocksGUI(); ~BlocksGUI();
bool OnGUIEvent (int theCommandID, SUIT_Desktop* parent); bool OnGUIEvent( int, SUIT_Desktop* );
}; };
#endif #endif // BLOCKSGUI_H

View File

@ -1,93 +1,93 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_BlockDlg.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_BlockDlg.cxx
// Author : Julia DOROVSKIKH
// Module : GEOM
// $Header$
#include "BlocksGUI_BlockDlg.h" #include "BlocksGUI_BlockDlg.h"
#include "SUIT_Session.h" #include <GEOM_DlgRef.h>
#include "SalomeApp_Application.h" #include <GeometryGUI.h>
#include "LightApp_SelectionMgr.h" #include <GEOMBase.h>
#include "GEOMImpl_Types.hxx" #include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
using namespace std; #include <GEOMImpl_Types.hxx>
#include <qlabel.h>
//================================================================================= //=================================================================================
// class : BlocksGUI_BlockDlg() // class : BlocksGUI_BlockDlg()
// purpose : Constructs a BlocksGUI_BlockDlg which is a child of 'parent'. // purpose : Constructs a BlocksGUI_BlockDlg which is a child of 'parent'.
//================================================================================= //=================================================================================
BlocksGUI_BlockDlg::BlocksGUI_BlockDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) BlocksGUI_BlockDlg::BlocksGUI_BlockDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
: GEOMBase_Skeleton(theGeometryGUI, parent, "BlockDlg", modal, : GEOMBase_Skeleton( theGeometryGUI, parent )
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_2F"))); QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_2F" ) ) );
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_6F"))); QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_6F" ) ) );
QPixmap imageS (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); QPixmap imageS( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setCaption(tr("GEOM_BLOCK_TITLE")); setWindowTitle( tr( "GEOM_BLOCK_TITLE" ) );
/***************************************************************/ /***************************************************************/
GroupConstructors->setTitle(tr("GEOM_BLOCK")); mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BLOCK" ) );
RadioButton1->setPixmap(image0); mainFrame()->RadioButton1->setIcon( image0 );
RadioButton2->setPixmap(image1); mainFrame()->RadioButton2->setIcon( image1 );
RadioButton3->close(TRUE); mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
// Create first group // Create first group
Group2F = new DlgRef_2Sel_QTD(this, "Group2F"); Group2F = new DlgRef_2Sel( centralWidget() );
Group2F->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); Group2F->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
Group2F->TextLabel1->setText(tr("FACE_1")); Group2F->TextLabel1->setText( tr( "FACE_1" ) );
Group2F->TextLabel2->setText(tr("FACE_2")); Group2F->TextLabel2->setText( tr( "FACE_2" ) );
Group2F->PushButton1->setPixmap(imageS); Group2F->PushButton1->setIcon( imageS );
Group2F->PushButton2->setPixmap(imageS); Group2F->PushButton2->setIcon( imageS );
// Create second group // Create second group
Group6F = new DlgRef_6Sel_QTD(this, "Group2F"); Group6F = new DlgRef_6Sel( centralWidget() );
Group6F->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); Group6F->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
Group6F->TextLabel1->setText(tr("FACE_1")); Group6F->TextLabel1->setText( tr( "FACE_1" ) );
Group6F->TextLabel2->setText(tr("FACE_2")); Group6F->TextLabel2->setText( tr( "FACE_2" ) );
Group6F->TextLabel3->setText(tr("FACE_3")); Group6F->TextLabel3->setText( tr( "FACE_3" ) );
Group6F->TextLabel4->setText(tr("FACE_4")); Group6F->TextLabel4->setText( tr( "FACE_4" ) );
Group6F->TextLabel5->setText(tr("FACE_5")); Group6F->TextLabel5->setText( tr( "FACE_5" ) );
Group6F->TextLabel6->setText(tr("FACE_6")); Group6F->TextLabel6->setText( tr( "FACE_6" ) );
Group6F->PushButton1->setPixmap(imageS); Group6F->PushButton1->setIcon( imageS );
Group6F->PushButton2->setPixmap(imageS); Group6F->PushButton2->setIcon( imageS );
Group6F->PushButton3->setPixmap(imageS); Group6F->PushButton3->setIcon( imageS );
Group6F->PushButton4->setPixmap(imageS); Group6F->PushButton4->setIcon( imageS );
Group6F->PushButton5->setPixmap(imageS); Group6F->PushButton5->setIcon( imageS );
Group6F->PushButton6->setPixmap(imageS); Group6F->PushButton6->setIcon( imageS );
// Add groups to layout // Add groups to layout
Layout1->addWidget(Group2F, 2, 0); QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
Layout1->addWidget(Group6F, 2, 0); layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( Group2F );
layout->addWidget( Group6F );
/***************************************************************/ /***************************************************************/
setHelpFileName("newentity_blocks.htm#HexahedralSolid"); setHelpFileName( "newentity_blocks.htm#HexahedralSolid" );
Init(); Init();
} }
@ -108,74 +108,74 @@ BlocksGUI_BlockDlg::~BlocksGUI_BlockDlg()
void BlocksGUI_BlockDlg::Init() void BlocksGUI_BlockDlg::Init()
{ {
// init variables // init variables
Group2F->LineEdit1->setReadOnly(true); Group2F->LineEdit1->setReadOnly( true );
Group2F->LineEdit2->setReadOnly(true); Group2F->LineEdit2->setReadOnly( true );
Group6F->LineEdit1->setReadOnly(true); Group6F->LineEdit1->setReadOnly( true );
Group6F->LineEdit2->setReadOnly(true); Group6F->LineEdit2->setReadOnly( true );
Group6F->LineEdit3->setReadOnly(true); Group6F->LineEdit3->setReadOnly( true );
Group6F->LineEdit4->setReadOnly(true); Group6F->LineEdit4->setReadOnly( true );
Group6F->LineEdit5->setReadOnly(true); Group6F->LineEdit5->setReadOnly( true );
Group6F->LineEdit6->setReadOnly(true); Group6F->LineEdit6->setReadOnly( true );
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group2F->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( this, SIGNAL( constructorsClicked( int ) ),
connect(Group2F->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); this, SLOT( ConstructorsClicked( int ) ) );
connect(Group6F->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( Group2F->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect(Group6F->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( Group2F->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect(Group6F->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group6F->PushButton4, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group6F->PushButton5, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group6F->PushButton6, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( Group6F->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; connect( Group6F->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group6F->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group6F->PushButton4, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group6F->PushButton5, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( Group6F->PushButton6, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
// init controls and fields // init controls and fields
initName(tr("GEOM_BLOCK")); initName( tr( "GEOM_BLOCK" ) );
myConstructorId = -1; myConstructorId = -1;
ConstructorsClicked(0); ConstructorsClicked( 0 );
} }
//================================================================================= //=================================================================================
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void BlocksGUI_BlockDlg::ConstructorsClicked (int constructorId) void BlocksGUI_BlockDlg::ConstructorsClicked( int constructorId )
{ {
if (myConstructorId == constructorId) if ( myConstructorId == constructorId )
return; return;
myConstructorId = constructorId; myConstructorId = constructorId;
switch (constructorId) { switch ( constructorId ) {
case 0: case 0:
Group6F->hide(); Group6F->hide();
resize(0, 0);
Group2F->show(); Group2F->show();
myEditCurrentArgument = Group2F->LineEdit1; myEditCurrentArgument = Group2F->LineEdit1;
Group2F->LineEdit1->setText(tr("")); Group2F->LineEdit1->setText( tr( "" ) );
Group2F->LineEdit2->setText(tr("")); Group2F->LineEdit2->setText( tr( "" ) );
break; break;
case 1: case 1:
Group2F->hide(); Group2F->hide();
resize(0, 0);
Group6F->show(); Group6F->show();
myEditCurrentArgument = Group6F->LineEdit1; myEditCurrentArgument = Group6F->LineEdit1;
Group6F->LineEdit1->setText(tr("")); Group6F->LineEdit1->setText( tr( "" ) );
Group6F->LineEdit2->setText(tr("")); Group6F->LineEdit2->setText( tr( "" ) );
Group6F->LineEdit3->setText(tr("")); Group6F->LineEdit3->setText( tr( "" ) );
Group6F->LineEdit4->setText(tr("")); Group6F->LineEdit4->setText( tr( "" ) );
Group6F->LineEdit5->setText(tr("")); Group6F->LineEdit5->setText( tr( "" ) );
Group6F->LineEdit6->setText(tr("")); Group6F->LineEdit6->setText( tr( "" ) );
break; break;
default: default:
break; break;
@ -185,10 +185,14 @@ void BlocksGUI_BlockDlg::ConstructorsClicked (int constructorId)
myFace1 = myFace2 = GEOM::GEOM_Object::_nil(); myFace1 = myFace2 = GEOM::GEOM_Object::_nil();
myFace3 = myFace4 = myFace5 = myFace6 = myFace1; myFace3 = myFace4 = myFace5 = myFace6 = myFace1;
globalSelection(GEOM_FACE); qApp->processEvents();
updateGeometry();
resize( minimumSize() );
globalSelection( GEOM_FACE );
SelectionIntoArgument(); SelectionIntoArgument();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
} }
//================================================================================= //=================================================================================
@ -197,7 +201,7 @@ void BlocksGUI_BlockDlg::ConstructorsClicked (int constructorId)
//================================================================================= //=================================================================================
void BlocksGUI_BlockDlg::ClickOnOk() void BlocksGUI_BlockDlg::ClickOnOk()
{ {
if (ClickOnApply()) if ( ClickOnApply() )
ClickOnCancel(); ClickOnCancel();
} }
@ -207,7 +211,7 @@ void BlocksGUI_BlockDlg::ClickOnOk()
//================================================================================= //=================================================================================
bool BlocksGUI_BlockDlg::ClickOnApply() bool BlocksGUI_BlockDlg::ClickOnApply()
{ {
if (!onAccept()) if ( !onAccept() )
return false; return false;
initName(); initName();
@ -221,23 +225,22 @@ bool BlocksGUI_BlockDlg::ClickOnApply()
void BlocksGUI_BlockDlg::SelectionIntoArgument() void BlocksGUI_BlockDlg::SelectionIntoArgument()
{ {
erasePreview(); erasePreview();
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText( "" );
if (IObjectCount() != 1) if ( IObjectCount() != 1 ) {
{ if ( myEditCurrentArgument == Group2F->LineEdit1 ||
if (myEditCurrentArgument == Group2F->LineEdit1 || myEditCurrentArgument == Group6F->LineEdit1 )
myEditCurrentArgument == Group6F->LineEdit1)
myFace1 = GEOM::GEOM_Object::_nil(); myFace1 = GEOM::GEOM_Object::_nil();
else if (myEditCurrentArgument == Group2F->LineEdit2 || else if ( myEditCurrentArgument == Group2F->LineEdit2 ||
myEditCurrentArgument == Group6F->LineEdit2) myEditCurrentArgument == Group6F->LineEdit2 )
myFace2 = GEOM::GEOM_Object::_nil(); myFace2 = GEOM::GEOM_Object::_nil();
else if (myEditCurrentArgument == Group6F->LineEdit3) else if ( myEditCurrentArgument == Group6F->LineEdit3 )
myFace3 = GEOM::GEOM_Object::_nil(); myFace3 = GEOM::GEOM_Object::_nil();
else if (myEditCurrentArgument == Group6F->LineEdit4) else if ( myEditCurrentArgument == Group6F->LineEdit4 )
myFace4 = GEOM::GEOM_Object::_nil(); myFace4 = GEOM::GEOM_Object::_nil();
else if (myEditCurrentArgument == Group6F->LineEdit5) else if ( myEditCurrentArgument == Group6F->LineEdit5 )
myFace5 = GEOM::GEOM_Object::_nil(); myFace5 = GEOM::GEOM_Object::_nil();
else if (myEditCurrentArgument == Group6F->LineEdit6) else if ( myEditCurrentArgument == Group6F->LineEdit6 )
myFace6 = GEOM::GEOM_Object::_nil(); myFace6 = GEOM::GEOM_Object::_nil();
return; return;
} }
@ -247,22 +250,22 @@ void BlocksGUI_BlockDlg::SelectionIntoArgument()
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object_var aSelectedObject =
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult ); GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if (!testResult || CORBA::is_nil( aSelectedObject )) if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return; return;
if (myEditCurrentArgument == Group2F->LineEdit1 || if ( myEditCurrentArgument == Group2F->LineEdit1 ||
myEditCurrentArgument == Group6F->LineEdit1) myEditCurrentArgument == Group6F->LineEdit1 )
myFace1 = aSelectedObject; myFace1 = aSelectedObject;
else if (myEditCurrentArgument == Group2F->LineEdit2 || else if ( myEditCurrentArgument == Group2F->LineEdit2 ||
myEditCurrentArgument == Group6F->LineEdit2) myEditCurrentArgument == Group6F->LineEdit2 )
myFace2 = aSelectedObject; myFace2 = aSelectedObject;
else if (myEditCurrentArgument == Group6F->LineEdit3) else if ( myEditCurrentArgument == Group6F->LineEdit3 )
myFace3 = aSelectedObject; myFace3 = aSelectedObject;
else if (myEditCurrentArgument == Group6F->LineEdit4) else if ( myEditCurrentArgument == Group6F->LineEdit4 )
myFace4 = aSelectedObject; myFace4 = aSelectedObject;
else if (myEditCurrentArgument == Group6F->LineEdit5) else if ( myEditCurrentArgument == Group6F->LineEdit5 )
myFace5 = aSelectedObject; myFace5 = aSelectedObject;
else if (myEditCurrentArgument == Group6F->LineEdit6) else if ( myEditCurrentArgument == Group6F->LineEdit6 )
myFace6 = aSelectedObject; myFace6 = aSelectedObject;
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
@ -278,26 +281,32 @@ void BlocksGUI_BlockDlg::SetEditCurrentArgument()
{ {
QPushButton* aSender = (QPushButton*)sender(); QPushButton* aSender = (QPushButton*)sender();
if (aSender == Group2F->PushButton1) { if ( aSender == Group2F->PushButton1 ) {
myEditCurrentArgument = Group2F->LineEdit1; myEditCurrentArgument = Group2F->LineEdit1;
} else if (aSender == Group2F->PushButton2) { }
else if ( aSender == Group2F->PushButton2 ) {
myEditCurrentArgument = Group2F->LineEdit2; myEditCurrentArgument = Group2F->LineEdit2;
}
} else if (aSender == Group6F->PushButton1) { else if ( aSender == Group6F->PushButton1 ) {
myEditCurrentArgument = Group6F->LineEdit1; myEditCurrentArgument = Group6F->LineEdit1;
} else if (aSender == Group6F->PushButton2) { }
else if ( aSender == Group6F->PushButton2 ) {
myEditCurrentArgument = Group6F->LineEdit2; myEditCurrentArgument = Group6F->LineEdit2;
} else if (aSender == Group6F->PushButton3) { }
else if ( aSender == Group6F->PushButton3 ) {
myEditCurrentArgument = Group6F->LineEdit3; myEditCurrentArgument = Group6F->LineEdit3;
} else if (aSender == Group6F->PushButton4) { }
else if ( aSender == Group6F->PushButton4 ) {
myEditCurrentArgument = Group6F->LineEdit4; myEditCurrentArgument = Group6F->LineEdit4;
} else if (aSender == Group6F->PushButton5) { }
else if ( aSender == Group6F->PushButton5 ) {
myEditCurrentArgument = Group6F->LineEdit5; myEditCurrentArgument = Group6F->LineEdit5;
} else if (aSender == Group6F->PushButton6) { }
else if ( aSender == Group6F->PushButton6 ) {
myEditCurrentArgument = Group6F->LineEdit6; myEditCurrentArgument = Group6F->LineEdit6;
} }
globalSelection(GEOM_FACE); globalSelection( GEOM_FACE );
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
SelectionIntoArgument(); SelectionIntoArgument();
@ -310,10 +319,10 @@ void BlocksGUI_BlockDlg::SetEditCurrentArgument()
void BlocksGUI_BlockDlg::ActivateThisDialog() void BlocksGUI_BlockDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection(GEOM_FACE); globalSelection( GEOM_FACE );
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -322,9 +331,9 @@ void BlocksGUI_BlockDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_BlockDlg::enterEvent (QEvent* e) void BlocksGUI_BlockDlg::enterEvent( QEvent* )
{ {
if (!GroupConstructors->isEnabled()) if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog(); ActivateThisDialog();
} }
@ -334,7 +343,7 @@ void BlocksGUI_BlockDlg::enterEvent (QEvent* e)
//================================================================================= //=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_BlockDlg::createOperation() GEOM::GEOM_IOperations_ptr BlocksGUI_BlockDlg::createOperation()
{ {
return getGeomEngine()->GetIBlocksOperations(getStudyId()); return getGeomEngine()->GetIBlocksOperations( getStudyId() );
} }
//================================================================================= //=================================================================================
@ -343,50 +352,53 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_BlockDlg::createOperation()
//================================================================================= //=================================================================================
bool BlocksGUI_BlockDlg::isValid (QString&) bool BlocksGUI_BlockDlg::isValid (QString&)
{ {
switch (getConstructorId()) { bool ok = false;
case 0: switch ( getConstructorId() ) {
return !(myFace1->_is_nil() || myFace2->_is_nil()); case 0:
case 1: ok = !( myFace1->_is_nil() || myFace2->_is_nil() );
return !(myFace1->_is_nil() || myFace2->_is_nil() || break;
myFace3->_is_nil() || myFace4->_is_nil() || case 1:
myFace5->_is_nil() || myFace6->_is_nil()); ok = !( myFace1->_is_nil() || myFace2->_is_nil() ||
default: myFace3->_is_nil() || myFace4->_is_nil() ||
return false; myFace5->_is_nil() || myFace6->_is_nil() );
break;
default:
break;
} }
return false; return ok;
} }
//================================================================================= //=================================================================================
// function : execute // function : execute
// purpose : // purpose :
//================================================================================= //=================================================================================
bool BlocksGUI_BlockDlg::execute (ObjectList& objects) bool BlocksGUI_BlockDlg::execute( ObjectList& objects )
{ {
bool res = false; bool res = false;
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
switch (getConstructorId()) { switch ( getConstructorId() ) {
case 0: case 0:
if (!CORBA::is_nil(myFace1) && !CORBA::is_nil(myFace2)) { if ( !CORBA::is_nil( myFace1 ) && !CORBA::is_nil( myFace2 ) ) {
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())-> anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->
MakeHexa2Faces(myFace1, myFace2); MakeHexa2Faces( myFace1, myFace2 );
res = true;
}
break;
case 1:
if ( !CORBA::is_nil( myFace1 ) && !CORBA::is_nil( myFace2 ) &&
!CORBA::is_nil(myFace3 ) && !CORBA::is_nil( myFace4 ) &&
!CORBA::is_nil( myFace5 ) && !CORBA::is_nil( myFace6 ) ) {
anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->
MakeHexa( myFace1, myFace2, myFace3, myFace4, myFace5, myFace6 );
res = true; res = true;
} }
break; break;
case 1:
if (!CORBA::is_nil(myFace1) && !CORBA::is_nil(myFace2) &&
!CORBA::is_nil(myFace3) && !CORBA::is_nil(myFace4) &&
!CORBA::is_nil(myFace5) && !CORBA::is_nil(myFace6)) {
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
MakeHexa(myFace1, myFace2, myFace3, myFace4, myFace5, myFace6);
res = true;
}
break;
} }
if (!anObj->_is_nil()) if ( !anObj->_is_nil() )
objects.push_back(anObj._retn()); objects.push_back( anObj._retn() );
return res; return res;
} }

View File

@ -1,79 +1,74 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_BlockDlg.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_BlockDlg.h
// Author : Julia DOROVSKIKH
// Module : GEOM
#ifndef DIALOGBOX_BLOCK_H #ifndef BLOCKSGUI_BLOCKDLG_H
#define DIALOGBOX_BLOCK_H #define BLOCKSGUI_BLOCKDLG_H
#include "GEOM_BlocksGUI.hxx" #include <GEOMBase_Skeleton.h>
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel_QTD.h"
#include "DlgRef_6Sel_QTD.h"
class DlgRef_2Sel;
class DlgRef_6Sel;
//================================================================================= //=================================================================================
// class : BlocksGUI_BlockDlg // class : BlocksGUI_BlockDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI_BlockDlg : public GEOMBase_Skeleton class BlocksGUI_BlockDlg : public GEOMBase_Skeleton
{ {
Q_OBJECT Q_OBJECT
public: public:
BlocksGUI_BlockDlg (GeometryGUI* theGeometryGUI, QWidget* parent, BlocksGUI_BlockDlg( GeometryGUI*, QWidget* );
bool modal = FALSE);
~BlocksGUI_BlockDlg(); ~BlocksGUI_BlockDlg();
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&); virtual bool isValid( QString& );
virtual bool execute (ObjectList& objects); virtual bool execute( ObjectList&);
private: private:
void Init(); void Init();
void enterEvent (QEvent* e); void enterEvent( QEvent* );
private: private:
int myConstructorId; int myConstructorId;
GEOM::GEOM_Object_var myFace1, myFace2; GEOM::GEOM_Object_var myFace1, myFace2;
GEOM::GEOM_Object_var myFace3, myFace4, myFace5, myFace6; GEOM::GEOM_Object_var myFace3, myFace4, myFace5, myFace6;
DlgRef_2Sel_QTD* Group2F; DlgRef_2Sel* Group2F;
DlgRef_6Sel_QTD* Group6F; DlgRef_6Sel* Group6F;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
void ActivateThisDialog(); void ActivateThisDialog();
void ConstructorsClicked (int constructorId); void ConstructorsClicked( int );
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
}; };
#endif // DIALOGBOX_BLOCK_H #endif // BLOCKSGUI_BLOCKDLG_H

View File

@ -1,113 +1,82 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_ExplodeDlg.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_ExplodeDlg.cxx
// Author : Julia DOROVSKIKH
// Module : GEOM
// $Header$
#include "BlocksGUI_ExplodeDlg.h" #include "BlocksGUI_ExplodeDlg.h"
#include "DlgRef_SpinBox.h" #include <GEOM_DlgRef.h>
#include <GeometryGUI.h>
#include <GEOMBase.h>
#include "GEOM_Displayer.h" #include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include "SUIT_Session.h" #include <SUIT_ResourceMgr.h>
#include "SalomeApp_Application.h" #include <SUIT_ViewWindow.h>
#include "LightApp_SelectionMgr.h" #include <SUIT_ViewManager.h>
#include "OCCViewer_ViewModel.h" #include <SUIT_MessageBox.h>
#include "SALOME_ListIteratorOfListIO.hxx" #include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include "utilities.h" #include <OCCViewer_ViewModel.h>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <qmessagebox.h>
#include <qtextedit.h>
#include <qcheckbox.h>
#include <qlabel.h>
//================================================================================= //=================================================================================
// class : BlocksGUI_ExplodeDlg() // class : BlocksGUI_ExplodeDlg()
// purpose : Constructs a BlocksGUI_ExplodeDlg which is a child of 'parent'. // purpose : Constructs a BlocksGUI_ExplodeDlg which is a child of 'parent'.
//================================================================================= //=================================================================================
BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
: GEOMBase_Skeleton(theGeometryGUI, parent, "ExplodeDlg", modal, : GEOMBase_Skeleton( theGeometryGUI, parent )
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BLOCK_EXPLODE"))); QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_EXPLODE" ) ) );
QPixmap imageS (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); QPixmap imageS( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setCaption(tr("GEOM_BLOCK_EXPLODE_TITLE")); setWindowTitle( tr( "GEOM_BLOCK_EXPLODE_TITLE" ) );
/***************************************************************/ /***************************************************************/
GroupConstructors->setTitle(tr("GEOM_BLOCK_EXPLODE")); mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BLOCK_EXPLODE" ) );
RadioButton1->setPixmap(image1); mainFrame()->RadioButton1->setIcon( image1 );
RadioButton2->close(TRUE); mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close(TRUE); mainFrame()->RadioButton2->close();
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
// Create first group // Create first group
myGrp1 = new QGroupBox(1, Qt::Horizontal, tr("GEOM_ARGUMENTS"), this); myGrp1 = new DlgRef_1Sel2Spin1View1Check( centralWidget() );
myGrp1->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
QGroupBox* aSelGrp = new QGroupBox(3, Qt::Horizontal, myGrp1); myGrp1->TextLabel1->setText( tr( "GEOM_MAIN_OBJECT" ) );
aSelGrp->setFrameStyle(QFrame::NoFrame); myGrp1->PushButton1->setIcon( imageS );
aSelGrp->setInsideMargin(0); myGrp1->LineEdit1->setReadOnly( true );
myGrp1->TextLabel2->setText( tr( "NB_FACES_MIN" ) );
new QLabel(tr("GEOM_MAIN_OBJECT"), aSelGrp); myGrp1->TextLabel3->setText( tr( "NB_FACES_MAX" ) );
mySelBtn = new QPushButton(aSelGrp); myGrp1->CheckBox1->setText( tr( "GEOM_SUBSHAPE_SELECT" ) );
mySelBtn->setPixmap(imageS);
mySelName = new QLineEdit(aSelGrp);
mySelName->setReadOnly(true);
QGroupBox* aSpinGrp = new QGroupBox(2, Qt::Horizontal, myGrp1);
aSpinGrp->setFrameStyle(QFrame::NoFrame);
aSpinGrp->setInsideMargin(0);
new QLabel(tr("NB_FACES_MIN"), aSpinGrp);
mySpinBoxMin = new DlgRef_SpinBox(aSpinGrp);
new QLabel(tr("NB_FACES_MAX"), aSpinGrp);
mySpinBoxMax = new DlgRef_SpinBox(aSpinGrp);
QGroupBox* anInfoGrp = new QGroupBox(2, Qt::Horizontal, myGrp1);
anInfoGrp->setFrameStyle(QFrame::NoFrame);
anInfoGrp->setInsideMargin(0);
myBlocksNb = new QTextEdit(anInfoGrp);
myBlocksNb->setReadOnly(true);
QGroupBox* aCheckGrp = new QGroupBox(3, Qt::Horizontal, myGrp1);
aCheckGrp->setFrameStyle(QFrame::NoFrame);
aCheckGrp->setInsideMargin(0);
myCheckBtn = new QCheckBox(aCheckGrp, "CheckButton1");
myCheckBtn->setText(tr("GEOM_SUBSHAPE_SELECT"));
// Add groups to layout // Add groups to layout
Layout1->addWidget(myGrp1, 1, 0); QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( myGrp1 );
/***************************************************************/ /***************************************************************/
setHelpFileName("explode_on_blocks.htm"); setHelpFileName( "explode_on_blocks.htm" );
Init(); Init();
} }
@ -129,56 +98,56 @@ BlocksGUI_ExplodeDlg::~BlocksGUI_ExplodeDlg()
void BlocksGUI_ExplodeDlg::Init() void BlocksGUI_ExplodeDlg::Init()
{ {
// Set range of spinboxes // Set range of spinboxes
double SpecificStep = 1.0; int SpecificStep = 1;
mySpinBoxMin->RangeStepAndValidator(0.0, 999.0, SpecificStep, 3); initSpinBox( myGrp1->SpinBox1, 0, 999, SpecificStep );
mySpinBoxMax->RangeStepAndValidator(0.0, 999.0, SpecificStep, 3); initSpinBox( myGrp1->SpinBox2, 0, 999, SpecificStep );
if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() if ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
!= OCCViewer_Viewer::Type()) != OCCViewer_Viewer::Type() )
myCheckBtn->setEnabled(false); myGrp1->CheckBox1->setEnabled( false );
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect(mySelBtn, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( myGrp1->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect(mySpinBoxMin, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect( myGrp1->SpinBox1, SIGNAL( valueChanged( int ) ), this, SLOT( ValueChangedInSpinBox( int ) ) );
connect(mySpinBoxMax, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect( myGrp1->SpinBox2, SIGNAL( valueChanged( int ) ), this, SLOT( ValueChangedInSpinBox( int ) ) );
connect(myCheckBtn, SIGNAL(stateChanged(int)), this, SLOT(SubShapeToggled())); connect( myGrp1->CheckBox1, SIGNAL( stateChanged( int ) ), this, SLOT( SubShapeToggled() ) );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
myConstructorId = -1; myConstructorId = -1;
ConstructorsClicked(0); ConstructorsClicked( 0 );
} }
//================================================================================= //=================================================================================
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::ConstructorsClicked (int constructorId) void BlocksGUI_ExplodeDlg::ConstructorsClicked( int constructorId )
{ {
if (myConstructorId == constructorId) if ( myConstructorId == constructorId )
return; return;
myConstructorId = constructorId; myConstructorId = constructorId;
switch (constructorId) { switch ( constructorId ) {
case 0: case 0:
myGrp1->show(); myGrp1->show();
mySpinBoxMin->SetValue(6.0); myGrp1->SpinBox1->setValue( 6 );
mySpinBoxMax->SetValue(6.0); myGrp1->SpinBox2->setValue( 6 );
myCheckBtn->setChecked(FALSE); myGrp1->CheckBox1->setChecked( false );
break; break;
default: default:
break; break;
} }
// init fields // init fields
myEditCurrentArgument = mySelName; myEditCurrentArgument = myGrp1->LineEdit1;
myObject = GEOM::GEOM_Object::_nil(); myObject = GEOM::GEOM_Object::_nil();
activateSelection(); activateSelection();
@ -190,7 +159,7 @@ void BlocksGUI_ExplodeDlg::ConstructorsClicked (int constructorId)
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::ClickOnOk() void BlocksGUI_ExplodeDlg::ClickOnOk()
{ {
if (ClickOnApply()) if ( ClickOnApply() )
ClickOnCancel(); ClickOnCancel();
} }
@ -200,23 +169,22 @@ void BlocksGUI_ExplodeDlg::ClickOnOk()
//================================================================================= //=================================================================================
bool BlocksGUI_ExplodeDlg::ClickOnApply() bool BlocksGUI_ExplodeDlg::ClickOnApply()
{ {
SUIT_Session::session()->activeApplication()->putInfo(tr("")); SUIT_Session::session()->activeApplication()->putInfo( tr( "" ) );
// Explode all sub shapes // Explode all sub shapes
if (isAllSubShapes()) { if ( isAllSubShapes() ) {
// More than 30 subshapes : ask confirmation // More than 30 subshapes : ask confirmation
if (myNbBlocks > 30) { if ( myNbBlocks > 30 ) {
const QString caption = tr("GEOM_CONFIRM"); if ( SUIT_MessageBox::warning( this,
const QString text = tr("GEOM_CONFIRM_INFO").arg(myNbBlocks); tr( "GEOM_CONFIRM" ),
const QString button0 = tr("GEOM_BUT_EXPLODE"); tr( "GEOM_CONFIRM_INFO" ).arg( myNbBlocks ),
const QString button1 = tr("GEOM_BUT_CANCEL"); tr( "GEOM_BUT_EXPLODE" ),
tr( "GEOM_BUT_CANCEL" ) ) != 0 )
if (QMessageBox::warning(this, caption, text, button0, button1) != 0)
return false; /* aborted */ return false; /* aborted */
} }
} }
if (!onAccept()) if ( !onAccept() )
return false; return false;
activateSelection(); activateSelection();
@ -230,20 +198,20 @@ bool BlocksGUI_ExplodeDlg::ClickOnApply()
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::SelectionIntoArgument() void BlocksGUI_ExplodeDlg::SelectionIntoArgument()
{ {
if (!isAllSubShapes()) if ( !isAllSubShapes() )
return; return;
myObject = GEOM::GEOM_Object::_nil(); myObject = GEOM::GEOM_Object::_nil();
mySelName->setText(""); myGrp1->LineEdit1->setText( "" );
if (IObjectCount() == 1) { if ( IObjectCount() == 1 ) {
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject(firstIObject(), aResult); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) { if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
myObject = anObj; myObject = anObj;
mySelName->setText(GEOMBase::GetName(anObj)); myGrp1->LineEdit1->setText( GEOMBase::GetName( anObj ) );
} }
} }
@ -258,10 +226,10 @@ void BlocksGUI_ExplodeDlg::SetEditCurrentArgument()
{ {
QPushButton* aSender = (QPushButton*)sender(); QPushButton* aSender = (QPushButton*)sender();
if (mySelBtn == aSender) { if ( myGrp1->PushButton1 == aSender ) {
mySelName->setFocus(); myGrp1->LineEdit1->setFocus();
myEditCurrentArgument = mySelName; myEditCurrentArgument = myGrp1->LineEdit1;
myCheckBtn->setChecked(FALSE); myGrp1->CheckBox1->setChecked( false );
} }
activateSelection(); activateSelection();
@ -274,8 +242,8 @@ void BlocksGUI_ExplodeDlg::SetEditCurrentArgument()
void BlocksGUI_ExplodeDlg::ActivateThisDialog() void BlocksGUI_ExplodeDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
activateSelection(); activateSelection();
} }
@ -284,9 +252,9 @@ void BlocksGUI_ExplodeDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::enterEvent (QEvent* e) void BlocksGUI_ExplodeDlg::enterEvent( QEvent* )
{ {
if (!GroupConstructors->isEnabled()) if ( !mainFrame()->GroupConstructors->isEnabled() )
this->ActivateThisDialog(); this->ActivateThisDialog();
} }
@ -294,9 +262,9 @@ void BlocksGUI_ExplodeDlg::enterEvent (QEvent* e)
// function : ValueChangedInSpinBox() // function : ValueChangedInSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::ValueChangedInSpinBox (double newValue) void BlocksGUI_ExplodeDlg::ValueChangedInSpinBox()
{ {
if (!isAllSubShapes()) if ( !isAllSubShapes() )
activateSelection(); activateSelection();
else else
updateButtonState(); updateButtonState();
@ -305,7 +273,7 @@ void BlocksGUI_ExplodeDlg::ValueChangedInSpinBox (double newValue)
//================================================================================= //=================================================================================
// function : SubShapeToggled() // function : SubShapeToggled()
// purpose : Allow user selection of all or only selected sub shapes // purpose : Allow user selection of all or only selected sub shapes
// : Called when 'myCheckBtn' state change // : Called when 'myGrp1->CheckBox1' state change
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::SubShapeToggled() void BlocksGUI_ExplodeDlg::SubShapeToggled()
{ {
@ -319,20 +287,21 @@ void BlocksGUI_ExplodeDlg::SubShapeToggled()
void BlocksGUI_ExplodeDlg::activateSelection() void BlocksGUI_ExplodeDlg::activateSelection()
{ {
clearTemporary(); clearTemporary();
erasePreview(true); erasePreview( true );
if (isAllSubShapes()) { // Sub-shapes selection disabled if ( isAllSubShapes() ) { // Sub-shapes selection disabled
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
if (myObject->_is_nil()) { if ( myObject->_is_nil() ) {
SelectionIntoArgument(); SelectionIntoArgument();
} }
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
} else { }
displayPreview(true, true, false); else {
globalSelection(GEOM_PREVIEW); displayPreview( true, true, false );
globalSelection( GEOM_PREVIEW );
} }
} }
@ -342,28 +311,30 @@ void BlocksGUI_ExplodeDlg::activateSelection()
//================================================================================= //=================================================================================
void BlocksGUI_ExplodeDlg::updateButtonState() void BlocksGUI_ExplodeDlg::updateButtonState()
{ {
if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() if ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
!= OCCViewer_Viewer::Type() || myObject->_is_nil()) { != OCCViewer_Viewer::Type() || myObject->_is_nil() ) {
myCheckBtn->setChecked(FALSE); myGrp1->CheckBox1->setChecked( false );
myCheckBtn->setEnabled(FALSE); myGrp1->CheckBox1->setEnabled( false );
} else { }
myCheckBtn->setEnabled(TRUE); else {
myGrp1->CheckBox1->setEnabled( true );
} }
myNbBlocks = 0; myNbBlocks = 0;
if (myObject->_is_nil()) { if ( myObject->_is_nil() ) {
myBlocksNb->setText(""); myGrp1->TextBrowser1->setText( "" );
} else { }
else {
bool isOnlyBlocks = GEOM::GEOM_IBlocksOperations::_narrow bool isOnlyBlocks = GEOM::GEOM_IBlocksOperations::_narrow
(getOperation())->IsCompoundOfBlocks(myObject, ( getOperation() )->IsCompoundOfBlocks( myObject,
(int)mySpinBoxMin->GetValue(), myGrp1->SpinBox1->value(),
(int)mySpinBoxMax->GetValue(), myGrp1->SpinBox2->value(),
myNbBlocks); myNbBlocks );
if (isOnlyBlocks) if ( isOnlyBlocks )
myBlocksNb->setText(tr("GEOM_NB_BLOCKS_NO_OTHERS").arg(myNbBlocks)); myGrp1->TextBrowser1->setText( tr( "GEOM_NB_BLOCKS_NO_OTHERS" ).arg( myNbBlocks ) );
else else
myBlocksNb->setText(tr("GEOM_NB_BLOCKS_SOME_OTHERS").arg(myNbBlocks)); myGrp1->TextBrowser1->setText( tr( "GEOM_NB_BLOCKS_SOME_OTHERS" ).arg( myNbBlocks ) );
} }
} }
@ -373,7 +344,7 @@ void BlocksGUI_ExplodeDlg::updateButtonState()
//================================================================================= //=================================================================================
bool BlocksGUI_ExplodeDlg::isAllSubShapes() const bool BlocksGUI_ExplodeDlg::isAllSubShapes() const
{ {
return !myCheckBtn->isChecked() || !myCheckBtn->isEnabled(); return !myGrp1->CheckBox1->isChecked() || !myGrp1->CheckBox1->isEnabled();
} }
//================================================================================= //=================================================================================
@ -382,23 +353,25 @@ bool BlocksGUI_ExplodeDlg::isAllSubShapes() const
//================================================================================= //=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation() GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation()
{ {
return getGeomEngine()->GetIBlocksOperations(getStudyId()); return getGeomEngine()->GetIBlocksOperations( getStudyId() );
} }
//================================================================================= //=================================================================================
// function : isValid() // function : isValid()
// purpose : Verify validity of input data // purpose : Verify validity of input data
//================================================================================= //=================================================================================
bool BlocksGUI_ExplodeDlg::isValid (QString&) bool BlocksGUI_ExplodeDlg::isValid( QString& )
{ {
switch (getConstructorId()) { bool ok = false;
switch ( getConstructorId() ) {
case 0: case 0:
if (IsPreview()) if ( IsPreview() )
return !myObject->_is_nil(); ok = !myObject->_is_nil();
else else
return !myObject->_is_nil() && (isAllSubShapes() || IObjectCount()); ok = !myObject->_is_nil() && ( isAllSubShapes() || IObjectCount() );
break;
default: default:
return false; break;
} }
return false; return false;
@ -408,67 +381,67 @@ bool BlocksGUI_ExplodeDlg::isValid (QString&)
// function : execute // function : execute
// purpose : // purpose :
//================================================================================= //=================================================================================
bool BlocksGUI_ExplodeDlg::execute (ObjectList& objects) bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
{ {
GEOM::ListOfGO_var aList; GEOM::ListOfGO_var aList;
switch (getConstructorId()) { switch ( getConstructorId() ) {
case 0: case 0:
aList = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->ExplodeCompoundOfBlocks aList = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->ExplodeCompoundOfBlocks
(myObject, ( myObject,
(int)mySpinBoxMin->GetValue(), myGrp1->SpinBox1->value(),
(int)mySpinBoxMax->GetValue()); myGrp1->SpinBox2->value() );
break; break;
} }
if (!aList->length()) if ( !aList->length() )
return false; return false;
if (IsPreview()) { if ( IsPreview() ) {
clearTemporary(); clearTemporary();
// Store objects. They will be put in study when "Apply" is pressed // Store objects. They will be put in study when "Apply" is pressed
for (int i = 0, n = aList->length(); i < n; i++) { for ( int i = 0, n = aList->length(); i < n; i++ ) {
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i])); objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
myTmpObjs.push_back(GEOM::GEOM_Object::_duplicate(aList[i])); myTmpObjs.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
} }
return objects.size() ? true : false; return objects.size() > 0;
} }
// Throw away sub-shapes not selected by user if not in preview mode // Throw away sub-shapes not selected by user if not in preview mode
// and manual selection is active // and manual selection is active
if (!isAllSubShapes()) if ( !isAllSubShapes() ) {
{
QMap<QString, char> selected; QMap<QString, char> selected;
// Get names of selected objects // Get names of selected objects
SALOME_ListIteratorOfListIO it (selectedIO()); SALOME_ListIteratorOfListIO it ( selectedIO() );
for (; it.More(); it.Next()) { for ( ; it.More(); it.Next() ) {
selected.insert(it.Value()->getName(), 0); selected.insert( it.Value()->getName(), 0 );
} }
// Iterate through result and select objects with names from selection // Iterate through result and select objects with names from selection
ObjectList toRemoveFromEnggine; ObjectList toRemoveFromEnggine;
ObjectList::iterator anIter; ObjectList::iterator anIter;
for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter) { for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string(*anIter); CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
if (selected.contains(QString(objStr.in()))) if ( selected.contains( QString( objStr.in() ) ) )
objects.push_back(*anIter); objects.push_back( *anIter );
else else
toRemoveFromEnggine.push_back(*anIter); toRemoveFromEnggine.push_back( *anIter );
} }
// Remove from engine useless objects // Remove from engine useless objects
ObjectList::iterator anIter2 = toRemoveFromEnggine.begin(); ObjectList::iterator anIter2 = toRemoveFromEnggine.begin();
for (; anIter2 != toRemoveFromEnggine.end(); ++anIter2) for ( ; anIter2 != toRemoveFromEnggine.end(); ++anIter2 )
getGeomEngine()->RemoveObject(*anIter2); getGeomEngine()->RemoveObject( *anIter2 );
myTmpObjs.clear(); myTmpObjs.clear();
} else { }
for (int i = 0, n = aList->length(); i < n; i++) else {
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i])); for ( int i = 0, n = aList->length(); i < n; i++ )
objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
} }
return objects.size(); return objects.size();
@ -481,8 +454,8 @@ bool BlocksGUI_ExplodeDlg::execute (ObjectList& objects)
void BlocksGUI_ExplodeDlg::clearTemporary() void BlocksGUI_ExplodeDlg::clearTemporary()
{ {
ObjectList::iterator anIter; ObjectList::iterator anIter;
for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter) for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter )
getGeomEngine()->RemoveObject(*anIter); getGeomEngine()->RemoveObject( *anIter );
myTmpObjs.clear(); myTmpObjs.clear();
} }
@ -492,7 +465,7 @@ void BlocksGUI_ExplodeDlg::clearTemporary()
// Purpose : Get father object for object to be added in study // Purpose : Get father object for object to be added in study
// ( called with addInStudy method ) // ( called with addInStudy method )
//================================================================ //================================================================
GEOM::GEOM_Object_ptr BlocksGUI_ExplodeDlg::getFather (GEOM::GEOM_Object_ptr) GEOM::GEOM_Object_ptr BlocksGUI_ExplodeDlg::getFather( GEOM::GEOM_Object_ptr )
{ {
return myObject; return myObject;
} }

View File

@ -1,105 +1,89 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_ExplodeDlg.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_ExplodeDlg.h
// Author : Julia DOROVSKIKH
// Module : GEOM
#ifndef DIALOGBOX_BLOCK_EXPLODE_H #ifndef BLOCKSGUI_EXPLODEDLG_H
#define DIALOGBOX_BLOCK_EXPLODE_H #define BLOCKSGUI_EXPLODEDLG_H
#include "GEOM_BlocksGUI.hxx" #include <GEOMBase_Skeleton.h>
#include "GEOMBase_Skeleton.h" class DlgRef_1Sel2Spin1View1Check;
class DlgRef_SpinBox;
class QTextEdit;
class QCheckBox;
//================================================================================= //=================================================================================
// class : BlocksGUI_ExplodeDlg // class : BlocksGUI_ExplodeDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI_ExplodeDlg : public GEOMBase_Skeleton class BlocksGUI_ExplodeDlg : public GEOMBase_Skeleton
{ {
Q_OBJECT Q_OBJECT
public: public:
BlocksGUI_ExplodeDlg (GeometryGUI*, QWidget* parent, bool modal = FALSE); BlocksGUI_ExplodeDlg( GeometryGUI*, QWidget* );
~BlocksGUI_ExplodeDlg(); ~BlocksGUI_ExplodeDlg();
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString& msg); virtual bool isValid( QString& );
virtual bool execute (ObjectList& objects); virtual bool execute( ObjectList& );
virtual GEOM::GEOM_Object_ptr getFather(GEOM::GEOM_Object_ptr theObj); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr );
virtual const char* getNewObjectName() const; virtual const char* getNewObjectName() const;
private: private:
void Init(); void Init();
void enterEvent (QEvent* e); void enterEvent( QEvent* );
void activateSelection(); void activateSelection();
void updateButtonState(); void updateButtonState();
bool isAllSubShapes() const; bool isAllSubShapes() const;
int shapeType() const; int shapeType() const;
void clearTemporary(); void clearTemporary();
private: private:
int myConstructorId; int myConstructorId;
CORBA::Long myNbBlocks; CORBA::Long myNbBlocks;
GEOM::GEOM_Object_var myObject; GEOM::GEOM_Object_var myObject;
ObjectList myTmpObjs; ObjectList myTmpObjs;
QFrame* myGrp1; DlgRef_1Sel2Spin1View1Check* myGrp1;
QPushButton* mySelBtn;
QLineEdit* mySelName;
DlgRef_SpinBox* mySpinBoxMin;
DlgRef_SpinBox* mySpinBoxMax;
QTextEdit* myBlocksNb;
QCheckBox* myCheckBtn;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
void ActivateThisDialog(); void ActivateThisDialog();
void ConstructorsClicked (int constructorId); void ConstructorsClicked( int );
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void SubShapeToggled(); void SubShapeToggled();
void ValueChangedInSpinBox (double newValue); void ValueChangedInSpinBox();
}; };
#endif // DIALOGBOX_BLOCK_EXPLODE_H #endif // BLOCKSGUI_EXPLODEDLG_H

View File

@ -1,44 +1,42 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_PropagateDlg.cxx
// Author : Vladimir KLYACHIN, Open CASCADE S.A.S. (vladimir.klyachin@opencascade.com)
// //
//
// File : BlocksGUI_PropagateDlg.cxx
// Author : VKN
// Module : GEOM
// $Header$
#include "BlocksGUI_PropagateDlg.h" #include "BlocksGUI_PropagateDlg.h"
#include "GEOMImpl_Types.hxx"
#include "SUIT_Session.h" #include <GEOM_DlgRef.h>
#include "SalomeApp_Application.h" #include <GeometryGUI.h>
#include "LightApp_SelectionMgr.h" #include <GEOMBase.h>
#include <GEOMImpl_Types.hxx>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
#include <qlabel.h>
using namespace std;
//================================================================================= //=================================================================================
// class : BlocksGUI_PropagateDlg() // class : BlocksGUI_PropagateDlg()
// purpose : Constructs a BlocksGUI_PropagateDlg which is a child of 'parent', with the // purpose : Constructs a BlocksGUI_PropagateDlg which is a child of 'parent', with the
@ -46,38 +44,35 @@ using namespace std;
// The dialog will by default be modeless, unless you set 'modal' to // The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
//================================================================================= //=================================================================================
BlocksGUI_PropagateDlg::BlocksGUI_PropagateDlg(GeometryGUI* theGeometryGUI, QWidget* parent, BlocksGUI_PropagateDlg::BlocksGUI_PropagateDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
const char* name, bool modal, WFlags fl) : GEOMBase_Skeleton( theGeometryGUI, parent )
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PROPAGATE"))); QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PROPAGATE" ) ) );
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setCaption(tr("GEOM_PROPAGATE_TITLE")); setWindowTitle( tr( "GEOM_PROPAGATE_TITLE" ) );
/***************************************************************/ /***************************************************************/
GroupConstructors->setTitle(tr("GEOM_PROPAGATE_TITLE")); mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PROPAGATE_TITLE" ) );
RadioButton1->setPixmap(image0); mainFrame()->RadioButton1->setIcon( image0 );
RadioButton2->close(TRUE); mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
RadioButton3->close(TRUE); mainFrame()->RadioButton2->close();
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
QGroupBox* aMainGrp = new QGroupBox( 1, Qt::Horizontal, tr( "GEOM_SELECTED_SHAPE" ), this ); myGrp = new DlgRef_1Sel( centralWidget() );
QGroupBox* aSelGrp = new QGroupBox(3, Qt::Horizontal, aMainGrp); myGrp->GroupBox1->setTitle( tr( "GEOM_SELECTED_SHAPE" ) );
aSelGrp->setFrameStyle(QFrame::NoFrame); myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
aSelGrp->setInsideMargin(0); myGrp->PushButton1->setIcon( image1 );
myGrp->LineEdit1->setReadOnly( true );
new QLabel(tr("GEOM_OBJECT"), aSelGrp); QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
mySelBtn = new QPushButton(aSelGrp); layout->setMargin( 0 ); layout->setSpacing( 6 );
mySelBtn->setPixmap(image1); layout->addWidget( myGrp );
mySelName = new QLineEdit(aSelGrp);
mySelName->setReadOnly(true);
Layout1->addWidget(aMainGrp, 1, 0);
/***************************************************************/ /***************************************************************/
setHelpFileName("propagate.htm"); setHelpFileName( "propagate.htm" );
Init(); Init();
} }
@ -99,16 +94,16 @@ void BlocksGUI_PropagateDlg::Init()
/* init variables */ /* init variables */
myObject = GEOM::GEOM_Object::_nil(); myObject = GEOM::GEOM_Object::_nil();
ResultName->setText( "" ); mainFrame()->ResultName->setText( "" );
//myGeomGUI->SetState( 0 ); //myGeomGUI->SetState( 0 );
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect(mySelBtn, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( myGrp->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect(mySelName, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect( myGrp->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
activateSelection(); activateSelection();
} }
@ -135,7 +130,7 @@ bool BlocksGUI_PropagateDlg::ClickOnApply()
initName(); initName();
mySelName->setText(""); myGrp->LineEdit1->setText( "" );
myObject = GEOM::GEOM_Object::_nil(); myObject = GEOM::GEOM_Object::_nil();
activateSelection(); activateSelection();
@ -150,7 +145,7 @@ bool BlocksGUI_PropagateDlg::ClickOnApply()
//================================================================================= //=================================================================================
void BlocksGUI_PropagateDlg::SelectionIntoArgument() void BlocksGUI_PropagateDlg::SelectionIntoArgument()
{ {
mySelName->setText(""); myGrp->LineEdit1->setText( "" );
myObject = GEOM::GEOM_Object::_nil(); myObject = GEOM::GEOM_Object::_nil();
if ( IObjectCount() == 1 ) { if ( IObjectCount() == 1 ) {
@ -158,7 +153,7 @@ void BlocksGUI_PropagateDlg::SelectionIntoArgument()
Standard_Boolean aRes; Standard_Boolean aRes;
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( aRes ) if ( aRes )
mySelName->setText( GEOMBase::GetName( myObject ) ); myGrp->LineEdit1->setText( GEOMBase::GetName( myObject ) );
} }
} }
@ -169,8 +164,8 @@ void BlocksGUI_PropagateDlg::SelectionIntoArgument()
void BlocksGUI_PropagateDlg::SetEditCurrentArgument() void BlocksGUI_PropagateDlg::SetEditCurrentArgument()
{ {
const QObject* send = sender(); const QObject* send = sender();
if ( send == mySelBtn ) { if ( send == myGrp->PushButton1 ) {
mySelName->setFocus(); myGrp->LineEdit1->setFocus();
} }
activateSelection(); activateSelection();
} }
@ -183,7 +178,7 @@ void BlocksGUI_PropagateDlg::SetEditCurrentArgument()
void BlocksGUI_PropagateDlg::LineEditReturnPressed() void BlocksGUI_PropagateDlg::LineEditReturnPressed()
{ {
const QObject* send = sender(); const QObject* send = sender();
if( send == mySelName ) { if ( send == myGrp->LineEdit1 ) {
GEOMBase_Skeleton::LineEditReturnPressed(); GEOMBase_Skeleton::LineEditReturnPressed();
} }
} }
@ -197,7 +192,7 @@ void BlocksGUI_PropagateDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
mySelName->setText(""); myGrp->LineEdit1->setText( "" );
myObject = GEOM::GEOM_Object::_nil(); myObject = GEOM::GEOM_Object::_nil();
//myGeomGUI->SetState( 0 ); //myGeomGUI->SetState( 0 );
@ -209,9 +204,9 @@ void BlocksGUI_PropagateDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : Mouse enter onto the dialog to activate it // purpose : Mouse enter onto the dialog to activate it
//================================================================================= //=================================================================================
void BlocksGUI_PropagateDlg::enterEvent(QEvent* e) void BlocksGUI_PropagateDlg::enterEvent( QEvent* )
{ {
if ( !GroupConstructors->isEnabled() ) if ( !mainFrame()->GroupConstructors->isEnabled() )
ActivateThisDialog(); ActivateThisDialog();
} }
@ -220,7 +215,7 @@ void BlocksGUI_PropagateDlg::enterEvent(QEvent* e)
// function : closeEvent() // function : closeEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_PropagateDlg::closeEvent(QCloseEvent* e) void BlocksGUI_PropagateDlg::closeEvent( QCloseEvent* e )
{ {
//myGeomGUI->SetState( -1 ); //myGeomGUI->SetState( -1 );
GEOMBase_Skeleton::closeEvent( e ); GEOMBase_Skeleton::closeEvent( e );
@ -239,7 +234,7 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_PropagateDlg::createOperation()
// function : isValid // function : isValid
// purpose : // purpose :
//================================================================================= //=================================================================================
bool BlocksGUI_PropagateDlg::isValid( QString& msg ) bool BlocksGUI_PropagateDlg::isValid( QString& )
{ {
return !myObject->_is_nil() ; return !myObject->_is_nil() ;
} }
@ -250,19 +245,17 @@ bool BlocksGUI_PropagateDlg::isValid( QString& msg )
//================================================================================= //=================================================================================
bool BlocksGUI_PropagateDlg::execute( ObjectList& objects ) bool BlocksGUI_PropagateDlg::execute( ObjectList& objects )
{ {
GEOM::ListOfGO_var aList = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->Propagate( myObject ); GEOM::ListOfGO_var aList = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->Propagate( myObject );
ResultName->setText( "" ); mainFrame()->ResultName->setText( "" );
if ( !aList->length() ) if ( !aList->length() )
return false; return false;
for ( int i = 0, n = aList->length(); i < n; i++ ) for ( int i = 0, n = aList->length(); i < n; i++ ) {
{ objects.push_back( aList[i]._retn() );
objects.push_back(aList[i]._retn());
} }
return objects.size() ? true : false; return objects.size() > 0;
} }
//================================================================================= //=================================================================================
@ -275,11 +268,11 @@ void BlocksGUI_PropagateDlg::activateSelection()
aMap.Add( GEOM_SOLID ); aMap.Add( GEOM_SOLID );
aMap.Add( GEOM_COMPOUND ); aMap.Add( GEOM_COMPOUND );
globalSelection( aMap ); globalSelection( aMap );
if (myObject->_is_nil()) { if ( myObject->_is_nil() ) {
SelectionIntoArgument(); SelectionIntoArgument();
} }
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
} }
//================================================================ //================================================================
@ -287,7 +280,7 @@ void BlocksGUI_PropagateDlg::activateSelection()
// Purpose : Get father object for object to be added in study // Purpose : Get father object for object to be added in study
// ( called with addInStudy method ) // ( called with addInStudy method )
//================================================================ //================================================================
GEOM::GEOM_Object_ptr BlocksGUI_PropagateDlg::getFather (GEOM::GEOM_Object_ptr) GEOM::GEOM_Object_ptr BlocksGUI_PropagateDlg::getFather( GEOM::GEOM_Object_ptr )
{ {
return myObject; return myObject;
} }

View File

@ -1,78 +1,73 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_PropagateDlg.h
// Author : Vladimir KLYACHIN, Open CASCADE S.A.S. (vladimir.klyachin@opencascade.com)
// //
//
// File : BlocksGUI_PropagateDlg.h
// Author : VKN
// Module : GEOM
#ifndef DIALOGBOX_BlocksGUI_PropagateDlg_H #ifndef BLOCKSGUI_PROPAGATEDLG_H
#define DIALOGBOX_BlocksGUI_PropagateDlg_H #define BLOCKSGUI_PROPAGATEDLG_H
#include "GEOM_BlocksGUI.hxx" #include <GEOMBase_Skeleton.h>
#include "GEOMBase_Skeleton.h"
class DlgRef_1Sel;
//================================================================================= //=================================================================================
// class : BlocksGUI_PropagateDlg // class : BlocksGUI_PropagateDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI_PropagateDlg : public GEOMBase_Skeleton class BlocksGUI_PropagateDlg : public GEOMBase_Skeleton
{ {
Q_OBJECT Q_OBJECT
public: public:
BlocksGUI_PropagateDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, BlocksGUI_PropagateDlg( GeometryGUI*, QWidget* = 0 );
const char* name = "", bool modal = FALSE, WFlags fl = 0); ~BlocksGUI_PropagateDlg();
~BlocksGUI_PropagateDlg();
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& ); virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects ); virtual bool execute( ObjectList& );
virtual GEOM::GEOM_Object_ptr getFather(GEOM::GEOM_Object_ptr theObj); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr );
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
void ActivateThisDialog(); void ActivateThisDialog();
void LineEditReturnPressed(); void LineEditReturnPressed();
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
private: private:
void Init(); void Init();
void enterEvent(QEvent* e); void enterEvent( QEvent* );
void closeEvent(QCloseEvent* e); void closeEvent( QCloseEvent* );
void activateSelection(); void activateSelection();
private: private:
GEOM::GEOM_Object_var myObject; GEOM::GEOM_Object_var myObject;
QPushButton* mySelBtn; DlgRef_1Sel* myGrp;
QLineEdit* mySelName;
}; };
#endif // DIALOGBOX_BlocksGUI_PropagateDlg_H #endif // BLOCKSGUI_PROPAGATEDLG_H

View File

@ -1,36 +1,38 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_QuadFaceDlg.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_QuadFaceDlg.cxx
// Author : Julia DOROVSKIKH
// Module : GEOM
// $Header$
#include "BlocksGUI_QuadFaceDlg.h" #include "BlocksGUI_QuadFaceDlg.h"
#include "GEOMImpl_Types.hxx"
#include "SUIT_Session.h" #include <GEOM_DlgRef.h>
#include "SalomeApp_Application.h" #include <GeometryGUI.h>
#include "LightApp_SelectionMgr.h" #include <GEOMBase.h>
#include <GEOMImpl_Types.hxx>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <qlabel.h> #include <qlabel.h>
@ -38,69 +40,56 @@
// class : BlocksGUI_QuadFaceDlg() // class : BlocksGUI_QuadFaceDlg()
// purpose : Constructs a BlocksGUI_QuadFaceDlg which is a child of 'parent'. // purpose : Constructs a BlocksGUI_QuadFaceDlg which is a child of 'parent'.
//================================================================================= //=================================================================================
BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
: GEOMBase_Skeleton(theGeometryGUI, parent, "QuadFaceDlg", modal, : GEOMBase_Skeleton( theGeometryGUI, parent )
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
QPixmap image1 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_VERT"))); QPixmap image1( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_QUAD_FACE_4_VERT" ) ) );
QPixmap image2 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_2_EDGE"))); QPixmap image2( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_QUAD_FACE_2_EDGE" ) ) );
QPixmap image3 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_EDGE"))); QPixmap image3( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_QUAD_FACE_4_EDGE" ) ) );
QPixmap imageS (aResMgr->loadPixmap("GEOM",tr("ICON_SELECT"))); QPixmap imageS( aResMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setCaption(tr("GEOM_QUAD_FACE_TITLE")); setWindowTitle( tr( "GEOM_QUAD_FACE_TITLE" ) );
/***************************************************************/ /***************************************************************/
GroupConstructors->setTitle(tr("GEOM_QUAD_FACE")); mainFrame()->GroupConstructors->setTitle( tr( "GEOM_QUAD_FACE" ) );
RadioButton1->setPixmap(image1); mainFrame()->RadioButton1->setIcon( image1 );
RadioButton2->setPixmap(image2); mainFrame()->RadioButton2->setIcon( image2 );
RadioButton3->setPixmap(image3); mainFrame()->RadioButton3->setIcon( image3 );
// Create first group // Create first group
myGrp1 = new QGroupBox(1, Qt::Horizontal, tr("GEOM_ARGUMENTS"), this); myGrp1 = new QGroupBox( tr( "GEOM_ARGUMENTS" ), centralWidget() );
QGroupBox* aSelGrp1 = new QGroupBox(3, Qt::Horizontal, myGrp1); createSelWg( tr( "VERTEX_1" ), imageS, myGrp1, Vertex1 );
aSelGrp1->setFrameStyle(QFrame::NoFrame); createSelWg( tr( "VERTEX_2" ), imageS, myGrp1, Vertex2 );
aSelGrp1->setInsideMargin(0); createSelWg( tr( "VERTEX_3" ), imageS, myGrp1, Vertex3 );
createSelWg( tr( "VERTEX_4" ), imageS, myGrp1, Vertex4 );
createSelWg(tr("VERTEX_1"), imageS, aSelGrp1, Vertex1);
createSelWg(tr("VERTEX_2"), imageS, aSelGrp1, Vertex2);
createSelWg(tr("VERTEX_3"), imageS, aSelGrp1, Vertex3);
createSelWg(tr("VERTEX_4"), imageS, aSelGrp1, Vertex4);
// Create second group // Create second group
myGrp2 = new QGroupBox(1, Qt::Horizontal, tr("GEOM_ARGUMENTS"), this); myGrp2 = new QGroupBox( tr( "GEOM_ARGUMENTS" ), centralWidget() );
QGroupBox* aSelGrp2 = new QGroupBox(3, Qt::Horizontal, myGrp2); createSelWg( tr( "EDGE_1" ), imageS, myGrp2, Edge12 );
aSelGrp2->setFrameStyle(QFrame::NoFrame); createSelWg( tr( "EDGE_2" ), imageS, myGrp2, Edge22 );
aSelGrp2->setInsideMargin(0);
createSelWg(tr("EDGE_1"), imageS, aSelGrp2, Edge12);
createSelWg(tr("EDGE_2"), imageS, aSelGrp2, Edge22);
// Create fird group // Create fird group
myGrp3 = new QGroupBox(1, Qt::Horizontal, tr("GEOM_ARGUMENTS"), this); myGrp3 = new QGroupBox( tr( "GEOM_ARGUMENTS" ), centralWidget() );
QGroupBox* aSelGrp3 = new QGroupBox(3, Qt::Horizontal, myGrp3); createSelWg( tr( "EDGE_1" ), imageS, myGrp3, Edge14 );
aSelGrp3->setFrameStyle(QFrame::NoFrame); createSelWg( tr( "EDGE_2" ), imageS, myGrp3, Edge24 );
aSelGrp3->setInsideMargin(0); createSelWg( tr( "EDGE_3" ), imageS, myGrp3, Edge34 );
createSelWg( tr( "EDGE_4" ), imageS, myGrp3, Edge44 );
createSelWg(tr("EDGE_1"), imageS, aSelGrp3, Edge14);
createSelWg(tr("EDGE_2"), imageS, aSelGrp3, Edge24);
createSelWg(tr("EDGE_3"), imageS, aSelGrp3, Edge34);
createSelWg(tr("EDGE_4"), imageS, aSelGrp3, Edge44);
(new QLabel(myGrp3))->setSizePolicy(
QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
// Add groups to layout // Add groups to layout
Layout1->addWidget(myGrp1, 2, 0); QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
Layout1->addWidget(myGrp2, 2, 0); layout->setMargin( 0 ); layout->setSpacing( 6 );
Layout1->addWidget(myGrp3, 2, 0); layout->addWidget( myGrp1 );
layout->addWidget( myGrp2 );
layout->addWidget( myGrp3 );
/***************************************************************/ /***************************************************************/
setHelpFileName("newentity_blocks.htm#QuadrangleFace"); setHelpFileName( "newentity_blocks.htm#QuadrangleFace" );
Init(); Init();
} }
@ -121,36 +110,38 @@ BlocksGUI_QuadFaceDlg::~BlocksGUI_QuadFaceDlg()
void BlocksGUI_QuadFaceDlg::Init() void BlocksGUI_QuadFaceDlg::Init()
{ {
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( this, SIGNAL( constructorsClicked( int ) ),
this, SLOT( ConstructorsClicked( int ) ) );
QMap<int, QPushButton*>::iterator anIterBtn; QMap<int, QPushButton*>::iterator anIterBtn;
for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn) for ( anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn )
connect(anIterBtn.data(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( anIterBtn.value(), SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
// init controls and fields // init controls and fields
initName(tr("GEOM_QUAD_FACE")); initName( tr( "GEOM_QUAD_FACE" ) );
myConstructorId = -1; myConstructorId = -1;
ConstructorsClicked(0); ConstructorsClicked( 0 );
} }
//================================================================================= //=================================================================================
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void BlocksGUI_QuadFaceDlg::ConstructorsClicked (int constructorId) void BlocksGUI_QuadFaceDlg::ConstructorsClicked( int constructorId )
{ {
if (myConstructorId == constructorId) if ( myConstructorId == constructorId )
return; return;
myConstructorId = constructorId; myConstructorId = constructorId;
switch (constructorId) { switch ( constructorId ) {
case 0: case 0:
myGrp2->hide(); myGrp2->hide();
myGrp3->hide(); myGrp3->hide();
@ -175,13 +166,17 @@ void BlocksGUI_QuadFaceDlg::ConstructorsClicked (int constructorId)
// clear line edits // clear line edits
QMap<int, QLineEdit*>::iterator anIterLE; QMap<int, QLineEdit*>::iterator anIterLE;
for (anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE) for ( anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE )
anIterLE.data()->setText(""); anIterLE.value()->setText( "" );
// init fields // init fields
myShape1 = myShape2 = GEOM::GEOM_Object::_nil(); myShape1 = myShape2 = GEOM::GEOM_Object::_nil();
myShape3 = myShape4 = myShape1; myShape3 = myShape4 = myShape1;
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
activateSelection(); activateSelection();
} }
@ -191,7 +186,7 @@ void BlocksGUI_QuadFaceDlg::ConstructorsClicked (int constructorId)
//================================================================================= //=================================================================================
void BlocksGUI_QuadFaceDlg::ClickOnOk() void BlocksGUI_QuadFaceDlg::ClickOnOk()
{ {
if (ClickOnApply()) if ( ClickOnApply() )
ClickOnCancel(); ClickOnCancel();
} }
@ -201,7 +196,7 @@ void BlocksGUI_QuadFaceDlg::ClickOnOk()
//================================================================================= //=================================================================================
bool BlocksGUI_QuadFaceDlg::ClickOnApply() bool BlocksGUI_QuadFaceDlg::ClickOnApply()
{ {
if (!onAccept()) if ( !onAccept() )
return false; return false;
initName(); initName();
@ -215,13 +210,13 @@ bool BlocksGUI_QuadFaceDlg::ClickOnApply()
void BlocksGUI_QuadFaceDlg::SelectionIntoArgument() void BlocksGUI_QuadFaceDlg::SelectionIntoArgument()
{ {
erasePreview(); erasePreview();
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText( "" );
// Get index of current selection focus // Get index of current selection focus
int aCurrFocus = -1; int aCurrFocus = -1;
QMap<int, QLineEdit*>::iterator anIter; QMap<int, QLineEdit*>::iterator anIter;
for (anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter) { for ( anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter ) {
if (myEditCurrentArgument == anIter.data()) { if ( myEditCurrentArgument == anIter.value() ) {
aCurrFocus = anIter.key(); aCurrFocus = anIter.key();
break; break;
} }
@ -229,31 +224,39 @@ void BlocksGUI_QuadFaceDlg::SelectionIntoArgument()
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
if (IObjectCount() == 1) { if ( IObjectCount() == 1 ) {
anObj = GEOMBase::ConvertIOinGEOMObject(firstIObject(), aResult); anObj = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if (aResult) { if ( aResult ) {
if (anObj->_is_nil()) { if (anObj->_is_nil()) {
aResult = Standard_False; aResult = Standard_False;
} else { }
mySelName[aCurrFocus]->setText(GEOMBase::GetName(anObj)); else {
mySelName[aCurrFocus]->setText( GEOMBase::GetName( anObj ) );
} }
} else { }
else {
anObj = GEOM::GEOM_Object::_nil(); anObj = GEOM::GEOM_Object::_nil();
} }
} }
if (aCurrFocus == Vertex1 || aCurrFocus == Edge12 || aCurrFocus == Edge14) { switch ( aCurrFocus ) {
myShape1 = anObj; case Vertex1:
} else if (aCurrFocus == Vertex2 || aCurrFocus == Edge22 || aCurrFocus == Edge24) { case Edge12:
myShape2 = anObj; case Edge14:
} else if (aCurrFocus == Vertex3 || aCurrFocus == Edge34) { myShape1 = anObj; break;
myShape3 = anObj; case Vertex2:
} else if (aCurrFocus == Vertex4 || aCurrFocus == Edge44) { case Edge22:
myShape4 = anObj; case Edge24:
} else { myShape2 = anObj; break;
case Vertex3:
case Edge34:
myShape3 = anObj; break;
case Vertex4:
case Edge44:
myShape4 = anObj; break;
default:
return; return;
} }
displayPreview(); displayPreview();
} }
@ -266,8 +269,8 @@ void BlocksGUI_QuadFaceDlg::SetEditCurrentArgument()
QPushButton* aSender = (QPushButton*)sender(); QPushButton* aSender = (QPushButton*)sender();
QMap<int, QPushButton*>::iterator anIter; QMap<int, QPushButton*>::iterator anIter;
for (anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter) { for ( anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter ) {
if (anIter.data() == aSender) { if ( anIter.value() == aSender ) {
mySelName[anIter.key()]->setFocus(); mySelName[anIter.key()]->setFocus();
myEditCurrentArgument = mySelName[anIter.key()]; myEditCurrentArgument = mySelName[anIter.key()];
} }
@ -283,8 +286,8 @@ void BlocksGUI_QuadFaceDlg::SetEditCurrentArgument()
void BlocksGUI_QuadFaceDlg::ActivateThisDialog() void BlocksGUI_QuadFaceDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
activateSelection(); activateSelection();
displayPreview(); displayPreview();
@ -294,9 +297,9 @@ void BlocksGUI_QuadFaceDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_QuadFaceDlg::enterEvent (QEvent* e) void BlocksGUI_QuadFaceDlg::enterEvent( QEvent* )
{ {
if (!GroupConstructors->isEnabled()) if ( !mainFrame()->GroupConstructors->isEnabled() )
this->ActivateThisDialog(); this->ActivateThisDialog();
} }
@ -314,16 +317,29 @@ void BlocksGUI_QuadFaceDlg::enterEvent (QEvent* e)
// function : createSelWg() // function : createSelWg()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_QuadFaceDlg::createSelWg (const QString& theLbl, void BlocksGUI_QuadFaceDlg::createSelWg( const QString& theLbl,
QPixmap& thePix, QPixmap& thePix,
QWidget* theParent, QWidget* theParent,
const int theId) const int theId )
{ {
new QLabel(theLbl, theParent); QLabel* lab = new QLabel( theLbl, theParent );
mySelBtn[theId] = new QPushButton(theParent); mySelBtn[theId] = new QPushButton( theParent );
mySelBtn[theId]->setPixmap(thePix); mySelBtn[theId]->setIcon( thePix );
mySelName[theId] = new QLineEdit(theParent); mySelBtn[theId]->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
mySelName[theId]->setReadOnly(true); mySelName[theId] = new QLineEdit( theParent );
mySelName[theId]->setReadOnly( true );
QGridLayout* l = 0;
if ( !theParent->layout() ) {
l = new QGridLayout( theParent );
l->setMargin( 9 ); l->setSpacing( 6 );
}
else {
l = qobject_cast<QGridLayout*>( theParent->layout() );
}
int row = l->rowCount();
l->addWidget( lab, row, 0 );
l->addWidget( mySelBtn[theId], row, 1 );
l->addWidget( mySelName[theId], row, 2 );
} }
//================================================================================= //=================================================================================
@ -332,15 +348,14 @@ void BlocksGUI_QuadFaceDlg::createSelWg (const QString& theLbl,
//================================================================================= //=================================================================================
void BlocksGUI_QuadFaceDlg::activateSelection() void BlocksGUI_QuadFaceDlg::activateSelection()
{ {
if (myEditCurrentArgument == mySelName[Vertex1] || if ( myEditCurrentArgument == mySelName[Vertex1] ||
myEditCurrentArgument == mySelName[Vertex2] || myEditCurrentArgument == mySelName[Vertex2] ||
myEditCurrentArgument == mySelName[Vertex3] || myEditCurrentArgument == mySelName[Vertex3] ||
myEditCurrentArgument == mySelName[Vertex4]) { myEditCurrentArgument == mySelName[Vertex4] ) {
globalSelection( GEOM_POINT );
globalSelection(GEOM_POINT); }
else {
} else { globalSelection( GEOM_EDGE );
globalSelection(GEOM_EDGE);
} }
SelectionIntoArgument(); SelectionIntoArgument();
@ -352,62 +367,66 @@ void BlocksGUI_QuadFaceDlg::activateSelection()
//================================================================================= //=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_QuadFaceDlg::createOperation() GEOM::GEOM_IOperations_ptr BlocksGUI_QuadFaceDlg::createOperation()
{ {
return getGeomEngine()->GetIBlocksOperations(getStudyId()); return getGeomEngine()->GetIBlocksOperations( getStudyId() );
} }
//================================================================================= //=================================================================================
// function : isValid // function : isValid
// purpose : Verify validity of input data // purpose : Verify validity of input data
//================================================================================= //=================================================================================
bool BlocksGUI_QuadFaceDlg::isValid (QString&) bool BlocksGUI_QuadFaceDlg::isValid( QString& )
{ {
switch (getConstructorId()) { bool ok = false;
case 0: switch ( getConstructorId() ) {
return (!myShape1->_is_nil() && !myShape2->_is_nil() && case 0:
!myShape3->_is_nil() && !myShape4->_is_nil()); ok = ( !myShape1->_is_nil() && !myShape2->_is_nil() &&
case 1: !myShape3->_is_nil() && !myShape4->_is_nil() );
return (!myShape1->_is_nil() && !myShape2->_is_nil()); break;
case 2: case 1:
return (!myShape1->_is_nil() && !myShape2->_is_nil() && ok = ( !myShape1->_is_nil() && !myShape2->_is_nil() );
!myShape3->_is_nil() && !myShape4->_is_nil()); break;
default: case 2:
return false; ok = ( !myShape1->_is_nil() && !myShape2->_is_nil() &&
!myShape3->_is_nil() && !myShape4->_is_nil() );
break;
default:
break;
} }
return false; return ok;
} }
//================================================================================= //=================================================================================
// function : execute // function : execute
// purpose : // purpose :
//================================================================================= //=================================================================================
bool BlocksGUI_QuadFaceDlg::execute (ObjectList& objects) bool BlocksGUI_QuadFaceDlg::execute( ObjectList& objects )
{ {
bool res = false; bool res = false;
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
switch (getConstructorId()) { switch ( getConstructorId() ) {
case 0: case 0:
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->MakeQuad4Vertices anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->MakeQuad4Vertices
(myShape1, myShape2, myShape3, myShape4); ( myShape1, myShape2, myShape3, myShape4 );
res = true; res = true;
break; break;
case 1: case 1:
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->MakeQuad2Edges anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->MakeQuad2Edges
(myShape1, myShape2); ( myShape1, myShape2 );
res = true; res = true;
break; break;
case 2: case 2:
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->MakeQuad anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->MakeQuad
(myShape1, myShape2, myShape3, myShape4); ( myShape1, myShape2, myShape3, myShape4 );
res = true; res = true;
break; break;
default: default:
break; break;
} }
if (!anObj->_is_nil()) if ( !anObj->_is_nil() )
objects.push_back(anObj._retn()); objects.push_back( anObj._retn() );
return res; return res;
} }

View File

@ -1,41 +1,43 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_QuadFaceDlg.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_QuadFaceDlg.h
// Author : Julia DOROVSKIKH
// Module : GEOM
#ifndef DIALOGBOX_QUAD_FACE_H #ifndef BLOCKSGUI_QUADFACEDLG_H
#define DIALOGBOX_QUAD_FACE_H #define BLOCKSGUI_QUADFACEDLG_H
#include "GEOM_BlocksGUI.hxx" #include <GEOMBase_Skeleton.h>
#include "GEOMBase_Skeleton.h" #include <QMap>
class QGroupBox;
class QPushButton;
class QLineEdit;
//================================================================================= //=================================================================================
// class : BlocksGUI_QuadFaceDlg // class : BlocksGUI_QuadFaceDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI_QuadFaceDlg : public GEOMBase_Skeleton class BlocksGUI_QuadFaceDlg : public GEOMBase_Skeleton
{ {
Q_OBJECT Q_OBJECT
@ -44,45 +46,46 @@ class GEOM_BLOCKSGUI_EXPORT BlocksGUI_QuadFaceDlg : public GEOMBase_Skeleton
Edge14, Edge24, Edge34, Edge44 }; Edge14, Edge24, Edge34, Edge44 };
public: public:
BlocksGUI_QuadFaceDlg (GeometryGUI*, QWidget* parent, bool modal = FALSE); BlocksGUI_QuadFaceDlg( GeometryGUI*, QWidget* );
~BlocksGUI_QuadFaceDlg(); ~BlocksGUI_QuadFaceDlg();
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString& msg); virtual bool isValid( QString& );
virtual bool execute (ObjectList& objects); virtual bool execute( ObjectList& );
private: private:
void Init(); void Init();
void enterEvent (QEvent* e); void enterEvent( QEvent* );
void createSelWg (const QString&, QPixmap&, QWidget*, const int); void createSelWg( const QString&, QPixmap&,
void activateSelection(); QWidget*, const int );
void activateSelection();
private: private:
int myConstructorId; int myConstructorId;
GEOM::GEOM_Object_var myShape1; GEOM::GEOM_Object_var myShape1;
GEOM::GEOM_Object_var myShape2; GEOM::GEOM_Object_var myShape2;
GEOM::GEOM_Object_var myShape3; GEOM::GEOM_Object_var myShape3;
GEOM::GEOM_Object_var myShape4; GEOM::GEOM_Object_var myShape4;
QFrame* myGrp1; QGroupBox* myGrp1;
QFrame* myGrp2; QGroupBox* myGrp2;
QFrame* myGrp3; QGroupBox* myGrp3;
QMap<int, QPushButton*> mySelBtn; QMap<int, QPushButton*> mySelBtn;
QMap<int, QLineEdit*> mySelName; QMap<int, QLineEdit*> mySelName;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
void ActivateThisDialog(); void ActivateThisDialog();
void ConstructorsClicked( int constructorId ); void ConstructorsClicked( int );
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
}; };
#endif // DIALOGBOX_QUAD_FACE_H #endif // BLOCKSGUI_QUADFACEDLG_H

View File

@ -1,125 +1,93 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_TrsfDlg.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_TrsfDlg.cxx
// Author : Julia DOROVSKIKH
// Module : GEOM
// $Header$
#include "BlocksGUI_TrsfDlg.h" #include "BlocksGUI_TrsfDlg.h"
#include "DlgRef_SpinBox.h" #include <GEOM_DlgRef.h>
#include <GeometryGUI.h>
#include <GEOMBase.h>
#include "SUIT_Session.h" #include <SUIT_Session.h>
#include "SalomeApp_Application.h" #include <SUIT_Desktop.h>
#include "LightApp_SelectionMgr.h" #include <SUIT_ResourceMgr.h>
#include "OCCViewer_ViewModel.h" #include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <OCCViewer_ViewModel.h>
#include <TColStd_IndexedMapOfInteger.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <qlabel.h>
//================================================================================= //=================================================================================
// class : BlocksGUI_TrsfDlg() // class : BlocksGUI_TrsfDlg()
// purpose : Constructs a BlocksGUI_TrsfDlg which is a child of 'parent'. // purpose : Constructs a BlocksGUI_TrsfDlg which is a child of 'parent'.
//================================================================================= //=================================================================================
BlocksGUI_TrsfDlg::BlocksGUI_TrsfDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) BlocksGUI_TrsfDlg::BlocksGUI_TrsfDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
: GEOMBase_Skeleton(theGeometryGUI, parent, "TrsfDlg", modal, : GEOMBase_Skeleton( theGeometryGUI, parent )
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_MULTITRSF_SIMPLE"))); QPixmap image1( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_MULTITRSF_SIMPLE" ) ) );
QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_MULTITRSF_DOUBLE"))); QPixmap image2( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_MULTITRSF_DOUBLE" ) ) );
QPixmap imageS (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); QPixmap imageS( aResMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setCaption(tr("GEOM_BLOCK_MULTITRSF_TITLE")); setWindowTitle( tr( "GEOM_BLOCK_MULTITRSF_TITLE" ) );
/***************************************************************/ /***************************************************************/
GroupConstructors->setTitle(tr("GEOM_BLOCK_MULTITRSF")); mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BLOCK_MULTITRSF" ) );
RadioButton1->setPixmap(image1); mainFrame()->RadioButton1->setIcon( image1 );
RadioButton2->setPixmap(image2); mainFrame()->RadioButton2->setIcon( image2 );
RadioButton3->close(TRUE); mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
// Create first group // Create first group
myGrp1 = new QGroupBox(1, Qt::Horizontal, tr("GEOM_BLOCK_MULTITRSF_SIMPLE"), this); myGrp1 = new QGroupBox( tr( "GEOM_BLOCK_MULTITRSF_SIMPLE" ), centralWidget() );
QGroupBox* aSelGrp1 = new QGroupBox(3, Qt::Horizontal, myGrp1); createSelWg( tr( "GEOM_MAIN_OBJECT" ), imageS, myGrp1, MainObj1 );
aSelGrp1->setFrameStyle(QFrame::NoFrame); createSelWg( tr( "FACE_1" ), imageS, myGrp1, Face1 );
aSelGrp1->setInsideMargin(0); createSelWg( tr( "FACE_2" ), imageS, myGrp1, Face2 );
createSpinWg( tr( "GEOM_NB_TIMES" ), myGrp1, SpinBox1 );
createSelWg(tr("GEOM_MAIN_OBJECT"), imageS, aSelGrp1, MainObj1);
createSelWg(tr("FACE_1"), imageS, aSelGrp1, Face1);
createSelWg(tr("FACE_2"), imageS, aSelGrp1, Face2);
QGroupBox* aSpinGrp1 = new QGroupBox(1, Qt::Vertical, myGrp1);
aSpinGrp1->setFrameStyle(QFrame::NoFrame);
aSpinGrp1->setInsideMargin(0);
new QLabel(tr("GEOM_NB_TIMES"), aSpinGrp1);
mySpinBox[SpinBox1] = new DlgRef_SpinBox(aSpinGrp1);
// Create second group // Create second group
myGrp2 = new QGroupBox(1, Qt::Horizontal, tr("GEOM_BLOCK_MULTITRSF_DOUBLE"), this); myGrp2 = new QGroupBox( tr( "GEOM_BLOCK_MULTITRSF_DOUBLE" ), centralWidget() );
// U trsf createSelWg( tr( "GEOM_MAIN_OBJECT"), imageS, myGrp2, MainObj2 );
QGroupBox* aSelGrp2U = new QGroupBox(3, Qt::Horizontal, myGrp2); createSelWg( tr( "FACE_1U"), imageS, myGrp2, Face1U );
aSelGrp2U->setFrameStyle(QFrame::NoFrame); createSelWg( tr( "FACE_2U"), imageS, myGrp2, Face2U );
aSelGrp2U->setInsideMargin(0); createSpinWg( tr( "GEOM_NB_TIMES_U" ), myGrp2, SpinBox2U );
createSelWg( tr( "FACE_1V" ), imageS, myGrp2, Face1V );
createSelWg(tr("GEOM_MAIN_OBJECT"), imageS, aSelGrp2U, MainObj2); createSelWg( tr( "FACE_2V" ), imageS, myGrp2, Face2V );
createSelWg(tr("FACE_1U"), imageS, aSelGrp2U, Face1U); createSpinWg( tr( "GEOM_NB_TIMES_V" ), myGrp2, SpinBox2V );
createSelWg(tr("FACE_2U"), imageS, aSelGrp2U, Face2U);
QGroupBox* aSpinGrp2U = new QGroupBox(1, Qt::Vertical, myGrp2);
aSpinGrp2U->setFrameStyle(QFrame::NoFrame);
aSpinGrp2U->setInsideMargin(0);
new QLabel(tr("GEOM_NB_TIMES_U"), aSpinGrp2U);
mySpinBox[SpinBox2U] = new DlgRef_SpinBox(aSpinGrp2U);
// V trsf
QGroupBox* aSelGrp2V = new QGroupBox(3, Qt::Horizontal, myGrp2);
aSelGrp2V->setFrameStyle(QFrame::NoFrame);
aSelGrp2V->setInsideMargin(0);
createSelWg(tr("FACE_1V"), imageS, aSelGrp2V, Face1V);
createSelWg(tr("FACE_2V"), imageS, aSelGrp2V, Face2V);
QGroupBox* aSpinGrp2V = new QGroupBox(1, Qt::Vertical, myGrp2);
aSpinGrp2V->setFrameStyle(QFrame::NoFrame);
aSpinGrp2V->setInsideMargin(0);
new QLabel(tr("GEOM_NB_TIMES_V"), aSpinGrp2V);
mySpinBox[SpinBox2V] = new DlgRef_SpinBox(aSpinGrp2V);
(new QLabel(myGrp2))->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
// Add groups to layout // Add groups to layout
Layout1->addWidget( myGrp1, 2, 0 ); QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
Layout1->addWidget( myGrp2, 2, 0 ); layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( myGrp1 );
layout->addWidget( myGrp2 );
/***************************************************************/ /***************************************************************/
setHelpFileName("multi_transformation.htm"); setHelpFileName( "multi_transformation.htm" );
Init(); Init();
} }
@ -141,51 +109,53 @@ void BlocksGUI_TrsfDlg::Init()
{ {
// Set range of spinboxes // Set range of spinboxes
double SpecificStep = 1.0; double SpecificStep = 1.0;
QMap<int, DlgRef_SpinBox*>::iterator anIter; QMap<int, QDoubleSpinBox*>::iterator anIter;
for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter ) {
//anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3);
anIter.data()->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3); initSpinBox( anIter.value(), 1.0, MAX_NUMBER, SpecificStep, 3 );
} }
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( this, SIGNAL( constructorsClicked( int ) ),
this, SLOT( ConstructorsClicked( int ) ) );
QMap<int, QPushButton*>::iterator anIterBtn; QMap<int, QPushButton*>::iterator anIterBtn;
for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn) for ( anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn )
connect(anIterBtn.data(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect( anIterBtn.value(), SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
QMap<int, DlgRef_SpinBox*>::iterator anIterSpin; QMap<int, QDoubleSpinBox*>::iterator anIterSpin;
for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin) for ( anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin )
connect(anIterSpin.data(), SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect( anIterSpin.value(), SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ;
// init controls and fields // init controls and fields
initName(tr("GEOM_BLOCK_MULTITRSF")); initName( tr( "GEOM_BLOCK_MULTITRSF" ) );
myConstructorId = -1; myConstructorId = -1;
ConstructorsClicked(0); ConstructorsClicked( 0 );
} }
//================================================================================= //=================================================================================
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId) void BlocksGUI_TrsfDlg::ConstructorsClicked( int constructorId )
{ {
if (myConstructorId == constructorId) if ( myConstructorId == constructorId )
return; return;
myConstructorId = constructorId; myConstructorId = constructorId;
switch (constructorId) { switch ( constructorId ) {
case 0: case 0:
myGrp2->hide(); myGrp2->hide();
myGrp1->show(); myGrp1->show();
mySpinBox[SpinBox1]->SetValue(2.0); mySpinBox[SpinBox1]->setValue( 2.0 );
myEditCurrentArgument = mySelName[MainObj1]; myEditCurrentArgument = mySelName[MainObj1];
myFaces[Face1] = -1; myFaces[Face1] = -1;
myFaces[Face2] = -1; myFaces[Face2] = -1;
@ -193,8 +163,8 @@ void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId)
case 1: case 1:
myGrp1->hide(); myGrp1->hide();
myGrp2->show(); myGrp2->show();
mySpinBox[SpinBox2U]->SetValue(2.0); mySpinBox[SpinBox2U]->setValue( 2.0 );
mySpinBox[SpinBox2V]->SetValue(2.0); mySpinBox[SpinBox2V]->setValue( 2.0 );
myEditCurrentArgument = mySelName[MainObj2]; myEditCurrentArgument = mySelName[MainObj2];
myFaces[Face1U] = -1; myFaces[Face1U] = -1;
myFaces[Face2U] = -1; myFaces[Face2U] = -1;
@ -207,12 +177,16 @@ void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId)
// clear line edits // clear line edits
QMap<int, QLineEdit*>::iterator anIterLE; QMap<int, QLineEdit*>::iterator anIterLE;
for (anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE) for ( anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE )
anIterLE.data()->setText(""); anIterLE.value()->setText( "" );
// init fields // init fields
myShape = GEOM::GEOM_Object::_nil(); myShape = GEOM::GEOM_Object::_nil();
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
activateSelection(); activateSelection();
// enableWidgets(); // enableWidgets();
// displayPreview(); // displayPreview();
@ -224,7 +198,7 @@ void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId)
//================================================================================= //=================================================================================
void BlocksGUI_TrsfDlg::ClickOnOk() void BlocksGUI_TrsfDlg::ClickOnOk()
{ {
if (ClickOnApply()) if ( ClickOnApply() )
ClickOnCancel(); ClickOnCancel();
} }
@ -234,7 +208,7 @@ void BlocksGUI_TrsfDlg::ClickOnOk()
//================================================================================= //=================================================================================
bool BlocksGUI_TrsfDlg::ClickOnApply() bool BlocksGUI_TrsfDlg::ClickOnApply()
{ {
if (!onAccept()) if ( !onAccept() )
return false; return false;
initName(); initName();
@ -248,28 +222,28 @@ bool BlocksGUI_TrsfDlg::ClickOnApply()
void BlocksGUI_TrsfDlg::SelectionIntoArgument() void BlocksGUI_TrsfDlg::SelectionIntoArgument()
{ {
erasePreview(); erasePreview();
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText( "" );
// Get index of current selection focus // Get index of current selection focus
int aCurrFocus = -1; int aCurrFocus = -1;
QMap<int, QLineEdit*>::iterator anIter; QMap<int, QLineEdit*>::iterator anIter;
for (anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter) { for ( anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter ) {
if (myEditCurrentArgument == anIter.data()) { if ( myEditCurrentArgument == anIter.value() ) {
aCurrFocus = anIter.key(); aCurrFocus = anIter.key();
break; break;
} }
} }
// If selection of main object is activated // If selection of main object is activated
if (aCurrFocus == MainObj1 || aCurrFocus == MainObj2) { if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 ) {
if (IObjectCount() == 1) { if ( IObjectCount() == 1 ) {
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject(firstIObject(), aResult); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if (aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) { if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
myShape = anObj; myShape = anObj;
mySelName[aCurrFocus]->setText(GEOMBase::GetName(anObj)); mySelName[aCurrFocus]->setText( GEOMBase::GetName( anObj ) );
enableWidgets(); enableWidgets();
return; return;
} }
@ -279,22 +253,22 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
enableWidgets(); enableWidgets();
} }
// If face selection is activated // If face selection is activated
else if (aCurrFocus == Face1 || aCurrFocus == Face2 || else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ||
aCurrFocus == Face1U || aCurrFocus == Face2U || aCurrFocus == Face1U || aCurrFocus == Face2U ||
aCurrFocus == Face1V || aCurrFocus == Face2V) { aCurrFocus == Face1V || aCurrFocus == Face2V ) {
if (IObjectCount() == 1) { if ( IObjectCount() == 1 ) {
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject(firstIObject(), aResult); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) { if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
TColStd_IndexedMapOfInteger anIndexes; TColStd_IndexedMapOfInteger anIndexes;
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), anIndexes ); ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
if (anIndexes.Extent() == 1) { if ( anIndexes.Extent() == 1 ) {
int anIndex = anIndexes(1); int anIndex = anIndexes( 1 );
QString aFaceName = QString(GEOMBase::GetName(anObj)) + ":%1"; QString aFaceName = QString( GEOMBase::GetName( anObj ) ) + ":%1";
myEditCurrentArgument->setText(aFaceName.arg(anIndex)); myEditCurrentArgument->setText( aFaceName.arg( anIndex ) );
myFaces[aCurrFocus] = anIndex; myFaces[aCurrFocus] = anIndex;
displayPreview(); displayPreview();
return; return;
@ -315,8 +289,8 @@ void BlocksGUI_TrsfDlg::SetEditCurrentArgument()
QPushButton* aSender = (QPushButton*)sender(); QPushButton* aSender = (QPushButton*)sender();
QMap<int, QPushButton*>::iterator anIter; QMap<int, QPushButton*>::iterator anIter;
for (anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter) { for ( anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter ) {
if (anIter.data() == aSender) { if ( anIter.value() == aSender ) {
mySelName[anIter.key()]->setFocus(); mySelName[anIter.key()]->setFocus();
myEditCurrentArgument = mySelName[anIter.key()]; myEditCurrentArgument = mySelName[anIter.key()];
break; break;
@ -333,8 +307,8 @@ void BlocksGUI_TrsfDlg::SetEditCurrentArgument()
void BlocksGUI_TrsfDlg::ActivateThisDialog() void BlocksGUI_TrsfDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
activateSelection(); activateSelection();
displayPreview(); displayPreview();
@ -344,9 +318,9 @@ void BlocksGUI_TrsfDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_TrsfDlg::enterEvent (QEvent* e) void BlocksGUI_TrsfDlg::enterEvent( QEvent* )
{ {
if (!GroupConstructors->isEnabled()) if ( !mainFrame()->GroupConstructors->isEnabled() )
this->ActivateThisDialog(); this->ActivateThisDialog();
} }
@ -354,7 +328,7 @@ void BlocksGUI_TrsfDlg::enterEvent (QEvent* e)
// function : ValueChangedInSpinBox() // function : ValueChangedInSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_TrsfDlg::ValueChangedInSpinBox (double newValue) void BlocksGUI_TrsfDlg::ValueChangedInSpinBox( double )
{ {
displayPreview(); displayPreview();
} }
@ -363,16 +337,52 @@ void BlocksGUI_TrsfDlg::ValueChangedInSpinBox (double newValue)
// function : createSelWg() // function : createSelWg()
// purpose : // purpose :
//================================================================================= //=================================================================================
void BlocksGUI_TrsfDlg::createSelWg (const QString& theLbl, void BlocksGUI_TrsfDlg::createSelWg( const QString& theLbl,
QPixmap& thePix, QPixmap& thePix,
QWidget* theParent, QWidget* theParent,
const int theId) const int theId )
{ {
new QLabel(theLbl, theParent); QLabel* lab = new QLabel( theLbl, theParent );
mySelBtn[theId] = new QPushButton(theParent); mySelBtn[theId] = new QPushButton( theParent );
mySelBtn[theId]->setPixmap(thePix); mySelBtn[theId]->setIcon( thePix );
mySelName[theId] = new QLineEdit(theParent); mySelBtn[theId]->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
mySelName[theId]->setReadOnly(true); mySelName[theId] = new QLineEdit( theParent );
mySelName[theId]->setReadOnly( true );
QGridLayout* l = 0;
if ( !theParent->layout() ) {
l = new QGridLayout( theParent );
l->setMargin( 9 ); l->setSpacing( 6 );
}
else {
l = qobject_cast<QGridLayout*>( theParent->layout() );
}
int row = l->rowCount();
l->addWidget( lab, row, 0 );
l->addWidget( mySelBtn[theId], row, 1 );
l->addWidget( mySelName[theId], row, 2 );
}
//=================================================================================
// function : createSpinWg()
// purpose :
//=================================================================================
void BlocksGUI_TrsfDlg::createSpinWg( const QString& theLbl,
QWidget* theParent,
const int theId )
{
QLabel* lab = new QLabel( theLbl, theParent );
mySpinBox[theId] = new QDoubleSpinBox( theParent );
QGridLayout* l = 0;
if ( !theParent->layout() ) {
l = new QGridLayout( theParent );
l->setMargin( 9 ); l->setSpacing( 6 );
}
else {
l = qobject_cast<QGridLayout*>( theParent->layout() );
}
int row = l->rowCount();
l->addWidget( lab, row, 0 );
l->addWidget( mySpinBox[theId], row, 2 );
} }
//================================================================================= //=================================================================================
@ -381,22 +391,24 @@ void BlocksGUI_TrsfDlg::createSelWg (const QString& theLbl,
//================================================================================= //=================================================================================
void BlocksGUI_TrsfDlg::activateSelection() void BlocksGUI_TrsfDlg::activateSelection()
{ {
if (!myShape->_is_nil() && if ( !myShape->_is_nil() &&
(myEditCurrentArgument == mySelName[ Face1 ] || ( myEditCurrentArgument == mySelName[ Face1 ] ||
myEditCurrentArgument == mySelName[ Face2 ] || myEditCurrentArgument == mySelName[ Face2 ] ||
myEditCurrentArgument == mySelName[ Face1U ] || myEditCurrentArgument == mySelName[ Face1U ] ||
myEditCurrentArgument == mySelName[ Face2U ] || myEditCurrentArgument == mySelName[ Face2U ] ||
myEditCurrentArgument == mySelName[ Face1V ] || myEditCurrentArgument == mySelName[ Face1V ] ||
myEditCurrentArgument == mySelName[ Face2V ])) { myEditCurrentArgument == mySelName[ Face2V ] ) ) {
// Local selection is available only in the OCC Viewer // Local selection is available only in the OCC Viewer
if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() if ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
== OCCViewer_Viewer::Type()) { == OCCViewer_Viewer::Type() ) {
localSelection(myShape, TopAbs_FACE); localSelection( myShape, TopAbs_FACE );
} else { }
else {
return; return;
} }
} else { }
else {
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
} }
@ -413,33 +425,34 @@ void BlocksGUI_TrsfDlg::enableWidgets()
bool toEnable = !myShape->_is_nil(); bool toEnable = !myShape->_is_nil();
if (anId == 0) { if ( anId == 0 ) {
mySelName[Face1]->setEnabled(toEnable); mySelName[Face1]->setEnabled( toEnable );
mySelName[Face2]->setEnabled(toEnable); mySelName[Face2]->setEnabled( toEnable );
mySelBtn[Face1]->setEnabled(toEnable); mySelBtn[Face1]->setEnabled( toEnable );
mySelBtn[Face2]->setEnabled(toEnable); mySelBtn[Face2]->setEnabled( toEnable );
if (!toEnable) { if ( !toEnable) {
mySelName[Face1]->setText(""); mySelName[Face1]->setText( "" );
mySelName[Face2]->setText(""); mySelName[Face2]->setText( "" );
myFaces[Face1] = -1; myFaces[Face1] = -1;
myFaces[Face2] = -1; myFaces[Face2] = -1;
} }
} else if (anId == 1) { }
mySelName[Face1U]->setEnabled(toEnable); else if ( anId == 1 ) {
mySelName[Face2U]->setEnabled(toEnable); mySelName[Face1U]->setEnabled( toEnable );
mySelName[Face1V]->setEnabled(toEnable); mySelName[Face2U]->setEnabled( toEnable );
mySelName[Face2V]->setEnabled(toEnable); mySelName[Face1V]->setEnabled( toEnable );
mySelBtn[Face1U]->setEnabled(toEnable); mySelName[Face2V]->setEnabled( toEnable );
mySelBtn[Face2U]->setEnabled(toEnable); mySelBtn[Face1U]->setEnabled( toEnable );
mySelBtn[Face1V]->setEnabled(toEnable); mySelBtn[Face2U]->setEnabled( toEnable );
mySelBtn[Face2V]->setEnabled(toEnable); mySelBtn[Face1V]->setEnabled( toEnable );
mySelBtn[Face2V]->setEnabled( toEnable );
if (!toEnable) { if ( !toEnable ) {
mySelName[Face1U]->setText(""); mySelName[Face1U]->setText( "" );
mySelName[Face2U]->setText(""); mySelName[Face2U]->setText( "" );
mySelName[Face1V]->setText(""); mySelName[Face1V]->setText( "" );
mySelName[Face2V]->setText(""); mySelName[Face2V]->setText( "" );
myFaces[Face1U] = -1; myFaces[Face1U] = -1;
myFaces[Face2U] = -1; myFaces[Face2U] = -1;
myFaces[Face1V] = -1; myFaces[Face1V] = -1;
@ -454,60 +467,63 @@ void BlocksGUI_TrsfDlg::enableWidgets()
//================================================================================= //=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation() GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation()
{ {
return getGeomEngine()->GetIBlocksOperations(getStudyId()); return getGeomEngine()->GetIBlocksOperations( getStudyId() );
} }
//================================================================================= //=================================================================================
// function : ClickOnApply() // function : ClickOnApply()
// purpose : Verify validity of input data // purpose : Verify validity of input data
//================================================================================= //=================================================================================
bool BlocksGUI_TrsfDlg::isValid (QString&) bool BlocksGUI_TrsfDlg::isValid( QString& )
{ {
switch (getConstructorId()) { bool ok = false;
case 0: switch ( getConstructorId() ) {
return !myShape->_is_nil() && myFaces[Face1] > 0; case 0:
case 1: ok = !myShape->_is_nil() && myFaces[Face1] > 0;
return !myShape->_is_nil() && myFaces[Face1U] > 0 && myFaces[Face1V] > 0; break;
default: case 1:
return false; ok = !myShape->_is_nil() && myFaces[Face1U] > 0 && myFaces[Face1V] > 0;
break;
default:
break;
} }
return false; return ok;
} }
//================================================================================= //=================================================================================
// function : execute // function : execute
// purpose : // purpose :
//================================================================================= //=================================================================================
bool BlocksGUI_TrsfDlg::execute (ObjectList& objects) bool BlocksGUI_TrsfDlg::execute( ObjectList& objects )
{ {
bool res = false; bool res = false;
GEOM::GEOM_Object_var anObj; GEOM::GEOM_Object_var anObj;
switch (getConstructorId()) { switch ( getConstructorId() ) {
case 0: case 0:
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->MakeMultiTransformation1D anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->MakeMultiTransformation1D
(myShape, ( myShape,
myFaces[Face1], myFaces[Face1],
myFaces[Face2], myFaces[Face2],
(int)mySpinBox[SpinBox1]->GetValue()); (int)mySpinBox[SpinBox1]->value() );
res = true; res = true;
break; break;
case 1: case 1:
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->MakeMultiTransformation2D anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->MakeMultiTransformation2D
(myShape, ( myShape,
myFaces[Face1U], myFaces[Face1U],
myFaces[Face2U], myFaces[Face2U],
(int)mySpinBox[SpinBox2U]->GetValue(), (int)mySpinBox[SpinBox2U]->value(),
myFaces[Face1V], myFaces[Face1V],
myFaces[Face2V], myFaces[Face2V],
(int)mySpinBox[SpinBox2V]->GetValue()); (int)mySpinBox[SpinBox2V]->value() );
res = true; res = true;
break; break;
} }
if (!anObj->_is_nil()) if ( !anObj->_is_nil() )
objects.push_back(anObj._retn()); objects.push_back( anObj._retn() );
return res; return res;
} }

View File

@ -1,43 +1,44 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// //
// Copyright (C) 2003 CEA // Copyright (C) 2003 CEA
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// File : BlocksGUI_TrsfDlg.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
// //
//
// File : BlocksGUI_TrsfDlg.h
// Author : Julia DOROVSKIKH
// Module : GEOM
#ifndef DIALOGBOX_BLOCK_MULTITRSF_H #ifndef BLOCKSGUI_TRSFDLG_H
#define DIALOGBOX_BLOCK_MULTITRSF_H #define BLOCKSGUI_TRSFDLG_H
#include "GEOM_BlocksGUI.hxx" #include <GEOMBase_Skeleton.h>
#include "GEOMBase_Skeleton.h" #include <QMap>
class DlgRef_SpinBox; class QDoubleSpinBox;
class QGroupBox;
class QPushButton;
class QLineEdit;
//================================================================================= //=================================================================================
// class : BlocksGUI_TrsfDlg // class : BlocksGUI_TrsfDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GEOM_BLOCKSGUI_EXPORT BlocksGUI_TrsfDlg : public GEOMBase_Skeleton class BlocksGUI_TrsfDlg : public GEOMBase_Skeleton
{ {
Q_OBJECT Q_OBJECT
@ -45,46 +46,49 @@ class GEOM_BLOCKSGUI_EXPORT BlocksGUI_TrsfDlg : public GEOMBase_Skeleton
enum { SpinBox1, SpinBox2U, SpinBox2V }; enum { SpinBox1, SpinBox2U, SpinBox2V };
public: public:
BlocksGUI_TrsfDlg (GeometryGUI*, QWidget* parent, bool modal = FALSE); BlocksGUI_TrsfDlg( GeometryGUI*, QWidget* );
~BlocksGUI_TrsfDlg(); ~BlocksGUI_TrsfDlg();
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString& msg); virtual bool isValid( QString& );
virtual bool execute (ObjectList& objects); virtual bool execute( ObjectList& );
private: private:
void Init(); void Init();
void enterEvent (QEvent* e); void enterEvent( QEvent* );
void createSelWg (const QString&, QPixmap&, QWidget*, const int); void createSelWg( const QString&, QPixmap&,
void activateSelection(); QWidget*, const int );
void enableWidgets(); void createSpinWg( const QString&, QWidget*,
const int );
void activateSelection();
void enableWidgets();
private: private:
int myConstructorId; int myConstructorId;
GEOM::GEOM_Object_var myShape; GEOM::GEOM_Object_var myShape;
QMap<int, int> myFaces; QMap<int, int> myFaces;
QFrame* myGrp1; QGroupBox* myGrp1;
QFrame* myGrp2; QGroupBox* myGrp2;
QMap<int, QPushButton*> mySelBtn; QMap<int, QPushButton*> mySelBtn;
QMap<int, QLineEdit*> mySelName; QMap<int, QLineEdit*> mySelName;
QMap<int, DlgRef_SpinBox*> mySpinBox; QMap<int, QDoubleSpinBox*> mySpinBox;
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
void ActivateThisDialog(); void ActivateThisDialog();
void ConstructorsClicked (int constructorId); void ConstructorsClicked( int );
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void ValueChangedInSpinBox (double newValue); void ValueChangedInSpinBox( double );
}; };
#endif // DIALOGBOX_BLOCK_MULTITRSF_H #endif // BLOCKSGUI_TRSFDLG_H

View File

@ -1,47 +0,0 @@
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_BlocksGUI.hxx
// Author : Alexander A. BORODIN
// Module : GEOM
#ifndef _GEOM_BlocksGUI_HXX_
#define _GEOM_BlocksGUI_HXX_
#ifdef WNT
#if defined BLOCKSGUI_EXPORTS
#if defined WIN32
#define GEOM_BLOCKSGUI_EXPORT __declspec( dllexport )
#else
#define GEOM_BLOCKSGUI_EXPORT
#endif
#else
#if defined WIN32
#define GEOM_BLOCKSGUI_EXPORT __declspec( dllimport )
#else
#define GEOM_BLOCKSGUI_EXPORT
#endif
#endif
#else
#define GEOM_BLOCKSGUI_EXPORT
#endif
#endif

View File

@ -1,30 +1,27 @@
# GEOM BUILDGUI : # GEOM BUILDGUI :
# #
# Copyright (C) 2003 CEA # Copyright (C) 2003 CEA
# #
# This library is free software; you can redistribute it and/or # This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public # modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either # License as published by the Free Software Foundation; either
# version 2.1 of the License. # version 2.1 of the License.
# #
# This library is distributed in the hope that it will be useful, # This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details. # Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Lesser General Public # You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software # License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
# File : Makefile.am
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
# Package : BlockGUI
# #
#
# File : Makefile.in
# Author : Julia DOROVSKIKH (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : GEOM
# $Header$
include $(top_srcdir)/adm_local/unix/make_common_starter.am include $(top_srcdir)/adm_local/unix/make_common_starter.am
@ -34,22 +31,29 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libBlocksGUI.la lib_LTLIBRARIES = libBlocksGUI.la
# Sources files # Sources files
dist_libBlocksGUI_la_SOURCES = \ dist_libBlocksGUI_la_SOURCES = \
BlocksGUI.cxx \ BlocksGUI.h \
BlocksGUI_QuadFaceDlg.cxx \ BlocksGUI_QuadFaceDlg.h \
BlocksGUI_BlockDlg.cxx \ BlocksGUI_BlockDlg.h \
BlocksGUI_ExplodeDlg.cxx \ BlocksGUI_ExplodeDlg.h \
BlocksGUI_PropagateDlg.cxx \ BlocksGUI_PropagateDlg.h \
BlocksGUI_TrsfDlg.h \
\
BlocksGUI.cxx \
BlocksGUI_QuadFaceDlg.cxx \
BlocksGUI_BlockDlg.cxx \
BlocksGUI_ExplodeDlg.cxx \
BlocksGUI_PropagateDlg.cxx \
BlocksGUI_TrsfDlg.cxx BlocksGUI_TrsfDlg.cxx
MOC_FILES = \ MOC_FILES = \
BlocksGUI_QuadFaceDlg_moc.cxx \ BlocksGUI_QuadFaceDlg_moc.cxx \
BlocksGUI_BlockDlg_moc.cxx \ BlocksGUI_BlockDlg_moc.cxx \
BlocksGUI_ExplodeDlg_moc.cxx \ BlocksGUI_ExplodeDlg_moc.cxx \
BlocksGUI_PropagateDlg_moc.cxx \ BlocksGUI_PropagateDlg_moc.cxx \
BlocksGUI_TrsfDlg_moc.cxx BlocksGUI_TrsfDlg_moc.cxx
nodist_libBlocksGUI_la_SOURCES= \ nodist_libBlocksGUI_la_SOURCES = \
$(MOC_FILES) $(MOC_FILES)
#LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_GenericObj.idl SALOME_Component.idl #LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_GenericObj.idl SALOME_Component.idl
@ -59,28 +63,29 @@ nodist_libBlocksGUI_la_SOURCES= \
# additionnal information to compil and link file # additionnal information to compil and link file
libBlocksGUI_la_CPPFLAGS = \ libBlocksGUI_la_CPPFLAGS = \
$(QT_INCLUDES) \ $(QT_INCLUDES) \
$(VTK_INCLUDES) \ $(VTK_INCLUDES) \
$(CAS_CPPFLAGS) \ $(CAS_CPPFLAGS) \
$(PYTHON_INCLUDES) \ $(PYTHON_INCLUDES) \
$(BOOST_CPPFLAGS) \ $(BOOST_CPPFLAGS) \
$(KERNEL_CXXFLAGS) \ $(KERNEL_CXXFLAGS) \
$(GUI_CXXFLAGS) \ $(GUI_CXXFLAGS) \
$(CORBA_CXXFLAGS) \ $(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \ $(CORBA_INCLUDES) \
-I$(srcdir)/../GEOMGUI \ -I$(srcdir)/../GEOMGUI \
-I$(srcdir)/../DlgRef \ -I$(srcdir)/../DlgRef \
-I$(srcdir)/../GEOMBase \ -I$(srcdir)/../GEOMBase \
-I$(srcdir)/../OBJECT \ -I$(srcdir)/../OBJECT \
-I$(srcdir)/../GEOMClient \ -I$(srcdir)/../GEOMClient \
-I$(srcdir)/../GEOMImpl \ -I$(srcdir)/../GEOMImpl \
-I$(srcdir)/../GEOMFiltersSelection \ -I$(srcdir)/../GEOMFiltersSelection \
-I$(top_builddir)/idl \ -I$(top_builddir)/src/DlgRef \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix -I$(top_builddir)/salome_adm/unix
libBlocksGUI_la_LDFLAGS = \ libBlocksGUI_la_LDFLAGS = \
../GEOMFiltersSelection/libGEOMFiltersSelection.la \ ../GEOMFiltersSelection/libGEOMFiltersSelection.la \
../DlgRef/libDlgRef.la \ ../DlgRef/libDlgRef.la \
../GEOMBase/libGEOMBase.la \ ../GEOMBase/libGEOMBase.la \
../GEOMGUI/libGEOM.la \ ../GEOMGUI/libGEOM.la \
$(QT_MT_LIBS) $(QT_MT_LIBS)