Dcq : Add MakeShell MakeSolid and New GUI Architecture

This commit is contained in:
yfr 2003-09-23 14:47:48 +00:00
parent df244cb127
commit 07a0b9e17c
44 changed files with 3024 additions and 1968 deletions

View File

@ -4243,6 +4243,93 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCompound( const GEOM::GEOM_Gen::ListOfIOR&
} }
//=================================================================================
// function : MakeShell()
// purpose : Make a compound from a list containing one or more shapes
//=================================================================================
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeShell( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
GEOM::GEOM_Shape_var result ;
BRepTools_Quilt Glue;
TopoDS_Shape C;
for ( unsigned int i = 0; i < ListShapes.length(); i++) {
GEOM::GEOM_Shape_var aShape = GetIORFromString( ListShapes[i] );
TopoDS_Shape Shape = GetTopoShape(aShape) ;
if( Shape.IsNull() ) {
THROW_SALOME_CORBA_EXCEPTION("Shell aborted : null shape during operation", SALOME::BAD_PARAM);
}
Glue.Add(Shape) ;
}
TopExp_Explorer exp(Glue.Shells(), TopAbs_SHELL);
Standard_Integer ish = 0;
for (; exp.More(); exp.Next()) {
C = exp.Current();
ish++;
}
if (ish != 1)
C = Glue.Shells();
if ( C.IsNull() ) {
THROW_SALOME_CORBA_EXCEPTION("Null result : Shell operation aborted", SALOME::BAD_PARAM);
}
else {
result = CreateObject(C) ;
InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc) ;
}
return result;
}
//=================================================================================
// function : MakeSolid()
// purpose : Make a compound from a list containing one or more shapes
//=================================================================================
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeSolid( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
GEOM::GEOM_Shape_var result ;
Standard_Integer ish = 0;
TopoDS_Compound Res;
TopoDS_Solid Sol;
BRep_Builder B;
TopoDS_Shape Shape;
B.MakeCompound(Res);
for ( unsigned int i = 0; i < ListShapes.length(); i++) {
GEOM::GEOM_Shape_var aShape = GetIORFromString( ListShapes[i] );
TopoDS_Shape Sh = GetTopoShape(aShape) ;
if( Sh.IsNull() ) {
THROW_SALOME_CORBA_EXCEPTION("Solid aborted : null shape during operation", SALOME::BAD_PARAM);
}
B.MakeSolid(Sol);
B.Add(Sol,Sh);
BRepClass3d_SolidClassifier SC(Sol);
SC.PerformInfinitePoint(Precision::Confusion());
if (SC.State() == TopAbs_IN) {
B.MakeSolid(Sol);
B.Add(Sol,Sh.Reversed());
}
B.Add(Res,Sol);
ish++;
}
if (ish == 1) { Shape = Sol;}
else { Shape = Res;}
if ( Shape.IsNull() ) {
THROW_SALOME_CORBA_EXCEPTION("Null result : Solid operation aborted", SALOME::BAD_PARAM);
}
else {
result = CreateObject(Shape) ;
InsertInLabelMoreArguments(Shape, result, ListShapes, myCurrentOCAFDoc) ;
}
return result;
}
//================================================================================ //================================================================================
// function : MakeEdge() // function : MakeEdge()

View File

@ -586,6 +586,10 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeFace (GEOM::GEOM_Shape_ptr wire, CORBA::Boolean wantplanarface) GEOM::GEOM_Shape_ptr MakeFace (GEOM::GEOM_Shape_ptr wire, CORBA::Boolean wantplanarface)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeShell (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeSolid (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
//-------------------------------------------------------------------// //-------------------------------------------------------------------//

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2001-06-14 09:11:49 PM CEST\n" "POT-Creation-Date: 2001-06-14 09:11:49 PM CEST\n"
"PO-Revision-Date: YYYY-MM-DD\n" "PO-Revision-Date: 2003-09-22 16:39+0200\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n" "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
@ -190,6 +190,10 @@ msgstr "build_face.png"
msgid "ICON_DLG_BUILD_SHELL" msgid "ICON_DLG_BUILD_SHELL"
msgstr "build_shell.png" msgstr "build_shell.png"
#SolidDlg
msgid "ICON_DLG_BUILD_SOLID"
msgstr "build_solid.png"
#WireDlg #WireDlg
msgid "ICON_DLG_BUILD_WIRE" msgid "ICON_DLG_BUILD_WIRE"
msgstr "build_wire.png" msgstr "build_wire.png"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2002-03-19 09:35:48 AM CET\n" "POT-Creation-Date: 2002-03-19 09:35:48 AM CET\n"
"PO-Revision-Date: YYYY-MM-DD\n" "PO-Revision-Date: 2003-09-22 16:38+0200\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n" "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
@ -1005,9 +1005,9 @@ msgstr "Sewing Topologies"
msgid "GEOM_SHELL_TITLE" msgid "GEOM_SHELL_TITLE"
msgstr "Shell Construction" msgstr "Shell Construction"
#: GeometryGUI_ShellDlg.cxx:74 #: GeometryGUI_SolidDlg.cxx:74
msgid "GEOM_SHELL_LIST" msgid "GEOM_SOLID_TITLE"
msgstr "List Of Connected Faces" msgstr "Solid Construction"
#: GeometryGUI_SphereDlg.cxx:50 #: GeometryGUI_SphereDlg.cxx:50
msgid "GEOM_SPHERE_TITLE" msgid "GEOM_SPHERE_TITLE"

View File

@ -138,20 +138,20 @@ using namespace std;
// QT Includes // QT Includes
#define INCLUDE_MENUITEM_DEF #define INCLUDE_MENUITEM_DEF
#include <qapplication.h> // #include <qapplication.h>
#include <qmenudata.h> // #include <qmenudata.h>
#include <qmenubar.h> // #include <qmenubar.h>
#include <qpopupmenu.h> // #include <qpopupmenu.h>
#include <qfont.h> // #include <qfont.h>
#include <qstring.h> // #include <qstring.h>
#include <qcheckbox.h> // #include <qcheckbox.h>
#include <qcolordialog.h> #include <qcolordialog.h>
#include <qmessagebox.h> #include <qmessagebox.h>
#include <qspinbox.h> #include <qspinbox.h>
#include <qlist.h> // #include <qlist.h>
#include <qwidget.h> // #include <qwidget.h>
#include <qevent.h> // #include <qevent.h>
#include <qlineedit.h> // #include <qlineedit.h>
#include "VTKViewer_RenderWindowInteractor.h" #include "VTKViewer_RenderWindowInteractor.h"
#include "VTKViewer_ViewFrame.h" #include "VTKViewer_ViewFrame.h"
@ -203,6 +203,8 @@ using namespace std;
#include "GeometryGUI_CenterMassDlg.h" // Method CENTER MASS #include "GeometryGUI_CenterMassDlg.h" // Method CENTER MASS
#include "GeometryGUI_InertiaDlg.h" // Method INERTIA #include "GeometryGUI_InertiaDlg.h" // Method INERTIA
#include "GeometryGUI_FaceDlg.h" // Method GEOM::FACE #include "GeometryGUI_FaceDlg.h" // Method GEOM::FACE
#include "GeometryGUI_ShellDlg.h" // Method GEOM::SHELL
#include "GeometryGUI_SolidDlg.h" // Method GEOM::SOLID
#include "GeometryGUI_FilletDlg.h" // Method FILLET #include "GeometryGUI_FilletDlg.h" // Method FILLET
#include "GeometryGUI_ChamferDlg.h" // Method CHAMFER #include "GeometryGUI_ChamferDlg.h" // Method CHAMFER
#include "GeometryGUI_FillingHoleDlg.h" // Method FILLING HOLE #include "GeometryGUI_FillingHoleDlg.h" // Method FILLING HOLE
@ -1467,6 +1469,51 @@ void GeometryGUI::MakeFaceAndDisplay( GEOM::GEOM_Shape_ptr aWire, const Standard
} }
//=====================================================================================
// function : MakeShellAndDisplay()
// purpose :
//=====================================================================================
void GeometryGUI::MakeShellAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR )
{
try {
GEOM::GEOM_Shape_var result = myComponentGeom->MakeShell(listShapesIOR) ;
if( result->_is_nil() ) {
myDesktop->putInfo(tr("GEOM_PRP_NULLSHAPE")) ;
return ;
}
result->NameType(tr("GEOM_SHELL"));
if( Display( result, "" ))
myDesktop->putInfo(tr("GEOM_PRP_DONE")) ;
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
return ;
}
//=====================================================================================
// function : MakeSolidAndDisplay()
// purpose :
//=====================================================================================
void GeometryGUI::MakeSolidAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR )
{
try {
GEOM::GEOM_Shape_var result = myComponentGeom->MakeSolid(listShapesIOR) ;
if( result->_is_nil() ) {
myDesktop->putInfo(tr("GEOM_PRP_NULLSHAPE")) ;
return ;
}
result->NameType(tr("GEOM_SOLID"));
if( Display( result, "" ))
myDesktop->putInfo(tr("GEOM_PRP_DONE")) ;
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
return ;
}
//===================================================================================== //=====================================================================================
// function : MakeLinearEdgeAndDisplay() // function : MakeLinearEdgeAndDisplay()
@ -2783,6 +2830,22 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
break ; break ;
} }
case 315: // GEOM::SHELL
{
GeomGUI->EmitSignalDeactivateDialog() ;
SALOME_Selection* Sel = SALOME_Selection::Selection( GeomGUI->myActiveStudy->getSelection() );
GeometryGUI_ShellDlg *aDlg = new GeometryGUI_ShellDlg ( parent, "", Sel ) ;
break ;
}
case 316: // GEOM::SOLID
{
GeomGUI->EmitSignalDeactivateDialog() ;
SALOME_Selection* Sel = SALOME_Selection::Selection( GeomGUI->myActiveStudy->getSelection() );
GeometryGUI_SolidDlg *aDlg = new GeometryGUI_SolidDlg ( parent, "", Sel ) ;
break ;
}
case 308: // GEOM::COMPOUND case 308: // GEOM::COMPOUND
{ {
GeomGUI->EmitSignalDeactivateDialog() ; GeomGUI->EmitSignalDeactivateDialog() ;

View File

@ -200,6 +200,8 @@ public :
void MakeSewingAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR, void MakeSewingAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR,
const Standard_Real precision ) ; const Standard_Real precision ) ;
void MakeCompoundAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR ) ; void MakeCompoundAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR ) ;
void MakeShellAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR ) ;
void MakeSolidAndDisplay( GEOM::GEOM_Gen::ListOfIOR& listShapesIOR ) ;
void MakeLinearEdgeAndDisplay( const gp_Pnt P1, const gp_Pnt P2 ) ; void MakeLinearEdgeAndDisplay( const gp_Pnt P1, const gp_Pnt P2 ) ;
void MakeOrientationChangeAndDisplay( GEOM::GEOM_Shape_ptr Shape ) ; void MakeOrientationChangeAndDisplay( GEOM::GEOM_Shape_ptr Shape ) ;

View File

