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()
@ -2782,6 +2829,22 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
GeometryGUI_FaceDlg *aDlg = new GeometryGUI_FaceDlg ( parent, "", Sel ) ; GeometryGUI_FaceDlg *aDlg = new GeometryGUI_FaceDlg ( parent, "", Sel ) ;
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
{ {

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()
@ -62,154 +43,40 @@ 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_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 ) setCaption(tr("GEOM_BOX_TITLE"));
setName( "GeometryGUI_BoxDlg" );
resize( 335, 220 );
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->setExclusive( TRUE );
GroupConstructors->setColumnLayout(0, Qt::Vertical );
GroupConstructors->layout()->setSpacing( 0 );
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 );
/***************************************************************/ /***************************************************************/
GroupButtons = new QGroupBox( this, "GroupButtons" ); GroupConstructors->setTitle(tr("GEOM_BOX"));
GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); RadioButton1->setPixmap(image0);
GroupButtons->setTitle( tr( "" ) ); RadioButton2->setPixmap(image1);
GroupButtons->setColumnLayout(0, Qt::Vertical ); RadioButton3->close(TRUE);
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 GeometryGUI_2Sel_QTD(this, "GroupPoints");
GroupPoints = new QGroupBox( this, "GroupPoints" ); GroupPoints->GroupBox1->setTitle(tr("GEOM_DIAGONAL_POINTS"));
GroupPoints->setGeometry( QRect( 10, 10, 280, 90 ) ); GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
GroupPoints->setTitle( tr( "GEOM_DIAGONAL_POINTS" ) ); GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
GroupPoints->setFrameShape( QGroupBox::Box ); GroupPoints->PushButton1->setPixmap(image2);
GroupPoints->setFrameShadow( QGroupBox::Sunken ); GroupPoints->PushButton2->setPixmap(image2);
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 GeometryGUI_3Spin(this, "GroupDimensions");
GroupDimensions = new QGroupBox( this, "GroupDimensions" ); GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
GroupDimensions->setGeometry( QRect( 11, 75, 310, 80 ) ); GroupDimensions->TextLabel1->setText(tr("GEOM_DX"));
GroupDimensions->setTitle( tr( "GEOM_BOX_OBJ" ) ); GroupDimensions->TextLabel2->setText(tr("GEOM_DY"));
GroupDimensions->setColumnLayout(0, Qt::Vertical ); GroupDimensions->TextLabel3->setText(tr("GEOM_DZ"));
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" ); Layout1->addWidget(GroupPoints, 1, 0);
TextLabel_DZ->setText( tr( "GEOM_DZ" ) ); Layout1->addWidget(GroupDimensions, 1, 0);
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 ); /* Initialisations */
GroupDimensionsLayout->addItem( spacer1, 1, 3 ); Init(Sel);
GeometryGUI_BoxDlgLayout->addWidget( GroupDimensions, 1, 0 );
/* Initialisations */
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) ;
} }
@ -228,190 +94,156 @@ GeometryGUI_BoxDlg::~GeometryGUI_BoxDlg()
// function : Init() // function : Init()
// purpose : // purpose :
//================================================================================= //=================================================================================
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 ) ; double initValue = 200.0;
SpinBox_DZ->SetValue( 200.0 ) ; GroupDimensions->SpinBox_DX->SetValue(initValue);
GroupDimensions->SpinBox_DY->SetValue(initValue);
GroupDimensions->SpinBox_DZ->SetValue(initValue);
GroupPoints->show();
GroupDimensions->hide() ;
myConstructorId = 0 ;
Constructor1->setChecked( TRUE );
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( SpinBox_DY, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
connect( SpinBox_DZ, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
connect( LineEditPt1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( LineEditPt2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ; connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
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 */ connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
int x, y ; connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
myGeomGUI->DefineDlgPosition( this, x, y ) ;
this->move( x, y ) ; 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)));
this->show() ; /* displays Dialog */ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
/* displays Dialog */
GroupDimensions->hide();
GroupPoints->show();
this->show();
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:
{ {
GroupDimensions->hide();
resize(0, 0);
GroupPoints->show(); GroupPoints->show();
GroupDimensions->hide() ; myEditCurrentArgument = GroupPoints->LineEdit1;
myConstructorId = constructorId ; GroupPoints->LineEdit1->setText("");
myEditCurrentArgument = LineEditPt1 ; GroupPoints->LineEdit2->setText("");
Constructor1->setChecked( TRUE );
LineEditPt1->setText("") ;
LineEditPt2->setText("") ;
myOkPoint1 = myOkPoint2 = false ;
/* filter for next selection */ /* filter for next selection */
mySelection->AddFilter( myVertexFilter ); mySelection->AddFilter(myVertexFilter);
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); connect (mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break; break;
} }
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;
GroupDimensions->SpinBox_DX->SetValue(initValue);
double initValue = 200.0 ; GroupDimensions->SpinBox_DY->SetValue(initValue);
SpinBox_DX->SetValue( initValue ) ; GroupDimensions->SpinBox_DZ->SetValue(initValue);
SpinBox_DY->SetValue( initValue ) ;
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);
mySimulationTopoDs = BRepPrimAPI_MakeBox( myPoint1, myPoint2 ).Shape(); mySimulationTopoDs = BRepPrimAPI_MakeBox(myPoint1, myPoint2).Shape();
myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
break; break;
} }
} }
return ; return;
} }
//================================================================================= //=================================================================================
// function : ClickOnOk() // function : ClickOnOk()
// purpose : // purpose :
//================================================================================= //=================================================================================
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 ;
} }
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);
break ; break;
} }
} }
return ; return;
}
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_BoxDlg::ClickOnCancel()
{
mySelection->ClearFilters() ;
myGeomGUI->EraseSimulationShape() ;
mySimulationTopoDs.Nullify() ;
disconnect( mySelection, 0, this, 0 );
myGeomGUI->ResetState() ;
reject() ;
return ;
} }
@ -421,42 +253,38 @@ void GeometryGUI_BoxDlg::ClickOnCancel()
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::SelectionIntoArgument() void GeometryGUI_BoxDlg::SelectionIntoArgument()
{ {
myEditCurrentArgument->setText("") ; myGeomGUI->EraseSimulationShape();
myGeomGUI->EraseSimulationShape() ; myEditCurrentArgument->setText("");
mySimulationTopoDs.Nullify() ; QString aString = ""; /* name of selection */
QString aString = "" ; /* name of selection */ int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
if (nbSel != 1) {
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; if (myEditCurrentArgument == GroupPoints->LineEdit1)
if ( nbSel != 1 ) { myOkPoint1 = false;
if ( myEditCurrentArgument == LineEditPt1 ) { else if ( myEditCurrentArgument == GroupPoints->LineEdit2)
myOkPoint1 = false ; myOkPoint2 = false;
} return;
else if ( myEditCurrentArgument == LineEditPt2 ) {
myOkPoint2 = false ;
}
return ;
} }
// nbSel == 1 // nbSel == 1
TopoDS_Shape S; TopoDS_Shape S;
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;
} }
if( myOkPoint1 && myOkPoint2 && TestBoxDimensions( myPoint1, myPoint2 ) ) { if(myOkPoint1 && myOkPoint2 && TestBoxDimensions(myPoint1, myPoint2)) {
mySimulationTopoDs = BRepPrimAPI_MakeBox( myPoint1, myPoint2 ).Shape(); mySimulationTopoDs = BRepPrimAPI_MakeBox(myPoint1, myPoint2).Shape();
myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
} }
return ; return;
} }
@ -466,69 +294,23 @@ 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)
{
case 0: // default constructor
{
if(send == SelectButtonPt1) {
LineEditPt1->setFocus() ;
myEditCurrentArgument = LineEditPt1;
}
else if(send == SelectButtonPt2) {
LineEditPt2->setFocus() ;
myEditCurrentArgument = LineEditPt2;
}
mySelection->AddFilter(myVertexFilter) ;
SelectionIntoArgument() ;
break;
}
case 1:
{
/* nothing to do here */
break;
}
}
return ;
}
//================================================================================= if(send == GroupPoints->PushButton1) {
// function : ValueChangedInSpinBox() GroupPoints->LineEdit1->setFocus();
// purpose : myEditCurrentArgument = GroupPoints->LineEdit1;
//================================================================================= }
void GeometryGUI_BoxDlg::ValueChangedInSpinBox( double newValue ) else if(send == GroupPoints->PushButton2) {
{ GroupPoints->LineEdit2->setFocus();
if(myConstructorId != 1) myEditCurrentArgument = GroupPoints->LineEdit2;
return ; }
mySelection->AddFilter(myVertexFilter);
myGeomGUI->EraseSimulationShape() ; this->SelectionIntoArgument();
mySimulationTopoDs.Nullify() ;
QObject* send = (QObject*)sender() ; return;
double vx, vy, vz ;
if( send == SpinBox_DX ) {
vx = newValue ;
vy = SpinBox_DY->GetValue() ;
vz = SpinBox_DZ->GetValue() ;
} else if ( send == SpinBox_DY ) {
vx = SpinBox_DX->GetValue() ;
vy = newValue ;
vz = SpinBox_DZ->GetValue() ;
} else if (send == SpinBox_DZ ) {
vx = SpinBox_DX->GetValue() ;
vy = SpinBox_DY->GetValue() ;
vz = newValue ;
}
myPoint1.SetCoord(0.0, 0.0, 0.0) ;
myPoint2.SetCoord(vx, vy, vz) ;
if ( TestBoxDimensions( myPoint1, myPoint2 ) ) {
mySimulationTopoDs = BRepPrimAPI_MakeBox( myPoint1, myPoint2 ).Shape();
myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
}
return ;
} }
@ -538,45 +320,16 @@ void GeometryGUI_BoxDlg::ValueChangedInSpinBox( double newValue )
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::LineEditReturnPressed() void GeometryGUI_BoxDlg::LineEditReturnPressed()
{ {
QLineEdit* send = (QLineEdit*)sender(); QLineEdit* send = (QLineEdit*)sender();
if( send == LineEditPt1 ) if(send == GroupPoints->LineEdit1)
myEditCurrentArgument = LineEditPt1 ; myEditCurrentArgument = GroupPoints->LineEdit1;
else if ( send == LineEditPt2 ) else if (send == GroupPoints->LineEdit2)
myEditCurrentArgument = LineEditPt2 ; myEditCurrentArgument = GroupPoints->LineEdit2;
else else
return ; 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 ;
}
GeometryGUI_Skeleton::LineEditReturnPressed();
//================================================================================= 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 ;
} }
@ -586,20 +339,11 @@ void GeometryGUI_BoxDlg::DeactivateActiveDialog()
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::ActivateThisDialog() void GeometryGUI_BoxDlg::ActivateThisDialog()
{ {
GeometryGUI_Skeleton::ActivateThisDialog();
/* Emit a signal to deactivate the active dialog */ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
myGeomGUI->EmitSignalDeactivateDialog() ; if(!mySimulationTopoDs.IsNull())
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
GroupConstructors->setEnabled(true) ; return;
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 ;
} }
@ -609,19 +353,46 @@ void GeometryGUI_BoxDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::enterEvent(QEvent* e) void GeometryGUI_BoxDlg::enterEvent(QEvent* e)
{ {
if ( GroupConstructors->isEnabled() ) if (GroupConstructors->isEnabled())
return ; return;
ActivateThisDialog() ; this->ActivateThisDialog();
return;
} }
//================================================================================= //=================================================================================
// function : closeEvent() // function : ValueChangedInSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GeometryGUI_BoxDlg::closeEvent( QCloseEvent* e ) void GeometryGUI_BoxDlg::ValueChangedInSpinBox(double newValue)
{ {
this->ClickOnCancel() ; /* same than click on cancel button */ myGeomGUI->EraseSimulationShape();
mySimulationTopoDs.Nullify();
QObject* send = (QObject*)sender();
double vx, vy, vz;
if(send == GroupDimensions->SpinBox_DX ) {
vx = newValue;
vy = GroupDimensions->SpinBox_DY->GetValue();
vz = GroupDimensions->SpinBox_DZ->GetValue();
} else if (send == GroupDimensions->SpinBox_DY) {
vx = GroupDimensions->SpinBox_DX->GetValue();
vy = newValue;
vz = GroupDimensions->SpinBox_DZ->GetValue();
} else if (send == GroupDimensions->SpinBox_DZ) {
vx = GroupDimensions->SpinBox_DX->GetValue();
vy = GroupDimensions->SpinBox_DY->GetValue();
vz = newValue;
}
myPoint1.SetCoord(0.0, 0.0, 0.0);
myPoint2.SetCoord(vx, vy, vz);
if(TestBoxDimensions(myPoint1, myPoint2)) {
mySimulationTopoDs = BRepPrimAPI_MakeBox(myPoint1, myPoint2).Shape();
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
}
return;
} }
@ -629,11 +400,11 @@ void GeometryGUI_BoxDlg::closeEvent( QCloseEvent* e )
// function : TestBoxDimensions() // function : TestBoxDimensions()
// purpose : // purpose :
//================================================================================= //=================================================================================
bool GeometryGUI_BoxDlg::TestBoxDimensions(gp_Pnt P1, gp_Pnt P2) bool GeometryGUI_BoxDlg::TestBoxDimensions(gp_Pnt P1, gp_Pnt P2)
{ {
if ( ( fabs( P1.X() - P2.X() ) > Precision::Confusion() ) && if ((fabs(P1.X() - P2.X()) > Precision::Confusion()) &&
( fabs( P1.Y() - P2.Y() ) > Precision::Confusion() ) && (fabs(P1.Y() - P2.Y()) > Precision::Confusion()) &&
( fabs( P1.Z() - P2.Z() ) > Precision::Confusion() ) ) (fabs(P1.Z() - P2.Z()) > Precision::Confusion()))
return true ; return true;
return false ; return false;
} }