@ -0,0 +1,57 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_1Sel1Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "GeometryGUI_1Sel1Spin.h"
#include <qlayout.h>
#include <qspinbox.h>
#include <qgroupbox.h>
/*
* Constructs a GeometryGUI_1Sel1Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
GeometryGUI_1Sel1Spin::GeometryGUI_1Sel1Spin( QWidget* parent, const char* name, WFlags fl )
: GeometryGUI_1Sel1Spin_QTD( parent, name, fl )
{
SpinBox1->close( TRUE );
SpinBox_DX = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DX" ) ;
Layout2->addWidget( SpinBox_DX, 0, 1 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_1Sel1Spin::~GeometryGUI_1Sel1Spin()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,47 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_1Sel1Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMETRYGUI_1SEL1SPIN_H
#define GEOMETRYGUI_1SEL1SPIN_H
#include "GeometryGUI_1Sel1Spin_QTD.h"
#include "GeometryGUI_SpinBox.h"
class GeometryGUI_1Sel1Spin : public GeometryGUI_1Sel1Spin_QTD
{
Q_OBJECT
public:
GeometryGUI_1Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_1Sel1Spin();
GeometryGUI_SpinBox* SpinBox_DX;
};
#endif // GEOMETRYGUI_1SEL1SPIN_H

View File

@ -0,0 +1,89 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_1Sel1Spin_QTD.ui'
**
** Created: mar sep 23 16:05:08 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_1Sel1Spin_QTD.h"
#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_1Sel1Spin_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
GeometryGUI_1Sel1Spin_QTD::GeometryGUI_1Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "GeometryGUI_1Sel1Spin_QTD" );
resize( 129, 87 );
setCaption( trUtf8( "GeometryGUI_1Sel1Spin_QTD" ) );
GeometryGUI_1Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Sel1Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setTitle( trUtf8( "" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton1, 0, 1 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
TextLabel1->setText( trUtf8( "TL1" ) );
Layout1->addWidget( TextLabel1, 0, 0 );
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
Layout1->addWidget( LineEdit1, 0, 2 );
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) );
Layout2->addWidget( TextLabel2, 0, 0 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( SpinBox1, 0, 1 );
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 2, 2 );
GroupBox1Layout->addLayout( Layout1, 0, 0 );
GeometryGUI_1Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_1Sel1Spin_QTD::~GeometryGUI_1Sel1Spin_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,46 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_1Sel1Spin_QTD.ui'
**
** Created: mar sep 23 16:05:08 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_1SEL1SPIN_QTD_H
#define GEOMETRYGUI_1SEL1SPIN_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QSpinBox;
class GeometryGUI_1Sel1Spin_QTD : public QWidget
{
Q_OBJECT
public:
GeometryGUI_1Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_1Sel1Spin_QTD();
QGroupBox* GroupBox1;
QPushButton* PushButton1;
QLabel* TextLabel1;
QLineEdit* LineEdit1;
QLabel* TextLabel2;
QSpinBox* SpinBox1;
protected:
QGridLayout* GeometryGUI_1Sel1Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
QGridLayout* Layout1;
QGridLayout* Layout2;
};
#endif // GEOMETRYGUI_1SEL1SPIN_QTD_H

View File

@ -0,0 +1,69 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_1Sel4Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "GeometryGUI_1Sel4Spin.h"
#include <qlayout.h>
#include <qspinbox.h>
#include <qgroupbox.h>
/*
* Constructs a GeometryGUI_1Sel4Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
GeometryGUI_1Sel4Spin::GeometryGUI_1Sel4Spin( QWidget* parent, const char* name, WFlags fl )
: GeometryGUI_1Sel4Spin_QTD( parent, name, fl )
{
SpinBox1->close( TRUE );
SpinBox2->close( TRUE );
SpinBox3->close( TRUE );
SpinBox4->close( TRUE );
SpinBox_DX = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DX" ) ;
Layout3->addWidget( SpinBox_DX, 0, 2 );
SpinBox_DY = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DY" ) ;
Layout3->addWidget( SpinBox_DY, 0, 4 );
SpinBox_DZ = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DZ" ) ;
Layout3->addWidget( SpinBox_DZ, 0, 6 );
SpinBox_S = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_S" ) ;
Layout4->addWidget( SpinBox_S, 0, 1 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_1Sel4Spin::~GeometryGUI_1Sel4Spin()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,51 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_1Sel4Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMETRYGUI_1SEL4SPIN_H
#define GEOMETRYGUI_1SEL4SPIN_H
#include "GeometryGUI_1Sel4Spin_QTD.h"
#include "GeometryGUI_SpinBox.h"
class GeometryGUI_1Sel4Spin : public GeometryGUI_1Sel4Spin_QTD
{
Q_OBJECT
public:
GeometryGUI_1Sel4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_1Sel4Spin();
GeometryGUI_SpinBox* SpinBox_DX;
GeometryGUI_SpinBox* SpinBox_DY;
GeometryGUI_SpinBox* SpinBox_DZ;
GeometryGUI_SpinBox* SpinBox_S;
};
#endif // GEOMETRYGUI_1SEL4SPIN_H

View File

@ -0,0 +1,132 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_1Sel4Spin_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_1Sel4Spin_QTD.h"
#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_1Sel4Spin_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
GeometryGUI_1Sel4Spin_QTD::GeometryGUI_1Sel4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "GeometryGUI_1Sel4Spin_QTD" );
resize( 284, 119 );
setCaption( trUtf8( "GeometryGUI_1Sel4Spin_QTD" ) );
GeometryGUI_1Sel4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Sel4Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setTitle( trUtf8( "" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
TextLabel5->setText( trUtf8( "TL5" ) );
Layout3->addWidget( TextLabel5, 0, 5 );
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
TextLabel3->setText( trUtf8( "TL3" ) );
Layout3->addWidget( TextLabel3, 0, 1 );
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
TextLabel4->setText( trUtf8( "TL4" ) );
Layout3->addWidget( TextLabel4, 0, 3 );
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
Layout3->addWidget( SpinBox3, 0, 6 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
Layout3->addWidget( SpinBox1, 0, 2 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) );
Layout3->addWidget( TextLabel2, 0, 0 );
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
Layout3->addWidget( SpinBox2, 0, 4 );
Layout1->addLayout( Layout3, 1, 0 );
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 3, 0 );
Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4");
TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
TextLabel6->setText( trUtf8( "TL6" ) );
Layout4->addWidget( TextLabel6, 0, 0 );
SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
Layout4->addWidget( SpinBox4, 0, 1 );
Layout1->addLayout( Layout4, 2, 0 );
Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
TextLabel1->setText( trUtf8( "TL1" ) );
Layout2->addWidget( TextLabel1 );
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout2->addWidget( PushButton1 );
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
Layout2->addWidget( LineEdit1 );
Layout1->addLayout( Layout2, 0, 0 );
GroupBox1Layout->addLayout( Layout1, 0, 0 );
GeometryGUI_1Sel4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_1Sel4Spin_QTD::~GeometryGUI_1Sel4Spin_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,55 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_1Sel4Spin_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_1SEL4SPIN_QTD_H
#define GEOMETRYGUI_1SEL4SPIN_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QSpinBox;
class GeometryGUI_1Sel4Spin_QTD : public QWidget
{
Q_OBJECT
public:
GeometryGUI_1Sel4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_1Sel4Spin_QTD();
QGroupBox* GroupBox1;
QLabel* TextLabel5;
QLabel* TextLabel3;
QLabel* TextLabel4;
QSpinBox* SpinBox3;
QSpinBox* SpinBox1;
QLabel* TextLabel2;
QSpinBox* SpinBox2;
QLabel* TextLabel6;
QSpinBox* SpinBox4;
QLabel* TextLabel1;
QPushButton* PushButton1;
QLineEdit* LineEdit1;
protected:
QGridLayout* GeometryGUI_1Sel4Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
QGridLayout* Layout1;
QGridLayout* Layout3;
QGridLayout* Layout4;
QHBoxLayout* Layout2;
};
#endif // GEOMETRYGUI_1SEL4SPIN_QTD_H

View File

@ -0,0 +1,74 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_1Sel_QTD.ui'
**
** Created: lun sep 22 17:38:06 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_1Sel_QTD.h"
#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_1Sel_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
GeometryGUI_1Sel_QTD::GeometryGUI_1Sel_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "GeometryGUI_1Sel_QTD" );
resize( 129, 57 );
setCaption( trUtf8( "GeometryGUI_1Sel_QTD" ) );
GeometryGUI_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_1Sel_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) );
GroupBox1->setTitle( trUtf8( "" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton1, 0, 1 );
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 1, 2 );
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
Layout1->addWidget( LineEdit1, 0, 2 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
TextLabel1->setText( trUtf8( "TL1" ) );
Layout1->addWidget( TextLabel1, 0, 0 );
GroupBox1Layout->addLayout( Layout1, 0, 0 );
GeometryGUI_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_1Sel_QTD::~GeometryGUI_1Sel_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,42 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_1Sel_QTD.ui'
**
** Created: lun sep 22 17:38:05 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_1SEL_QTD_H
#define GEOMETRYGUI_1SEL_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class GeometryGUI_1Sel_QTD : public QWidget
{
Q_OBJECT
public:
GeometryGUI_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_1Sel_QTD();
QGroupBox* GroupBox1;
QPushButton* PushButton1;
QLineEdit* LineEdit1;
QLabel* TextLabel1;
protected:
QGridLayout* GeometryGUI_1Sel_QTDLayout;
QGridLayout* GroupBox1Layout;
QGridLayout* Layout1;
};
#endif // GEOMETRYGUI_1SEL_QTD_H

View File

@ -0,0 +1,57 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_2Sel1Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "GeometryGUI_2Sel1Spin.h"
#include <qlayout.h>
#include <qspinbox.h>
#include <qgroupbox.h>
/*
* Constructs a GeometryGUI_2Sel1Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
GeometryGUI_2Sel1Spin::GeometryGUI_2Sel1Spin( QWidget* parent, const char* name, WFlags fl )
: GeometryGUI_2Sel1Spin_QTD( parent, name, fl )
{
SpinBox1->close( TRUE );
SpinBox_DX = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DX" ) ;
Layout2->addWidget( SpinBox_DX, 0, 1 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_2Sel1Spin::~GeometryGUI_2Sel1Spin()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,47 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_2Sel1Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMETRYGUI_2SEL1SPIN_H
#define GEOMETRYGUI_2SEL1SPIN_H
#include "GeometryGUI_2Sel1Spin_QTD.h"
#include "GeometryGUI_SpinBox.h"
class GeometryGUI_2Sel1Spin : public GeometryGUI_2Sel1Spin_QTD
{
Q_OBJECT
public:
GeometryGUI_2Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_2Sel1Spin();
GeometryGUI_SpinBox* SpinBox_DX;
};
#endif // GEOMETRYGUI_2SEL1SPIN_H

View File

@ -0,0 +1,105 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_2Sel1Spin_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_2Sel1Spin_QTD.h"
#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_2Sel1Spin_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
GeometryGUI_2Sel1Spin_QTD::GeometryGUI_2Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "GeometryGUI_2Sel1Spin_QTD" );
resize( 129, 117 );
setCaption( trUtf8( "GeometryGUI_2Sel1Spin_QTD" ) );
GeometryGUI_2Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Sel1Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setTitle( trUtf8( "" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
Layout1->addWidget( LineEdit1, 0, 2 );
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
PushButton2->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton2, 1, 1 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
TextLabel1->setText( trUtf8( "TL1" ) );
Layout1->addWidget( TextLabel1, 0, 0 );
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
Layout1->addWidget( LineEdit2, 1, 2 );
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton1, 0, 1 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) );
Layout1->addWidget( TextLabel2, 1, 0 );
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( SpinBox1, 0, 1 );
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
TextLabel3->setText( trUtf8( "TL3" ) );
Layout2->addWidget( TextLabel3, 0, 0 );
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 3, 2 );
GroupBox1Layout->addLayout( Layout1, 0, 0 );
GeometryGUI_2Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_2Sel1Spin_QTD::~GeometryGUI_2Sel1Spin_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,49 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_2Sel1Spin_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_2SEL1SPIN_QTD_H
#define GEOMETRYGUI_2SEL1SPIN_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QSpinBox;
class GeometryGUI_2Sel1Spin_QTD : public QWidget
{
Q_OBJECT
public:
GeometryGUI_2Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_2Sel1Spin_QTD();
QGroupBox* GroupBox1;
QLineEdit* LineEdit1;
QPushButton* PushButton2;
QLabel* TextLabel1;
QLineEdit* LineEdit2;
QPushButton* PushButton1;
QLabel* TextLabel2;
QSpinBox* SpinBox1;
QLabel* TextLabel3;
protected:
QGridLayout* GeometryGUI_2Sel1Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
QGridLayout* Layout1;
QGridLayout* Layout2;
};
#endif // GEOMETRYGUI_2SEL1SPIN_QTD_H

View File

@ -0,0 +1,90 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_2Sel_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_2Sel_QTD.h"
#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_2Sel_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
GeometryGUI_2Sel_QTD::GeometryGUI_2Sel_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "GeometryGUI_2Sel_QTD" );
resize( 129, 87 );
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
setCaption( trUtf8( "GeometryGUI_2Sel_QTD" ) );
GeometryGUI_2Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_2Sel_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setTitle( trUtf8( "" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton1, 0, 1 );
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 2, 2 );
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
Layout1->addWidget( LineEdit2, 1, 2 );
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
PushButton2->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton2, 1, 1 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
TextLabel1->setText( trUtf8( "TL1" ) );
Layout1->addWidget( TextLabel1, 0, 0 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) );
Layout1->addWidget( TextLabel2, 1, 0 );
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
Layout1->addWidget( LineEdit1, 0, 2 );
GroupBox1Layout->addLayout( Layout1, 0, 0 );
GeometryGUI_2Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_2Sel_QTD::~GeometryGUI_2Sel_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,45 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_2Sel_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_2SEL_QTD_H
#define GEOMETRYGUI_2SEL_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class GeometryGUI_2Sel_QTD : public QWidget
{
Q_OBJECT
public:
GeometryGUI_2Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_2Sel_QTD();
QGroupBox* GroupBox1;
QPushButton* PushButton1;
QLineEdit* LineEdit2;
QPushButton* PushButton2;
QLabel* TextLabel1;
QLabel* TextLabel2;
QLineEdit* LineEdit1;
protected:
QGridLayout* GeometryGUI_2Sel_QTDLayout;
QGridLayout* GroupBox1Layout;
QGridLayout* Layout1;
};
#endif // GEOMETRYGUI_2SEL_QTD_H

View File

@ -0,0 +1,65 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_3Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "GeometryGUI_3Spin.h"
#include <qlayout.h>
#include <qspinbox.h>
#include <qgroupbox.h>
/*
* Constructs a GeometryGUI_3Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
GeometryGUI_3Spin::GeometryGUI_3Spin( QWidget* parent, const char* name, WFlags fl )
: GeometryGUI_3Spin_QTD( parent, name, fl )
{
SpinBox1->close( TRUE );
SpinBox2->close( TRUE );
SpinBox3->close( TRUE );
SpinBox_DX = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DX" ) ;
Layout1->addWidget( SpinBox_DX, 0, 1 );
SpinBox_DY = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DY" ) ;
Layout1->addWidget( SpinBox_DY, 1, 1 );
SpinBox_DZ = new GeometryGUI_SpinBox( GroupBox1, "SpinBox_DZ" ) ;
Layout1->addWidget( SpinBox_DZ, 2, 1 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_3Spin::~GeometryGUI_3Spin()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,49 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_3Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMETRYGUI_3SPIN_H
#define GEOMETRYGUI_3SPIN_H
#include "GeometryGUI_3Spin_QTD.h"
#include "GeometryGUI_SpinBox.h"
class GeometryGUI_3Spin : public GeometryGUI_3Spin_QTD
{
Q_OBJECT
public:
GeometryGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_3Spin();
GeometryGUI_SpinBox* SpinBox_DX;
GeometryGUI_SpinBox* SpinBox_DY;
GeometryGUI_SpinBox* SpinBox_DZ;
};
#endif // GEOMETRYGUI_3SPIN_H

View File

@ -0,0 +1,90 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_3Spin_QTD.ui'
**
** Created: mar sep 23 16:05:10 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_3Spin_QTD.h"
#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_3Spin_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
GeometryGUI_3Spin_QTD::GeometryGUI_3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "GeometryGUI_3Spin_QTD" );
resize( 124, 111 );
setCaption( trUtf8( "GeometryGUI_3Spin_QTD" ) );
GeometryGUI_3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "GeometryGUI_3Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setTitle( trUtf8( "" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox2, 1, 1 );
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 3, 1 );
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
TextLabel3->setText( trUtf8( "TL3" ) );
Layout1->addWidget( TextLabel3, 2, 0 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox1, 0, 1 );
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox3, 2, 1 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
TextLabel1->setText( trUtf8( "TL1" ) );
Layout1->addWidget( TextLabel1, 0, 0 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) );
Layout1->addWidget( TextLabel2, 1, 0 );
GroupBox1Layout->addLayout( Layout1, 0, 0 );
GeometryGUI_3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_3Spin_QTD::~GeometryGUI_3Spin_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,44 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_3Spin_QTD.ui'
**
** Created: mar sep 23 16:05:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_3SPIN_QTD_H
#define GEOMETRYGUI_3SPIN_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
class QSpinBox;
class GeometryGUI_3Spin_QTD : public QWidget
{
Q_OBJECT
public:
GeometryGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~GeometryGUI_3Spin_QTD();
QGroupBox* GroupBox1;
QSpinBox* SpinBox2;
QLabel* TextLabel3;
QSpinBox* SpinBox1;
QSpinBox* SpinBox3;
QLabel* TextLabel1;
QLabel* TextLabel2;
protected:
QGridLayout* GeometryGUI_3Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
QGridLayout* Layout1;
};
#endif // GEOMETRYGUI_3SPIN_QTD_H

View File

@ -28,32 +28,13 @@
using namespace std; using namespace std;
#include "GeometryGUI_BoxDlg.h" #include "GeometryGUI_BoxDlg.h"
#include "GeometryGUI_SpinBox.h"
#include <Precision.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include "GeometryGUI.h" #include "GeometryGUI.h"
#include "QAD_Application.h"
#include "QAD_Desktop.h" #include "QAD_Desktop.h"
#include "QAD_Config.h" #include "QAD_Config.h"
#include "utilities.h"
#include <qbuttongroup.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qlabel.h>
#include <qvalidator.h>
#include <qevent.h>
#include <qmessagebox.h>
//================================================================================= //=================================================================================
// class : GeometryGUI_BoxDlg() // class : GeometryGUI_BoxDlg()
@ -63,150 +44,36 @@ using namespace std;
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
//================================================================================= //=================================================================================
GeometryGUI_BoxDlg::GeometryGUI_BoxDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) GeometryGUI_BoxDlg::GeometryGUI_BoxDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P"))); QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ")));
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BOX_DXYZ"))); QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
if ( !name )
setName( "GeometryGUI_BoxDlg" );
resize( 335, 220 );
setCaption(tr("GEOM_BOX_TITLE")); setCaption(tr("GEOM_BOX_TITLE"));
setSizeGripEnabled( TRUE );
GeometryGUI_BoxDlgLayout = new QGridLayout( this );
GeometryGUI_BoxDlgLayout->setSpacing( 6 );
GeometryGUI_BoxDlgLayout->setMargin( 11 );
/***************************************************************/ /***************************************************************/
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
GroupConstructors->setTitle(tr("GEOM_BOX")); GroupConstructors->setTitle(tr("GEOM_BOX"));
GroupConstructors->setExclusive( TRUE ); RadioButton1->setPixmap(image0);
GroupConstructors->setColumnLayout(0, Qt::Vertical ); RadioButton2->setPixmap(image1);
GroupConstructors->layout()->setSpacing( 0 ); RadioButton3->close(TRUE);
GroupConstructors->layout()->setMargin( 0 );
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
GroupConstructorsLayout->setSpacing( 6 );
GroupConstructorsLayout->setMargin( 11 );
QSpacerItem* spacer_1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer_1, 0, 3 );
Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
Constructor1->setText( tr( "" ) );
Constructor1->setPixmap( image0 );
Constructor1->setChecked( TRUE );
Constructor1->setMinimumSize( QSize( 50, 0 ) );
GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" );
Constructor2->setText( tr( "" ) );
Constructor2->setPixmap( image2 );
Constructor2->setMinimumSize( QSize( 50, 0 ) );
GroupConstructorsLayout->addWidget( Constructor2, 0, 2 );
QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer_2, 0, 1 );
GeometryGUI_BoxDlgLayout->addWidget( GroupConstructors, 0, 0 );
GroupPoints = new GeometryGUI_2Sel_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_DIAGONAL_POINTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
GroupPoints->PushButton1->setPixmap(image2);
GroupPoints->PushButton2->setPixmap(image2);
GroupDimensions = new GeometryGUI_3Spin(this, "GroupDimensions");
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
GroupDimensions->TextLabel1->setText(tr("GEOM_DX"));
GroupDimensions->TextLabel2->setText(tr("GEOM_DY"));
GroupDimensions->TextLabel3->setText(tr("GEOM_DZ"));
Layout1->addWidget(GroupPoints, 1, 0);
Layout1->addWidget(GroupDimensions, 1, 0);
/***************************************************************/ /***************************************************************/
GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
GroupButtons->setTitle( tr( "" ) );
GroupButtons->setColumnLayout(0, Qt::Vertical );
GroupButtons->layout()->setSpacing( 0 );
GroupButtons->layout()->setMargin( 0 );
GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->setSpacing( 6 );
GroupButtonsLayout->setMargin( 11 );
buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
buttonApply->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupButtonsLayout->addItem( spacer, 0, 2 );
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
buttonOk->setText( tr( "GEOM_BUT_OK" ) );
buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
GeometryGUI_BoxDlgLayout->addWidget( GroupButtons, 2, 0 );
/***************************************************************/
GroupPoints = new QGroupBox( this, "GroupPoints" );
GroupPoints->setGeometry( QRect( 10, 10, 280, 90 ) );
GroupPoints->setTitle( tr( "GEOM_DIAGONAL_POINTS" ) );
GroupPoints->setFrameShape( QGroupBox::Box );
GroupPoints->setFrameShadow( QGroupBox::Sunken );
GroupPoints->setColumnLayout(0, Qt::Vertical );
GroupPoints->layout()->setSpacing( 0 );
GroupPoints->layout()->setMargin( 0 );
GroupPointsLayout = new QGridLayout( GroupPoints->layout() );
GroupPointsLayout->setAlignment( Qt::AlignTop );
GroupPointsLayout->setSpacing( 6 );
GroupPointsLayout->setMargin( 11 );
SelectButtonPt2 = new QPushButton( GroupPoints, "SelectButtonPt2" );
SelectButtonPt2->setText( tr( "" ) );
SelectButtonPt2->setPixmap( image1 );
GroupPointsLayout->addWidget( SelectButtonPt2, 1, 1 );
LineEditPt1 = new QLineEdit( GroupPoints, "LineEditPt1" );
GroupPointsLayout->addWidget( LineEditPt1, 0, 2 );
LineEditPt2 = new QLineEdit( GroupPoints, "LineEditPt2" );
GroupPointsLayout->addWidget( LineEditPt2, 1, 2 );
SelectButtonPt1 = new QPushButton( GroupPoints, "SelectButtonPt1" );
SelectButtonPt1->setText( tr( "" ) );
SelectButtonPt1->setPixmap( image1 );
SelectButtonPt1->setToggleButton( FALSE );
GroupPointsLayout->addWidget( SelectButtonPt1, 0, 1 );
TextLabelPt1 = new QLabel( GroupPoints, "TextLabelPt1" );
TextLabelPt1->setText( tr( "GEOM_POINT_I" ).arg("1") );
TextLabelPt1->setMinimumSize( QSize( 50, 0 ) );
TextLabelPt1->setFrameShape( QLabel::NoFrame );
TextLabelPt1->setFrameShadow( QLabel::Plain );
GroupPointsLayout->addWidget( TextLabelPt1, 0, 0 );
TextLabelPt2 = new QLabel( GroupPoints, "TextLabelPt2" );
TextLabelPt2->setText( tr( "GEOM_POINT_I" ).arg("2") );
TextLabelPt2->setMinimumSize( QSize( 50, 0 ) );
GroupPointsLayout->addWidget( TextLabelPt2, 1, 0 );
GeometryGUI_BoxDlgLayout->addWidget( GroupPoints, 1, 0 );
/***************************************************************/
GroupDimensions = new QGroupBox( this, "GroupDimensions" );
GroupDimensions->setGeometry( QRect( 11, 75, 310, 80 ) );
GroupDimensions->setTitle( tr( "GEOM_BOX_OBJ" ) );
GroupDimensions->setColumnLayout(0, Qt::Vertical );
GroupDimensions->setMinimumSize( QSize( 0, 90 ) );
GroupDimensions->layout()->setSpacing( 0 );
GroupDimensions->layout()->setMargin( 0 );
GroupDimensionsLayout = new QGridLayout( GroupDimensions->layout() );
GroupDimensionsLayout->setAlignment( Qt::AlignTop );
GroupDimensionsLayout->setSpacing( 6 );
GroupDimensionsLayout->setMargin( 11 );
TextLabel_DZ = new QLabel( GroupDimensions, "TextLabel_DZ" );
TextLabel_DZ->setText( tr( "GEOM_DZ" ) );
GroupDimensionsLayout->addWidget( TextLabel_DZ, 0, 4 );
TextLabel_DY = new QLabel( GroupDimensions, "TextLabel_DY" );
TextLabel_DY->setText( tr( "GEOM_DY" ) );
GroupDimensionsLayout->addWidget( TextLabel_DY, 0, 2 );
TextLabel_DX = new QLabel( GroupDimensions, "TextLabel_DX" );
TextLabel_DX->setText( tr( "GEOM_DX" ) );
GroupDimensionsLayout->addWidget( TextLabel_DX, 0, 0 );
/* Spin boxes construction */
SpinBox_DX = new GeometryGUI_SpinBox( GroupDimensions, "GeomSpinBox_DX" ) ;
GroupDimensionsLayout->addWidget( SpinBox_DX, 0, 1 );
SpinBox_DY = new GeometryGUI_SpinBox( GroupDimensions, "GeomSpinBox_DY" ) ;
GroupDimensionsLayout->addWidget( SpinBox_DY, 0, 3 );
SpinBox_DZ = new GeometryGUI_SpinBox( GroupDimensions, "GeomSpinBox_DZ" ) ;
GroupDimensionsLayout->addWidget( SpinBox_DZ, 0, 5 );
QSpacerItem* spacer1 = new QSpacerItem( 20, 24, QSizePolicy::Minimum, QSizePolicy::Fixed );
GroupDimensionsLayout->addItem( spacer1, 1, 3 );
GeometryGUI_BoxDlgLayout->addWidget( GroupDimensions, 1, 0 );
/* Initialisations */ /* Initialisations */
Init(Sel); Init(Sel);
@ -220,7 +87,6 @@ GeometryGUI_BoxDlg::GeometryGUI_BoxDlg( QWidget* parent, const char* name, SALOM
GeometryGUI_BoxDlg::~GeometryGUI_BoxDlg() GeometryGUI_BoxDlg::~GeometryGUI_BoxDlg()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, Qt does it all for us
this->destroy(TRUE, TRUE) ;
} }
@ -230,95 +96,80 @@ GeometryGUI_BoxDlg::~GeometryGUI_BoxDlg()
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::Init(SALOME_Selection* Sel) void GeometryGUI_BoxDlg::Init(SALOME_Selection* Sel)
{ {
/* init variables */
myConstructorId = 0;
myEditCurrentArgument = GroupPoints->LineEdit1;
myPoint1.SetCoord(0.0, 0.0, 0.0);
myPoint2.SetCoord(0.0, 0.0, 0.0);
myOkPoint1 = myOkPoint2 = false;
/* Vertices Filter for all arguments */
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
mySelection->AddFilter(myVertexFilter);
/* Get setting of step value from file configuration */ /* Get setting of step value from file configuration */
double step ;
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep"); QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
step = St.toDouble(); step = St.toDouble();
/* min, max, step and decimals for spin boxes */ /* min, max, step and decimals for spin boxes */
SpinBox_DX->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
SpinBox_DX->SetValue( 200.0 ) ; GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
SpinBox_DY->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ; GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
SpinBox_DY->SetValue( 200.0 ) ;
SpinBox_DZ->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
SpinBox_DZ->SetValue( 200.0 ) ;
GroupPoints->show(); double initValue = 200.0;
GroupDimensions->hide() ; GroupDimensions->SpinBox_DX->SetValue(initValue);
myConstructorId = 0 ; GroupDimensions->SpinBox_DY->SetValue(initValue);
Constructor1->setChecked( TRUE ); GroupDimensions->SpinBox_DZ->SetValue(initValue);
myEditCurrentArgument = LineEditPt1 ;
mySelection = Sel;
myGeomGUI = GeometryGUI::GetGeometryGUI() ;
myPoint1.SetCoord( 0.0, 0.0, 0.0 );
myPoint2.SetCoord( 0.0, 0.0, 0.0 );
myOkPoint1 = myOkPoint2 = false ;
mySimulationTopoDs.Nullify() ;
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
// TODO previous selection into argument ?
/* Vertices Filter for all arguments */
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
myGeom = GEOM::GEOM_Gen::_narrow(comp);
myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom );
mySelection->AddFilter( myVertexFilter ); /* filter for next selection */
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect( SelectButtonPt1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
connect( SelectButtonPt2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
connect( SpinBox_DX, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( SpinBox_DY, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( SpinBox_DZ, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
connect( LineEditPt1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect( LineEditPt2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
/* To close dialog if study change */
connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
/* Move widget on the botton right corner of main widget */ /* displays Dialog */
int x, y ; GroupDimensions->hide();
myGeomGUI->DefineDlgPosition( this, x, y ) ; GroupPoints->show();
this->move( x, y ) ; this->show();
this->show() ; /* displays Dialog */ return ;
} }
//================================================================================= //=================================================================================
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId) void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId)
{ {
myConstructorId = constructorId;
mySelection->ClearFilters(); mySelection->ClearFilters();
myGeomGUI->EraseSimulationShape(); myGeomGUI->EraseSimulationShape();
disconnect(mySelection, 0, this, 0);
myOkPoint1 = myOkPoint2 = false;
switch (constructorId) switch (constructorId)
{ {
case 0: case 0:
{ {
GroupPoints->show();
GroupDimensions->hide(); GroupDimensions->hide();
myConstructorId = constructorId ; resize(0, 0);
myEditCurrentArgument = LineEditPt1 ; GroupPoints->show();
Constructor1->setChecked( TRUE ); myEditCurrentArgument = GroupPoints->LineEdit1;
LineEditPt1->setText("") ; GroupPoints->LineEdit1->setText("");
LineEditPt2->setText("") ; GroupPoints->LineEdit2->setText("");
myOkPoint1 = myOkPoint2 = false ;
/* filter for next selection */ /* filter for next selection */
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
@ -328,16 +179,13 @@ void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId)
case 1: case 1:
{ {
GroupPoints->hide(); GroupPoints->hide();
resize( 0, 0 );
GroupDimensions->show(); GroupDimensions->show();
myConstructorId = constructorId ;
myOkPoint1 = myOkPoint2 = false ;
disconnect( mySelection, 0, this, 0 );
double initValue = 200.0; double initValue = 200.0;
SpinBox_DX->SetValue( initValue ) ; GroupDimensions->SpinBox_DX->SetValue(initValue);
SpinBox_DY->SetValue( initValue ) ; GroupDimensions->SpinBox_DY->SetValue(initValue);
SpinBox_DZ->SetValue( initValue ) ; GroupDimensions->SpinBox_DZ->SetValue(initValue);
myPoint1.SetCoord(0.0, 0.0, 0.0) ; myPoint1.SetCoord(0.0, 0.0, 0.0) ;
myPoint2.SetCoord(initValue, initValue, initValue); myPoint2.SetCoord(initValue, initValue, initValue);
@ -350,6 +198,7 @@ void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId)
return; return;
} }
//================================================================================= //=================================================================================
// function : ClickOnOk() // function : ClickOnOk()
// purpose : // purpose :
@ -357,28 +206,27 @@ void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId)
void GeometryGUI_BoxDlg::ClickOnOk() void GeometryGUI_BoxDlg::ClickOnOk()
{ {
this->ClickOnApply(); this->ClickOnApply();
this->ClickOnCancel() ; ClickOnCancel();
return; return;
} }
//================================================================================= //=================================================================================
// function : ClickOnApply() // function : ClickOnApply()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::ClickOnApply() void GeometryGUI_BoxDlg::ClickOnApply()
{ {
//NRI+ : 02/12/2202 - BugID 1065 myGeomGUI->GetDesktop()->putInfo(tr(""));
// if (mySimulationTopoDs.IsNull()) if (mySimulationTopoDs.IsNull())
// return; return;
myGeomGUI->EraseSimulationShape(); myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
switch(myConstructorId) switch(myConstructorId)
{ {
case 0 : case 0 :
{ {
//NRI+ : 02/12/2202 - BugID 1065 mySelection->ClearFilters() ;
if(myOkPoint1 && myOkPoint2) if(myOkPoint1 && myOkPoint2)
myGeomGUI->MakeBoxAndDisplay(myPoint1, myPoint2); myGeomGUI->MakeBoxAndDisplay(myPoint1, myPoint2);
break; break;
@ -386,9 +234,9 @@ void GeometryGUI_BoxDlg::ClickOnApply()
case 1 : case 1 :
{ {
/* Recup args and call method */ /* Recup args and call method */
double vx = SpinBox_DX->GetValue() ; double vx = GroupDimensions->SpinBox_DX->GetValue();
double vy = SpinBox_DY->GetValue() ; double vy = GroupDimensions->SpinBox_DY->GetValue();
double vz = SpinBox_DZ->GetValue() ; double vz = GroupDimensions->SpinBox_DZ->GetValue();
myPoint1.SetCoord(0.0, 0.0, 0.0); myPoint1.SetCoord(0.0, 0.0, 0.0);
myPoint2.SetCoord(vx, vy, vz); myPoint2.SetCoord(vx, vy, vz);
myGeomGUI->MakeBoxAndDisplay(myPoint1, myPoint2); myGeomGUI->MakeBoxAndDisplay(myPoint1, myPoint2);
@ -399,42 +247,22 @@ void GeometryGUI_BoxDlg::ClickOnApply()
} }
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::ClickOnCancel()
{
mySelection->ClearFilters() ;
myGeomGUI->EraseSimulationShape() ;
mySimulationTopoDs.Nullify() ;
disconnect( mySelection, 0, this, 0 );
myGeomGUI->ResetState() ;
reject() ;
return ;
}
//================================================================================= //=================================================================================
// function : SelectionIntoArgument() // function : SelectionIntoArgument()
// purpose : Called when selection as changed // purpose : Called when selection as changed
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::SelectionIntoArgument() void GeometryGUI_BoxDlg::SelectionIntoArgument()
{ {
myEditCurrentArgument->setText("") ;
myGeomGUI->EraseSimulationShape(); myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify() ; myEditCurrentArgument->setText("");
QString aString = ""; /* name of selection */ QString aString = ""; /* name of selection */
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
if (nbSel != 1) { if (nbSel != 1) {
if ( myEditCurrentArgument == LineEditPt1 ) { if (myEditCurrentArgument == GroupPoints->LineEdit1)
myOkPoint1 = false; myOkPoint1 = false;
} else if ( myEditCurrentArgument == GroupPoints->LineEdit2)
else if ( myEditCurrentArgument == LineEditPt2 ) {
myOkPoint2 = false; myOkPoint2 = false;
}
return; return;
} }
@ -443,11 +271,11 @@ void GeometryGUI_BoxDlg::SelectionIntoArgument()
if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
return; return;
if ( myEditCurrentArgument == LineEditPt1 && myGeomGUI->VertexToPoint(S, myPoint1) ) { if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
myEditCurrentArgument->setText(aString); myEditCurrentArgument->setText(aString);
myOkPoint1 = true; myOkPoint1 = true;
} }
else if ( myEditCurrentArgument == LineEditPt2 && myGeomGUI->VertexToPoint(S, myPoint2) ) { else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomGUI->VertexToPoint(S, myPoint2)) {
myEditCurrentArgument->setText(aString); myEditCurrentArgument->setText(aString);
myOkPoint2 = true; myOkPoint2 = true;
} }
@ -466,58 +294,94 @@ void GeometryGUI_BoxDlg::SelectionIntoArgument()
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::SetEditCurrentArgument() void GeometryGUI_BoxDlg::SetEditCurrentArgument()
{ {
if(myConstructorId != 0)
return;
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
switch (myConstructorId)
{ if(send == GroupPoints->PushButton1) {
case 0: // default constructor GroupPoints->LineEdit1->setFocus();
{ myEditCurrentArgument = GroupPoints->LineEdit1;
if(send == SelectButtonPt1) {
LineEditPt1->setFocus() ;
myEditCurrentArgument = LineEditPt1;
} }
else if(send == SelectButtonPt2) { else if(send == GroupPoints->PushButton2) {
LineEditPt2->setFocus() ; GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = LineEditPt2; myEditCurrentArgument = GroupPoints->LineEdit2;
} }
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
SelectionIntoArgument() ; this->SelectionIntoArgument();
break;
}
case 1:
{
/* nothing to do here */
break;
}
}
return; return;
} }
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1)
myEditCurrentArgument = GroupPoints->LineEdit1;
else if (send == GroupPoints->LineEdit2)
myEditCurrentArgument = GroupPoints->LineEdit2;
else
return;
GeometryGUI_Skeleton::LineEditReturnPressed();
return;
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::ActivateThisDialog()
{
GeometryGUI_Skeleton::ActivateThisDialog();
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
if(!mySimulationTopoDs.IsNull())
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
return;
}
//=================================================================================
// function : enterEvent [REDEFINED]
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::enterEvent(QEvent* e)
{
if (GroupConstructors->isEnabled())
return;
this->ActivateThisDialog();
return;
}
//================================================================================= //=================================================================================
// function : ValueChangedInSpinBox() // function : ValueChangedInSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::ValueChangedInSpinBox(double newValue) void GeometryGUI_BoxDlg::ValueChangedInSpinBox(double newValue)
{ {
if(myConstructorId != 1)
return ;
myGeomGUI->EraseSimulationShape(); myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
QObject* send = (QObject*)sender(); QObject* send = (QObject*)sender();
double vx, vy, vz; double vx, vy, vz;
if( send == SpinBox_DX ) { if(send == GroupDimensions->SpinBox_DX ) {
vx = newValue; vx = newValue;
vy = SpinBox_DY->GetValue() ; vy = GroupDimensions->SpinBox_DY->GetValue();
vz = SpinBox_DZ->GetValue() ; vz = GroupDimensions->SpinBox_DZ->GetValue();
} else if ( send == SpinBox_DY ) { } else if (send == GroupDimensions->SpinBox_DY) {
vx = SpinBox_DX->GetValue() ; vx = GroupDimensions->SpinBox_DX->GetValue();
vy = newValue; vy = newValue;
vz = SpinBox_DZ->GetValue() ; vz = GroupDimensions->SpinBox_DZ->GetValue();
} else if (send == SpinBox_DZ ) { } else if (send == GroupDimensions->SpinBox_DZ) {
vx = SpinBox_DX->GetValue() ; vx = GroupDimensions->SpinBox_DX->GetValue();
vy = SpinBox_DY->GetValue() ; vy = GroupDimensions->SpinBox_DY->GetValue();
vz = newValue; vz = newValue;
} }
@ -532,99 +396,6 @@ void GeometryGUI_BoxDlg::ValueChangedInSpinBox( double newValue )
} }
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if( send == LineEditPt1 )
myEditCurrentArgument = LineEditPt1 ;
else if ( send == LineEditPt2 )
myEditCurrentArgument = LineEditPt2 ;
else
return ;
/* User name of object input management */
/* If successfull the selection is changed and signal emitted... */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text() ;
QWidget* thisWidget = (QWidget*)this ;
if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
myEditCurrentArgument->setText( objectUserName ) ;
}
return ;
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::DeactivateActiveDialog()
{
if ( GroupConstructors->isEnabled() ) {
GroupConstructors->setEnabled(false) ;
GroupDimensions->setEnabled(false) ;
GroupButtons->setEnabled(false) ;
GroupPoints->setEnabled(false) ;
mySelection->ClearFilters() ;
disconnect( mySelection, 0, this, 0 );
myGeomGUI->SetActiveDialogBox(0) ;
myGeomGUI->EraseSimulationShape() ;
}
return ;
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::ActivateThisDialog()
{
/* Emit a signal to deactivate the active dialog */
myGeomGUI->EmitSignalDeactivateDialog() ;
GroupConstructors->setEnabled(true) ;
GroupDimensions->setEnabled(true) ;
GroupButtons->setEnabled(true) ;
GroupPoints->setEnabled(true) ;
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
if( !mySimulationTopoDs.IsNull() )
myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
return ;
}
//=================================================================================
// function : enterEvent [REDEFINED]
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::enterEvent(QEvent* e)
{
if ( GroupConstructors->isEnabled() )
return ;
ActivateThisDialog() ;
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::closeEvent( QCloseEvent* e )
{
this->ClickOnCancel() ; /* same than click on cancel button */
}
//================================================================================= //=================================================================================
// function : TestBoxDimensions() // function : TestBoxDimensions()
// purpose : // purpose :

View File

@ -29,37 +29,17 @@
#ifndef DIALOGBOX_BOX_H #ifndef DIALOGBOX_BOX_H
#define DIALOGBOX_BOX_H #define DIALOGBOX_BOX_H
#include "SALOME_Selection.h" #include "GeometryGUI_Skeleton.h"
#include "GEOM_ShapeTypeFilter.hxx" #include "GeometryGUI_2Sel_QTD.h"
#include "GeometryGUI_3Spin.h"
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <Precision.hxx>
#include <qvariant.h>
#include <qdialog.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QButtonGroup;
class QFrame;
class QGroupBox;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QLabel;
class QPushButton;
class GeometryGUI_SpinBox;
class GeometryGUI;
//================================================================================= //=================================================================================
// class : GeometryGUI_BoxDlg // class : GeometryGUI_BoxDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GeometryGUI_BoxDlg : public QDialog class GeometryGUI_BoxDlg : public GeometryGUI_Skeleton
{ {
Q_OBJECT Q_OBJECT
@ -68,72 +48,32 @@ public:
~GeometryGUI_BoxDlg(); ~GeometryGUI_BoxDlg();
private : private :
void closeEvent( QCloseEvent* e ) ;
void enterEvent( QEvent* e );
void Init(SALOME_Selection* Sel); void Init(SALOME_Selection* Sel);
void enterEvent(QEvent* e);
bool TestBoxDimensions(gp_Pnt P1, gp_Pnt P2); bool TestBoxDimensions(gp_Pnt P1, gp_Pnt P2);
GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ double step;
GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ int myConstructorId;
TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */ Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */
SALOME_Selection* mySelection ; /* User shape selection */
gp_Pnt myPoint1; /* Points containing the vector */ gp_Pnt myPoint1; /* Points containing the vector */
gp_Pnt myPoint2; gp_Pnt myPoint2;
bool myOkPoint1; /* true when myPoint is defined */ bool myOkPoint1; /* true when myPoint is defined */
bool myOkPoint2; bool myOkPoint2;
int myConstructorId ; /* Current constructor id = radio button id */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */
GeometryGUI_2Sel_QTD* GroupPoints;
QButtonGroup* GroupConstructors; GeometryGUI_3Spin* GroupDimensions;
QRadioButton* Constructor1;
QRadioButton* Constructor2;
QGroupBox* GroupButtons;
QPushButton* buttonApply;
QPushButton* buttonOk;
QPushButton* buttonCancel;
QGroupBox* GroupPoints;
QPushButton* SelectButtonPt1;
QPushButton* SelectButtonPt2;
QLineEdit* LineEditPt2;
QLineEdit* LineEditPt1;
QLabel* TextLabelPt1;
QLabel* TextLabelPt2;
QGroupBox* GroupDimensions ;
QLabel* TextLabel_DX ;
QLabel* TextLabel_DY ;
QLabel* TextLabel_DZ ;
GeometryGUI_SpinBox* SpinBox_DX ;
GeometryGUI_SpinBox* SpinBox_DY ;
GeometryGUI_SpinBox* SpinBox_DZ ;
private slots: private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void LineEditReturnPressed() ;
void DeactivateActiveDialog() ;
void ActivateThisDialog(); void ActivateThisDialog();
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ConstructorsClicked(int constructorId);
void ValueChangedInSpinBox(double newValue); void ValueChangedInSpinBox(double newValue);
protected:
QGridLayout* GeometryGUI_BoxDlgLayout;
QGridLayout* GroupConstructorsLayout;
QGridLayout* GroupButtonsLayout;
QGridLayout* GroupPointsLayout;
QGridLayout* GroupDimensionsLayout;
}; };
#endif // DIALOGBOX_BOX_H #endif // DIALOGBOX_BOX_H

View File

@ -30,25 +30,7 @@ using namespace std;
#include "GeometryGUI_FuseDlg.h" #include "GeometryGUI_FuseDlg.h"
#include "GeometryGUI.h" #include "GeometryGUI.h"
#include "QAD_Application.h"
#include "QAD_Desktop.h" #include "QAD_Desktop.h"
#include "utilities.h"
#include <qbuttongroup.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qevent.h>
//================================================================================= //=================================================================================
// class : GeometryGUI_FuseDlg() // class : GeometryGUI_FuseDlg()
@ -58,107 +40,28 @@ using namespace std;
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
//================================================================================= //=================================================================================
GeometryGUI_FuseDlg::GeometryGUI_FuseDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) GeometryGUI_FuseDlg::GeometryGUI_FuseDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_FUSE"))); QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_FUSE")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT"))); QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
if ( !name )
setName( "GeometryGUI_FuseDlg" );
resize( 322, 220 );
setCaption(tr("GEOM_FUSE_TITLE")); setCaption(tr("GEOM_FUSE_TITLE"));
setSizeGripEnabled( TRUE );
GeometryGUI_FuseDlgLayout = new QGridLayout( this );
GeometryGUI_FuseDlgLayout->setSpacing( 6 );
GeometryGUI_FuseDlgLayout->setMargin( 11 );
/***************************************************************/ /***************************************************************/
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
GroupConstructors->setTitle(tr("GEOM_FUSE")); GroupConstructors->setTitle(tr("GEOM_FUSE"));
GroupConstructors->setExclusive( TRUE ); RadioButton1->setPixmap(image0);
GroupConstructors->setColumnLayout(0, Qt::Vertical ); RadioButton2->close(TRUE);
GroupConstructors->layout()->setSpacing( 0 ); RadioButton3->close(TRUE);
GroupConstructors->layout()->setMargin( 0 );
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
GroupConstructorsLayout->setSpacing( 6 );
GroupConstructorsLayout->setMargin( 11 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer, 0, 1 );
Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
Constructor1->setText( tr( "" ) );
Constructor1->setPixmap( image0 );
Constructor1->setChecked( TRUE );
Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
GeometryGUI_FuseDlgLayout->addWidget( GroupConstructors, 0, 0 );
/***************************************************************/ GroupFuse = new GeometryGUI_2Sel_QTD(this, "GroupFuse");
GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); GroupFuse->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupConstructor1->setTitle( tr( "GEOM_ARGUMENTS" ) ); GroupFuse->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
GroupConstructor1->setColumnLayout(0, Qt::Vertical ); GroupFuse->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
GroupConstructor1->layout()->setSpacing( 0 ); GroupFuse->PushButton1->setPixmap(image1);
GroupConstructor1->layout()->setMargin( 0 ); GroupFuse->PushButton2->setPixmap(image1);
GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() );
GroupConstructor1Layout->setAlignment( Qt::AlignTop );
GroupConstructor1Layout->setSpacing( 6 );
GroupConstructor1Layout->setMargin( 11 );
LineEditC1A2Shape = new QLineEdit( GroupConstructor1, "LineEditC1A2Shape" );
LineEditC1A2Shape->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2Shape->sizePolicy().hasHeightForWidth() ) );
GroupConstructor1Layout->addWidget( LineEditC1A2Shape, 1, 2 );
LineEditC1A1Shape = new QLineEdit( GroupConstructor1, "LineEditC1A1Shape" );
LineEditC1A1Shape->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1Shape->sizePolicy().hasHeightForWidth() ) );
GroupConstructor1Layout->addWidget( LineEditC1A1Shape, 0, 2 );
SelectButtonC1A1Shape = new QPushButton( GroupConstructor1, "SelectButtonC1A1Shape" );
SelectButtonC1A1Shape->setText( tr( "" ) );
SelectButtonC1A1Shape->setPixmap( image1 );
GroupConstructor1Layout->addWidget( SelectButtonC1A1Shape, 0, 1 );
SelectButtonC1A2Shape = new QPushButton( GroupConstructor1, "SelectButtonC1A2Shape" );
SelectButtonC1A2Shape->setText( tr( "" ) );
SelectButtonC1A2Shape->setPixmap( image1 );
GroupConstructor1Layout->addWidget( SelectButtonC1A2Shape, 1, 1 );
TextLabelC1A2Shape = new QLabel( GroupConstructor1, "TextLabelC1A2Shape" );
TextLabelC1A2Shape->setText( tr( "GEOM_OBJECT_I" ).arg("2") );
TextLabelC1A2Shape->setMinimumSize( QSize( 50, 0 ) );
TextLabelC1A2Shape->setFrameShape( QLabel::NoFrame );
TextLabelC1A2Shape->setFrameShadow( QLabel::Plain );
GroupConstructor1Layout->addWidget( TextLabelC1A2Shape, 1, 0 );
TextLabelC1A1Shape = new QLabel( GroupConstructor1, "TextLabelC1A1Shape" );
TextLabelC1A1Shape->setText( tr( "GEOM_OBJECT_I" ).arg("1") );
TextLabelC1A1Shape->setMinimumSize( QSize( 50, 0 ) );
TextLabelC1A1Shape->setFrameShape( QLabel::NoFrame );
TextLabelC1A1Shape->setFrameShadow( QLabel::Plain );
GroupConstructor1Layout->addWidget( TextLabelC1A1Shape, 0, 0 );
GeometryGUI_FuseDlgLayout->addWidget( GroupConstructor1, 1, 0 );
Layout1->addWidget(GroupFuse, 1, 0);
/***************************************************************/ /***************************************************************/
GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
GroupButtons->setTitle( tr( "" ) );
GroupButtons->setColumnLayout(0, Qt::Vertical );
GroupButtons->layout()->setSpacing( 0 );
GroupButtons->layout()->setMargin( 0 );
GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->setSpacing( 6 );
GroupButtonsLayout->setMargin( 11 );
buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
buttonApply->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
QSpacerItem* spacer_1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupButtonsLayout->addItem( spacer_1, 0, 2 );
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
buttonOk->setText( tr( "GEOM_BUT_OK" ) );
buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
GeometryGUI_FuseDlgLayout->addWidget( GroupButtons, 2, 0 );
/* Initialisation */ /* Initialisation */
Init(Sel); Init(Sel);
@ -172,88 +75,42 @@ GeometryGUI_FuseDlg::GeometryGUI_FuseDlg( QWidget* parent, const char* name, SAL
GeometryGUI_FuseDlg::~GeometryGUI_FuseDlg() GeometryGUI_FuseDlg::~GeometryGUI_FuseDlg()
{ {
/* no need to delete child widgets, Qt does it all for us */ /* no need to delete child widgets, Qt does it all for us */
this->destroy(TRUE, TRUE) ;
} }
//================================================================================= //=================================================================================
// function : Init() // function : Init()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_FuseDlg::Init(SALOME_Selection* Sel) void GeometryGUI_FuseDlg::Init(SALOME_Selection* Sel)
{ {
mySelection = Sel ; /* init variables */
myEditCurrentArgument = GroupFuse->LineEdit1;
myShape1.Nullify(); myShape1.Nullify();
myShape2.Nullify(); myShape2.Nullify();
myConstructorId = 0 ;
myGeomGUI = GeometryGUI::GetGeometryGUI() ;
GroupConstructor1->show();
myConstructorId = 0 ;
myEditCurrentArgument = LineEditC1A1Shape ;
Constructor1->setChecked( TRUE );
myOkShape1 = myOkShape2 = false; myOkShape1 = myOkShape2 = false;
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
myGeom = GEOM::GEOM_Gen::_narrow(comp);
// TODO previous selection into argument ?
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
connect( LineEditC1A1Shape, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupFuse->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect( LineEditC1A2Shape, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupFuse->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupFuse->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupFuse->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( SelectButtonC1A1Shape, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
connect( SelectButtonC1A2Shape, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument()));
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
/* to close dialog if study change */
connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
/* Move widget on the botton right corner of main widget */ /* displays Dialog */
int x, y ; GroupFuse->show();
myGeomGUI->DefineDlgPosition( this, x, y ) ; this->show();
this->move( x, y ) ;
this->show() ; /* Displays Dialog */
return; return;
} }
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
void GeometryGUI_FuseDlg::ConstructorsClicked(int constructorId)
{
GeometryGUI::GetGeometryGUI()->EraseSimulationShape() ;
switch (constructorId)
{
case 0:
{
GroupConstructor1->show();
myConstructorId = constructorId ;
myEditCurrentArgument = LineEditC1A1Shape ;
LineEditC1A2Shape->setText(tr("")) ;
Constructor1->setChecked( TRUE );
myOkShape1 = myOkShape2 = false ;
break;
}
}
return ;
}
//================================================================================= //=================================================================================
// function : ClickOnOk() // function : ClickOnOk()
// purpose : // purpose :
@ -261,76 +118,41 @@ void GeometryGUI_FuseDlg::ConstructorsClicked(int constructorId)
void GeometryGUI_FuseDlg::ClickOnOk() void GeometryGUI_FuseDlg::ClickOnOk()
{ {
this->ClickOnApply(); this->ClickOnApply();
this->ClickOnCancel() ; ClickOnCancel();
return ; return ;
} }
//================================================================================= //=================================================================================
// function : ClickOnApply() // function : ClickOnApply()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_FuseDlg::ClickOnApply() void GeometryGUI_FuseDlg::ClickOnApply()
{ {
myGeomGUI->EraseSimulationShape() ;
myGeomGUI->GetDesktop()->putInfo(tr("")); myGeomGUI->GetDesktop()->putInfo(tr(""));
switch(myConstructorId) if(myOkShape1 && myOkShape2)
{
case 0 :
{
if(myOkShape1 && myOkShape2) {
myGeomGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3); myGeomGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
}
break ;
}
}
// accept();
return; return;
} }
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_FuseDlg::ClickOnCancel()
{
myGeomGUI->EraseSimulationShape() ;
disconnect( mySelection, 0, this, 0 );
myGeomGUI->ResetState() ;
reject() ;
return ;
}
//================================================================================= //=================================================================================
// function : SelectionIntoArgument() // function : SelectionIntoArgument()
// purpose : Called when selection has changed // purpose : Called when selection has changed
//================================================================================= //=================================================================================
void GeometryGUI_FuseDlg::SelectionIntoArgument() void GeometryGUI_FuseDlg::SelectionIntoArgument()
{ {
myEditCurrentArgument->setText("");
myEditCurrentArgument->setText("") ; /* by default */ QString aString = "";
QString aString = ""; /* the name of selection */
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
if(nbSel != 1) { if(nbSel != 1) {
switch (myConstructorId) if(myEditCurrentArgument == GroupFuse->LineEdit1)
{
case 0:
{
if ( myEditCurrentArgument == LineEditC1A1Shape ) {
myOkShape1 = false; myOkShape1 = false;
} else if( myEditCurrentArgument == GroupFuse->LineEdit2)
else if ( myEditCurrentArgument == LineEditC1A2Shape ) {
myOkShape2 = false; myOkShape2 = false;
}
break ;
}
}
return; return;
} }
@ -342,23 +164,22 @@ void GeometryGUI_FuseDlg::SelectionIntoArgument()
if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
return; return;
if ( myEditCurrentArgument == LineEditC1A1Shape ) { if(myEditCurrentArgument == GroupFuse->LineEdit1) {
myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; return;
myShape1 = S; myShape1 = S;
LineEditC1A1Shape->setText(aString) ; GroupFuse->LineEdit1->setText(aString);
myOkShape1 = true; myOkShape1 = true;
} }
else if ( myEditCurrentArgument == LineEditC1A2Shape ) { else if(myEditCurrentArgument == GroupFuse->LineEdit2) {
myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult); myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; return;
myShape2 = S; myShape2 = S;
LineEditC1A2Shape->setText(aString) ; GroupFuse->LineEdit2->setText(aString);
myOkShape2 = true; myOkShape2 = true;
} }
return; return;
} }
@ -371,27 +192,20 @@ void GeometryGUI_FuseDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
switch (myConstructorId) if(send == GroupFuse->PushButton1) {
{ GroupFuse->LineEdit1->setFocus();
case 0: /* default constructor */ myEditCurrentArgument = GroupFuse->LineEdit1;
{
if( send == SelectButtonC1A1Shape ) {
LineEditC1A1Shape->setFocus() ;
myEditCurrentArgument = LineEditC1A1Shape ;
} }
else if(send == SelectButtonC1A2Shape) { else if(send == GroupFuse->PushButton2) {
LineEditC1A2Shape->setFocus() ; GroupFuse->LineEdit2->setFocus();
myEditCurrentArgument = LineEditC1A2Shape; myEditCurrentArgument = GroupFuse->LineEdit2;
} }
SelectionIntoArgument(); SelectionIntoArgument();
break;
}
}
return; return;
} }
//================================================================================= //=================================================================================
// function : LineEditReturnPressed() // function : LineEditReturnPressed()
// purpose : // purpose :
@ -399,79 +213,38 @@ void GeometryGUI_FuseDlg::SetEditCurrentArgument()
void GeometryGUI_FuseDlg::LineEditReturnPressed() void GeometryGUI_FuseDlg::LineEditReturnPressed()
{ {
QLineEdit* send = (QLineEdit*)sender(); QLineEdit* send = (QLineEdit*)sender();
if( send == LineEditC1A1Shape ) if(send == GroupFuse->LineEdit1)
myEditCurrentArgument = LineEditC1A1Shape ; myEditCurrentArgument = GroupFuse->LineEdit1;
else if ( send == LineEditC1A2Shape ) else if(send == GroupFuse->LineEdit2)
myEditCurrentArgument = LineEditC1A2Shape ; myEditCurrentArgument = GroupFuse->LineEdit2;
else else
return; return;
/* User name of object input management */ GeometryGUI_Skeleton::LineEditReturnPressed();
/* If successfull the selection is changed and signal emitted... */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text() ;
QWidget* thisWidget = (QWidget*)this ;
if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
myEditCurrentArgument->setText( objectUserName ) ;
}
return; return;
} }
//=================================================================================
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
void GeometryGUI_FuseDlg::DeactivateActiveDialog()
{
if ( GroupConstructors->isEnabled() ) {
GroupConstructors->setEnabled(false) ;
GroupConstructor1->setEnabled(false) ;
GroupButtons->setEnabled(false) ;
disconnect( mySelection, 0, this, 0 );
}
return ;
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void GeometryGUI_FuseDlg::closeEvent( QCloseEvent* e )
{
this->ClickOnCancel() ; /* same than click on cancel button */
}
//=================================================================================
// function : enterEvent()
// purpose : when mouse enter onto the QWidget
//=================================================================================
void GeometryGUI_FuseDlg::enterEvent( QEvent * )
{
if ( GroupConstructors->isEnabled() )
return ;
ActivateThisDialog() ;
}
//================================================================================= //=================================================================================
// function : ActivateThisDialog() // function : ActivateThisDialog()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_FuseDlg::ActivateThisDialog() void GeometryGUI_FuseDlg::ActivateThisDialog()
{ {
/* Emit a signal to deactivate any active dialog */ GeometryGUI_Skeleton::ActivateThisDialog();
myGeomGUI->EmitSignalDeactivateDialog() ;
GroupConstructors->setEnabled(true) ;
GroupConstructor1->setEnabled(true) ;
GroupButtons->setEnabled(true) ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
return; return;
} }
//=================================================================================
// function : enterEvent()
// purpose : when mouse enter onto the QWidget
//=================================================================================
void GeometryGUI_FuseDlg::enterEvent(QEvent* e)
{
if (GroupConstructors->isEnabled())
return;
this->ActivateThisDialog();
return;
}

View File

@ -29,32 +29,16 @@
#ifndef DIALOGBOX_FUSE_H #ifndef DIALOGBOX_FUSE_H
#define DIALOGBOX_FUSE_H #define DIALOGBOX_FUSE_H
#include "SALOME_Selection.h" #include "GeometryGUI_Skeleton.h"
#include "GEOM_ShapeTypeFilter.hxx" #include "GeometryGUI_2Sel_QTD.h"
#include <BRepAlgoAPI_Fuse.hxx> #include <BRepAlgoAPI_Fuse.hxx>
#include <qvariant.h>
#include <qdialog.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QButtonGroup;
class QFrame;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class GeometryGUI;
//================================================================================= //=================================================================================
// class : GeometryGUI_FuseDlg // class : GeometryGUI_FuseDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GeometryGUI_FuseDlg : public QDialog class GeometryGUI_FuseDlg : public GeometryGUI_Skeleton
{ {
Q_OBJECT Q_OBJECT
@ -63,57 +47,26 @@ public:
~GeometryGUI_FuseDlg(); ~GeometryGUI_FuseDlg();
private: private:
void Init(SALOME_Selection* Sel); void Init(SALOME_Selection* Sel);
void closeEvent( QCloseEvent* e ) ; void enterEvent(QEvent* e);
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
SALOME_Selection* mySelection ; /* User shape selection */
TopoDS_Shape myShape1; /* topology used to fuse */ TopoDS_Shape myShape1; /* topology used to fuse */
TopoDS_Shape myShape2; /* topology used to fuse */ TopoDS_Shape myShape2; /* topology used to fuse */
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */ GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */ GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
bool myOkShape1 ; bool myOkShape1; /* to check when arguments are defined */
bool myOkShape2 ; /* to check when arguments are defined */ bool myOkShape2;
int myConstructorId ; /* Current constructor id = radio button id */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
GeometryGUI_2Sel_QTD* GroupFuse ;
QButtonGroup* GroupConstructors;
QRadioButton* Constructor1;
QGroupBox* GroupConstructor1;
QLineEdit* LineEditC1A1Shape;
QLineEdit* LineEditC1A2Shape;
QPushButton* SelectButtonC1A1Shape;
QPushButton* SelectButtonC1A2Shape;
QLabel* TextLabelC1A2Shape;
QLabel* TextLabelC1A1Shape;
QGroupBox* GroupButtons;
QPushButton* buttonApply;
QPushButton* buttonOk;
QPushButton* buttonCancel;
private slots: private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void SetEditCurrentArgument() ; void SetEditCurrentArgument() ;
void SelectionIntoArgument() ; void SelectionIntoArgument() ;
void LineEditReturnPressed() ; void LineEditReturnPressed() ;
void DeactivateActiveDialog() ;
void ActivateThisDialog() ; void ActivateThisDialog() ;
protected:
QGridLayout* GeometryGUI_FuseDlgLayout;
QGridLayout* GroupConstructorsLayout;
QGridLayout* GroupButtonsLayout;
QGridLayout* GroupConstructor1Layout;
}; };
#endif // DIALOGBOX_FUSE_H #endif // DIALOGBOX_FUSE_H

View File

@ -29,35 +29,16 @@
using namespace std; using namespace std;
#include "GeometryGUI_PlaneDlg.h" #include "GeometryGUI_PlaneDlg.h"
#include "GeometryGUI.h" #include <Precision.hxx>
#include "QAD_Application.h" #include <BRepBuilderAPI_MakeFace.hxx>
#include "QAD_Desktop.h"
#include "QAD_Config.h"
#include "utilities.h"
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <Precision.hxx>
#include <qbuttongroup.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qlabel.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qvalidator.h>
#include <qevent.h>
#include "GeometryGUI.h"
#include "QAD_Desktop.h"
#include "QAD_Config.h"
//================================================================================= //=================================================================================
// class : GeometryGUI_PlaneDlg() // class : GeometryGUI_PlaneDlg()
@ -67,254 +48,49 @@ using namespace std;
// TRUE to construct a modal dialog. // TRUE to construct a modal dialog.
//================================================================================= //=================================================================================
GeometryGUI_PlaneDlg::GeometryGUI_PlaneDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl) GeometryGUI_PlaneDlg::GeometryGUI_PlaneDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
/***************************************************************/
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_PV"))); QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_PV")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT"))); QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_DXYZ")));
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_PLANE_DXYZ"))); QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_FACE")));
QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_PLANE_FACE"))); QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
if ( !name )
setName( "GeometryGUI_PlaneDlg" );
resize( 365, 220 );
setCaption(tr("GEOM_PLANE_TITLE")); setCaption(tr("GEOM_PLANE_TITLE"));
setSizeGripEnabled( TRUE );
GeometryGUI_PlaneDlgLayout = new QGridLayout( this );
GeometryGUI_PlaneDlgLayout->setSpacing( 6 );
GeometryGUI_PlaneDlgLayout->setMargin( 11 );
/***************************************************************/ /***************************************************************/
GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
GroupButtons->setTitle( tr( "" ) );
GroupButtons->setColumnLayout(0, Qt::Vertical );
GroupButtons->layout()->setSpacing( 0 );
GroupButtons->layout()->setMargin( 0 );
GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->setSpacing( 6 );
GroupButtonsLayout->setMargin( 11 );
buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
buttonApply->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupButtonsLayout->addItem( spacer_9, 0, 2 );
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
buttonOk->setText( tr( "GEOM_BUT_OK" ) );
buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
GeometryGUI_PlaneDlgLayout->addWidget( GroupButtons, 2, 0 );
/***************************************************************/
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
GroupConstructors->setTitle(tr("GEOM_PLANE")); GroupConstructors->setTitle(tr("GEOM_PLANE"));
GroupConstructors->setExclusive( TRUE ); RadioButton1->setPixmap(image0);
GroupConstructors->setColumnLayout(0, Qt::Vertical ); RadioButton2->setPixmap(image1);
GroupConstructors->layout()->setSpacing( 0 ); RadioButton3->setPixmap(image2);
GroupConstructors->layout()->setMargin( 0 );
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
GroupConstructorsLayout->setSpacing( 6 );
GroupConstructorsLayout->setMargin( 11 );
Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
Constructor1->setText( tr( "" ) );
Constructor1->setPixmap( image0 );
Constructor1->setChecked( TRUE );
Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
Constructor1->setMinimumSize( QSize( 50, 0 ) );
GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" );
Constructor2->setText( tr( "" ) );
Constructor2->setPixmap( image2 );
Constructor2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor2->sizePolicy().hasHeightForWidth() ) );
Constructor2->setMinimumSize( QSize( 50, 0 ) );
GroupConstructorsLayout->addWidget( Constructor2, 0, 2 );
QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer_2, 0, 3 );
QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer_3, 0, 1 );
Constructor3 = new QRadioButton( GroupConstructors, "Constructor3" );
Constructor3->setText( tr( "" ) );
Constructor3->setPixmap( image3 );
Constructor3->setMinimumSize( QSize( 50, 0 ) );
GroupConstructorsLayout->addWidget( Constructor3, 0, 4 );
QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer_4, 0, 5 );
GeometryGUI_PlaneDlgLayout->addWidget( GroupConstructors, 0, 0 );
GroupPointDirection = new GeometryGUI_2Sel1Spin(this, "GroupPointDirection");
GroupPointDirection->GroupBox1->setTitle(tr("GEOM_PLANE_PV"));
GroupPointDirection->TextLabel1->setText(tr("GEOM_POINT"));
GroupPointDirection->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupPointDirection->TextLabel3->setText(tr("GEOM_PLANE_SIZE"));
GroupPointDirection->PushButton1->setPixmap(image3);
GroupPointDirection->PushButton2->setPixmap(image3);
GroupPointPlusCoordinates = new GeometryGUI_1Sel4Spin(this, "GroupPointPlusCoordinates" );
GroupPointPlusCoordinates->GroupBox1->setTitle(tr("GEOM_PLANE_PVC"));
GroupPointPlusCoordinates->TextLabel1->setText(tr("GEOM_POINT"));
GroupPointPlusCoordinates->TextLabel2->setText(tr("GEOM_COOR"));
GroupPointPlusCoordinates->TextLabel3->setText(tr("GEOM_DX"));
GroupPointPlusCoordinates->TextLabel4->setText(tr("GEOM_DY"));
GroupPointPlusCoordinates->TextLabel5->setText(tr("GEOM_DZ"));
GroupPointPlusCoordinates->TextLabel6->setText(tr("GEOM_PLANE_SIZE"));
GroupPointPlusCoordinates->PushButton1->setPixmap(image3);
GroupFace = new GeometryGUI_1Sel1Spin(this, "GroupFace");
GroupFace->GroupBox1->setTitle(tr("GEOM_FACE"));
GroupFace->TextLabel1->setText(tr("GEOM_SELECTION"));
GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE"));
GroupFace->PushButton1->setPixmap(image3);
Layout1->addWidget(GroupPointDirection, 1, 0);
Layout1->addWidget(GroupPointPlusCoordinates, 1, 0);
Layout1->addWidget(GroupFace, 1, 0);
/***************************************************************/ /***************************************************************/
GroupPointDirection = new QGroupBox( this, "GroupPointDirection" );
GroupPointDirection->setTitle( tr( "GEOM_PLANE_PV" ) );
GroupPointDirection->setColumnLayout(0, Qt::Vertical );
GroupPointDirection->layout()->setSpacing( 0 );
GroupPointDirection->layout()->setMargin( 0 );
GroupPointDirectionLayout = new QGridLayout( GroupPointDirection->layout() );
GroupPointDirectionLayout->setAlignment( Qt::AlignTop );
GroupPointDirectionLayout->setSpacing( 6 );
GroupPointDirectionLayout->setMargin( 11 );
LineEditDirection = new QLineEdit( GroupPointDirection, "LineEditDirection" );
LineEditDirection->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditDirection->sizePolicy().hasHeightForWidth() ) );
GroupPointDirectionLayout->addWidget( LineEditDirection, 1, 2 );
LineEditPt1 = new QLineEdit( GroupPointDirection, "LineEditPt1" );
LineEditPt1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditPt1->sizePolicy().hasHeightForWidth() ) );
GroupPointDirectionLayout->addWidget( LineEditPt1, 0, 2 );
SelectButtonPt1 = new QPushButton( GroupPointDirection, "SelectButtonPt1" );
SelectButtonPt1->setText( tr( "" ) );
SelectButtonPt1->setPixmap( image1 );
GroupPointDirectionLayout->addWidget( SelectButtonPt1, 0, 1 );
SelectButtonDirection = new QPushButton( GroupPointDirection, "SelectButtonDirection" );
SelectButtonDirection->setText( tr( "" ) );
SelectButtonDirection->setPixmap( image1 );
GroupPointDirectionLayout->addWidget( SelectButtonDirection, 1, 1 );
TextLabelDirection = new QLabel( GroupPointDirection, "TextLabelDirection" );
TextLabelDirection->setText( tr( "GEOM_VECTOR" ) );
TextLabelDirection->setMinimumSize( QSize( 50, 0 ) );
TextLabelDirection->setFrameShape( QLabel::NoFrame );
TextLabelDirection->setFrameShadow( QLabel::Plain );
GroupPointDirectionLayout->addWidget( TextLabelDirection, 1, 0 );
TextLabelPt1 = new QLabel( GroupPointDirection, "TextLabelPt1" );
TextLabelPt1->setText( tr( "GEOM_POINT" ) );
TextLabelPt1->setMinimumSize( QSize( 50, 0 ) );
TextLabelPt1->setFrameShape( QLabel::NoFrame );
TextLabelPt1->setFrameShadow( QLabel::Plain );
GroupPointDirectionLayout->addWidget( TextLabelPt1, 0, 0 );
SpinBox_C1Size = new GeometryGUI_SpinBox( GroupPointDirection, "SpinBox_C1Size" );
GroupPointDirectionLayout->addWidget( SpinBox_C1Size, 2, 2 );
TextLabelC1Size = new QLabel( GroupPointDirection, "TextLabelC1Size" );
TextLabelC1Size->setText( tr( "GEOM_PLANE_SIZE" ) );
TextLabelC1Size->setMinimumSize( QSize( 60, 0 ) );
GroupPointDirectionLayout->addWidget( TextLabelC1Size, 2, 0 );
GeometryGUI_PlaneDlgLayout->addWidget( GroupPointDirection, 1, 0 );
/***************************************************************/
GroupPointPlusCoordinates = new QGroupBox( this, "GroupPointPlusCoordinates" );
GroupPointPlusCoordinates->setTitle( tr( "GEOM_PLANE_PVC" ) );
GroupPointPlusCoordinates->setColumnLayout(0, Qt::Vertical );
GroupPointPlusCoordinates->layout()->setSpacing( 0 );
GroupPointPlusCoordinates->layout()->setMargin( 0 );
GroupPointPlusCoordinatesLayout = new QGridLayout( GroupPointPlusCoordinates->layout() );
GroupPointPlusCoordinatesLayout->setAlignment( Qt::AlignTop );
GroupPointPlusCoordinatesLayout->setSpacing( 6 );
GroupPointPlusCoordinatesLayout->setMargin( 11 );
LineEditPt2 = new QLineEdit( GroupPointPlusCoordinates, "LineEditPt2" );
LineEditPt2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditPt2->sizePolicy().hasHeightForWidth() ) );
GroupPointPlusCoordinatesLayout->addMultiCellWidget( LineEditPt2, 0, 0, 5, 8 );
SelectButtonPt2 = new QPushButton( GroupPointPlusCoordinates, "SelectButtonPt2" );
SelectButtonPt2->setText( tr( "" ) );
SelectButtonPt2->setPixmap( image1 );
SelectButtonPt2->setMaximumSize( QSize( 28, 32767 ) );
GroupPointPlusCoordinatesLayout->addWidget( SelectButtonPt2, 0, 4 );
TextLabelPt2 = new QLabel( GroupPointPlusCoordinates, "TextLabelPt2" );
TextLabelPt2->setText( tr( "GEOM_POINT" ) );
TextLabelPt2->setMinimumSize( QSize( 50, 0 ) );
TextLabelPt2->setFrameShape( QLabel::NoFrame );
TextLabelPt2->setFrameShadow( QLabel::Plain );
GroupPointPlusCoordinatesLayout->addMultiCellWidget( TextLabelPt2, 0, 0, 0, 3 );
SpinBox_DX = new GeometryGUI_SpinBox( GroupPointPlusCoordinates, "SpinBox_DX" );
SpinBox_DX->setMinimumSize( QSize( 50, 0 ) );
SpinBox_DX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_DX->sizePolicy().hasHeightForWidth() ) );
GroupPointPlusCoordinatesLayout->addMultiCellWidget( SpinBox_DX, 1, 1, 3, 4 );
SpinBox_DY = new GeometryGUI_SpinBox( GroupPointPlusCoordinates, "SpinBox_DY" );
SpinBox_DY->setMinimumSize( QSize( 50, 0 ) );
SpinBox_DY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_DY->sizePolicy().hasHeightForWidth() ) );
GroupPointPlusCoordinatesLayout->addWidget( SpinBox_DY, 1, 6 );
SpinBox_DZ = new GeometryGUI_SpinBox( GroupPointPlusCoordinates, "SpinBox_DZ" );
SpinBox_DZ->setMinimumSize( QSize( 50, 0 ) );
SpinBox_DZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_DZ->sizePolicy().hasHeightForWidth() ) );
GroupPointPlusCoordinatesLayout->addWidget( SpinBox_DZ, 1, 8 );
TextLabel_DX = new QLabel( GroupPointPlusCoordinates, "TextLabel_DX" );
TextLabel_DX->setText( tr( "GEOM_DX" ) );
GroupPointPlusCoordinatesLayout->addWidget( TextLabel_DX, 1, 2 );
TextLabel_DY = new QLabel( GroupPointPlusCoordinates, "TextLabel_DY" );
TextLabel_DY->setText( tr( "GEOM_DY" ) );
GroupPointPlusCoordinatesLayout->addWidget( TextLabel_DY, 1, 5 );
TextLabel_DZ = new QLabel( GroupPointPlusCoordinates, "TextLabel_DZ" );
TextLabel_DZ->setText( tr( "GEOM_DZ" ) );
GroupPointPlusCoordinatesLayout->addWidget( TextLabel_DZ, 1, 7 );
TextLabelCoordinates = new QLabel( GroupPointPlusCoordinates, "TextLabelCoordinates" );
TextLabelCoordinates->setText( tr( "GEOM_COOR" ) );
TextLabelCoordinates->setMinimumSize( QSize( 50, 0 ) );
TextLabelCoordinates->setFrameShape( QLabel::NoFrame );
TextLabelCoordinates->setFrameShadow( QLabel::Plain );
GroupPointPlusCoordinatesLayout->addWidget( TextLabelCoordinates, 1, 0 );
TextLabelC2Size = new QLabel( GroupPointPlusCoordinates, "TextLabelC2Size" );
TextLabelC2Size->setText( tr( "GEOM_PLANE_SIZE" ) );
TextLabelC2Size->setMinimumSize( QSize( 60, 0 ) );
GroupPointPlusCoordinatesLayout->addMultiCellWidget( TextLabelC2Size, 2, 2, 0, 1 );
SpinBox_C2Size = new GeometryGUI_SpinBox( GroupPointPlusCoordinates, "SpinBox_C2Size" );
GroupPointPlusCoordinatesLayout->addMultiCellWidget( SpinBox_C2Size, 2, 2, 5, 8 );
QSpacerItem* spacer_c = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupPointPlusCoordinatesLayout->addMultiCell( spacer_c, 2, 2, 2, 4 );
QSpacerItem* spacer_d = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupPointPlusCoordinatesLayout->addItem( spacer_d, 1, 1 );
GeometryGUI_PlaneDlgLayout->addWidget( GroupPointPlusCoordinates, 1, 0 );
/***************************************************************/
GroupFace = new QGroupBox( this, "GroupFace" );
GroupFace->setTitle( tr( "GEOM_FACE" ) );
GroupFace->setColumnLayout(0, Qt::Vertical );
GroupFace->layout()->setSpacing( 0 );
GroupFace->layout()->setMargin( 0 );
GroupFaceLayout = new QGridLayout( GroupFace->layout() );
GroupFaceLayout->setAlignment( Qt::AlignTop );
GroupFaceLayout->setSpacing( 6 );
GroupFaceLayout->setMargin( 11 );
TextLabelFace = new QLabel( GroupFace, "TextLabelFace" );
TextLabelFace->setFrameShadow( QLabel::Plain );
TextLabelFace->setFrameShape( QLabel::NoFrame );
TextLabelFace->setText( tr( "GEOM_SELECTION" ) );
TextLabelFace->setMinimumSize( QSize( 50, 0 ) );
GroupFaceLayout->addMultiCellWidget( TextLabelFace, 0, 0, 0, 1 );
SelectButtonFace = new QPushButton( GroupFace, "SelectButtonFace" );
SelectButtonFace->setText( tr( "" ) );
SelectButtonFace->setPixmap( image1 );
SelectButtonFace->setMaximumSize( QSize( 28, 32767 ) );
GroupFaceLayout->addWidget( SelectButtonFace, 0, 2 );
LineEditFace = new QLineEdit( GroupFace, "LineEditFace" );
LineEditFace->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditFace->sizePolicy().hasHeightForWidth() ) );
GroupFaceLayout->addWidget( LineEditFace, 0, 3 );
TextLabelC3Size = new QLabel( GroupFace, "TextLabelC3Size" );
TextLabelC3Size->setText( tr( "GEOM_PLANE_SIZE" ) );
TextLabelC3Size->setMinimumSize( QSize( 60, 0 ) );
GroupFaceLayout->addWidget( TextLabelC3Size, 1, 0 );
SpinBox_C3Size = new GeometryGUI_SpinBox( GroupFace, "SpinBox_C3Size" );
SpinBox_C3Size->setCaption( tr( "" ) );
GroupFaceLayout->addWidget( SpinBox_C3Size, 1, 3 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupFaceLayout->addMultiCell( spacer, 1, 1, 1, 2 );
QSpacerItem* spacer_e = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
GroupFaceLayout->addItem( spacer_e, 2, 3 );
GeometryGUI_PlaneDlgLayout->addWidget( GroupFace, 1, 0 );
/* Initialisation */ /* Initialisation */
Init(Sel); Init(Sel);
@ -328,7 +104,6 @@ GeometryGUI_PlaneDlg::GeometryGUI_PlaneDlg( QWidget* parent, const char* name, S
GeometryGUI_PlaneDlg::~GeometryGUI_PlaneDlg() GeometryGUI_PlaneDlg::~GeometryGUI_PlaneDlg()
{ {
/* no need to delete child widgets, Qt does it all for us */ /* no need to delete child widgets, Qt does it all for us */
this->destroy(TRUE, TRUE) ;
} }
@ -338,155 +113,141 @@ GeometryGUI_PlaneDlg::~GeometryGUI_PlaneDlg()
//================================================================================= //=================================================================================
void GeometryGUI_PlaneDlg::Init( SALOME_Selection* Sel ) void GeometryGUI_PlaneDlg::Init( SALOME_Selection* Sel )
{ {
double step ; /* init variables */
QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
step = St.toDouble() ;
/* min, max, step and decimals for spin boxes */
SpinBox_DX->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
SpinBox_DX->SetValue( 1.0 ) ;
SpinBox_DY->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
SpinBox_DY->SetValue( 1.0 ) ;
SpinBox_DZ->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
SpinBox_DZ->SetValue( 1.0 ) ;
this->myTrimSize = 2000.0 ;
SpinBox_C1Size->RangeStepAndValidator( +0.001, 10000000.0, step, 5 ) ;
SpinBox_C1Size->SetValue( myTrimSize ) ;
SpinBox_C2Size->RangeStepAndValidator( +0.001, 10000000.0, step, 5 ) ;
SpinBox_C2Size->SetValue( myTrimSize ) ;
SpinBox_C3Size->RangeStepAndValidator( +0.001, 10000000.0, step, 5 ) ;
SpinBox_C3Size->SetValue( myTrimSize ) ;
GroupPointDirection->show();
GroupPointPlusCoordinates->hide() ;
GroupFace->hide() ;
myConstructorId = 0; myConstructorId = 0;
Constructor1->setChecked( TRUE ); myEditCurrentArgument = GroupPointDirection->LineEdit1;
mySelection = Sel ;
myEditCurrentArgument = LineEditPt1 ;
mySimulationTopoDs.Nullify() ;
myPoint1.SetCoord(0.0, 0.0, 0.0); myPoint1.SetCoord(0.0, 0.0, 0.0);
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false; myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false;
myGeomGUI = GeometryGUI::GetGeometryGUI() ;
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
// TODO previous selection into argument ?
/* Filters definition */ /* Filters definition */
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
myGeom = GEOM::GEOM_Gen::_narrow(comp);
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom); myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom); myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom); myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
/* Filter for the next selection */ /* Filter for the next selection */
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
/* Get setting of step value from file configuration */
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
step = St.toDouble();
this->myTrimSize = 2000.0;
/* min, max, step and decimals for spin boxes */
GroupPointDirection->SpinBox_DX->RangeStepAndValidator(+0.001, 10000000.0, step, 5);
GroupPointDirection->SpinBox_DX->SetValue(myTrimSize);
GroupPointPlusCoordinates->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupPointPlusCoordinates->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupPointPlusCoordinates->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupPointPlusCoordinates->SpinBox_DX->SetValue(1.0);
GroupPointPlusCoordinates->SpinBox_DY->SetValue(1.0);
GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0);
GroupPointPlusCoordinates->SpinBox_S->RangeStepAndValidator(+0.001, 10000000.0, step, 5);
GroupPointPlusCoordinates->SpinBox_S->SetValue(myTrimSize) ;
GroupFace->SpinBox_DX->RangeStepAndValidator(+0.001, 10000000.0, step, 5);
GroupFace->SpinBox_DX->SetValue(myTrimSize);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int))); connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect( LineEditPt1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPointDirection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( LineEditDirection, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPointDirection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPointPlusCoordinates->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupFace->PushButton1, SIGNAL(clicked()), this, SLOT( SetEditCurrentArgument()));
connect( LineEditPt2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPointDirection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect( LineEditFace, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPointDirection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPointPlusCoordinates->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupFace->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect( SelectButtonPt1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; connect(GroupPointPlusCoordinates->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect( SelectButtonPt2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; connect(GroupPointPlusCoordinates->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect( SelectButtonFace, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; connect(GroupPointPlusCoordinates->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect( SelectButtonDirection, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; connect(GroupPointPlusCoordinates->SpinBox_S, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupPointDirection->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect( SpinBox_DX, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ; connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect( SpinBox_DY, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
connect( SpinBox_DZ, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
connect( SpinBox_C1Size, SIGNAL ( ValueChangedSignal( const double) ), this, SLOT( ValueChangedInSpinBox( const double) ) ) ;
connect( SpinBox_C2Size, SIGNAL ( ValueChangedSignal( const double) ), this, SLOT( ValueChangedInSpinBox( const double) ) ) ;
connect( SpinBox_C3Size, SIGNAL ( ValueChangedSignal( const double) ), this, SLOT( ValueChangedInSpinBox( const double) ) ) ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
/* to close dialog if study change */
connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
/* Move widget on the botton right corner of main widget */ /* Displays Dialog */
int x, y ; GroupPointPlusCoordinates->hide();
myGeomGUI->DefineDlgPosition( this, x, y ) ; GroupFace->hide();
this->move( x, y ) ; GroupPointDirection->show();
this->show() ; /* Displays Dialog */ this->show();
return ; return ;
} }
//================================================================================= //=================================================================================
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void GeometryGUI_PlaneDlg::ConstructorsClicked(int constructorId) void GeometryGUI_PlaneDlg::ConstructorsClicked(int constructorId)
{ {
myGeomGUI->EraseSimulationShape() ;
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false ;
mySelection->ClearFilters() ;
myConstructorId = constructorId; myConstructorId = constructorId;
mySelection->ClearFilters();
myGeomGUI->EraseSimulationShape();
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false;
switch (constructorId) switch (constructorId)
{ {
case 0: /* plane from a point and a direction (vector, edge...) */ case 0: /* plane from a point and a direction (vector, edge...) */
{ {
GroupPointDirection->show();
GroupPointPlusCoordinates->hide(); GroupPointPlusCoordinates->hide();
GroupFace->hide(); GroupFace->hide();
myEditCurrentArgument = LineEditPt1 ; resize(0, 0);
LineEditPt1->setText(tr("")) ; GroupPointDirection->show();
LineEditDirection->setText(tr("")) ;
myEditCurrentArgument = GroupPointDirection->LineEdit1;
GroupPointDirection->LineEdit1->setText(tr(""));
GroupPointDirection->LineEdit2->setText(tr(""));
/* for the first argument */ /* for the first argument */
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
break; break;
} }
case 1: /* plane from a point and vector coordinates */ case 1: /* plane from a point and vector coordinates */
{ {
GroupPointDirection->hide(); GroupPointDirection->hide();
GroupPointPlusCoordinates->show() ;
GroupFace->hide(); GroupFace->hide();
myEditCurrentArgument = LineEditPt2 ; resize(0, 0);
LineEditPt2->setText(tr("")) ; GroupPointPlusCoordinates->show();
SpinBox_DX->SetValue( 1.0 ) ;
SpinBox_DY->SetValue( 1.0 ) ; myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
SpinBox_DZ->SetValue( 1.0 ) ; GroupPointPlusCoordinates->LineEdit1->setText(tr(""));
GroupPointPlusCoordinates->SpinBox_DX->SetValue(1.0);
GroupPointPlusCoordinates->SpinBox_DY->SetValue(1.0);
GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0);
myOkCoordinates = true; myOkCoordinates = true;
/* for the first argument */ /* for the first argument */
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
break; break;
} }
case 2: /* plane from a planar face selection */ case 2: /* plane from a planar face selection */
{ {
GroupPointDirection->hide(); GroupPointDirection->hide();
GroupPointPlusCoordinates->hide(); GroupPointPlusCoordinates->hide();
resize(0, 0);
GroupFace->show(); GroupFace->show();
myEditCurrentArgument = LineEditFace ;
LineEditFace->setText(tr("")) ; myEditCurrentArgument = GroupFace->LineEdit1;
GroupFace->LineEdit1->setText(tr(""));
/* for the first argument */ /* for the first argument */
mySelection->AddFilter(myFaceFilter); mySelection->AddFilter(myFaceFilter);
break; break;
} }
} }
return; return;
} }
//================================================================================= //=================================================================================
// function : ClickOnOk() // function : ClickOnOk()
// purpose : // purpose :
@ -494,43 +255,41 @@ void GeometryGUI_PlaneDlg::ConstructorsClicked(int constructorId)
void GeometryGUI_PlaneDlg::ClickOnOk() void GeometryGUI_PlaneDlg::ClickOnOk()
{ {
this->ClickOnApply(); this->ClickOnApply();
this->ClickOnCancel() ; ClickOnCancel();
return ; return ;
} }
//================================================================================= //=================================================================================
// function : ClickOnApply() // function : ClickOnApply()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_PlaneDlg::ClickOnApply() void GeometryGUI_PlaneDlg::ClickOnApply()
{ {
myGeomGUI->GetDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomGUI->EraseSimulationShape(); myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
switch(myConstructorId) switch(myConstructorId)
{ {
case 0 : /* args are myPoint1 and myDx, myDy, myDz from a vector(edge) */ case 0 : /* args are myPoint1 and myDx, myDy, myDz from a vector(edge) */
{ {
if(myOkPoint1 && myOkDirection) { if(myOkPoint1 && myOkDirection)
myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize); myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
}
break; break;
} }
case 1 : /* args are myPoint1 and myDx, myDy, myDz from a Spin Box */ case 1 : /* args are myPoint1 and myDx, myDy, myDz from a Spin Box */
{ {
if(myOkPoint1) { if(myOkPoint1)
myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize); myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
}
break; break;
} }
case 2 : /* arg is a planar face selection */ case 2 : /* arg is a planar face selection */
{ {
if(myOkPlanarFace) { if(myOkPlanarFace)
myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize); myGeomGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
}
break; break;
} }
} }
@ -538,33 +297,14 @@ void GeometryGUI_PlaneDlg::ClickOnApply()
} }
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_PlaneDlg::ClickOnCancel()
{
mySelection->ClearFilters() ;
myGeomGUI->EraseSimulationShape() ;
mySimulationTopoDs.Nullify() ;
disconnect( mySelection, 0, this, 0 );
myGeomGUI->ResetState() ;
reject() ;
return ;
}
//================================================================================= //=================================================================================
// function : SelectionIntoArgument() // function : SelectionIntoArgument()
// purpose : Called when selection has changed // purpose : Called when selection has changed
//================================================================================= //=================================================================================
void GeometryGUI_PlaneDlg::SelectionIntoArgument() void GeometryGUI_PlaneDlg::SelectionIntoArgument()
{ {
myGeomGUI->EraseSimulationShape(); myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
/* Future name of argument */
QString aString = ""; QString aString = "";
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString); int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
@ -573,29 +313,28 @@ void GeometryGUI_PlaneDlg::SelectionIntoArgument()
{ {
case 0: case 0:
{ {
if ( myEditCurrentArgument == LineEditPt1 ) { if(myEditCurrentArgument == GroupPointDirection->LineEdit1) {
LineEditPt1->setText("") ; GroupPointDirection->LineEdit1->setText("");
myOkPoint1 = false ; myOkPoint1 = false ;
} }
else if ( myEditCurrentArgument == LineEditDirection ) { else if(myEditCurrentArgument == GroupPointDirection->LineEdit2) {
LineEditDirection->setText("") ; GroupPointDirection->LineEdit2->setText("");
myOkDirection = false ; myOkDirection = false ;
} }
break; break;
} }
case 1: case 1:
{ {
if ( myEditCurrentArgument == LineEditPt2 ) { if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1) {
LineEditPt2->setText("") ; GroupPointPlusCoordinates->LineEdit1->setText("") ;
myOkPoint1 = false ; myOkPoint1 = false ;
} }
break; break;
} }
case 2: case 2:
{ {
if ( myEditCurrentArgument == LineEditFace ) { if(myEditCurrentArgument == GroupFace->LineEdit1) {
LineEditFace->setText("") ; GroupFace->LineEdit1->setText("") ;
if(aString.compare("") == 0) if(aString.compare("") == 0)
myOkPlanarFace = false; myOkPlanarFace = false;
else else
@ -603,7 +342,6 @@ void GeometryGUI_PlaneDlg::SelectionIntoArgument()
} }
break; break;
} }
} }
return ; return ;
} }
@ -613,39 +351,38 @@ void GeometryGUI_PlaneDlg::SelectionIntoArgument()
if(!myGeomGUI->GetTopoFromSelection(mySelection, S)) if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
return ; return ;
/* FIRST CONSTRUCTOR */ /* FIRST CONSTRUCTOR */
if ( myEditCurrentArgument == LineEditPt1 && myGeomGUI->VertexToPoint(S, myPoint1) ) { if(myEditCurrentArgument == GroupPointDirection->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
LineEditPt1->setText(aString) ; GroupPointDirection->LineEdit1->setText(aString);
myOkPoint1 = true; myOkPoint1 = true;
} }
else if ( myEditCurrentArgument == LineEditDirection ) { else if( myEditCurrentArgument == GroupPointDirection->LineEdit2) {
/* We verify if the selection is a linear edge */ /* We verify if the selection is a linear edge */
gp_Pnt Pfirst, Plast; gp_Pnt Pfirst, Plast;
if( myGeomGUI->LinearEdgeExtremities(S, Pfirst, Plast)) { if( myGeomGUI->LinearEdgeExtremities(S, Pfirst, Plast)) {
myGeomGUI->GetBipointDxDyDz(Pfirst, Plast, myDx, myDy, myDz); myGeomGUI->GetBipointDxDyDz(Pfirst, Plast, myDx, myDy, myDz);
LineEditDirection->setText(aString) ; GroupPointDirection->LineEdit2->setText(aString);
myOkDirection = true; myOkDirection = true;
this->myTrimSize = SpinBox_C1Size->GetValue() ; this->myTrimSize = GroupPointDirection->SpinBox_DX->GetValue();
} }
} }
/* SECOND CONSTRUCTOR */ /* SECOND CONSTRUCTOR */
else if ( myEditCurrentArgument == LineEditPt2 && myGeomGUI->VertexToPoint(S, myPoint1) ) { else if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
LineEditPt2->setText(aString) ; GroupPointPlusCoordinates->LineEdit1->setText(aString);
/* Get arguments */ /* Get arguments */
myDx = SpinBox_DX->GetValue() ; myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
myDy = SpinBox_DY->GetValue() ; myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
myDz = SpinBox_DZ->GetValue() ; myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
this->myTrimSize = SpinBox_C2Size->GetValue() ; this->myTrimSize = GroupPointPlusCoordinates->SpinBox_S->GetValue();
myOkPoint1 = true; myOkPoint1 = true;
myOkCoordinates = true; myOkCoordinates = true;
} }
/* THIRD CONSTRUCTOR */ /* THIRD CONSTRUCTOR */
else if ( myEditCurrentArgument == LineEditFace) { else if(myEditCurrentArgument == GroupFace->LineEdit1) {
if(myOkPlanarFace) { if(myOkPlanarFace) {
LineEditFace->setText(aString) ; GroupFace->LineEdit1->setText(aString);
BRepAdaptor_Surface surf(TopoDS::Face(S)); BRepAdaptor_Surface surf(TopoDS::Face(S));
gp_Pln Plane = surf.Plane(); gp_Pln Plane = surf.Plane();
@ -654,21 +391,19 @@ void GeometryGUI_PlaneDlg::SelectionIntoArgument()
myDx = (ax.Direction()).X(); myDx = (ax.Direction()).X();
myDy = (ax.Direction()).Y(); myDy = (ax.Direction()).Y();
myDz = (ax.Direction()).Z(); myDz = (ax.Direction()).Z();
this->myTrimSize = SpinBox_C3Size->GetValue() ; this->myTrimSize = GroupFace->SpinBox_DX->GetValue();
} }
} }
/* Call method simulation */ /* Call method simulation */
if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) { if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) {
if ( myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion()*Precision::Confusion() ) { if(myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion()*Precision::Confusion())
MakePlaneSimulationAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize) ; MakePlaneSimulationAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize) ;
} }
}
return; return;
} }
//================================================================================= //=================================================================================
// function : SetEditCurrentArgument() // function : SetEditCurrentArgument()
// purpose : // purpose :
@ -682,80 +417,42 @@ void GeometryGUI_PlaneDlg::SetEditCurrentArgument()
{ {
case 0: case 0:
{ {
if(send == SelectButtonPt1) { if(send == GroupPointDirection->PushButton1) {
LineEditPt1->setFocus() ; GroupPointDirection->LineEdit1->setFocus();
myEditCurrentArgument = LineEditPt1; myEditCurrentArgument = GroupPointDirection->LineEdit1;
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
} }
else if(send == SelectButtonDirection) { else if(send == GroupPointDirection->PushButton2) {
LineEditDirection->setFocus() ; GroupPointDirection->LineEdit2->setFocus();
myEditCurrentArgument = LineEditDirection; myEditCurrentArgument = GroupPointDirection->LineEdit2;
/* Edge filter here */ /* Edge filter here */
mySelection->AddFilter(myEdgeFilter); mySelection->AddFilter(myEdgeFilter);
SelectionIntoArgument(); SelectionIntoArgument();
} }
break; break;
} }
case 1: case 1:
{ {
if(send == SelectButtonPt2) { if(send == GroupPointPlusCoordinates->PushButton1) {
LineEditPt2->setFocus() ; GroupPointPlusCoordinates->LineEdit1->setFocus();
myEditCurrentArgument = LineEditPt2; myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
/* Vertex filter here */ /* Vertex filter here */
mySelection->AddFilter(myVertexFilter); mySelection->AddFilter(myVertexFilter);
SelectionIntoArgument(); SelectionIntoArgument();
} }
break; break;
} }
case 2: case 2:
{ {
if(send == SelectButtonFace) { if(send == GroupFace->PushButton1) {
LineEditFace->setFocus() ; GroupFace->LineEdit1->setFocus();
myEditCurrentArgument = LineEditFace; myEditCurrentArgument = GroupFace->LineEdit1;
/* Face filter here */ /* Face filter here */
mySelection->AddFilter(myFaceFilter); mySelection->AddFilter(myFaceFilter);
SelectionIntoArgument(); SelectionIntoArgument();
} }
break; break;
} }
}
return ;
}
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
void GeometryGUI_PlaneDlg::ValueChangedInSpinBox( double newValue )
{
QObject* send = (QObject*)sender() ;
if( send == SpinBox_DX ) {
myDx = newValue ;
myDy = SpinBox_DY->GetValue() ;
myDz = SpinBox_DZ->GetValue() ;
} else if( send == SpinBox_DY ) {
myDx = SpinBox_DX->GetValue() ;
myDy = newValue ;
myDz = SpinBox_DZ->GetValue() ;
} else if( send == SpinBox_DZ ) {
myDx = SpinBox_DX->GetValue() ;
myDy = SpinBox_DY->GetValue() ;
myDz = newValue ;
} else if( send == SpinBox_C1Size || send == SpinBox_C2Size || send == SpinBox_C3Size ) {
myTrimSize = newValue ;
} else
return ;
if ( myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion() * Precision::Confusion() ) {
MakePlaneSimulationAndDisplay( myPoint1, myDx, myDy, myDz, myTrimSize ) ;
}
else {
myGeomGUI->EraseSimulationShape() ;
mySimulationTopoDs.Nullify() ;
} }
return ; return ;
} }
@ -768,43 +465,18 @@ void GeometryGUI_PlaneDlg::ValueChangedInSpinBox( double newValue )
void GeometryGUI_PlaneDlg::LineEditReturnPressed() void GeometryGUI_PlaneDlg::LineEditReturnPressed()
{ {
QLineEdit* send = (QLineEdit*)sender(); QLineEdit* send = (QLineEdit*)sender();
if( send == LineEditPt1 ) if(send == GroupPointDirection->LineEdit1)
myEditCurrentArgument = LineEditPt1 ; myEditCurrentArgument = GroupPointDirection->LineEdit1;
else if ( send == LineEditDirection ) else if (send == GroupPointDirection->LineEdit2)
myEditCurrentArgument = LineEditDirection ; myEditCurrentArgument = GroupPointDirection->LineEdit2;
else if ( send == LineEditPt2 ) else if (send == GroupPointPlusCoordinates->LineEdit1)
myEditCurrentArgument = LineEditPt2 ; myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
else if ( send == LineEditFace ) else if (send == GroupFace->LineEdit1)
myEditCurrentArgument = LineEditFace ; myEditCurrentArgument = GroupFace->LineEdit1;
else else
return; return;
/* User name of object input management */ GeometryGUI_Skeleton::LineEditReturnPressed();
/* If successfull the selection is changed and signal emitted... */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text() ;
QWidget* thisWidget = (QWidget*)this ;
if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
myEditCurrentArgument->setText( objectUserName ) ;
}
return ;
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
void GeometryGUI_PlaneDlg::DeactivateActiveDialog()
{
if ( GroupConstructors->isEnabled() ) {
GroupConstructors->setEnabled(false) ;
GroupPointDirection->setEnabled(false) ;
GroupButtons->setEnabled(false) ;
GroupFace->setEnabled(false) ;
disconnect( mySelection, 0, this, 0 );
myGeomGUI->EraseSimulationShape() ;
}
return ; return ;
} }
@ -815,13 +487,7 @@ void GeometryGUI_PlaneDlg::DeactivateActiveDialog()
//================================================================================= //=================================================================================
void GeometryGUI_PlaneDlg::ActivateThisDialog() void GeometryGUI_PlaneDlg::ActivateThisDialog()
{ {
/* Emit a signal to deactivate the active dialog */ GeometryGUI_Skeleton::ActivateThisDialog();
myGeomGUI->EmitSignalDeactivateDialog() ;
GroupConstructors->setEnabled(true) ;
GroupPointDirection->setEnabled(true) ;
GroupButtons->setEnabled(true) ;
GroupFace->setEnabled(true) ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
if(!mySimulationTopoDs.IsNull()) if(!mySimulationTopoDs.IsNull())
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs); myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
@ -837,20 +503,45 @@ void GeometryGUI_PlaneDlg::enterEvent( QEvent* e)
{ {
if (GroupConstructors->isEnabled()) if (GroupConstructors->isEnabled())
return; return;
ActivateThisDialog() ; this->ActivateThisDialog();
return;
} }
//================================================================================= //=================================================================================
// function : closeEvent() // function : ValueChangedInSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_PlaneDlg::closeEvent( QCloseEvent* e ) void GeometryGUI_PlaneDlg::ValueChangedInSpinBox( double newValue )
{ {
/* same than click on cancel button */ myGeomGUI->EraseSimulationShape();
this->ClickOnCancel() ; mySimulationTopoDs.Nullify();
QObject* send = (QObject*)sender() ;
if(send == GroupPointPlusCoordinates->SpinBox_DX) {
myDx = newValue;
myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
} else if(send == GroupPointPlusCoordinates->SpinBox_DY) {
myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
myDy = newValue;
myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
} else if(send == GroupPointPlusCoordinates->SpinBox_DZ) {
myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
myDz = newValue;
} else if(send == GroupPointDirection->SpinBox_DX || send == GroupPointPlusCoordinates->SpinBox_S || send == GroupFace->SpinBox_DX) {
myTrimSize = newValue;
} else
return;
if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) {
if (myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion() * Precision::Confusion())
MakePlaneSimulationAndDisplay( myPoint1, myDx, myDy, myDz, myTrimSize);
} }
return ;
}
//================================================================================= //=================================================================================