View File

@ -29,110 +29,50 @@
#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
public: public:
GeometryGUI_BoxDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); GeometryGUI_BoxDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GeometryGUI_BoxDlg(); ~GeometryGUI_BoxDlg();
private : private :
void Init(SALOME_Selection* Sel);
void closeEvent( QCloseEvent* e ) ; void enterEvent(QEvent* e);
void enterEvent( QEvent* e ); bool TestBoxDimensions(gp_Pnt P1, gp_Pnt P2);
void Init(SALOME_Selection* Sel) ;
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 */
SALOME_Selection* mySelection ; /* User shape selection */
gp_Pnt myPoint1 ; /* Points containing the vector */
gp_Pnt myPoint2 ;
bool myOkPoint1 ; /* true when myPoint is defined */
bool myOkPoint2 ;
int myConstructorId ; /* Current constructor id = radio button id */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */ Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* filter for selection */
gp_Pnt myPoint1; /* Points containing the vector */
gp_Pnt myPoint2;
bool myOkPoint1; /* true when myPoint is defined */
bool myOkPoint2;
QButtonGroup* GroupConstructors; GeometryGUI_2Sel_QTD* GroupPoints;
QRadioButton* Constructor1; GeometryGUI_3Spin* GroupDimensions;
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 ActivateThisDialog();
void SelectionIntoArgument() ; void LineEditReturnPressed();
void LineEditReturnPressed() ; void SelectionIntoArgument();
void DeactivateActiveDialog() ; void SetEditCurrentArgument();
void ActivateThisDialog() ; void ConstructorsClicked(int constructorId);
void ValueChangedInSpinBox( double newValue ) ; void ValueChangedInSpinBox(double newValue);
protected:
QGridLayout* GeometryGUI_BoxDlgLayout;
QGridLayout* GroupConstructorsLayout;
QGridLayout* GroupButtonsLayout;
QGridLayout* GroupPointsLayout;
QGridLayout* GroupDimensionsLayout;
}; };

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()
@ -57,111 +39,32 @@ 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_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 ) setCaption(tr("GEOM_FUSE_TITLE"));
setName( "GeometryGUI_FuseDlg" );
resize( 322, 220 );
setCaption( tr( "GEOM_FUSE_TITLE" ) );
setSizeGripEnabled( TRUE );
GeometryGUI_FuseDlgLayout = new QGridLayout( this ); /***************************************************************/
GeometryGUI_FuseDlgLayout->setSpacing( 6 ); GroupConstructors->setTitle(tr("GEOM_FUSE"));
GeometryGUI_FuseDlgLayout->setMargin( 11 ); RadioButton1->setPixmap(image0);
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
/***************************************************************/ GroupFuse = new GeometryGUI_2Sel_QTD(this, "GroupFuse");
GroupConstructors = new QButtonGroup( this, "GroupConstructors" ); GroupFuse->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupConstructors->setTitle( tr( "GEOM_FUSE" ) ); GroupFuse->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
GroupConstructors->setExclusive( TRUE ); GroupFuse->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
GroupConstructors->setColumnLayout(0, Qt::Vertical ); GroupFuse->PushButton1->setPixmap(image1);
GroupConstructors->layout()->setSpacing( 0 ); GroupFuse->PushButton2->setPixmap(image1);
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 );
/***************************************************************/ Layout1->addWidget(GroupFuse, 1, 0);
GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" ); /***************************************************************/
GroupConstructor1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupConstructor1->setColumnLayout(0, Qt::Vertical );
GroupConstructor1->layout()->setSpacing( 0 );
GroupConstructor1->layout()->setMargin( 0 );
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 );
/***************************************************************/ /* Initialisation */
GroupButtons = new QGroupBox( this, "GroupButtons" ); Init(Sel);
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 */
Init( Sel ) ;
} }
@ -170,196 +73,114 @@ GeometryGUI_FuseDlg::GeometryGUI_FuseDlg( QWidget* parent, const char* name, SAL
// purpose : Destroys the object and frees any allocated resources // purpose : Destroys the object and frees any allocated resources
//================================================================================= //=================================================================================
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 ;
myShape1.Nullify() ;
myShape2.Nullify() ;
myConstructorId = 0 ;
myGeomGUI = GeometryGUI::GetGeometryGUI() ;
GroupConstructor1->show();
myConstructorId = 0 ;
myEditCurrentArgument = LineEditC1A1Shape ;
Constructor1->setChecked( TRUE );
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 */
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) );
connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
connect( LineEditC1A1Shape, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
connect( LineEditC1A2Shape, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
connect( SelectButtonC1A1Shape, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
connect( SelectButtonC1A2Shape, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
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 */
int x, y ;
myGeomGUI->DefineDlgPosition( this, x, y ) ;
this->move( x, y ) ;
this->show() ; /* Displays Dialog */
return ;
}
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
void GeometryGUI_FuseDlg::ConstructorsClicked(int constructorId)
{ {
GeometryGUI::GetGeometryGUI()->EraseSimulationShape() ; /* init variables */
myEditCurrentArgument = GroupFuse->LineEdit1;
switch (constructorId) myShape1.Nullify();
{ myShape2.Nullify();
case 0: myOkShape1 = myOkShape2 = false;
{
GroupConstructor1->show(); /* signals and slots connections */
myConstructorId = constructorId ; connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
myEditCurrentArgument = LineEditC1A1Shape ; connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
LineEditC1A2Shape->setText(tr("")) ;
Constructor1->setChecked( TRUE ); connect(GroupFuse->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
myOkShape1 = myOkShape2 = false ; connect(GroupFuse->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
break;
} connect(GroupFuse->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
} connect(GroupFuse->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
return ;
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument()));
/* displays Dialog */
GroupFuse->show();
this->show();
return;
} }
//================================================================================= //=================================================================================
// function : ClickOnOk() // function : ClickOnOk()
// purpose : // purpose :
//================================================================================= //=================================================================================
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)
{ myGeomGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
case 0 :
{
if(myOkShape1 && myOkShape2) {
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("");
QString aString = "";
myEditCurrentArgument->setText("") ; /* by default */ int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
QString aString = ""; /* the name of selection */ if(nbSel != 1) {
if(myEditCurrentArgument == GroupFuse->LineEdit1)
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; myOkShape1 = false;
if ( nbSel != 1 ) { else if( myEditCurrentArgument == GroupFuse->LineEdit2)
switch (myConstructorId) myOkShape2 = false;
{ return;
case 0:
{
if ( myEditCurrentArgument == LineEditC1A1Shape ) {
myOkShape1 = false ;
}
else if ( myEditCurrentArgument == LineEditC1A2Shape ) {
myOkShape2 = false ;
}
break ;
}
}
return ;
} }
/* nbSel == 1 */ /* nbSel == 1 */
TopoDS_Shape S; TopoDS_Shape S;
Standard_Boolean testResult ; Standard_Boolean testResult;
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ; Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
return ;
if ( myEditCurrentArgument == LineEditC1A1Shape ) { if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; return;
if( !testResult )
return ; if(myEditCurrentArgument == GroupFuse->LineEdit1) {
myShape1 = S ; myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
LineEditC1A1Shape->setText(aString) ; if(!testResult)
myOkShape1 = true ; return;
} myShape1 = S;
else if ( myEditCurrentArgument == LineEditC1A2Shape ) { GroupFuse->LineEdit1->setText(aString);
myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ; myOkShape1 = true;
if( !testResult )
return ;
myShape2 = S ;
LineEditC1A2Shape->setText(aString) ;
myOkShape2 = true ;
} }
else if(myEditCurrentArgument == GroupFuse->LineEdit2) {
return ; myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
myShape2 = S;
GroupFuse->LineEdit2->setText(aString);
myOkShape2 = true;
}
return;
} }
@ -371,25 +192,18 @@ 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 ) { else if(send == GroupFuse->PushButton2) {
LineEditC1A1Shape->setFocus() ; GroupFuse->LineEdit2->setFocus();
myEditCurrentArgument = LineEditC1A1Shape ; myEditCurrentArgument = GroupFuse->LineEdit2;
} }
else if(send == SelectButtonC1A2Shape) { SelectionIntoArgument();
LineEditC1A2Shape->setFocus() ;
myEditCurrentArgument = LineEditC1A2Shape;
}
SelectionIntoArgument() ;
break;
}
}
return ;
}
return;
}
//================================================================================= //=================================================================================
@ -398,80 +212,39 @@ 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... */ return;
/* 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_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() ; connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
GroupConstructors->setEnabled(true) ; return;
GroupConstructor1->setEnabled(true) ; }
GroupButtons->setEnabled(true) ;
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); //=================================================================================
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,91 +29,44 @@
#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
public: public:
GeometryGUI_FuseDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); GeometryGUI_FuseDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GeometryGUI_FuseDlg(); ~GeometryGUI_FuseDlg();
private: private:
void Init(SALOME_Selection* Sel);
void enterEvent(QEvent* e);
void Init( SALOME_Selection* Sel ) ; TopoDS_Shape myShape1; /* topology used to fuse */
void closeEvent( QCloseEvent* e ) ; TopoDS_Shape myShape2; /* topology used to fuse */
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
bool myOkShape1; /* to check when arguments are defined */
bool myOkShape2;
GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */ GeometryGUI_2Sel_QTD* GroupFuse ;
GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
SALOME_Selection* mySelection ; /* User shape selection */
TopoDS_Shape myShape1 ; /* topology used to fuse */
TopoDS_Shape myShape2 ; /* topology used to fuse */
GEOM::GEOM_Shape_var myGeomShape1 ; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2 ; /* is myShape2 */
bool myOkShape1 ;
bool myOkShape2 ; /* to check when arguments are defined */
int myConstructorId ; /* Current constructor id = radio button id */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
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