View File

@ -29,35 +29,19 @@
#ifndef DIALOGBOX_PLANE_H #ifndef DIALOGBOX_PLANE_H
#define DIALOGBOX_PLANE_H #define DIALOGBOX_PLANE_H
#include "SALOME_Selection.h" #include "GeometryGUI_Skeleton.h"
#include "GEOM_ShapeTypeFilter.hxx" #include "GeometryGUI_2Sel1Spin.h"
#include "GeometryGUI_1Sel4Spin.h"
#include "GeometryGUI_1Sel1Spin.h"
#include "GEOM_FaceFilter.hxx" #include "GEOM_FaceFilter.hxx"
#include "GeometryGUI_SpinBox.h"
#include <BRepBuilderAPI_MakeFace.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <qvariant.h>
#include <qdialog.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QButtonGroup;
class QFrame;
class QGroupBox;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QToolButton;
class QLabel;
class GeometryGUI;
//================================================================================= //=================================================================================
// class : GeometryGUI_PlaneDlg // class : GeometryGUI_PlaneDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GeometryGUI_PlaneDlg : public QDialog class GeometryGUI_PlaneDlg : public GeometryGUI_Skeleton
{ {
Q_OBJECT Q_OBJECT
@ -66,15 +50,15 @@ public:
~GeometryGUI_PlaneDlg(); ~GeometryGUI_PlaneDlg();
private : private :
void Init(SALOME_Selection* Sel); void Init(SALOME_Selection* Sel);
void closeEvent( QCloseEvent* e ) ;
void enterEvent(QEvent* e); void enterEvent(QEvent* e);
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ double step;
GeometryGUI* myGeomGUI ; /* Current GeomGUI object */ int myConstructorId;
TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */ Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */
SALOME_Selection* mySelection ; /* User shape selection */ Handle(GEOM_ShapeTypeFilter) myEdgeFilter;
Handle(GEOM_FaceFilter) myFaceFilter;
gp_Pnt myPoint1; /* Point on the plane */ gp_Pnt myPoint1; /* Point on the plane */
Standard_Real myDx; Standard_Real myDx;
@ -86,94 +70,26 @@ private :
bool myOkDirection; bool myOkDirection;
bool myOkCoordinates; bool myOkCoordinates;
bool myOkPlanarFace; bool myOkPlanarFace;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
int myConstructorId ; /* Current constructor id = radio button id */
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */ GeometryGUI_2Sel1Spin* GroupPointDirection;
Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filters selection */ GeometryGUI_1Sel4Spin* GroupPointPlusCoordinates;
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */ GeometryGUI_1Sel1Spin* GroupFace;
// Constructors
QButtonGroup* GroupConstructors;
QRadioButton* Constructor1;
QRadioButton* Constructor2;
QRadioButton* Constructor3;
// Constructor with a point + direction (vector)
QGroupBox* GroupPointDirection;
QLabel* TextLabelPt1;
QPushButton* SelectButtonPt1;
QLineEdit* LineEditPt1;
QLabel* TextLabelDirection;
QPushButton* SelectButtonDirection;
QLineEdit* LineEditDirection;
QLabel* TextLabelC1Size;
GeometryGUI_SpinBox* SpinBox_C1Size ;
// Constructor with a point + dx, dy, dz coordinates
QGroupBox* GroupPointPlusCoordinates;
QLabel* TextLabelPt2;
QPushButton* SelectButtonPt2;
QLineEdit* LineEditPt2;
QLabel* TextLabelCoordinates;
QLabel* TextLabel_DX;
QLabel* TextLabel_DY;
QLabel* TextLabel_DZ;
GeometryGUI_SpinBox* SpinBox_DX ;
GeometryGUI_SpinBox* SpinBox_DY ;
GeometryGUI_SpinBox* SpinBox_DZ ;
QLabel* TextLabelC2Size;
GeometryGUI_SpinBox* SpinBox_C2Size ;
// Constructor with a face
QGroupBox* GroupFace;
QLabel* TextLabelFace;
QPushButton* SelectButtonFace;
QLineEdit* LineEditFace;
QLabel* TextLabelC3Size;
GeometryGUI_SpinBox* SpinBox_C3Size ;
// BUTTONS
QGroupBox* GroupButtons;
QPushButton* buttonApply;
QPushButton* buttonOk;
QPushButton* buttonCancel;
private slots: private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void SetEditCurrentArgument() ; void ActivateThisDialog();
void SelectionIntoArgument(); void SelectionIntoArgument();
void LineEditReturnPressed(); void LineEditReturnPressed();
void DeactivateActiveDialog() ; void SetEditCurrentArgument();
void ActivateThisDialog() ; void ConstructorsClicked(int constructorId);
void ValueChangedInSpinBox(double newValue);
void MakePlaneSimulationAndDisplay(const gp_Pnt& P, void MakePlaneSimulationAndDisplay(const gp_Pnt& P,
const Standard_Real dx, const Standard_Real dx,
const Standard_Real dy, const Standard_Real dy,
const Standard_Real dz, const Standard_Real dz,
const Standard_Real trimSize); const Standard_Real trimSize);
void ValueChangedInSpinBox( double newValue ) ;
protected:
QGridLayout* GeometryGUI_PlaneDlgLayout;
QGridLayout* GroupButtonsLayout;
QGridLayout* GroupPointDirectionLayout;
QGridLayout* GroupConstructorsLayout;
QGridLayout* GroupPointPlusCoordinatesLayout;
QGridLayout* GroupFaceLayout;
QHBoxLayout* Layout2 ;
}; };
#endif // DIALOGBOX_PLANE_H #endif // DIALOGBOX_PLANE_H

View File

@ -22,30 +22,15 @@
// //
// //
// File : GeometryGUI_ShellDlg.cxx // File : GeometryGUI_ShellDlg.cxx
// Author : Lucien PIGNOLONI // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header$ // $Header:
using namespace std; using namespace std;
#include "GeometryGUI_ShellDlg.h" #include "GeometryGUI_ShellDlg.h"
#include "GeometryGUI.h" #include "GeometryGUI.h"
#include "QAD_Application.h"
#include "QAD_Desktop.h" #include "QAD_Desktop.h"
#include "utilities.h"
#include <qbuttongroup.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
//================================================================================= //=================================================================================
// class : GeometryGUI_ShellDlg() // class : GeometryGUI_ShellDlg()
@ -54,96 +39,30 @@ 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.
//================================================================================= //=================================================================================
GeometryGUI_ShellDlg::GeometryGUI_ShellDlg( QWidget* parent, const char* name, SALOME_Selection* Sel = 0, bool modal, WFlags fl ) GeometryGUI_ShellDlg::GeometryGUI_ShellDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) :GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{ {
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SHELL"))); QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_SHELL")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT"))); QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
if ( !name )
setName( "GeometryGUI_ShellDlg" );
resize( 303, 190 );
setCaption(tr("GEOM_SHELL_TITLE")); setCaption(tr("GEOM_SHELL_TITLE"));
setSizeGripEnabled( TRUE );
GeometryGUI_ShellDlgLayout = new QGridLayout( this );
GeometryGUI_ShellDlgLayout->setSpacing( 6 );
GeometryGUI_ShellDlgLayout->setMargin( 11 );
/***************************************************************/ /***************************************************************/
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
GroupConstructors->setTitle(tr("GEOM_SHELL")); GroupConstructors->setTitle(tr("GEOM_SHELL"));
GroupConstructors->setExclusive( TRUE ); RadioButton1->setPixmap(image0);
GroupConstructors->setColumnLayout(0, Qt::Vertical ); RadioButton2->close(TRUE);
GroupConstructors->layout()->setSpacing( 0 ); RadioButton3->close(TRUE);
GroupConstructors->layout()->setMargin( 0 );
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
GroupConstructorsLayout->setSpacing( 6 );
GroupConstructorsLayout->setMargin( 11 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupConstructorsLayout->addItem( spacer, 0, 1 );
Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
Constructor1->setText( tr( "" ) );
Constructor1->setPixmap( image0 );
Constructor1->setChecked( TRUE );
Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
GeometryGUI_ShellDlgLayout->addWidget( GroupConstructors, 0, 0 );
/***************************************************************/ GroupShell = new GeometryGUI_1Sel_QTD(this, "GroupShell");
GroupC1 = new QGroupBox( this, "GroupC1" ); GroupShell->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupC1->setTitle( tr( "GEOM_SHELL_LIST" ) ); GroupShell->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupC1->setColumnLayout(0, Qt::Vertical ); GroupShell->PushButton1->setPixmap(image1);
GroupC1->layout()->setSpacing( 0 );
GroupC1->layout()->setMargin( 0 );
GroupC1Layout = new QGridLayout( GroupC1->layout() );
GroupC1Layout->setAlignment( Qt::AlignTop );
GroupC1Layout->setSpacing( 6 );
GroupC1Layout->setMargin( 11 );
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) );
GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
SelectButtonC1A1->setText( tr( "" ) );
SelectButtonC1A1->setPixmap( image1 );
GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
TextLabelC1A1->setText( tr( "GEOM_FACES" ) );
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
TextLabelC1A1->setFrameShadow( QLabel::Plain );
GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
GeometryGUI_ShellDlgLayout->addWidget( GroupC1, 1, 0 );
/***************************************************************/ Layout1->addWidget(GroupShell, 1, 0);
GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
GroupButtons->setTitle( tr( "" ) );
GroupButtons->setColumnLayout(0, Qt::Vertical );
GroupButtons->layout()->setSpacing( 0 );
GroupButtons->layout()->setMargin( 0 );
GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->setSpacing( 6 );
GroupButtonsLayout->setMargin( 11 );
buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
buttonApply->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
GroupButtonsLayout->addItem( spacer_9, 0, 2 );
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
buttonOk->setText( tr( "GEOM_BUT_OK" ) );
buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
GeometryGUI_ShellDlgLayout->addWidget( GroupButtons, 2, 0 );
/***************************************************************/ /***************************************************************/
Init(Sel) ; /* Initialisations */ /* Initialisations */
Init(Sel);
} }
@ -157,55 +76,32 @@ GeometryGUI_ShellDlg::~GeometryGUI_ShellDlg()
} }
//================================================================================= //=================================================================================
// function : Init() // function : Init()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::Init( SALOME_Selection* Sel ) void GeometryGUI_ShellDlg::Init( SALOME_Selection* Sel )
{ {
/* init variables */
myEditCurrentArgument = GroupShell->LineEdit1;
myOkListShapes = false;
GroupC1->show(); myFaceFilter = new GEOM_FaceFilter( StdSelect_Plane, myGeom );
myConstructorId = 0 ; /* Filter for the next selection */
Constructor1->setChecked( TRUE ); mySelection->AddFilter( myFaceFilter ) ;
myEditCurrentArgument = LineEditC1A1 ;
mySelection = Sel;
this->myOkListShapes = false ;
myGeomGUI = GeometryGUI::GetGeometryGUI() ;
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
// TODO : previous selection into argument ?
/* Filter definitions */
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
myGeom = GEOM::GEOM_Gen::_narrow(comp);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ; connect(GroupShell->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
/* to close dialog if study change */
connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
/* Move widget on the botton right corner of main widget */ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
int x, y ;
myGeomGUI->DefineDlgPosition( this, x, y ) ;
this->move( x, y ) ;
this->show() ; /* displays Dialog */
return ;
}
/* displays Dialog */
GroupShell->show();
this->show();
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
void GeometryGUI_ShellDlg::ConstructorsClicked(int constructorId)
{
return; return;
} }
@ -217,8 +113,7 @@ void GeometryGUI_ShellDlg::ConstructorsClicked(int constructorId)
void GeometryGUI_ShellDlg::ClickOnOk() void GeometryGUI_ShellDlg::ClickOnOk()
{ {
this->ClickOnApply(); this->ClickOnApply();
this->ClickOnCancel() ; ClickOnCancel();
return ; return ;
} }
@ -229,30 +124,11 @@ void GeometryGUI_ShellDlg::ClickOnOk()
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::ClickOnApply() void GeometryGUI_ShellDlg::ClickOnApply()
{ {
switch(myConstructorId) myGeomGUI->GetDesktop()->putInfo(tr(""));
{
case 0 :
{
if(myOkListShapes) {
// myGeomGUI->MakeShellAndDisplay( myListShapes ) ;
}
break ;
}
}
// accept();
return ;
}
if(myOkListShapes)
myGeomGUI->MakeShellAndDisplay(myListShapes);
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_ShellDlg::ClickOnCancel()
{
disconnect( mySelection, 0, this, 0 );
myGeomGUI->ResetState() ;
reject() ;
return; return;
} }
@ -263,22 +139,20 @@ void GeometryGUI_ShellDlg::ClickOnCancel()
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::SelectionIntoArgument() void GeometryGUI_ShellDlg::SelectionIntoArgument()
{ {
/* All this for first constructor */
// if(myEditCurrentArgument == LineEditC1A1 )
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText("");
QString aString = "";
myOkListShapes = false; myOkListShapes = false;
int nbSel = mySelection->IObjectCount();
QString aString = ""; /* name of future selection */ if (nbSel == 0)
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
if ( nbSel < 1 ) {
return; return;
}
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ;
aString = tr("%1_objects").arg(nbSel);
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
myEditCurrentArgument->setText(aString); myEditCurrentArgument->setText(aString);
myOkListShapes = true; myOkListShapes = true;
/* no simulation */
return; return;
} }
@ -290,45 +164,15 @@ void GeometryGUI_ShellDlg::SelectionIntoArgument()
void GeometryGUI_ShellDlg::SetEditCurrentArgument() void GeometryGUI_ShellDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
switch (myConstructorId) mySelection->ClearFilters() ;
{
case 0: /* default constructor */ if(send == GroupShell->PushButton1) {
{ GroupShell->LineEdit1->setFocus();
if(send == SelectButtonC1A1) { myEditCurrentArgument = GroupShell->LineEdit1;
LineEditC1A1->setFocus() ; mySelection->AddFilter(myFaceFilter);
myEditCurrentArgument = LineEditC1A1;
} }
SelectionIntoArgument(); SelectionIntoArgument();
break;
}
}
return ;
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void GeometryGUI_ShellDlg::LineEditReturnPressed()
{
return ;
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
void GeometryGUI_ShellDlg::DeactivateActiveDialog()
{
if ( GroupConstructors->isEnabled() ) {
disconnect( mySelection, 0, this, 0 );
GroupConstructors->setEnabled(false) ;
GroupC1->setEnabled(false) ;
GroupButtons->setEnabled(false) ;
}
return ; return ;
} }
@ -339,11 +183,7 @@ void GeometryGUI_ShellDlg::DeactivateActiveDialog()
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::ActivateThisDialog() void GeometryGUI_ShellDlg::ActivateThisDialog()
{ {
/* Emit a signal to deactivate the active dialog */ GeometryGUI_Skeleton::ActivateThisDialog();
myGeomGUI->EmitSignalDeactivateDialog() ;
GroupConstructors->setEnabled(true) ;
GroupC1->setEnabled(true) ;
GroupButtons->setEnabled(true) ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
return ; return ;
} }
@ -357,19 +197,6 @@ void GeometryGUI_ShellDlg::enterEvent(QEvent* e)
{ {
if (GroupConstructors->isEnabled()) if (GroupConstructors->isEnabled())
return; return;
ActivateThisDialog() ; this->ActivateThisDialog();
return; return;
} }
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void GeometryGUI_ShellDlg::closeEvent( QCloseEvent* e )
{
/* same than click on cancel button */
this->ClickOnCancel() ;
return ;
}

View File

@ -22,35 +22,23 @@
// //
// //
// File : GeometryGUI_ShellDlg.h // File : GeometryGUI_ShellDlg.h
// Author : Lucien PIGNOLONI // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header$ // $Header:
#ifndef DIALOGBOX_SHELL_H #ifndef DIALOGBOX_SHELL_H
#define DIALOGBOX_SHELL_H #define DIALOGBOX_SHELL_H
#include "SALOME_Selection.h" #include "GeometryGUI_Skeleton.h"
#include "GEOM_ShapeTypeFilter.hxx" #include "GeometryGUI_1Sel_QTD.h"
#include <qvariant.h>
#include <qdialog.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class GeometryGUI;
#include "GEOM_FaceFilter.hxx"
//================================================================================= //=================================================================================
// class : GeometryGUI_ShellDlg // class : GeometryGUI_ShellDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class GeometryGUI_ShellDlg : public QDialog class GeometryGUI_ShellDlg : public GeometryGUI_Skeleton
{ {
Q_OBJECT Q_OBJECT
@ -59,49 +47,23 @@ public:
~GeometryGUI_ShellDlg(); ~GeometryGUI_ShellDlg();
private: private:
void Init(SALOME_Selection* Sel); void Init(SALOME_Selection* Sel);
void closeEvent( QCloseEvent* e ) ; void enterEvent(QEvent * e);
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
SALOME_Selection* mySelection ; /* User shape selection */
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
GEOM::GEOM_Gen::ListOfIOR myListShapes; GEOM::GEOM_Gen::ListOfIOR myListShapes;
bool myOkListShapes ; /* to check when argument is defined */ bool myOkListShapes; /* to check when arguments is defined */
int myConstructorId ; /* Current constructor id = radio button id */ GeometryGUI_1Sel_QTD* GroupShell ;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
QButtonGroup* GroupConstructors;
QRadioButton* Constructor1;
QGroupBox* GroupC1;
QLineEdit* LineEditC1A1;
QPushButton* SelectButtonC1A1;
QLabel* TextLabelC1A1;
QGroupBox* GroupButtons;
QPushButton* buttonApply;
QPushButton* buttonOk;
QPushButton* buttonCancel;
private slots: private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void LineEditReturnPressed(); void LineEditReturnPressed();
void SelectionIntoArgument(); void SelectionIntoArgument();
void DeactivateActiveDialog() ;
void ActivateThisDialog(); void ActivateThisDialog();
protected:
QGridLayout* GeometryGUI_ShellDlgLayout;
QGridLayout* GroupConstructorsLayout;
QGridLayout* GroupC1Layout;
QHBoxLayout* GroupButtonsLayout;
}; };
#endif // DIALOGBOX_SHELL_H #endif // DIALOGBOX_SHELL_H

View File

@ -0,0 +1,175 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_Skeleton.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "GeometryGUI_Skeleton.h"
#include "GeometryGUI.h"
#include "QAD_Application.h"
//=================================================================================
// class : GeometryGUI_Skeleton()
// purpose : Constructs a GeometryGUI_Skeleton which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
GeometryGUI_Skeleton::GeometryGUI_Skeleton(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
:GeometryGUI_Skeleton_QTD(parent, name, modal, fl)
{
if (!name)
setName("GeometryGUI_Skeleton");
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
buttonOk->setText(tr("GEOM_BUT_OK"));
buttonApply->setText(tr("GEOM_BUT_APPLY"));
GroupMedium->close(TRUE);
resize(0, 0);
Init(Sel) ;
}
//=================================================================================
// function : ~GeometryGUI_Skeleton()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
GeometryGUI_Skeleton::~GeometryGUI_Skeleton()
{
// no need to delete child widgets, Qt does it all for us
this->destroy(TRUE, TRUE);
}
//=================================================================================
// function : Init()
// purpose :
//=================================================================================
void GeometryGUI_Skeleton::Init(SALOME_Selection* Sel)
{
/* init variables */
mySelection = Sel;
mySimulationTopoDs.Nullify();
myGeomGUI = GeometryGUI::GetGeometryGUI();
myGeomGUI->SetActiveDialogBox((QDialog*)this);
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
myGeom = GEOM::GEOM_Gen::_narrow(comp);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
/* Move widget on the botton right corner of main widget */
// int x, y ;
// myGeomGUI->DefineDlgPosition( this, x, y ) ;
/* displays Dialog */
RadioButton1->setChecked(TRUE);
return ;
}
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_Skeleton::ClickOnCancel()
{
myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify();
mySelection->ClearFilters();
disconnect(mySelection, 0, this, 0);
myGeomGUI->ResetState();
reject();
return;
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void GeometryGUI_Skeleton::LineEditReturnPressed()
{
/* User name of object input management */
/* If successfull the selection is changed and signal emitted... */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text();
QWidget* thisWidget = (QWidget*)this;
if( myGeomGUI->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
myEditCurrentArgument->setText(objectUserName);
return;
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
void GeometryGUI_Skeleton::DeactivateActiveDialog()
{
Layout1->setEnabled(false);
mySelection->ClearFilters();
disconnect(mySelection, 0, this, 0);
myGeomGUI->EraseSimulationShape();
myGeomGUI->SetActiveDialogBox(0);
return;
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void GeometryGUI_Skeleton::ActivateThisDialog()
{
/* Emit a signal to deactivate the active dialog */
myGeomGUI->EmitSignalDeactivateDialog();
Layout1->setEnabled(true);
myGeomGUI->SetActiveDialogBox((QDialog*)this);
return;
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void GeometryGUI_Skeleton::closeEvent(QCloseEvent* e)
{
/* same than click on cancel button */
this->ClickOnCancel();
return;
}

View File

@ -0,0 +1,76 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_Skeleton.h
// Author : Damine COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMETRYGUI_SKELETON_H
#define GEOMETRYGUI_SKELETON_H
#include "GeometryGUI_Skeleton_QTD.h"
#include "SALOME_Selection.h"
#include "GEOM_ShapeTypeFilter.hxx"
#include <qvariant.h>
#include <qdialog.h>
#include <qwidget.h>
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
class GeometryGUI;
class GeometryGUI_Skeleton : public GeometryGUI_Skeleton_QTD
{
Q_OBJECT
public:
GeometryGUI_Skeleton(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GeometryGUI_Skeleton();
private :
void Init(SALOME_Selection* Sel);
protected:
void closeEvent(QCloseEvent* e);
TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
SALOME_Selection* mySelection ; /* User shape selection */
GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
GeometryGUI* myGeomGUI; /* Current GeomGUI object */
protected slots:
void ClickOnCancel();
void LineEditReturnPressed();
void DeactivateActiveDialog();
void ActivateThisDialog();
};
#endif // GEOMETRYGUI_SKELETON_H

View File

@ -0,0 +1,111 @@
/****************************************************************************
** Form implementation generated from reading ui file 'GeometryGUI_Skeleton_QTD.ui'
**
** Created: mar sep 23 15:06:58 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "GeometryGUI_Skeleton_QTD.h"
#include <qvariant.h>
#include <qbuttongroup.h>
#include <qgroupbox.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a GeometryGUI_Skeleton_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
GeometryGUI_Skeleton_QTD::GeometryGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "GeometryGUI_Skeleton_QTD" );
resize( 307, 147 );
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
setCaption( trUtf8( "GeometryGUI_Skeleton_QTD" ) );
setSizeGripEnabled( TRUE );
GeometryGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "GeometryGUI_Skeleton_QTDLayout");
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
GroupButtons->setTitle( trUtf8( "" ) );
GroupButtons->setColumnLayout(0, Qt::Vertical );
GroupButtons->layout()->setSpacing( 6 );
GroupButtons->layout()->setMargin( 11 );
GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3");
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
buttonOk->setText( trUtf8( "&Ok" ) );
Layout3->addWidget( buttonOk );
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
buttonApply->setText( trUtf8( "&Apply" ) );
Layout3->addWidget( buttonApply );
QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout3->addItem( spacer );
buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
buttonCancel->setText( trUtf8( "&Cancel" ) );
Layout3->addWidget( buttonCancel );
GroupButtonsLayout->addLayout( Layout3 );
Layout1->addWidget( GroupButtons, 2, 0 );
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
GroupConstructors->setTitle( trUtf8( "" ) );
GroupConstructors->setColumnLayout(0, Qt::Vertical );
GroupConstructors->layout()->setSpacing( 6 );
GroupConstructors->layout()->setMargin( 11 );
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
RadioButton1 = new QRadioButton( GroupConstructors, "RadioButton1" );
RadioButton1->setText( trUtf8( "" ) );
Layout2->addWidget( RadioButton1 );
RadioButton2 = new QRadioButton( GroupConstructors, "RadioButton2" );
RadioButton2->setText( trUtf8( "" ) );
Layout2->addWidget( RadioButton2 );
RadioButton3 = new QRadioButton( GroupConstructors, "RadioButton3" );
RadioButton3->setText( trUtf8( "" ) );
Layout2->addWidget( RadioButton3 );
GroupConstructorsLayout->addLayout( Layout2, 0, 0 );
Layout1->addWidget( GroupConstructors, 0, 0 );
GroupMedium = new QGroupBox( this, "GroupMedium" );
GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
GroupMedium->setTitle( trUtf8( "" ) );
Layout1->addWidget( GroupMedium, 1, 0 );
GeometryGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
}
/*
* Destroys the object and frees any allocated resources
*/
GeometryGUI_Skeleton_QTD::~GeometryGUI_Skeleton_QTD()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,50 @@
/****************************************************************************
** Form interface generated from reading ui file 'GeometryGUI_Skeleton_QTD.ui'
**
** Created: mar sep 23 15:06:57 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef GEOMETRYGUI_SKELETON_QTD_H
#define GEOMETRYGUI_SKELETON_QTD_H
#include <qvariant.h>
#include <qdialog.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QPushButton;
class QRadioButton;
class GeometryGUI_Skeleton_QTD : public QDialog
{
Q_OBJECT
public:
GeometryGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~GeometryGUI_Skeleton_QTD();
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonApply;
QPushButton* buttonCancel;
QButtonGroup* GroupConstructors;
QRadioButton* RadioButton1;
QRadioButton* RadioButton2;
QRadioButton* RadioButton3;
QGroupBox* GroupMedium;
protected:
QGridLayout* GeometryGUI_Skeleton_QTDLayout;
QGridLayout* Layout1;
QHBoxLayout* GroupButtonsLayout;
QHBoxLayout* Layout3;
QGridLayout* GroupConstructorsLayout;
QHBoxLayout* Layout2;
};
#endif // GEOMETRYGUI_SKELETON_QTD_H

View File

@ -0,0 +1,200 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_SolidDlg.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
using namespace std;
#include "GeometryGUI_SolidDlg.h"
#include "GeometryGUI.h"
#include "QAD_Desktop.h"
//=================================================================================
// class : GeometryGUI_SolidDlg()
// purpose : Constructs a GeometryGUI_SolidDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
GeometryGUI_SolidDlg::GeometryGUI_SolidDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
:GeometryGUI_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_SOLID")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
setCaption(tr("GEOM_SOLID_TITLE"));
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_SOLID"));
RadioButton1->setPixmap(image0);
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
GroupSolid = new GeometryGUI_1Sel_QTD(this, "GroupSolid");
GroupSolid->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupSolid->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupSolid->PushButton1->setPixmap(image1);
Layout1->addWidget(GroupSolid, 1, 0);
/***************************************************************/
/* Initialisations */
Init(Sel);
}
//=================================================================================
// function : ~GeometryGUI_SolidDlg()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
GeometryGUI_SolidDlg::~GeometryGUI_SolidDlg()
{
// no need to delete child widgets, Qt does it all for us
}
//=================================================================================
// function : Init()
// purpose :
//=================================================================================
void GeometryGUI_SolidDlg::Init(SALOME_Selection* Sel)
{
/* init variables */
myEditCurrentArgument = GroupSolid->LineEdit1;
myOkListShapes = false;
myShellFilter = new GEOM_ShapeTypeFilter(TopAbs_SHELL, myGeom);
/* filter for next selection */
mySelection->AddFilter(myShellFilter);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupSolid->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */
GroupSolid->show();
this->show();
return;
}
//=================================================================================
// function : ClickOnOk()
// purpose :
//=================================================================================
void GeometryGUI_SolidDlg::ClickOnOk()
{
this->ClickOnApply();
ClickOnCancel();
return ;
}
//=================================================================================
// function : ClickOnApply()
// purpose :
//=================================================================================
void GeometryGUI_SolidDlg::ClickOnApply()
{
myGeomGUI->GetDesktop()->putInfo(tr(""));
if(myOkListShapes)
myGeomGUI->MakeSolidAndDisplay(myListShapes);
return;
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
//=================================================================================
void GeometryGUI_SolidDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText("");
QString aString = "";
myOkListShapes = false;
int nbSel = mySelection->IObjectCount();
if (nbSel == 0)
return;
aString = tr("%1_objects").arg(nbSel);
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
myEditCurrentArgument->setText(aString);
myOkListShapes = true;
return ;
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
//=================================================================================
void GeometryGUI_SolidDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
mySelection->ClearFilters() ;
if(send == GroupSolid->PushButton1) {
GroupSolid->LineEdit1->setFocus();
myEditCurrentArgument = GroupSolid->LineEdit1;
mySelection->AddFilter(myShellFilter);
}
SelectionIntoArgument();
return ;
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void GeometryGUI_SolidDlg::ActivateThisDialog()
{
GeometryGUI_Skeleton::ActivateThisDialog();
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
return ;
}
//=================================================================================
// function : enterEvent()
// purpose :
//=================================================================================
void GeometryGUI_SolidDlg::enterEvent(QEvent* e)
{
if (GroupConstructors->isEnabled())
return;
this->ActivateThisDialog();
return;
}

View File

@ -0,0 +1,67 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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 : GeometryGUI_SolidDlg.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef DIALOGBOX_SOLID_H
#define DIALOGBOX_SOLID_H
#include "GeometryGUI_Skeleton.h"
#include "GeometryGUI_1Sel_QTD.h"
//=================================================================================
// class : GeometryGUI_SolidDlg
// purpose :
//=================================================================================
class GeometryGUI_SolidDlg : public GeometryGUI_Skeleton
{
Q_OBJECT
public:
GeometryGUI_SolidDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GeometryGUI_SolidDlg();
private:
void Init(SALOME_Selection* Sel);
void enterEvent(QEvent * e);
Handle(GEOM_ShapeTypeFilter) myShellFilter; /* filter for selection */
GEOM::GEOM_Gen::ListOfIOR myListShapes;
bool myOkListShapes; /* to check when arguments is defined */
GeometryGUI_1Sel_QTD* GroupSolid;
private slots:
void ClickOnOk();
void ClickOnApply();
void SetEditCurrentArgument();
void LineEditReturnPressed();
void SelectionIntoArgument();
void ActivateThisDialog();
};
#endif // DIALOGBOX_SOLID_H

View File

@ -48,6 +48,18 @@ PO_FILES = \
LIB = libGEOMGUI.la LIB = libGEOMGUI.la
LIB_SRC = GeometryGUI.cxx \ LIB_SRC = GeometryGUI.cxx \
GeometryGUI_SpinBox.cxx \ GeometryGUI_SpinBox.cxx \
GeometryGUI_Skeleton_QTD.cxx \
GeometryGUI_Skeleton.cxx \
GeometryGUI_1Sel_QTD.cxx \
GeometryGUI_2Sel_QTD.cxx \
GeometryGUI_1Sel1Spin_QTD.cxx \
GeometryGUI_1Sel1Spin.cxx \
GeometryGUI_1Sel4Spin_QTD.cxx \
GeometryGUI_1Sel4Spin.cxx \
GeometryGUI_2Sel1Spin_QTD.cxx \
GeometryGUI_2Sel1Spin.cxx \
GeometryGUI_3Spin_QTD.cxx \
GeometryGUI_3Spin.cxx \
GeometryGUI_TransparencyDlg.cxx \ GeometryGUI_TransparencyDlg.cxx \
GeometryGUI_NbIsosDlg.cxx \ GeometryGUI_NbIsosDlg.cxx \
GeometryGUI_BoxDlg.cxx \ GeometryGUI_BoxDlg.cxx \
@ -87,6 +99,8 @@ LIB_SRC = GeometryGUI.cxx \
GeometryGUI_InertiaDlg.cxx \ GeometryGUI_InertiaDlg.cxx \
GeometryGUI_CenterMassDlg.cxx \ GeometryGUI_CenterMassDlg.cxx \
GeometryGUI_FaceDlg.cxx \ GeometryGUI_FaceDlg.cxx \
GeometryGUI_ShellDlg.cxx \
GeometryGUI_SolidDlg.cxx \
GeometryGUI_BndBoxDlg.cxx \ GeometryGUI_BndBoxDlg.cxx \
GeometryGUI_MaxToleranceDlg.cxx \ GeometryGUI_MaxToleranceDlg.cxx \
GeometryGUI_WhatisDlg.cxx \ GeometryGUI_WhatisDlg.cxx \
@ -104,6 +118,18 @@ LIB_SRC = GeometryGUI.cxx \
LIB_MOC = \ LIB_MOC = \
GeometryGUI.h \ GeometryGUI.h \
GeometryGUI_SpinBox.h \ GeometryGUI_SpinBox.h \
GeometryGUI_Skeleton_QTD.h \
GeometryGUI_Skeleton.h \
GeometryGUI_1Sel_QTD.h \
GeometryGUI_2Sel_QTD.h \
GeometryGUI_1Sel1Spin_QTD.h \
GeometryGUI_1Sel1Spin.h \
GeometryGUI_1Sel4Spin_QTD.h \
GeometryGUI_1Sel4Spin.h \
GeometryGUI_2Sel1Spin_QTD.h \
GeometryGUI_2Sel1Spin.h \
GeometryGUI_3Spin_QTD.h \
GeometryGUI_3Spin.h \
GeometryGUI_TransparencyDlg.h \ GeometryGUI_TransparencyDlg.h \
GeometryGUI_NbIsosDlg.h \ GeometryGUI_NbIsosDlg.h \
GeometryGUI_BoxDlg.h \ GeometryGUI_BoxDlg.h \
@ -143,6 +169,8 @@ LIB_MOC = \
GeometryGUI_InertiaDlg.h \ GeometryGUI_InertiaDlg.h \
GeometryGUI_CenterMassDlg.h \ GeometryGUI_CenterMassDlg.h \
GeometryGUI_FaceDlg.h \ GeometryGUI_FaceDlg.h \
GeometryGUI_ShellDlg.h \
GeometryGUI_SolidDlg.h \
GeometryGUI_BndBoxDlg.h \ GeometryGUI_BndBoxDlg.h \
GeometryGUI_MaxToleranceDlg.h \ GeometryGUI_MaxToleranceDlg.h \
GeometryGUI_WhatisDlg.h \ GeometryGUI_WhatisDlg.h \

View File

@ -65,6 +65,9 @@ GEOM_Actor::GEOM_Actor()
this->ShadingProperty = NULL; this->ShadingProperty = NULL;
this->WireframeProperty = NULL; this->WireframeProperty = NULL;
//DCQ : Bug Color Face :
this->PreviewProperty = NULL;
//DCQ
this->deflection = 0; this->deflection = 0;
myDisplayMode = 0; myDisplayMode = 0;
@ -86,6 +89,10 @@ GEOM_Actor::~GEOM_Actor()
ShadingMapper->Delete(); ShadingMapper->Delete();
if (ShadingProperty != NULL) if (ShadingProperty != NULL)
ShadingProperty->Delete(); ShadingProperty->Delete();
//DCQ : Bug Color Face :
if (PreviewProperty != NULL)
PreviewProperty->Delete();
//DCQ
if (WireframeProperty != NULL) if (WireframeProperty != NULL)
WireframeProperty->Delete(); WireframeProperty->Delete();
if (HighlightProperty != NULL) if (HighlightProperty != NULL)
@ -126,12 +133,15 @@ void GEOM_Actor::setDisplayMode(int thenewmode) {
if ((myShape.ShapeType() == TopAbs_WIRE) || if ((myShape.ShapeType() == TopAbs_WIRE) ||
(myShape.ShapeType() == TopAbs_EDGE) || (myShape.ShapeType() == TopAbs_EDGE) ||
(myShape.ShapeType() == TopAbs_VERTEX)) { (myShape.ShapeType() == TopAbs_VERTEX)) {
if ( !subshape ) if ( !subshape ) {
CreateWireframeMapper(); CreateWireframeMapper();
else }
else {
return; return;
} else }
} else {
CreateShadingMapper(); CreateShadingMapper();
}
} else } else
CreateWireframeMapper(); CreateWireframeMapper();
} }
@ -180,16 +190,36 @@ void GEOM_Actor::CreateMapper(int theMode) {
aread->setDisplayMode(theMode); aread->setDisplayMode(theMode);
aread->GetOutput()->ReleaseDataFlagOn(); aread->GetOutput()->ReleaseDataFlagOn();
vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New(); // vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
if (theMode == 0) { // if (theMode == 0) {
aMapper->SetInput(aread->GetOutput()); // aMapper->SetInput(aread->GetOutput());
} else { // } else {
// vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
// normals->SetInput(aread->GetOutput());
// aMapper->SetInput(normals->GetOutput());
// }
// aread->Delete();
// this->SetMapper(theMode == 0? WireframeMapper = aMapper : ShadingMapper = aMapper);
vtkPolyDataMapper* aMapperWF = vtkPolyDataMapper::New();
vtkPolyDataMapper* aMapperSH = vtkPolyDataMapper::New();
vtkPolyDataNormals *normals = vtkPolyDataNormals::New(); vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
aMapperWF->SetInput(aread->GetOutput());
normals->SetInput(aread->GetOutput()); normals->SetInput(aread->GetOutput());
aMapper->SetInput(normals->GetOutput()); aMapperSH->SetInput(normals->GetOutput());
}
WireframeMapper = aMapperWF;
ShadingMapper = aMapperSH;
aread->Delete(); aread->Delete();
this->SetMapper(theMode == 0? WireframeMapper = aMapper : ShadingMapper = aMapper);
if (theMode == 0) {
this->SetMapper(WireframeMapper);
} else {
this->SetMapper(ShadingMapper);
}
} }
void GEOM_Actor::CreateShadingMapper() { void GEOM_Actor::CreateShadingMapper() {
@ -256,6 +286,7 @@ void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *Mapper)
else { else {
if(WireframeMapper==NULL) CreateWireframeMapper(); if(WireframeMapper==NULL) CreateWireframeMapper();
} }
if(myShape.ShapeType() == TopAbs_VERTEX) { if(myShape.ShapeType() == TopAbs_VERTEX) {
if(ren){ if(ren){
//The parameter determine size of vertex actor relate to diagonal of RendererWindow //The parameter determine size of vertex actor relate to diagonal of RendererWindow
@ -274,6 +305,10 @@ void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *Mapper)
aMatrix->Delete(); aMatrix->Delete();
} else } else
this->Device->Render(ren, this->Mapper); this->Device->Render(ren, this->Mapper);
if(myDisplayMode >= 1)
this->EstimatedRenderTime = ShadingMapper->GetTimeToDraw();
else
this->EstimatedRenderTime = WireframeMapper->GetTimeToDraw(); this->EstimatedRenderTime = WireframeMapper->GetTimeToDraw();
} }
@ -296,6 +331,9 @@ void GEOM_Actor::SetOpacity(float opa)
//HighlightProperty->SetOpacity(opa); //HighlightProperty->SetOpacity(opa);
SALOME_Actor::SetOpacity(opa); SALOME_Actor::SetOpacity(opa);
ShadingProperty->SetOpacity(opa); ShadingProperty->SetOpacity(opa);
//DCQ : Bug Color Face :
PreviewProperty->SetOpacity(opa);
//DCQ
} }
float GEOM_Actor::GetOpacity() { float GEOM_Actor::GetOpacity() {
@ -307,6 +345,9 @@ float GEOM_Actor::GetOpacity() {
//------------------------------------------------------------- //-------------------------------------------------------------
void GEOM_Actor::SetColor(float r,float g,float b) { void GEOM_Actor::SetColor(float r,float g,float b) {
ShadingProperty->SetColor(r,g,b); ShadingProperty->SetColor(r,g,b);
//DCQ : Bug Color Face :
PreviewProperty->SetColor(r,g,b);
//DCQ
} }
void GEOM_Actor::GetColor(float& r,float& g,float& b) { void GEOM_Actor::GetColor(float& r,float& g,float& b) {

View File

@ -208,7 +208,10 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap
FaceActor->SetShadingProperty(FaceProp); FaceActor->SetShadingProperty(FaceProp);
FaceActor->SetWireframeProperty(IsoProp); FaceActor->SetWireframeProperty(IsoProp);
FaceActor->SetPreviewProperty(IsoPVProp); //DCQ : Bug Color Face :
//FaceActor->SetPreviewProperty(IsoPVProp);
FaceActor->SetPreviewProperty(FaceProp);
//DCQ
FaceActor->setInputShape(ex.Current(),deflection,mode); FaceActor->setInputShape(ex.Current(),deflection,mode);
@ -266,7 +269,10 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap
EdgeActor->setInputShape(ex.Current(),deflection,mode); EdgeActor->setInputShape(ex.Current(),deflection,mode);
EdgeActor->SetShadingProperty(EdgeIProp); EdgeActor->SetShadingProperty(EdgeIProp);
EdgeActor->SetWireframeProperty(EdgeIProp); EdgeActor->SetWireframeProperty(EdgeIProp);
EdgeActor->SetPreviewProperty(EdgePVProp); //DCQ : Bug Color Face :
//EdgeActor->SetPreviewProperty(EdgePVProp);
EdgeActor->SetPreviewProperty(EdgeIProp);
//DCQ
AISActors->AddItem(EdgeActor); AISActors->AddItem(EdgeActor);
} }
@ -275,7 +281,10 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap
EdgeActor->setInputShape(myShape,deflection,mode); EdgeActor->setInputShape(myShape,deflection,mode);
EdgeActor->SetShadingProperty(EdgeIProp); EdgeActor->SetShadingProperty(EdgeIProp);
EdgeActor->SetWireframeProperty(EdgeIProp); EdgeActor->SetWireframeProperty(EdgeIProp);
EdgeActor->SetPreviewProperty(EdgePVProp); //DCQ : Bug Color Face :
//EdgeActor->SetPreviewProperty(EdgePVProp);
EdgeActor->SetPreviewProperty(EdgeIProp);
//DCQ
AISActors->AddItem(EdgeActor); AISActors->AddItem(EdgeActor);
} else if ( myShape.ShapeType() == TopAbs_VERTEX ) { // VERTEX Actor } else if ( myShape.ShapeType() == TopAbs_VERTEX ) { // VERTEX Actor
@ -283,7 +292,10 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap
VertexActor->setInputShape(myShape,deflection,mode); VertexActor->setInputShape(myShape,deflection,mode);
VertexActor->SetShadingProperty(VertexProp); VertexActor->SetShadingProperty(VertexProp);
VertexActor->SetWireframeProperty(VertexProp); VertexActor->SetWireframeProperty(VertexProp);
VertexActor->SetPreviewProperty(VertexPVProp); //DCQ : Bug Color Face :
//VertexActor->SetPreviewProperty(VertexPVProp);
VertexActor->SetPreviewProperty(VertexProp);
//DCQ
AISActors->AddItem(VertexActor); AISActors->AddItem(VertexActor);