File diff suppressed because it is too large Load Diff

View File

@ -29,151 +29,67 @@
#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
public: public:
GeometryGUI_PlaneDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); GeometryGUI_PlaneDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GeometryGUI_PlaneDlg(); ~GeometryGUI_PlaneDlg();
private : private :
void Init(SALOME_Selection* Sel);
void Init( SALOME_Selection* Sel ) ; void enterEvent(QEvent* e);
void closeEvent( QCloseEvent* 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 */
SALOME_Selection* mySelection ; /* User shape selection */
gp_Pnt myPoint1 ; /* Point on the plane */
Standard_Real myDx ;
Standard_Real myDy ;
Standard_Real myDz ;
Standard_Real myTrimSize ;
bool myOkPoint1 ; /* true when argument is defined */
bool myOkDirection ;
bool myOkCoordinates ;
bool myOkPlanarFace ;
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
int myConstructorId ; /* Current constructor id = radio button id */
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */ Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */
Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* Filters selection */ Handle(GEOM_ShapeTypeFilter) myEdgeFilter;
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */ Handle(GEOM_FaceFilter) myFaceFilter;
// Constructors gp_Pnt myPoint1; /* Point on the plane */
QButtonGroup* GroupConstructors;
QRadioButton* Constructor1;
QRadioButton* Constructor2;
QRadioButton* Constructor3;
// Constructor with a point + direction (vector) Standard_Real myDx;
QGroupBox* GroupPointDirection; Standard_Real myDy;
Standard_Real myDz;
Standard_Real myTrimSize;
QLabel* TextLabelPt1; bool myOkPoint1; /* true when argument is defined */
QPushButton* SelectButtonPt1; bool myOkDirection;
QLineEdit* LineEditPt1; bool myOkCoordinates;
bool myOkPlanarFace;
QLabel* TextLabelDirection;
QPushButton* SelectButtonDirection;
QLineEdit* LineEditDirection;
QLabel* TextLabelC1Size;
GeometryGUI_SpinBox* SpinBox_C1Size ;
// Constructor with a point + dx, dy, dz coordinates GeometryGUI_2Sel1Spin* GroupPointDirection;
QGroupBox* GroupPointPlusCoordinates; GeometryGUI_1Sel4Spin* GroupPointPlusCoordinates;
GeometryGUI_1Sel1Spin* GroupFace;
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 MakePlaneSimulationAndDisplay( const gp_Pnt& P, void ValueChangedInSpinBox(double newValue);
const Standard_Real dx, void MakePlaneSimulationAndDisplay(const gp_Pnt& P,
const Standard_Real dy, const Standard_Real dx,
const Standard_Real dz, const Standard_Real dy,
const Standard_Real trimSize ) ; const Standard_Real dz,
void ValueChangedInSpinBox( double newValue ) ; const Standard_Real trimSize);
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" ); setCaption(tr("GEOM_SHELL_TITLE"));
resize( 303, 190 );
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" ) ); RadioButton1->setPixmap(image0);
GroupConstructors->setExclusive( TRUE ); RadioButton2->close(TRUE);
GroupConstructors->setColumnLayout(0, Qt::Vertical ); RadioButton3->close(TRUE);
GroupConstructors->layout()->setSpacing( 0 );
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 ); Layout1->addWidget(GroupShell, 1, 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 );
/***************************************************************/ /* Initialisations */
GroupButtons = new QGroupBox( this, "GroupButtons" ); Init(Sel);
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 */
} }
@ -157,56 +76,33 @@ 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 */
int x, y ;
myGeomGUI->DefineDlgPosition( this, x, y ) ;
this->move( x, y ) ;
this->show() ; /* displays Dialog */
return ;
}
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
//================================================================================= /* displays Dialog */
// function : ConstructorsClicked() GroupShell->show();
// purpose : Radio button management this->show();
//=================================================================================
void GeometryGUI_ShellDlg::ConstructorsClicked(int constructorId) return;
{
return ;
} }
@ -216,9 +112,8 @@ void GeometryGUI_ShellDlg::ConstructorsClicked(int constructorId)
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::ClickOnOk() void GeometryGUI_ShellDlg::ClickOnOk()
{ {
this->ClickOnApply() ; this->ClickOnApply();
this->ClickOnCancel() ; ClickOnCancel();
return ; return ;
} }
@ -229,31 +124,12 @@ 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);
//================================================================================= return;
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GeometryGUI_ShellDlg::ClickOnCancel()
{
disconnect( mySelection, 0, this, 0 );
myGeomGUI->ResetState() ;
reject() ;
return ;
} }
@ -263,23 +139,21 @@ void GeometryGUI_ShellDlg::ClickOnCancel()
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::SelectionIntoArgument() void GeometryGUI_ShellDlg::SelectionIntoArgument()
{ {
/* All this for first constructor */ myEditCurrentArgument->setText("");
// if(myEditCurrentArgument == LineEditC1A1 ) QString aString = "";
myEditCurrentArgument->setText("") ;
myOkListShapes = false; myOkListShapes = false;
int nbSel = mySelection->IObjectCount();
if (nbSel == 0)
return;
QString aString = ""; /* name of future selection */ aString = tr("%1_objects").arg(nbSel);
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ; myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
if ( nbSel < 1 ) { myEditCurrentArgument->setText(aString);
return ; myOkListShapes = true;
}
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ; return;
myEditCurrentArgument->setText(aString) ;
myOkListShapes = true ;
/* no simulation */
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 == SelectButtonC1A1) {
LineEditC1A1->setFocus() ;
myEditCurrentArgument = LineEditC1A1;
}
SelectionIntoArgument() ;
break;
}
}
return ;
}
if(send == GroupShell->PushButton1) {
GroupShell->LineEdit1->setFocus();
//================================================================================= myEditCurrentArgument = GroupShell->LineEdit1;
// function : LineEditReturnPressed() mySelection->AddFilter(myFaceFilter);
// 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) ;
} }
SelectionIntoArgument();
return ; return ;
} }
@ -339,12 +183,8 @@ 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() ; connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
GroupConstructors->setEnabled(true) ;
GroupC1->setEnabled(true) ;
GroupButtons->setEnabled(true) ;
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
return ; return ;
} }
@ -355,21 +195,8 @@ void GeometryGUI_ShellDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void GeometryGUI_ShellDlg::enterEvent(QEvent* e) 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,86 +22,48 @@
// //
// //
// 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
public: public:
GeometryGUI_ShellDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 ); GeometryGUI_ShellDlg(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GeometryGUI_ShellDlg(); ~GeometryGUI_ShellDlg();
private: private:
void Init(SALOME_Selection* Sel);
void enterEvent(QEvent * e);
void Init( SALOME_Selection* Sel ) ; Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
void closeEvent( QCloseEvent* e ) ; GEOM::GEOM_Gen::ListOfIOR myListShapes;
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */ bool myOkListShapes; /* to check when arguments is defined */
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */ GeometryGUI_1Sel_QTD* GroupShell ;
GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
SALOME_Selection* mySelection ; /* User shape selection */
GEOM::GEOM_Gen::ListOfIOR myListShapes ;
bool myOkListShapes ; /* to check when argument is defined */
int myConstructorId ; /* Current constructor id = radio button id */
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

@ -400,7 +400,7 @@ void GeometryGUI_TorusDlg::ClickOnApply()
} }
case 1 : case 1 :
{ {
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 ) { if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 ) {
myGeomGUI->MakeTorusAndDisplay( myPoint1, myDir, myRadius1, myRadius2 ) ; myGeomGUI->MakeTorusAndDisplay( myPoint1, myDir, myRadius1, myRadius2 ) ;
} }
break ; break ;

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(); // vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
normals->SetInput(aread->GetOutput()); // normals->SetInput(aread->GetOutput());
aMapper->SetInput(normals->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();
aMapperWF->SetInput(aread->GetOutput());
normals->SetInput(aread->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,7 +305,11 @@ 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);
this->EstimatedRenderTime = WireframeMapper->GetTimeToDraw();
if(myDisplayMode >= 1)
this->EstimatedRenderTime = ShadingMapper->GetTimeToDraw();
else
this->EstimatedRenderTime = WireframeMapper->GetTimeToDraw();
} }
// SubShape // SubShape
@ -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() {
@ -306,7 +344,10 @@ float GEOM_Actor::GetOpacity() {
// Color methods // Color methods
//------------------------------------------------------------- //-------------------------------------------------------------
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) {
@ -336,7 +377,7 @@ void GEOM_Actor::highlight(Standard_Boolean highlight) {
HighlightProperty->SetDiffuseColor(1, 1, 1); HighlightProperty->SetDiffuseColor(1, 1, 1);
HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5); HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5);
} }
this->Property = HighlightProperty; this->Property = HighlightProperty;
} }

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);