mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-28 18:30:36 +05:00
*** empty log message ***
This commit is contained in:
parent
c764c1ebb4
commit
4e7b28499d
@ -45,7 +45,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_ArcDlg::BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_ArcDlg::BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_ArcDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ARC" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ARC" ) ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ARC_CENTER" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ARC_CENTER" ) ) );
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_CircleDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PV" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PV" ) ) );
|
||||||
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PNTS" ) ) );
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CIRCLE_PNTS" ) ) );
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_CurveDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POLYLINE" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POLYLINE" ) ) );
|
||||||
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPLINE" ) ) );
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPLINE" ) ) );
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_EllipseDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ELLIPSE_PV" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_ELLIPSE_PV" ) ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_LineDlg::BasicGUI_LineDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_LineDlg::BasicGUI_LineDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_LineDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_LINE_2P" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_LINE_2P" ) ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent )
|
BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, theParent, "BasicGUI_MarkerDlg", false,
|
: GEOMBase_Skeleton( theGeometryGUI, theParent, false,
|
||||||
Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
|
Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
|
||||||
{
|
{
|
||||||
QPixmap iconCS1 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) );
|
QPixmap iconCS1 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) );
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_PlaneDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_PV" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_PV" ) ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_3PNTS" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PLANE_3PNTS" ) ) );
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_PointDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_EDGE" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_EDGE" ) ) );
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_VectorDlg::BasicGUI_VectorDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_VectorDlg::BasicGUI_VectorDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_VectorDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_2P" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_2P" ) ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_DXYZ" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_VECTOR_DXYZ" ) ) );
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, "BasicGUI_WorkingPlaneDlg", modal, fl )
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_WPLANE_FACE" ) ) );
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_WPLANE_FACE" ) ) );
|
||||||
|
@ -50,17 +50,12 @@ using namespace std;
|
|||||||
// true to construct a modal dialog.
|
// true to construct a modal dialog.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent,
|
GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
|
: QDialog( parent, fl ),
|
||||||
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
|
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
|
||||||
myGeomGUI( theGeometryGUI ),
|
myGeomGUI( theGeometryGUI ),
|
||||||
myRBGroup( 0 )
|
myRBGroup( 0 )
|
||||||
{
|
{
|
||||||
if ( !name )
|
|
||||||
setObjectName( "GEOMBase_Skeleton" );
|
|
||||||
else
|
|
||||||
setObjectName( name );
|
|
||||||
|
|
||||||
setAttribute( Qt::WA_DeleteOnClose );
|
setAttribute( Qt::WA_DeleteOnClose );
|
||||||
|
|
||||||
setModal( modal );
|
setModal( modal );
|
||||||
|
@ -41,6 +41,8 @@ class QPushButton;
|
|||||||
#ifndef COORD_MIN
|
#ifndef COORD_MIN
|
||||||
# define COORD_MIN -1e+15
|
# define COORD_MIN -1e+15
|
||||||
# define COORD_MAX +1e+15
|
# define COORD_MAX +1e+15
|
||||||
|
# define MAX_NUMBER 100000
|
||||||
|
# define DBL_DIGITS_DISPLAY 16
|
||||||
#endif // COORD_MIN
|
#endif // COORD_MIN
|
||||||
|
|
||||||
class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public GEOMBase_Helper
|
class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public GEOMBase_Helper
|
||||||
@ -48,7 +50,7 @@ class GEOMBASE_EXPORT GEOMBase_Skeleton : public QDialog, public GEOMBase_Helper
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, const char* = 0, bool = false, Qt::WindowFlags = 0 );
|
GEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
~GEOMBase_Skeleton();
|
~GEOMBase_Skeleton();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,51 +1,46 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI.cxx
|
||||||
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI.cxx
|
|
||||||
// Author : Damien COQUERET
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "GenerationGUI.h"
|
#include "GenerationGUI.h"
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GeometryGUI.h>
|
||||||
|
|
||||||
#include "SUIT_Desktop.h"
|
#include <SUIT_Desktop.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
#include "SalomeApp_Application.h"
|
|
||||||
|
|
||||||
#include "GenerationGUI_PrismDlg.h" // Method PRISM
|
#include "GenerationGUI_PrismDlg.h" // Method PRISM
|
||||||
#include "GenerationGUI_RevolDlg.h" // Method REVOL
|
#include "GenerationGUI_RevolDlg.h" // Method REVOL
|
||||||
#include "GenerationGUI_FillingDlg.h" // Method FILLING
|
#include "GenerationGUI_FillingDlg.h" // Method FILLING
|
||||||
#include "GenerationGUI_PipeDlg.h" // Method PIPE
|
#include "GenerationGUI_PipeDlg.h" // Method PIPE
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : GenerationGUI()
|
// function : GenerationGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
GenerationGUI::GenerationGUI(GeometryGUI* parent) : GEOMGUI(parent)
|
GenerationGUI::GenerationGUI( GeometryGUI* parent )
|
||||||
|
: GEOMGUI( parent )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,17 +66,16 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
|
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
|
|
||||||
switch (theCommandID)
|
switch ( theCommandID ) {
|
||||||
{
|
case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent ); break;
|
||||||
case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent, ""); break;
|
case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent ); break;
|
||||||
case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent, ""); break;
|
case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent ); break;
|
||||||
case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break;
|
case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent ); break;
|
||||||
case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent, ""); break;
|
|
||||||
|
|
||||||
default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
|
default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aDlg != NULL)
|
if (aDlg != NULL )
|
||||||
aDlg->show();
|
aDlg->show();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -93,9 +87,11 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
GENERATIONGUI_EXPORT
|
#ifdef WIN32
|
||||||
GEOMGUI* GetLibGUI(GeometryGUI* parent)
|
__declspec( dllexport )
|
||||||
|
#endif
|
||||||
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
return new GenerationGUI(parent);
|
return new GenerationGUI( parent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,56 +1,44 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI.h
|
||||||
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI.h
|
|
||||||
// Author : Damien COQUERET
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef GENERATIONGUI_H
|
#ifndef GENERATIONGUI_H
|
||||||
#define GENERATIONGUI_H
|
#define GENERATIONGUI_H
|
||||||
|
|
||||||
#ifdef WNT
|
#include <GEOMGUI.h>
|
||||||
# if defined GENERATIONGUI_EXPORTS
|
|
||||||
# define GENERATIONGUI_EXPORT __declspec( dllexport )
|
|
||||||
# else
|
|
||||||
# define GENERATIONGUI_EXPORT __declspec( dllimport )
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define GENERATIONGUI_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "GEOMGUI.h"
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI
|
// class : GenerationGUI
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class GENERATIONGUI_EXPORT GenerationGUI : public GEOMGUI
|
class GenerationGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GenerationGUI(GeometryGUI* parent);
|
GenerationGUI( GeometryGUI* );
|
||||||
~GenerationGUI();
|
~GenerationGUI();
|
||||||
|
|
||||||
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
bool OnGUIEvent( int, SUIT_Desktop* );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,45 +1,41 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_FillingDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_FillingDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "GenerationGUI_FillingDlg.h"
|
#include "GenerationGUI_FillingDlg.h"
|
||||||
#include "DlgRef_1Sel5Spin.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI_FillingDlg()
|
// class : GenerationGUI_FillingDlg()
|
||||||
@ -48,38 +44,40 @@
|
|||||||
// 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
GenerationGUI_FillingDlg::GenerationGUI_FillingDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FILLING")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FILLING" ) ) );
|
||||||
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_FILLING_TITLE"));
|
setWindowTitle( tr( "GEOM_FILLING_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_FILLING"));
|
mainFrame()->GroupConstructors->setTitle( tr ( "GEOM_FILLING" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton2->close();
|
mainFrame()->RadioButton2->close();
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_1Sel5Spin(this, "GroupPoints");
|
GroupPoints = new DlgRef_1Sel5Spin( centralWidget() );
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_FILLING_COMPOUND"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_FILLING_MIN_DEG"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) );
|
||||||
GroupPoints->TextLabel3->setText(tr("GEOM_FILLING_TOL_2D"));
|
GroupPoints->TextLabel3->setText( tr( "GEOM_FILLING_TOL_2D" ) );
|
||||||
GroupPoints->TextLabel4->setText(tr("GEOM_FILLING_NB_ITER"));
|
GroupPoints->TextLabel4->setText( tr( "GEOM_FILLING_NB_ITER" ) );
|
||||||
GroupPoints->TextLabel5->setText(tr("GEOM_FILLING_MAX_DEG"));
|
GroupPoints->TextLabel5->setText( tr( "GEOM_FILLING_MAX_DEG" ) );
|
||||||
GroupPoints->TextLabel6->setText(tr("GEOM_FILLING_TOL_3D"));
|
GroupPoints->TextLabel6->setText( tr( "GEOM_FILLING_TOL_3D" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image1);
|
GroupPoints->PushButton1->setIcon( image1 );
|
||||||
GroupPoints->LineEdit1->setReadOnly( true );
|
GroupPoints->LineEdit1->setReadOnly( true );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("filling.htm");
|
setHelpFileName( "filling.htm" );
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
Init();
|
Init();
|
||||||
@ -116,41 +114,43 @@ void GenerationGUI_FillingDlg::Init()
|
|||||||
double SpecificStep1 = 1;
|
double SpecificStep1 = 1;
|
||||||
double SpecificStep2 = 0.0001;
|
double SpecificStep2 = 0.0001;
|
||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
GroupPoints->SpinBox_1->RangeStepAndValidator(2.0, MAX_NUMBER, SpecificStep1, 3);
|
initSpinBox( GroupPoints->SpinBox1, 2.0, MAX_NUMBER, SpecificStep1, 3 );
|
||||||
GroupPoints->SpinBox_2->RangeStepAndValidator(0.00001, 10000.0, SpecificStep2, 5);
|
initSpinBox( GroupPoints->SpinBox2, 0.00001, 10000.0, SpecificStep2, 5 );
|
||||||
GroupPoints->SpinBox_3->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep1, 3);
|
initSpinBox( GroupPoints->SpinBox3, 1.0, MAX_NUMBER, SpecificStep1, 3 );
|
||||||
GroupPoints->SpinBox_4->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep1, 3);
|
initSpinBox( GroupPoints->SpinBox4, 1.0, MAX_NUMBER, SpecificStep1, 3 );
|
||||||
GroupPoints->SpinBox_5->RangeStepAndValidator(0.00001, 10000.0, SpecificStep2, 5);
|
initSpinBox( GroupPoints->SpinBox5, 0.00001, 10000.0, SpecificStep2, 5 );
|
||||||
|
|
||||||
GroupPoints->SpinBox_1->SetValue(myMinDeg);
|
GroupPoints->SpinBox1->setValue( myMinDeg );
|
||||||
GroupPoints->SpinBox_2->SetValue(myTol2D);
|
GroupPoints->SpinBox2->setValue( myTol2D );
|
||||||
GroupPoints->SpinBox_3->SetValue(myNbIter);
|
GroupPoints->SpinBox3->setValue( myNbIter );
|
||||||
GroupPoints->SpinBox_4->SetValue(myMaxDeg);
|
GroupPoints->SpinBox4->setValue( myMaxDeg );
|
||||||
GroupPoints->SpinBox_5->SetValue(myTol3D);
|
GroupPoints->SpinBox5->setValue( myTol3D );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
connect(GroupPoints->SpinBox_1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect( GroupPoints->SpinBox1, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
||||||
connect(GroupPoints->SpinBox_2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect( GroupPoints->SpinBox2, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
||||||
connect(GroupPoints->SpinBox_3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect( GroupPoints->SpinBox3, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
||||||
connect(GroupPoints->SpinBox_4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect( GroupPoints->SpinBox4, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
||||||
connect(GroupPoints->SpinBox_5, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
connect( GroupPoints->SpinBox5, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_1, SLOT(SetStep(double)));
|
// VSR: TODO ->>
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_2, SLOT(SetStep(double)));
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox1, SLOT( SetStep( double ) ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_3, SLOT(SetStep(double)));
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox2, SLOT( SetStep( double ) ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_4, SLOT(SetStep(double)));
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox3, SLOT( SetStep( double ) ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_5, SLOT(SetStep(double)));
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox4, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox5, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName(tr("GEOM_FILLING").toLatin1().constData());
|
initName( tr( "GEOM_FILLING" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -186,28 +186,27 @@ bool GenerationGUI_FillingDlg::ClickOnApply()
|
|||||||
void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if(IObjectCount() != 1) {
|
if ( IObjectCount() != 1 ) {
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkCompound = false;
|
myOkCompound = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if (!testResult)
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
myOkCompound = false;
|
myOkCompound = false;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape(aSelectedObject, S) &&
|
if ( GEOMBase::GetShape(aSelectedObject, S) &&
|
||||||
S.ShapeType() == TopAbs_COMPOUND)
|
S.ShapeType() == TopAbs_COMPOUND ) {
|
||||||
{
|
|
||||||
// myCompound should be a compound of edges
|
// myCompound should be a compound of edges
|
||||||
for ( TopoDS_Iterator it( S ); it.More(); it.Next() )
|
for ( TopoDS_Iterator it( S ); it.More(); it.Next() )
|
||||||
if ( it.Value().ShapeType() != TopAbs_EDGE )
|
if ( it.Value().ShapeType() != TopAbs_EDGE )
|
||||||
@ -231,7 +230,7 @@ void GenerationGUI_FillingDlg::SetEditCurrentArgument()
|
|||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
globalSelection( GEOM_COMPOUND );
|
globalSelection( GEOM_COMPOUND );
|
||||||
@ -247,11 +246,10 @@ void GenerationGUI_FillingDlg::SetEditCurrentArgument()
|
|||||||
void GenerationGUI_FillingDlg::LineEditReturnPressed()
|
void GenerationGUI_FillingDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1)
|
if ( send == GroupPoints->LineEdit1 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -262,8 +260,8 @@ void GenerationGUI_FillingDlg::LineEditReturnPressed()
|
|||||||
void GenerationGUI_FillingDlg::ActivateThisDialog()
|
void GenerationGUI_FillingDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
globalSelection( GEOM_COMPOUND );
|
globalSelection( GEOM_COMPOUND );
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
@ -273,9 +271,9 @@ void GenerationGUI_FillingDlg::ActivateThisDialog()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_FillingDlg::enterEvent(QEvent* e)
|
void GenerationGUI_FillingDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,19 +282,19 @@ void GenerationGUI_FillingDlg::enterEvent(QEvent* e)
|
|||||||
// function : ValueChangedInSpinBox()
|
// function : ValueChangedInSpinBox()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_FillingDlg::ValueChangedInSpinBox(double newValue)
|
void GenerationGUI_FillingDlg::ValueChangedInSpinBox( double newValue )
|
||||||
{
|
{
|
||||||
QObject* send = (QObject*)sender();
|
QObject* send = (QObject*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->SpinBox_1)
|
if ( send == GroupPoints->SpinBox1 )
|
||||||
myMinDeg = int(newValue);
|
myMinDeg = int( newValue );
|
||||||
else if(send == GroupPoints->SpinBox_2)
|
else if ( send == GroupPoints->SpinBox2 )
|
||||||
myTol2D = newValue;
|
myTol2D = newValue;
|
||||||
else if(send == GroupPoints->SpinBox_3)
|
else if ( send == GroupPoints->SpinBox3 )
|
||||||
myNbIter = int(newValue);
|
myNbIter = int(newValue);
|
||||||
else if(send == GroupPoints->SpinBox_4)
|
else if ( send == GroupPoints->SpinBox4 )
|
||||||
myMaxDeg = int(newValue);
|
myMaxDeg = int(newValue);
|
||||||
else if(send == GroupPoints->SpinBox_5)
|
else if ( send == GroupPoints->SpinBox5 )
|
||||||
myTol3D = newValue;
|
myTol3D = newValue;
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
|
@ -1,36 +1,32 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_FillingDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_FillingDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_FILLING_H
|
#ifndef GENERATIONGUI_FILLINGDLG_H
|
||||||
#define DIALOGBOX_FILLING_H
|
#define GENERATIONGUI_FILLINGDLG_H
|
||||||
|
|
||||||
#include "GenerationGUI.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
|
||||||
|
|
||||||
class DlgRef_1Sel5Spin;
|
class DlgRef_1Sel5Spin;
|
||||||
|
|
||||||
@ -38,43 +34,43 @@ class DlgRef_1Sel5Spin;
|
|||||||
// class : GenerationGUI_FillingDlg
|
// class : GenerationGUI_FillingDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class GENERATIONGUI_EXPORT GenerationGUI_FillingDlg : public GEOMBase_Skeleton
|
class GenerationGUI_FillingDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
GenerationGUI_FillingDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~GenerationGUI_FillingDlg();
|
||||||
~GenerationGUI_FillingDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myCompound; /* compound of curves */
|
private:
|
||||||
Standard_Integer myMinDeg;
|
GEOM::GEOM_Object_var myCompound; /* compound of curves */
|
||||||
Standard_Integer myMaxDeg;
|
Standard_Integer myMinDeg;
|
||||||
Standard_Real myTol3D;
|
Standard_Integer myMaxDeg;
|
||||||
Standard_Real myTol2D;
|
Standard_Real myTol3D;
|
||||||
Standard_Integer myNbIter;
|
Standard_Real myTol2D;
|
||||||
bool myOkCompound; /* to check when curv. compound is defined */
|
Standard_Integer myNbIter;
|
||||||
|
bool myOkCompound; /* to check when curv. compound is defined */
|
||||||
DlgRef_1Sel5Spin* GroupPoints;
|
|
||||||
|
|
||||||
|
DlgRef_1Sel5Spin* GroupPoints;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void ValueChangedInSpinBox(double newValue);
|
void ValueChangedInSpinBox( double );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_FILLING_H
|
#endif // GENERATIONGUI_FILLINGDLG_H
|
||||||
|
@ -1,42 +1,40 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_PipeDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_PipeDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "GenerationGUI_PipeDlg.h"
|
#include "GenerationGUI_PipeDlg.h"
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI_PipeDlg()
|
// class : GenerationGUI_PipeDlg()
|
||||||
@ -45,40 +43,39 @@
|
|||||||
// 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
GenerationGUI_PipeDlg::GenerationGUI_PipeDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PIPE")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PIPE" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_PIPE_TITLE"));
|
setWindowTitle( tr( "GEOM_PIPE_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_PIPE"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PIPE" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon(image0);
|
||||||
RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton2->close();
|
mainFrame()->RadioButton2->close();
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new Ui::DlgRef_2Sel_QTD();
|
GroupPoints = new DlgRef_2Sel( centralWidget() );
|
||||||
QWidget* aGroupPointsWidget = new QWidget(this);
|
|
||||||
GroupPoints->setupUi(aGroupPointsWidget);
|
|
||||||
aGroupPointsWidget->setObjectName("GroupPoints");
|
|
||||||
|
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_OBJECT"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_OBJECT" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_PATH_OBJECT"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_PATH_OBJECT" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image1);
|
GroupPoints->PushButton1->setIcon( image1 );
|
||||||
GroupPoints->PushButton2->setIcon(image1);
|
GroupPoints->PushButton2->setIcon( image1 );
|
||||||
GroupPoints->LineEdit1->setReadOnly( true );
|
GroupPoints->LineEdit1->setReadOnly( true );
|
||||||
GroupPoints->LineEdit2->setReadOnly( true );
|
GroupPoints->LineEdit2->setReadOnly( true );
|
||||||
|
|
||||||
gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("pipe_creation.htm");
|
setHelpFileName( "pipe_creation.htm" );
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
Init();
|
Init();
|
||||||
@ -109,19 +106,19 @@ void GenerationGUI_PipeDlg::Init()
|
|||||||
myOkBase = myOkPath = false;
|
myOkBase = myOkPath = false;
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName(tr("GEOM_PIPE").toLatin1().constData());
|
initName( tr( "GEOM_PIPE" ) );
|
||||||
|
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
}
|
}
|
||||||
@ -159,43 +156,43 @@ bool GenerationGUI_PipeDlg::ClickOnApply()
|
|||||||
void GenerationGUI_PipeDlg::SelectionIntoArgument()
|
void GenerationGUI_PipeDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if(IObjectCount() != 1) {
|
if ( IObjectCount() != 1 ) {
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myOkPath = false;
|
myOkPath = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if (!testResult)
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
|
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
|
|
||||||
if(!GEOMBase::GetShape(aSelectedObject, S) ||
|
if ( !GEOMBase::GetShape( aSelectedObject, S ) ||
|
||||||
S.ShapeType() == TopAbs_COMPSOLID ||
|
S.ShapeType() == TopAbs_COMPSOLID ||
|
||||||
S.ShapeType() == TopAbs_COMPOUND ||
|
S.ShapeType() == TopAbs_COMPOUND ||
|
||||||
S.ShapeType() == TopAbs_SOLID ||
|
S.ShapeType() == TopAbs_SOLID ||
|
||||||
S.ShapeType() == TopAbs_SHAPE)
|
S.ShapeType() == TopAbs_SHAPE )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myBase = aSelectedObject;
|
myBase = aSelectedObject;
|
||||||
myOkBase = true;
|
myOkBase = true;
|
||||||
}
|
}
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
||||||
myOkPath = false;
|
myOkPath = false;
|
||||||
|
|
||||||
if(!GEOMBase::GetShape(aSelectedObject, S) ||
|
if ( !GEOMBase::GetShape( aSelectedObject, S ) ||
|
||||||
!(S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE) )
|
!( S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myPath = aSelectedObject;
|
myPath = aSelectedObject;
|
||||||
@ -215,11 +212,11 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints->PushButton2) {
|
else if ( send == GroupPoints->PushButton2 ) {
|
||||||
GroupPoints->LineEdit2->setFocus();
|
GroupPoints->LineEdit2->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
}
|
}
|
||||||
@ -234,12 +231,11 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
|
|||||||
void GenerationGUI_PipeDlg::LineEditReturnPressed()
|
void GenerationGUI_PipeDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 ||
|
if ( send == GroupPoints->LineEdit1 ||
|
||||||
send == GroupPoints->LineEdit2)
|
send == GroupPoints->LineEdit2 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -247,9 +243,9 @@ void GenerationGUI_PipeDlg::LineEditReturnPressed()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose : when mouse enter onto the QWidget
|
// purpose : when mouse enter onto the QWidget
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_PipeDlg::enterEvent(QEvent* e)
|
void GenerationGUI_PipeDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,8 +258,8 @@ void GenerationGUI_PipeDlg::ActivateThisDialog()
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT(SelectionIntoArgument() ) );
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,75 +1,72 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_PipeDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_PipeDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_PIPE_H
|
#ifndef GENERATIONGUI_PIPEDLG_H
|
||||||
#define DIALOGBOX_PIPE_H
|
#define GENERATIONGUI_PIPEDLG_H
|
||||||
|
|
||||||
#include "GenerationGUI.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
class DlgRef_2Sel;
|
||||||
#include "DlgRef_2Sel_QTD.h"
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI_PipeDlg
|
// class : GenerationGUI_PipeDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class GENERATIONGUI_EXPORT GenerationGUI_PipeDlg : public GEOMBase_Skeleton
|
class GenerationGUI_PipeDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
GenerationGUI_PipeDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~GenerationGUI_PipeDlg();
|
||||||
~GenerationGUI_PipeDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myBase; /* Base shape */
|
private:
|
||||||
GEOM::GEOM_Object_var myPath; /* Shape, defining the path */
|
GEOM::GEOM_Object_var myBase; /* Base shape */
|
||||||
bool myOkBase;
|
GEOM::GEOM_Object_var myPath; /* Shape, defining the path */
|
||||||
bool myOkPath; /* to check when arguments are defined */
|
bool myOkBase;
|
||||||
|
bool myOkPath; /* to check when arguments are defined */
|
||||||
Ui::DlgRef_2Sel_QTD* GroupPoints;
|
|
||||||
|
DlgRef_2Sel* GroupPoints;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_PIPE_H
|
#endif // GENERATIONGUI_PIPEDLG_H
|
||||||
|
@ -1,44 +1,40 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_PrismDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_PrismDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "GenerationGUI_PrismDlg.h"
|
#include "GenerationGUI_PrismDlg.h"
|
||||||
#include "DlgRef_2Sel1Spin2Check.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI_PrismDlg()
|
// class : GenerationGUI_PrismDlg()
|
||||||
@ -47,53 +43,52 @@
|
|||||||
// 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
GenerationGUI_PrismDlg::GenerationGUI_PrismDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM_2P")));
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM_2P" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_EXTRUSION_TITLE"));
|
setWindowTitle( tr( "GEOM_EXTRUSION_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_EXTRUSION"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_EXTRUSION" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setIcon(image2);
|
mainFrame()->RadioButton2->setIcon( image2 );
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
|
GroupPoints = new DlgRef_2Sel1Spin2Check( centralWidget() );
|
||||||
GroupPoints->CheckButton1->hide();
|
GroupPoints->CheckButton1->hide();
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_EXTRUSION_BSV" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_BASE"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
|
||||||
GroupPoints->TextLabel3->setText(tr("GEOM_HEIGHT"));
|
GroupPoints->TextLabel3->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image1);
|
GroupPoints->PushButton1->setIcon( image1 );
|
||||||
GroupPoints->PushButton2->setIcon(image1);
|
GroupPoints->PushButton2->setIcon( image1 );
|
||||||
GroupPoints->LineEdit1->setReadOnly( true );
|
GroupPoints->LineEdit1->setReadOnly( true );
|
||||||
GroupPoints->LineEdit2->setReadOnly( true );
|
GroupPoints->LineEdit2->setReadOnly( true );
|
||||||
GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
|
GroupPoints->CheckButton2->setText( tr( "GEOM_REVERSE" ) );
|
||||||
|
|
||||||
GroupPoints2 = new Ui::DlgRef_3Sel_QTD();
|
GroupPoints2 = new DlgRef_3Sel( centralWidget() );
|
||||||
QWidget* aGroupPoints2Widget = new QWidget(this);
|
|
||||||
GroupPoints2->setupUi(aGroupPoints2Widget);
|
|
||||||
aGroupPoints2Widget->setObjectName("GroupPoints2");
|
|
||||||
|
|
||||||
GroupPoints2->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P"));
|
GroupPoints2->GroupBox1->setTitle( tr( "GEOM_EXTRUSION_BSV_2P" ) );
|
||||||
GroupPoints2->TextLabel1->setText(tr("GEOM_BASE"));
|
GroupPoints2->TextLabel1->setText( tr( "GEOM_BASE" ) );
|
||||||
GroupPoints2->TextLabel2->setText(tr("GEOM_POINT_I").arg("1"));
|
GroupPoints2->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
|
||||||
GroupPoints2->TextLabel3->setText(tr("GEOM_POINT_I").arg("2"));
|
GroupPoints2->TextLabel3->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
|
||||||
GroupPoints2->PushButton1->setIcon(image1);
|
GroupPoints2->PushButton1->setIcon( image1 );
|
||||||
GroupPoints2->PushButton2->setIcon(image1);
|
GroupPoints2->PushButton2->setIcon( image1 );
|
||||||
GroupPoints2->PushButton3->setIcon(image1);
|
GroupPoints2->PushButton3->setIcon( image1 );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
gridLayout1->addWidget(aGroupPoints2Widget, 2, 0);
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
|
layout->addWidget( GroupPoints2 );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("extrusion.htm");
|
setHelpFileName( "extrusion.htm" );
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
Init();
|
Init();
|
||||||
@ -130,46 +125,47 @@ void GenerationGUI_PrismDlg::Init()
|
|||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
GroupPoints->SpinBox_DX->SetValue(100.0);
|
GroupPoints->SpinBox_DX->setValue( 100.0 );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
|
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
// VSR: TODO ->>
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
|
connect( GroupPoints->CheckButton2, SIGNAL( toggled( bool ) ), this, SLOT( onReverse() ) );
|
||||||
|
|
||||||
|
connect( GroupPoints2->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
connect( GroupPoints2->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
connect( GroupPoints2->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
|
connect( GroupPoints2->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
connect( GroupPoints2->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
connect( GroupPoints2->LineEdit3, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
|
|
||||||
connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
connect(GroupPoints2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
connect(GroupPoints2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
||||||
|
|
||||||
connect(GroupPoints2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
initName( tr( "GEOM_EXTRUSION" ) );
|
||||||
connect(GroupPoints2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
|
||||||
connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
|
||||||
|
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
|
||||||
|
|
||||||
initName(tr("GEOM_EXTRUSION").toLatin1().constData());
|
|
||||||
|
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
ConstructorsClicked(0);
|
ConstructorsClicked( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -177,53 +173,54 @@ void GenerationGUI_PrismDlg::Init()
|
|||||||
// function : ConstructorsClicked()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
|
void GenerationGUI_PrismDlg::ConstructorsClicked( int constructorId )
|
||||||
{
|
{
|
||||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
|
||||||
|
|
||||||
switch (constructorId)
|
switch ( constructorId ) {
|
||||||
|
case 0:
|
||||||
{
|
{
|
||||||
case 0:
|
globalSelection( GEOM_POINT );
|
||||||
{
|
GroupPoints2->hide();
|
||||||
globalSelection( GEOM_POINT );
|
GroupPoints->show();
|
||||||
|
|
||||||
::qobject_cast<QWidget*>( GroupPoints2->gridLayout->parent() )->hide();
|
//GroupPoints->LineEdit1->setFocus();
|
||||||
resize(0, 0);
|
//myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
GroupPoints->show();
|
//displayPreview();
|
||||||
|
|
||||||
//GroupPoints->LineEdit1->setFocus();
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
//myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit1->setText( "" );
|
||||||
//displayPreview();
|
GroupPoints->LineEdit2->setText( "" );
|
||||||
|
GroupPoints2->LineEdit1->setText( "" );
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints2->LineEdit2->setText( "" );
|
||||||
GroupPoints->LineEdit1->setText("");
|
GroupPoints2->LineEdit3->setText( "" );
|
||||||
GroupPoints->LineEdit2->setText("");
|
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
||||||
GroupPoints2->LineEdit1->setText("");
|
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
||||||
GroupPoints2->LineEdit2->setText("");
|
|
||||||
GroupPoints2->LineEdit3->setText("");
|
break;
|
||||||
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
|
||||||
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
GroupPoints->hide();
|
|
||||||
resize(0, 0);
|
|
||||||
::qobject_cast<QWidget*>( GroupPoints2->gridLayout->parent() )->show();
|
|
||||||
|
|
||||||
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
|
||||||
GroupPoints2->LineEdit1->setText("");
|
|
||||||
GroupPoints2->LineEdit2->setText("");
|
|
||||||
GroupPoints2->LineEdit3->setText("");
|
|
||||||
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
|
||||||
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
|
||||||
GroupPoints->LineEdit1->setText("");
|
|
||||||
GroupPoints->LineEdit2->setText("");
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
GroupPoints2->show();
|
||||||
|
|
||||||
|
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
||||||
|
GroupPoints2->LineEdit1->setText( "" );
|
||||||
|
GroupPoints2->LineEdit2->setText( "" );
|
||||||
|
GroupPoints2->LineEdit3->setText( "" );
|
||||||
|
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
||||||
|
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
||||||
|
GroupPoints->LineEdit1->setText("");
|
||||||
|
GroupPoints->LineEdit2->setText("");
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
updateGeometry();
|
||||||
|
resize( minimumSize() );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,14 +257,14 @@ bool GenerationGUI_PrismDlg::ClickOnApply()
|
|||||||
void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( getConstructorId()==0 ) {
|
if ( getConstructorId() == 0 ) {
|
||||||
|
|
||||||
if (IObjectCount() != 1) {
|
if ( IObjectCount() != 1 ) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myOkVec = false;
|
myOkVec = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -277,14 +274,14 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
GEOM::GEOM_Object_ptr aSelectedObject =
|
GEOM::GEOM_Object_ptr aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if (!testResult)
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
myBase = aSelectedObject;
|
myBase = aSelectedObject;
|
||||||
myOkBase = true;
|
myOkBase = true;
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
||||||
myVec = aSelectedObject;
|
myVec = aSelectedObject;
|
||||||
myOkVec = true;
|
myOkVec = true;
|
||||||
}
|
}
|
||||||
@ -295,14 +292,14 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
else { // getConstructorId()==1 - extrusion using 2 points
|
else { // getConstructorId()==1 - extrusion using 2 points
|
||||||
|
|
||||||
if (IObjectCount() != 1) {
|
if ( IObjectCount() != 1 ) {
|
||||||
if (myEditCurrentArgument == GroupPoints2->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints2->LineEdit1 )
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
|
else if ( myEditCurrentArgument == GroupPoints2->LineEdit2 ) {
|
||||||
myPoint1 = GEOM::GEOM_Object::_nil();
|
myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
myOkPnt1 = false;
|
myOkPnt1 = false;
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
|
else if ( myEditCurrentArgument == GroupPoints2->LineEdit3 ) {
|
||||||
myPoint2 = GEOM::GEOM_Object::_nil();
|
myPoint2 = GEOM::GEOM_Object::_nil();
|
||||||
myOkPnt2 = false;
|
myOkPnt2 = false;
|
||||||
}
|
}
|
||||||
@ -312,20 +309,20 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if (!testResult || CORBA::is_nil( aSelectedObject ))
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
|
if ( myEditCurrentArgument == GroupPoints2->LineEdit1 ) {
|
||||||
myBase = aSelectedObject;
|
myBase = aSelectedObject;
|
||||||
myOkBase = true;
|
myOkBase = true;
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
|
else if ( myEditCurrentArgument == GroupPoints2->LineEdit2 ) {
|
||||||
myPoint1 = aSelectedObject;
|
myPoint1 = aSelectedObject;
|
||||||
myOkPnt1 = true;
|
myOkPnt1 = true;
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
|
else if ( myEditCurrentArgument == GroupPoints2->LineEdit3 ) {
|
||||||
myPoint2 = aSelectedObject;
|
myPoint2 = aSelectedObject;
|
||||||
myOkPnt2 = true;
|
myOkPnt2 = true;
|
||||||
}
|
}
|
||||||
@ -346,25 +343,25 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
|
|||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints->PushButton2) {
|
else if ( send == GroupPoints->PushButton2 ) {
|
||||||
GroupPoints->LineEdit2->setFocus();
|
GroupPoints->LineEdit2->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
globalSelection( GEOM_LINE );
|
globalSelection( GEOM_LINE );
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints2->PushButton1) {
|
else if ( send == GroupPoints2->PushButton1 ) {
|
||||||
GroupPoints2->LineEdit1->setFocus();
|
GroupPoints2->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints2->PushButton2) {
|
else if ( send == GroupPoints2->PushButton2 ) {
|
||||||
GroupPoints2->LineEdit2->setFocus();
|
GroupPoints2->LineEdit2->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints2->LineEdit2;
|
myEditCurrentArgument = GroupPoints2->LineEdit2;
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints2->PushButton3) {
|
else if ( send == GroupPoints2->PushButton3 ) {
|
||||||
GroupPoints2->LineEdit3->setFocus();
|
GroupPoints2->LineEdit3->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints2->LineEdit3;
|
myEditCurrentArgument = GroupPoints2->LineEdit3;
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
@ -380,24 +377,23 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
|
|||||||
void GenerationGUI_PrismDlg::LineEditReturnPressed()
|
void GenerationGUI_PrismDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 ||
|
if ( send == GroupPoints->LineEdit1 ||
|
||||||
send == GroupPoints->LineEdit2 ||
|
send == GroupPoints->LineEdit2 ||
|
||||||
send == GroupPoints2->LineEdit1 ||
|
send == GroupPoints2->LineEdit1 ||
|
||||||
send == GroupPoints2->LineEdit2 ||
|
send == GroupPoints2->LineEdit2 ||
|
||||||
send == GroupPoints2->LineEdit3 )
|
send == GroupPoints2->LineEdit3 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose : when mouse enter onto the QWidget
|
// purpose : when mouse enter onto the QWidget
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
|
void GenerationGUI_PrismDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,8 +406,8 @@ void GenerationGUI_PrismDlg::ActivateThisDialog()
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
//GroupPoints->LineEdit1->setFocus();
|
//GroupPoints->LineEdit1->setFocus();
|
||||||
//myEditCurrentArgument = GroupPoints->LineEdit1;
|
//myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
//displayPreview();
|
//displayPreview();
|
||||||
@ -435,7 +431,7 @@ void GenerationGUI_PrismDlg::ValueChangedInSpinBox()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
double GenerationGUI_PrismDlg::getHeight() const
|
double GenerationGUI_PrismDlg::getHeight() const
|
||||||
{
|
{
|
||||||
return GroupPoints->SpinBox_DX->GetValue();
|
return GroupPoints->SpinBox_DX->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -464,20 +460,15 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
|
|||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
switch ( getConstructorId() )
|
switch ( getConstructorId() ) {
|
||||||
{
|
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
|
MakePrismVecH( myBase, myVec, getHeight() );
|
||||||
MakePrismVecH(myBase, myVec, getHeight());
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1 :
|
case 1 :
|
||||||
{
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
|
MakePrismTwoPnt( myBase, myPoint1, myPoint2 );
|
||||||
MakePrismTwoPnt(myBase, myPoint1, myPoint2);
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
@ -492,6 +483,6 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_PrismDlg::onReverse()
|
void GenerationGUI_PrismDlg::onReverse()
|
||||||
{
|
{
|
||||||
double anOldValue = GroupPoints->SpinBox_DX->GetValue();
|
double anOldValue = GroupPoints->SpinBox_DX->value();
|
||||||
GroupPoints->SpinBox_DX->SetValue( -anOldValue );
|
GroupPoints->SpinBox_DX->setValue( -anOldValue );
|
||||||
}
|
}
|
||||||
|
@ -1,86 +1,82 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_PrismDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_PrismDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_PRISM_H
|
#ifndef GENERATIONGUI_PRISMDLG_H
|
||||||
#define DIALOGBOX_PRISM_H
|
#define GENERATIONGUI_PRISMDLG_H
|
||||||
|
|
||||||
#include "GenerationGUI.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
|
||||||
#include "DlgRef_3Sel_QTD.h"
|
|
||||||
|
|
||||||
|
class DlgRef_3Sel;
|
||||||
class DlgRef_2Sel1Spin2Check;
|
class DlgRef_2Sel1Spin2Check;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI_PrismDlg
|
// class : GenerationGUI_PrismDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class GENERATIONGUI_EXPORT GenerationGUI_PrismDlg : public GEOMBase_Skeleton
|
class GenerationGUI_PrismDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
GenerationGUI_PrismDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~GenerationGUI_PrismDlg();
|
||||||
~GenerationGUI_PrismDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
private :
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
double getHeight() const;
|
double getHeight() const;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myBase; /* Base shape */
|
|
||||||
GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */
|
|
||||||
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
|
|
||||||
|
|
||||||
bool myOkBase;
|
private:
|
||||||
bool myOkVec;
|
GEOM::GEOM_Object_var myBase; /* Base shape */
|
||||||
bool myOkPnt1;
|
GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */
|
||||||
bool myOkPnt2;
|
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
|
||||||
|
|
||||||
DlgRef_2Sel1Spin2Check* GroupPoints;
|
bool myOkBase;
|
||||||
Ui::DlgRef_3Sel_QTD* GroupPoints2; // for second layout for extrusion using 2 points
|
bool myOkVec;
|
||||||
|
bool myOkPnt1;
|
||||||
|
bool myOkPnt2;
|
||||||
|
|
||||||
|
DlgRef_2Sel1Spin2Check* GroupPoints;
|
||||||
|
DlgRef_3Sel* GroupPoints2; // for second layout for extrusion using 2 points
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void ConstructorsClicked(int);
|
void ConstructorsClicked( int );
|
||||||
void ValueChangedInSpinBox();
|
void ValueChangedInSpinBox();
|
||||||
void onReverse();
|
void onReverse();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_PRISM_H
|
#endif // GENERATIONGUI_PRISMDLG_H
|
||||||
|
@ -1,45 +1,41 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_RevolDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_RevolDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "GenerationGUI_RevolDlg.h"
|
#include "GenerationGUI_RevolDlg.h"
|
||||||
#include "DlgRef_2Sel1Spin2Check.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GenerationGUI_RevolDlg()
|
// class : GenerationGUI_RevolDlg()
|
||||||
@ -48,39 +44,41 @@
|
|||||||
// 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GenerationGUI_RevolDlg::GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
GenerationGUI_RevolDlg::GenerationGUI_RevolDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_REVOL")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_REVOL" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_REVOLUTION_TITLE"));
|
setWindowTitle( tr( "GEOM_REVOLUTION_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_REVOLUTION"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_REVOLUTION" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton2->close();
|
mainFrame()->RadioButton2->close();
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
|
GroupPoints = new DlgRef_2Sel1Spin2Check( centralWidget() );
|
||||||
GroupPoints->CheckButton1->hide();
|
GroupPoints->CheckButton1->hide();
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECT"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_AXIS"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_AXIS" ) );
|
||||||
GroupPoints->TextLabel3->setText(tr("GEOM_ANGLE"));
|
GroupPoints->TextLabel3->setText( tr( "GEOM_ANGLE" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image1);
|
GroupPoints->PushButton1->setIcon( image1 );
|
||||||
GroupPoints->PushButton2->setIcon(image1);
|
GroupPoints->PushButton2->setIcon( image1 );
|
||||||
GroupPoints->LineEdit1->setReadOnly( true );
|
GroupPoints->LineEdit1->setReadOnly( true );
|
||||||
GroupPoints->LineEdit2->setReadOnly( true );
|
GroupPoints->LineEdit2->setReadOnly( true );
|
||||||
GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
|
GroupPoints->CheckButton2->setText( tr( "GEOM_REVERSE" ) );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("revolution.htm");
|
setHelpFileName( "revolution.htm" );
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
Init();
|
Init();
|
||||||
@ -112,28 +110,30 @@ void GenerationGUI_RevolDlg::Init()
|
|||||||
|
|
||||||
double SpecificStep = 5;
|
double SpecificStep = 5;
|
||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
|
initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, SpecificStep, 3 );
|
||||||
GroupPoints->SpinBox_DX->SetValue(45.0);
|
GroupPoints->SpinBox_DX->setValue( 45.0 );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
|
connect( GroupPoints->CheckButton2, SIGNAL( toggled( bool ) ), this, SLOT( onReverse() ) );
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
// VSR: TODO ->>
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName(tr("GEOM_REVOLUTION").toLatin1().constData());
|
initName( tr( "GEOM_REVOLUTION" ) );
|
||||||
|
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ bool GenerationGUI_RevolDlg::ClickOnApply()
|
|||||||
//purpose : return true if theBase can be used as algo argument
|
//purpose : return true if theBase can be used as algo argument
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
static bool isAcceptableBase(const TopoDS_Shape& theBase)
|
static bool isAcceptableBase( const TopoDS_Shape& theBase )
|
||||||
{
|
{
|
||||||
switch ( theBase.ShapeType() ) {
|
switch ( theBase.ShapeType() ) {
|
||||||
case TopAbs_VERTEX:
|
case TopAbs_VERTEX:
|
||||||
@ -181,7 +181,7 @@ static bool isAcceptableBase(const TopoDS_Shape& theBase)
|
|||||||
case TopAbs_COMPSOLID:
|
case TopAbs_COMPSOLID:
|
||||||
return false;
|
return false;
|
||||||
case TopAbs_COMPOUND: {
|
case TopAbs_COMPOUND: {
|
||||||
TopExp_Explorer exp( theBase, TopAbs_SOLID);
|
TopExp_Explorer exp( theBase, TopAbs_SOLID );
|
||||||
return !exp.More();
|
return !exp.More();
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -197,12 +197,12 @@ static bool isAcceptableBase(const TopoDS_Shape& theBase)
|
|||||||
void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if(IObjectCount() != 1) {
|
if ( IObjectCount() != 1 ) {
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myOkAxis = false;
|
myOkAxis = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -211,10 +211,10 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if (!testResult)
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
myBase = aSelectedObject;
|
myBase = aSelectedObject;
|
||||||
myOkBase = true;
|
myOkBase = true;
|
||||||
}
|
}
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
||||||
myAxis = aSelectedObject;
|
myAxis = aSelectedObject;
|
||||||
myOkAxis = true;
|
myOkAxis = true;
|
||||||
}
|
}
|
||||||
@ -243,11 +243,11 @@ void GenerationGUI_RevolDlg::SetEditCurrentArgument()
|
|||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints->PushButton2) {
|
else if ( send == GroupPoints->PushButton2 ) {
|
||||||
GroupPoints->LineEdit2->setFocus();
|
GroupPoints->LineEdit2->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
globalSelection( GEOM_LINE );
|
globalSelection( GEOM_LINE );
|
||||||
@ -263,12 +263,11 @@ void GenerationGUI_RevolDlg::SetEditCurrentArgument()
|
|||||||
void GenerationGUI_RevolDlg::LineEditReturnPressed()
|
void GenerationGUI_RevolDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 ||
|
if ( send == GroupPoints->LineEdit1 ||
|
||||||
send == GroupPoints->LineEdit2)
|
send == GroupPoints->LineEdit2 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -280,7 +279,7 @@ void GenerationGUI_RevolDlg::ActivateThisDialog()
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument() ) );
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
displayPreview();
|
displayPreview();
|
||||||
@ -291,9 +290,9 @@ void GenerationGUI_RevolDlg::ActivateThisDialog()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_RevolDlg::enterEvent(QEvent* e)
|
void GenerationGUI_RevolDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +313,7 @@ void GenerationGUI_RevolDlg::ValueChangedInSpinBox()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
double GenerationGUI_RevolDlg::getAngle() const
|
double GenerationGUI_RevolDlg::getAngle() const
|
||||||
{
|
{
|
||||||
return GroupPoints->SpinBox_DX->GetValue();
|
return GroupPoints->SpinBox_DX->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -359,6 +358,6 @@ bool GenerationGUI_RevolDlg::execute( ObjectList& objects )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_RevolDlg::onReverse()
|
void GenerationGUI_RevolDlg::onReverse()
|
||||||
{
|
{
|
||||||
double anOldValue = GroupPoints->SpinBox_DX->GetValue();
|
double anOldValue = GroupPoints->SpinBox_DX->value();
|
||||||
GroupPoints->SpinBox_DX->SetValue( -anOldValue );
|
GroupPoints->SpinBox_DX->setValue( -anOldValue );
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,32 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : GenerationGUI_RevolDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : GenerationGUI_RevolDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_REVOLUTION_H
|
#ifndef GENERATIONGUI_REVOLUTIONDLG_H
|
||||||
#define DIALOGBOX_REVOLUTION_H
|
#define GENERATIONGUI_REVOLUTIONDLG_H
|
||||||
|
|
||||||
#include "GenerationGUI.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
|
||||||
|
|
||||||
class DlgRef_2Sel1Spin2Check;
|
class DlgRef_2Sel1Spin2Check;
|
||||||
|
|
||||||
@ -38,42 +34,42 @@ class DlgRef_2Sel1Spin2Check;
|
|||||||
// class : GenerationGUI_RevolDlg
|
// class : GenerationGUI_RevolDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class GENERATIONGUI_EXPORT GenerationGUI_RevolDlg : public GEOMBase_Skeleton
|
class GenerationGUI_RevolDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
GenerationGUI_RevolDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~GenerationGUI_RevolDlg();
|
||||||
~GenerationGUI_RevolDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& msg );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
private :
|
|
||||||
void Init();
|
|
||||||
void enterEvent(QEvent* e);
|
|
||||||
double getAngle() const;
|
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myBase; /* Base shape */
|
|
||||||
GEOM::GEOM_Object_var myAxis; /* Axis of the revolution */
|
|
||||||
bool myOkBase;
|
|
||||||
bool myOkAxis;
|
|
||||||
|
|
||||||
DlgRef_2Sel1Spin2Check* GroupPoints;
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent( QEvent* );
|
||||||
|
double getAngle() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
GEOM::GEOM_Object_var myBase; /* Base shape */
|
||||||
|
GEOM::GEOM_Object_var myAxis; /* Axis of the revolution */
|
||||||
|
bool myOkBase;
|
||||||
|
bool myOkAxis;
|
||||||
|
|
||||||
|
DlgRef_2Sel1Spin2Check* GroupPoints;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void ValueChangedInSpinBox();
|
void ValueChangedInSpinBox();
|
||||||
void onReverse();
|
void onReverse();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_REVOLUTION_H
|
#endif // GENERATIONGUI_REVOLUTIONDLG_H
|
||||||
|
@ -1,31 +1,28 @@
|
|||||||
# GEOM GENERATIONGUI :
|
# GEOM GENERATIONGUI :
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
# License as published by the Free Software Foundation; either
|
# License as published by the Free Software Foundation; either
|
||||||
# version 2.1 of the License.
|
# version 2.1 of the License.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful,
|
# This library is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
# File : Makefile.am
|
||||||
|
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
|
||||||
|
# Package : GenerationGUI
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# File : Makefile.in
|
|
||||||
# Author : Damien COQUERET (OCC)
|
|
||||||
# Modified by : Alexander BORODIN (OCN) - autotools usage
|
|
||||||
# Module : GEOM
|
|
||||||
# $Header:
|
|
||||||
|
|
||||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||||
|
|
||||||
@ -35,20 +32,26 @@ lib_LTLIBRARIES = libGenerationGUI.la
|
|||||||
# header files
|
# header files
|
||||||
salomeinclude_HEADERS =
|
salomeinclude_HEADERS =
|
||||||
|
|
||||||
dist_libGenerationGUI_la_SOURCES = \
|
dist_libGenerationGUI_la_SOURCES = \
|
||||||
GenerationGUI.cxx \
|
GenerationGUI.h \
|
||||||
GenerationGUI_PrismDlg.cxx \
|
GenerationGUI_PrismDlg.h \
|
||||||
GenerationGUI_RevolDlg.cxx \
|
GenerationGUI_RevolDlg.h \
|
||||||
GenerationGUI_FillingDlg.cxx \
|
GenerationGUI_FillingDlg.h \
|
||||||
|
GenerationGUI_PipeDlg.h \
|
||||||
|
\
|
||||||
|
GenerationGUI.cxx \
|
||||||
|
GenerationGUI_PrismDlg.cxx \
|
||||||
|
GenerationGUI_RevolDlg.cxx \
|
||||||
|
GenerationGUI_FillingDlg.cxx \
|
||||||
GenerationGUI_PipeDlg.cxx
|
GenerationGUI_PipeDlg.cxx
|
||||||
|
|
||||||
MOC_FILES = \
|
MOC_FILES = \
|
||||||
GenerationGUI_PrismDlg_moc.cxx \
|
GenerationGUI_PrismDlg_moc.cxx \
|
||||||
GenerationGUI_RevolDlg_moc.cxx \
|
GenerationGUI_RevolDlg_moc.cxx \
|
||||||
GenerationGUI_FillingDlg_moc.cxx \
|
GenerationGUI_FillingDlg_moc.cxx \
|
||||||
GenerationGUI_PipeDlg_moc.cxx
|
GenerationGUI_PipeDlg_moc.cxx
|
||||||
|
|
||||||
nodist_libGenerationGUI_la_SOURCES= \
|
nodist_libGenerationGUI_la_SOURCES = \
|
||||||
$(MOC_FILES)
|
$(MOC_FILES)
|
||||||
|
|
||||||
#LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
|
#LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
|
||||||
@ -57,27 +60,28 @@ nodist_libGenerationGUI_la_SOURCES= \
|
|||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
libGenerationGUI_la_CPPFLAGS = \
|
libGenerationGUI_la_CPPFLAGS = \
|
||||||
$(QT_INCLUDES) \
|
$(QT_INCLUDES) \
|
||||||
$(VTK_INCLUDES) \
|
$(VTK_INCLUDES) \
|
||||||
$(CAS_CPPFLAGS) \
|
$(CAS_CPPFLAGS) \
|
||||||
$(PYTHON_INCLUDES) \
|
$(PYTHON_INCLUDES) \
|
||||||
$(BOOST_CPPFLAGS) \
|
$(BOOST_CPPFLAGS) \
|
||||||
$(KERNEL_CXXFLAGS) \
|
$(KERNEL_CXXFLAGS) \
|
||||||
$(GUI_CXXFLAGS) \
|
$(GUI_CXXFLAGS) \
|
||||||
$(CORBA_CXXFLAGS) \
|
$(CORBA_CXXFLAGS) \
|
||||||
$(CORBA_INCLUDES) \
|
$(CORBA_INCLUDES) \
|
||||||
-I$(srcdir)/../GEOMGUI \
|
-I$(srcdir)/../GEOMGUI \
|
||||||
-I$(srcdir)/../DlgRef \
|
-I$(srcdir)/../DlgRef \
|
||||||
-I$(srcdir)/../GEOMBase \
|
-I$(srcdir)/../GEOMBase \
|
||||||
-I$(srcdir)/../OBJECT \
|
-I$(srcdir)/../OBJECT \
|
||||||
-I$(srcdir)/../GEOMClient \
|
-I$(srcdir)/../GEOMClient \
|
||||||
-I$(srcdir)/../GEOMImpl \
|
-I$(srcdir)/../GEOMImpl \
|
||||||
-I$(srcdir)/../GEOMFiltersSelection \
|
-I$(srcdir)/../GEOMFiltersSelection \
|
||||||
-I$(top_builddir)/idl \
|
-I$(top_builddir)/src/DlgRef \
|
||||||
|
-I$(top_builddir)/idl \
|
||||||
-I$(top_builddir)/salome_adm/unix
|
-I$(top_builddir)/salome_adm/unix
|
||||||
|
|
||||||
libGenerationGUI_la_LDFLAGS = \
|
libGenerationGUI_la_LDFLAGS = \
|
||||||
../GEOMFiltersSelection/libGEOMFiltersSelection.la \
|
../GEOMFiltersSelection/libGEOMFiltersSelection.la \
|
||||||
../GEOMBase/libGEOMBase.la \
|
../GEOMBase/libGEOMBase.la \
|
||||||
$(CAS_LDPATH) -lTKOffset
|
$(CAS_LDPATH) -lTKOffset
|
||||||
|
@ -1,31 +1,27 @@
|
|||||||
# GEOM PRIMITIVEGUI :
|
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
#
|
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
# 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
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
# License as published by the Free Software Foundation; either
|
# License as published by the Free Software Foundation; either
|
||||||
# version 2.1 of the License.
|
# version 2.1 of the License.
|
||||||
#
|
#
|
||||||
# This library is distributed in the hope that it will be useful,
|
# This library is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
# File : Makefile.am
|
||||||
|
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
|
||||||
|
# Package : PrimitiveGUI
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# File : Makefile.in
|
|
||||||
# Author : Damien COQUERET (OCC)
|
|
||||||
# Modified by : Alexander BORODIN (OCN) - autotools usage
|
|
||||||
# Module : GEOM
|
|
||||||
# $Header:
|
|
||||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||||
|
|
||||||
# header files
|
# header files
|
||||||
@ -34,22 +30,29 @@ salomeinclude_HEADERS =
|
|||||||
# Libraries targets
|
# Libraries targets
|
||||||
lib_LTLIBRARIES = libPrimitiveGUI.la
|
lib_LTLIBRARIES = libPrimitiveGUI.la
|
||||||
|
|
||||||
dist_libPrimitiveGUI_la_SOURCES = \
|
dist_libPrimitiveGUI_la_SOURCES = \
|
||||||
PrimitiveGUI.cxx \
|
PrimitiveGUI.h \
|
||||||
PrimitiveGUI_BoxDlg.cxx \
|
PrimitiveGUI_BoxDlg.h \
|
||||||
PrimitiveGUI_CylinderDlg.cxx \
|
PrimitiveGUI_ConeDlg.h \
|
||||||
PrimitiveGUI_SphereDlg.cxx \
|
PrimitiveGUI_CylinderDlg.h \
|
||||||
PrimitiveGUI_TorusDlg.cxx \
|
PrimitiveGUI_SphereDlg.h \
|
||||||
|
PrimitiveGUI_TorusDlg.h \
|
||||||
|
\
|
||||||
|
PrimitiveGUI.cxx \
|
||||||
|
PrimitiveGUI_BoxDlg.cxx \
|
||||||
|
PrimitiveGUI_CylinderDlg.cxx \
|
||||||
|
PrimitiveGUI_SphereDlg.cxx \
|
||||||
|
PrimitiveGUI_TorusDlg.cxx \
|
||||||
PrimitiveGUI_ConeDlg.cxx
|
PrimitiveGUI_ConeDlg.cxx
|
||||||
|
|
||||||
MOC_FILES = \
|
MOC_FILES = \
|
||||||
PrimitiveGUI_BoxDlg_moc.cxx \
|
PrimitiveGUI_BoxDlg_moc.cxx \
|
||||||
PrimitiveGUI_CylinderDlg_moc.cxx \
|
PrimitiveGUI_CylinderDlg_moc.cxx \
|
||||||
PrimitiveGUI_SphereDlg_moc.cxx \
|
PrimitiveGUI_SphereDlg_moc.cxx \
|
||||||
PrimitiveGUI_TorusDlg_moc.cxx \
|
PrimitiveGUI_TorusDlg_moc.cxx \
|
||||||
PrimitiveGUI_ConeDlg_moc.cxx
|
PrimitiveGUI_ConeDlg_moc.cxx
|
||||||
|
|
||||||
nodist_libPrimitiveGUI_la_SOURCES= \
|
nodist_libPrimitiveGUI_la_SOURCES = \
|
||||||
$(MOC_FILES)
|
$(MOC_FILES)
|
||||||
|
|
||||||
#LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
|
#LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
|
||||||
@ -58,26 +61,27 @@ nodist_libPrimitiveGUI_la_SOURCES= \
|
|||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
libPrimitiveGUI_la_CPPFLAGS = \
|
libPrimitiveGUI_la_CPPFLAGS = \
|
||||||
$(QT_INCLUDES) \
|
$(QT_INCLUDES) \
|
||||||
$(VTK_INCLUDES) \
|
$(VTK_INCLUDES) \
|
||||||
$(CAS_CPPFLAGS) \
|
$(CAS_CPPFLAGS) \
|
||||||
$(PYTHON_INCLUDES) \
|
$(PYTHON_INCLUDES) \
|
||||||
$(BOOST_CPPFLAGS) \
|
$(BOOST_CPPFLAGS) \
|
||||||
$(KERNEL_CXXFLAGS) \
|
$(KERNEL_CXXFLAGS) \
|
||||||
$(GUI_CXXFLAGS) \
|
$(GUI_CXXFLAGS) \
|
||||||
$(CORBA_CXXFLAGS) \
|
$(CORBA_CXXFLAGS) \
|
||||||
$(CORBA_INCLUDES) \
|
$(CORBA_INCLUDES) \
|
||||||
-I$(srcdir)/../GEOMGUI \
|
-I$(srcdir)/../GEOMGUI \
|
||||||
-I$(srcdir)/../DlgRef \
|
-I$(srcdir)/../DlgRef \
|
||||||
-I$(srcdir)/../GEOMBase \
|
-I$(srcdir)/../GEOMBase \
|
||||||
-I$(srcdir)/../OBJECT \
|
-I$(srcdir)/../OBJECT \
|
||||||
-I$(srcdir)/../GEOMClient \
|
-I$(srcdir)/../GEOMClient \
|
||||||
-I$(srcdir)/../GEOMImpl \
|
-I$(srcdir)/../GEOMImpl \
|
||||||
-I$(srcdir)/../GEOMFiltersSelection \
|
-I$(srcdir)/../GEOMFiltersSelection \
|
||||||
-I$(top_builddir)/idl \
|
-I$(top_builddir)/src/DlgRef \
|
||||||
|
-I$(top_builddir)/idl \
|
||||||
-I$(top_builddir)/salome_adm/unix
|
-I$(top_builddir)/salome_adm/unix
|
||||||
|
|
||||||
libPrimitiveGUI_la_LDFLAGS = \
|
libPrimitiveGUI_la_LDFLAGS = \
|
||||||
../GEOMFiltersSelection/libGEOMFiltersSelection.la \
|
../GEOMFiltersSelection/libGEOMFiltersSelection.la \
|
||||||
../GEOMBase/libGEOMBase.la
|
../GEOMBase/libGEOMBase.la
|
||||||
|
@ -1,38 +1,34 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI.cxx
|
||||||
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI.cxx
|
|
||||||
// Author : Damien COQUERET
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
|
|
||||||
#include "PrimitiveGUI.h"
|
#include "PrimitiveGUI.h"
|
||||||
#include "GeometryGUI.h"
|
|
||||||
|
|
||||||
#include "SUIT_Desktop.h"
|
#include <GeometryGUI.h>
|
||||||
|
|
||||||
#include "SalomeApp_Application.h"
|
#include <SUIT_Desktop.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
|
||||||
#include "PrimitiveGUI_BoxDlg.h" // Method BOX
|
#include "PrimitiveGUI_BoxDlg.h" // Method BOX
|
||||||
#include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER
|
#include "PrimitiveGUI_CylinderDlg.h" // Method CYLINDER
|
||||||
@ -40,13 +36,11 @@
|
|||||||
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
|
#include "PrimitiveGUI_TorusDlg.h" // Method TORUS
|
||||||
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
|
#include "PrimitiveGUI_ConeDlg.h" // Method CONE
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : PrimitiveGUI()
|
// function : PrimitiveGUI()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
PrimitiveGUI::PrimitiveGUI(GeometryGUI* parent) : GEOMGUI(parent)
|
PrimitiveGUI::PrimitiveGUI( GeometryGUI* parent ) : GEOMGUI( parent )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,56 +52,53 @@ PrimitiveGUI::~PrimitiveGUI()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : OnGUIEvent()
|
// function : OnGUIEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool PrimitiveGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool PrimitiveGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
|
||||||
{
|
{
|
||||||
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
SalomeApp_Application* app = getGeometryGUI()->getApp();
|
||||||
if (!app) return false;
|
if ( !app ) return false;
|
||||||
|
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
QDialog* aDlg = NULL;
|
QDialog* aDlg = NULL;
|
||||||
|
|
||||||
switch (theCommandID)
|
switch ( theCommandID ) {
|
||||||
{
|
case 4021: // BOX
|
||||||
case 4021: // BOX
|
aDlg = new PrimitiveGUI_BoxDlg( getGeometryGUI(), parent );
|
||||||
aDlg = new PrimitiveGUI_BoxDlg(getGeometryGUI(), parent, "");
|
break;
|
||||||
break;
|
case 4022: // CYLINDER
|
||||||
case 4022: // CYLINDER
|
aDlg = new PrimitiveGUI_CylinderDlg( getGeometryGUI(), parent );
|
||||||
aDlg = new PrimitiveGUI_CylinderDlg(getGeometryGUI(), parent, "");
|
break;
|
||||||
break;
|
case 4023: // SPHERE
|
||||||
case 4023: // SPHERE
|
aDlg = new PrimitiveGUI_SphereDlg( getGeometryGUI(), parent );
|
||||||
aDlg = new PrimitiveGUI_SphereDlg(getGeometryGUI(), parent, "");
|
break;
|
||||||
break;
|
case 4024: // TORUS
|
||||||
case 4024: // TORUS
|
aDlg = new PrimitiveGUI_TorusDlg( getGeometryGUI(), parent );
|
||||||
aDlg = new PrimitiveGUI_TorusDlg(getGeometryGUI(), parent, "");
|
break;
|
||||||
break;
|
case 4025: // CONE
|
||||||
case 4025: // CONE
|
aDlg = new PrimitiveGUI_ConeDlg( getGeometryGUI(), parent, "" );
|
||||||
aDlg = new PrimitiveGUI_ConeDlg(getGeometryGUI(), parent, "");
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
|
||||||
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
break;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (aDlg != NULL)
|
if ( aDlg != NULL )
|
||||||
aDlg->show();
|
aDlg->show();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
// EXPORTED METHODS
|
// EXPORTED METHODS
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#ifdef WNT
|
#ifdef WIN32
|
||||||
__declspec( dllexport )
|
__declspec( dllexport )
|
||||||
#endif
|
#endif
|
||||||
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
GEOMGUI* GetLibGUI( GeometryGUI* parent )
|
||||||
{
|
{
|
||||||
|
@ -1,35 +1,32 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI.h
|
||||||
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI.h
|
|
||||||
// Author : Damien COQUERET
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef PRIMITIVEGUI_H
|
#ifndef PRIMITIVEGUI_H
|
||||||
#define PRIMITIVEGUI_H
|
#define PRIMITIVEGUI_H
|
||||||
|
|
||||||
#include "GEOMGUI.h"
|
#include <GEOMGUI.h>
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI
|
// class : PrimitiveGUI
|
||||||
@ -38,10 +35,10 @@
|
|||||||
class PrimitiveGUI : public GEOMGUI
|
class PrimitiveGUI : public GEOMGUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PrimitiveGUI(GeometryGUI* parent);
|
PrimitiveGUI( GeometryGUI* );
|
||||||
~PrimitiveGUI();
|
~PrimitiveGUI();
|
||||||
|
|
||||||
bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent);
|
bool OnGUIEvent( int, SUIT_Desktop* );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,47 +1,40 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_BoxDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_BoxDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "PrimitiveGUI_BoxDlg.h"
|
#include "PrimitiveGUI_BoxDlg.h"
|
||||||
#include "DlgRef_3Spin.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_BoxDlg()
|
// class : PrimitiveGUI_BoxDlg()
|
||||||
@ -50,45 +43,43 @@ 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BOX_2P" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BOX_DXYZ" ) ));
|
||||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_BOX_TITLE"));
|
setWindowTitle( tr( "GEOM_BOX_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_BOX"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BOX" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setIcon(image1);
|
mainFrame()->RadioButton2->setIcon( image1 );
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new Ui::DlgRef_2Sel_QTD();
|
GroupPoints = new DlgRef_2Sel( centralWidget() );
|
||||||
QWidget* aGroupPointsWidget = new QWidget(this);
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_DIAGONAL_POINTS" ) );
|
||||||
GroupPoints->setupUi(aGroupPointsWidget);
|
GroupPoints->TextLabel1->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
|
||||||
aGroupPointsWidget->setObjectName("GroupPoints");
|
GroupPoints->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
|
||||||
|
GroupPoints->PushButton1->setIcon( image2 );
|
||||||
|
GroupPoints->PushButton2->setIcon( image2 );
|
||||||
|
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_DIAGONAL_POINTS"));
|
GroupDimensions = new DlgRef_3Spin( centralWidget() );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
GroupDimensions->TextLabel1->setText( tr( "GEOM_DX" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image2);
|
GroupDimensions->TextLabel2->setText( tr( "GEOM_DY" ) );
|
||||||
GroupPoints->PushButton2->setIcon(image2);
|
GroupDimensions->TextLabel3->setText( tr( "GEOM_DZ" ) );
|
||||||
|
|
||||||
GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions");
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
GroupDimensions->TextLabel1->setText(tr("GEOM_DX"));
|
layout->addWidget( GroupPoints );
|
||||||
GroupDimensions->TextLabel2->setText(tr("GEOM_DY"));
|
layout->addWidget( GroupDimensions );
|
||||||
GroupDimensions->TextLabel3->setText(tr("GEOM_DZ"));
|
|
||||||
|
|
||||||
gridLayout1->addWidget(aGroupPointsWidget, 2, 0);
|
|
||||||
gridLayout1->addWidget(GroupDimensions, 2, 0);
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("box.htm");
|
setHelpFileName( "box.htm" );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@ -119,43 +110,46 @@ void PrimitiveGUI_BoxDlg::Init()
|
|||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes */
|
/* min, max, step and decimals for spin boxes */
|
||||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
|
|
||||||
double initValue = 200.0;
|
double initValue = 200.0;
|
||||||
GroupDimensions->SpinBox_DX->SetValue(initValue);
|
GroupDimensions->SpinBox_DX->setValue( initValue );
|
||||||
GroupDimensions->SpinBox_DY->SetValue(initValue);
|
GroupDimensions->SpinBox_DY->setValue( initValue );
|
||||||
GroupDimensions->SpinBox_DZ->SetValue(initValue);
|
GroupDimensions->SpinBox_DZ->setValue( initValue );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
|
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupDimensions->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
// VSR: TODO ->>
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DZ, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName( tr( "GEOM_BOX" ).toLatin1().constData() );
|
initName( tr( "GEOM_BOX" ) );
|
||||||
ConstructorsClicked(0);
|
|
||||||
|
ConstructorsClicked( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -163,38 +157,39 @@ void PrimitiveGUI_BoxDlg::Init()
|
|||||||
// function : ConstructorsClicked()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
|
void PrimitiveGUI_BoxDlg::ConstructorsClicked( int constructorId )
|
||||||
{
|
{
|
||||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ) )->selectionMgr(), 0, this, 0 );
|
||||||
|
|
||||||
switch (constructorId)
|
switch ( constructorId ) {
|
||||||
|
case 0:
|
||||||
{
|
{
|
||||||
case 0:
|
globalSelection( GEOM_POINT );
|
||||||
{
|
|
||||||
globalSelection( GEOM_POINT );
|
GroupDimensions->hide();
|
||||||
|
GroupPoints->show();
|
||||||
GroupDimensions->hide();
|
|
||||||
resize(0, 0);
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->show();
|
GroupPoints->LineEdit1->setText( "" );
|
||||||
|
GroupPoints->LineEdit2->setText( "" );
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
|
||||||
GroupPoints->LineEdit1->setText("");
|
|
||||||
GroupPoints->LineEdit2->setText("");
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
break;
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
::qobject_cast<QWidget*>( GroupPoints->gridLayout->parent() )->hide();
|
|
||||||
resize(0, 0);
|
|
||||||
GroupDimensions->show();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
GroupDimensions->show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
updateGeometry();
|
||||||
|
resize( minimumSize() );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,27 +229,26 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
|
|||||||
if ( getConstructorId() != 0 )
|
if ( getConstructorId() != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if (IObjectCount() != 1)
|
if ( IObjectCount() != 1 ) {
|
||||||
{
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
myPoint1 = GEOM::GEOM_Object::_nil();
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2)
|
myPoint2 = GEOM::GEOM_Object::_nil();
|
||||||
myPoint2 = GEOM::GEOM_Object::_nil();
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if(!testResult || CORBA::is_nil( aSelectedObject ))
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myPoint1 = aSelectedObject;
|
myPoint1 = aSelectedObject;
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myPoint2 = aSelectedObject;
|
myPoint2 = aSelectedObject;
|
||||||
|
|
||||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||||
@ -271,9 +265,9 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1)
|
if ( send == GroupPoints->PushButton1 )
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
else if(send == GroupPoints->PushButton2)
|
else if ( send == GroupPoints->PushButton2 )
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
@ -290,11 +284,10 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
|
|||||||
void PrimitiveGUI_BoxDlg::LineEditReturnPressed()
|
void PrimitiveGUI_BoxDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2)
|
if ( send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -305,8 +298,8 @@ void PrimitiveGUI_BoxDlg::LineEditReturnPressed()
|
|||||||
void PrimitiveGUI_BoxDlg::ActivateThisDialog()
|
void PrimitiveGUI_BoxDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
ConstructorsClicked( getConstructorId() );
|
ConstructorsClicked( getConstructorId() );
|
||||||
}
|
}
|
||||||
@ -316,9 +309,9 @@ void PrimitiveGUI_BoxDlg::ActivateThisDialog()
|
|||||||
// function : enterEvent [REDEFINED]
|
// function : enterEvent [REDEFINED]
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_BoxDlg::enterEvent(QEvent* e)
|
void PrimitiveGUI_BoxDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +342,7 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_BoxDlg::createOperation()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool PrimitiveGUI_BoxDlg::isValid( QString& msg )
|
bool PrimitiveGUI_BoxDlg::isValid( QString& msg )
|
||||||
{
|
{
|
||||||
return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : true;
|
return getConstructorId() == 0 ? !( myPoint1->_is_nil() || myPoint2->_is_nil() ) : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -363,8 +356,7 @@ bool PrimitiveGUI_BoxDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
switch ( getConstructorId() )
|
switch ( getConstructorId() ) {
|
||||||
{
|
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
{
|
||||||
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) ) {
|
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) ) {
|
||||||
@ -376,9 +368,9 @@ bool PrimitiveGUI_BoxDlg::execute( ObjectList& objects )
|
|||||||
}
|
}
|
||||||
case 1 :
|
case 1 :
|
||||||
{
|
{
|
||||||
double x = GroupDimensions->SpinBox_DX->GetValue();
|
double x = GroupDimensions->SpinBox_DX->value();
|
||||||
double y = GroupDimensions->SpinBox_DY->GetValue();
|
double y = GroupDimensions->SpinBox_DY->value();
|
||||||
double z = GroupDimensions->SpinBox_DZ->GetValue();
|
double z = GroupDimensions->SpinBox_DZ->value();
|
||||||
|
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeBoxDXDYDZ( x, y, z );
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeBoxDXDYDZ( x, y, z );
|
||||||
res = true;
|
res = true;
|
||||||
@ -396,7 +388,7 @@ bool PrimitiveGUI_BoxDlg::execute( ObjectList& objects )
|
|||||||
// function : closeEvent
|
// function : closeEvent
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_BoxDlg::closeEvent( QCloseEvent* e )
|
void PrimitiveGUI_BoxDlg::closeEvent( QCloseEvent* e )
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::closeEvent( e );
|
GEOMBase_Skeleton::closeEvent( e );
|
||||||
}
|
}
|
||||||
|
@ -1,38 +1,34 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_BoxDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_BoxDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_BOX_H
|
#ifndef PRIMITIVEGUI_BOXDLG_H
|
||||||
#define DIALOGBOX_BOX_H
|
#define PRIMITIVEGUI_BOXDLG_H
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
#include "DlgRef_2Sel_QTD.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
class DlgRef_2Sel;
|
||||||
class DlgRef_3Spin;
|
class DlgRef_3Spin;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -41,39 +37,39 @@ class DlgRef_3Spin;
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class PrimitiveGUI_BoxDlg : public GEOMBase_Skeleton
|
class PrimitiveGUI_BoxDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
PrimitiveGUI_BoxDlg( GeometryGUI*, QWidget* = 0, bool modal = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~PrimitiveGUI_BoxDlg();
|
||||||
~PrimitiveGUI_BoxDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* );
|
||||||
|
|
||||||
private :
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */
|
private:
|
||||||
|
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */
|
||||||
Ui::DlgRef_2Sel_QTD* GroupPoints;
|
|
||||||
DlgRef_3Spin* GroupDimensions;
|
DlgRef_2Sel* GroupPoints;
|
||||||
|
DlgRef_3Spin* GroupDimensions;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void ConstructorsClicked(int);
|
void ConstructorsClicked( int );
|
||||||
void ValueChangedInSpinBox();
|
void ValueChangedInSpinBox();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_BOX_H
|
#endif // PRIMITIVEGUI_BOXDLG_H
|
||||||
|
@ -1,47 +1,40 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_ConeDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_ConeDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "PrimitiveGUI_ConeDlg.h"
|
#include "PrimitiveGUI_ConeDlg.h"
|
||||||
#include "DlgRef_2Sel3Spin.h"
|
|
||||||
#include "DlgRef_3Spin.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_ConeDlg()
|
// class : PrimitiveGUI_ConeDlg()
|
||||||
@ -50,41 +43,43 @@ 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_PV")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CONE_PV" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_DXYZ")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CONE_DXYZ" ) ) );
|
||||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_CONE_TITLE"));
|
setWindowTitle( tr( "GEOM_CONE_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_CONE"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_CONE" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setIcon(image1);
|
mainFrame()->RadioButton2->setIcon( image1 );
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_2Sel3Spin(this, "GroupPoints");
|
GroupPoints = new DlgRef_2Sel3Spin( centralWidget() );
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
|
||||||
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1"));
|
GroupPoints->TextLabel3->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
|
||||||
GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2"));
|
GroupPoints->TextLabel4->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
|
||||||
GroupPoints->TextLabel5->setText(tr("GEOM_HEIGHT"));
|
GroupPoints->TextLabel5->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image2);
|
GroupPoints->PushButton1->setIcon( image2 );
|
||||||
GroupPoints->PushButton2->setIcon(image2);
|
GroupPoints->PushButton2->setIcon( image2 );
|
||||||
|
|
||||||
GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions");
|
GroupDimensions = new DlgRef_3Spin( centralWidget() );
|
||||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
|
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
|
||||||
GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1"));
|
GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
|
||||||
GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2"));
|
GroupDimensions->TextLabel2->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
|
||||||
GroupDimensions->TextLabel3->setText(tr("GEOM_HEIGHT"));
|
GroupDimensions->TextLabel3->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
gridLayout1->addWidget(GroupDimensions, 2, 0);
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
|
layout->addWidget( GroupDimensions );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName( "cone.htm" );
|
setHelpFileName( "cone.htm" );
|
||||||
@ -99,7 +94,7 @@ PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget*
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_ConeDlg::~PrimitiveGUI_ConeDlg()
|
PrimitiveGUI_ConeDlg::~PrimitiveGUI_ConeDlg()
|
||||||
{
|
{
|
||||||
// no need to delete child widgets, Qt does it all for us
|
// no need to delete child widgets, Qt does it all for us
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -118,54 +113,58 @@ void PrimitiveGUI_ConeDlg::Init()
|
|||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DX, 0.000, COORD_MAX, step, 3 );
|
||||||
GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DY, 0.000, COORD_MAX, step, 3 );
|
||||||
GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DX, 0.000, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DY, 0.000, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
|
|
||||||
double aRadius1(100.0), aRadius2(0.0), aHeight(300.0);
|
double aRadius1( 100.0 ), aRadius2( 0.0 ), aHeight( 300.0 );
|
||||||
GroupPoints->SpinBox_DX->SetValue(aRadius1);
|
GroupPoints->SpinBox_DX->setValue( aRadius1 );
|
||||||
GroupPoints->SpinBox_DY->SetValue(aRadius2);
|
GroupPoints->SpinBox_DY->setValue( aRadius2 );
|
||||||
GroupPoints->SpinBox_DZ->SetValue(aHeight);
|
GroupPoints->SpinBox_DZ->setValue( aHeight );
|
||||||
GroupDimensions->SpinBox_DX->SetValue(aRadius1);
|
GroupDimensions->SpinBox_DX->setValue( aRadius1 );
|
||||||
GroupDimensions->SpinBox_DY->SetValue(aRadius2);
|
GroupDimensions->SpinBox_DY->setValue( aRadius2 );
|
||||||
GroupDimensions->SpinBox_DZ->SetValue(aHeight);
|
GroupDimensions->SpinBox_DZ->setValue( aHeight );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
|
|
||||||
|
// VSR: TODO ->>
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DZ, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DZ, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName( tr( "GEOM_CONE" ).toLatin1().constData() );
|
initName( tr( "GEOM_CONE" ) );
|
||||||
ConstructorsClicked(0);
|
|
||||||
|
ConstructorsClicked( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -173,37 +172,39 @@ void PrimitiveGUI_ConeDlg::Init()
|
|||||||
// function : ConstructorsClicked()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_ConeDlg::ConstructorsClicked(int constructorId)
|
void PrimitiveGUI_ConeDlg::ConstructorsClicked( int constructorId )
|
||||||
{
|
{
|
||||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
|
||||||
|
|
||||||
switch(constructorId)
|
switch( constructorId ) {
|
||||||
{
|
case 0 :
|
||||||
case 0 :
|
{
|
||||||
{
|
globalSelection( GEOM_POINT );
|
||||||
globalSelection( GEOM_POINT );
|
GroupDimensions->hide();
|
||||||
GroupDimensions->hide();
|
GroupPoints->show();
|
||||||
resize(0, 0);
|
|
||||||
GroupPoints->show();
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
GroupPoints->LineEdit1->setText( "" );
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit2->setText( "" );
|
||||||
GroupPoints->LineEdit1->setText(tr(""));
|
myPoint = myDir = GEOM::GEOM_Object::_nil();
|
||||||
GroupPoints->LineEdit2->setText(tr(""));
|
|
||||||
myPoint = myDir = GEOM::GEOM_Object::_nil();
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
break;
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1 :
|
|
||||||
{
|
|
||||||
GroupPoints->hide();
|
|
||||||
resize( 0, 0 );
|
|
||||||
GroupDimensions->show();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
case 1 :
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
GroupDimensions->show();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
updateGeometry();
|
||||||
|
resize( minimumSize() );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,16 +235,6 @@ bool PrimitiveGUI_ConeDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : ClickOnCancel()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void PrimitiveGUI_ConeDlg::ClickOnCancel()
|
|
||||||
{
|
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -253,25 +244,24 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
|
|||||||
if ( getConstructorId() != 0 )
|
if ( getConstructorId() != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(IObjectCount() != 1)
|
if ( IObjectCount() != 1 ) {
|
||||||
{
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
myDir = GEOM::GEOM_Object::_nil();
|
||||||
myDir = GEOM::GEOM_Object::_nil();
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if(!testResult || CORBA::is_nil( aSelectedObject ))
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myPoint = aSelectedObject;
|
myPoint = aSelectedObject;
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myDir = aSelectedObject;
|
myDir = aSelectedObject;
|
||||||
|
|
||||||
|
|
||||||
@ -288,11 +278,11 @@ void PrimitiveGUI_ConeDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints->PushButton2) {
|
else if ( send == GroupPoints->PushButton2 ) {
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
globalSelection( GEOM_LINE );
|
globalSelection( GEOM_LINE );
|
||||||
}
|
}
|
||||||
@ -309,12 +299,11 @@ void PrimitiveGUI_ConeDlg::SetEditCurrentArgument()
|
|||||||
void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
|
void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 ||
|
if ( send == GroupPoints->LineEdit1 ||
|
||||||
send == GroupPoints->LineEdit2)
|
send == GroupPoints->LineEdit2 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -325,8 +314,8 @@ void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
|
|||||||
void PrimitiveGUI_ConeDlg::ActivateThisDialog()
|
void PrimitiveGUI_ConeDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
ConstructorsClicked( getConstructorId() );
|
ConstructorsClicked( getConstructorId() );
|
||||||
}
|
}
|
||||||
@ -346,9 +335,9 @@ void PrimitiveGUI_ConeDlg::DeactivateActiveDialog()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_ConeDlg::enterEvent(QEvent* e)
|
void PrimitiveGUI_ConeDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,28 +380,23 @@ bool PrimitiveGUI_ConeDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
switch ( getConstructorId() )
|
switch ( getConstructorId() ) {
|
||||||
{
|
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) ) {
|
||||||
if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) ){
|
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConePntVecR1R2H( myPoint,
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConePntVecR1R2H( myPoint,
|
||||||
myDir,
|
myDir,
|
||||||
getRadius1(),
|
getRadius1(),
|
||||||
getRadius2(),
|
getRadius2(),
|
||||||
getHeight());
|
getHeight() );
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 1 :
|
case 1 :
|
||||||
{
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConeR1R2H( getRadius1(),
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeConeR1R2H( getRadius1(),
|
getRadius2(),
|
||||||
getRadius2(),
|
getHeight() );
|
||||||
getHeight());
|
res = true;
|
||||||
res = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
@ -439,10 +423,10 @@ void PrimitiveGUI_ConeDlg::closeEvent( QCloseEvent* e )
|
|||||||
double PrimitiveGUI_ConeDlg::getRadius1() const
|
double PrimitiveGUI_ConeDlg::getRadius1() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DX->GetValue();
|
return GroupPoints->SpinBox_DX->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DX->GetValue();
|
return GroupDimensions->SpinBox_DX->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,10 +438,10 @@ double PrimitiveGUI_ConeDlg::getRadius1() const
|
|||||||
double PrimitiveGUI_ConeDlg::getRadius2() const
|
double PrimitiveGUI_ConeDlg::getRadius2() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DY->GetValue();
|
return GroupPoints->SpinBox_DY->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DY->GetValue();
|
return GroupDimensions->SpinBox_DY->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,9 +453,9 @@ double PrimitiveGUI_ConeDlg::getRadius2() const
|
|||||||
double PrimitiveGUI_ConeDlg::getHeight() const
|
double PrimitiveGUI_ConeDlg::getHeight() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DZ->GetValue();
|
return GroupPoints->SpinBox_DZ->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DZ->GetValue();
|
return GroupDimensions->SpinBox_DZ->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,32 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_ConeDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_ConeDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_CONE_H
|
#ifndef PRIMITIVEGUI_CONEDLG_H
|
||||||
#define DIALOGBOX_CONE_H
|
#define PRIMITIVEGUI_CONEDLG_H
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
class DlgRef_2Sel3Spin;
|
class DlgRef_2Sel3Spin;
|
||||||
class DlgRef_3Spin;
|
class DlgRef_3Spin;
|
||||||
@ -39,44 +37,43 @@ class DlgRef_3Spin;
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
class PrimitiveGUI_ConeDlg : public GEOMBase_Skeleton
|
class PrimitiveGUI_ConeDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
PrimitiveGUI_ConeDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~PrimitiveGUI_ConeDlg();
|
||||||
~PrimitiveGUI_ConeDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
double getRadius1() const;
|
double getRadius1() const;
|
||||||
double getRadius2() const;
|
double getRadius2() const;
|
||||||
double getHeight() const;
|
double getHeight() const;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myPoint, myDir;
|
private:
|
||||||
|
GEOM::GEOM_Object_var myPoint, myDir;
|
||||||
DlgRef_2Sel3Spin* GroupPoints;
|
|
||||||
DlgRef_3Spin* GroupDimensions;
|
DlgRef_2Sel3Spin* GroupPoints;
|
||||||
|
DlgRef_3Spin* GroupDimensions;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnCancel();
|
void ActivateThisDialog();
|
||||||
void ActivateThisDialog();
|
void DeactivateActiveDialog();
|
||||||
void DeactivateActiveDialog();
|
void LineEditReturnPressed();
|
||||||
void LineEditReturnPressed();
|
void SelectionIntoArgument();
|
||||||
void SelectionIntoArgument();
|
void SetEditCurrentArgument();
|
||||||
void SetEditCurrentArgument();
|
void ConstructorsClicked( int );
|
||||||
void ConstructorsClicked(int);
|
void ValueChangedInSpinBox();
|
||||||
void ValueChangedInSpinBox();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_CONE_H
|
#endif // PRIMITIVEGUI_CONEDLG_H
|
||||||
|
@ -1,47 +1,41 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_CylinderDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_CylinderDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "PrimitiveGUI_CylinderDlg.h"
|
#include "PrimitiveGUI_CylinderDlg.h"
|
||||||
#include "DlgRef_2Sel2Spin.h"
|
|
||||||
#include "DlgRef_2Spin.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <GeometryGUI.h>
|
||||||
#include "SUIT_Session.h"
|
#include <GEOMBase.h>
|
||||||
#include "SalomeApp_Application.h"
|
|
||||||
#include "LightApp_SelectionMgr.h"
|
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SUIT_Session.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
using namespace std;
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_CylinderDlg()
|
// class : PrimitiveGUI_CylinderDlg()
|
||||||
@ -50,42 +44,44 @@ 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_PV")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CYLINDER_PV" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_DXYZ")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_CYLINDER_DXYZ" ) ) );
|
||||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_CYLINDER_TITLE"));
|
setWindowTitle( tr( "GEOM_CYLINDER_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_CYLINDER"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_CYLINDER" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setIcon(image1);
|
mainFrame()->RadioButton2->setIcon( image1 );
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
|
GroupPoints = new DlgRef_2Sel2Spin( centralWidget() );
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
|
||||||
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
|
GroupPoints->TextLabel3->setText( tr( "GEOM_RADIUS" ) );
|
||||||
GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT"));
|
GroupPoints->TextLabel4->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image2);
|
GroupPoints->PushButton1->setIcon( image2 );
|
||||||
GroupPoints->PushButton2->setIcon(image2);
|
GroupPoints->PushButton2->setIcon( image2 );
|
||||||
|
|
||||||
GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions");
|
GroupDimensions = new DlgRef_2Spin( centralWidget() );
|
||||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
|
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
|
||||||
GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
|
GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
|
||||||
GroupDimensions->TextLabel2->setText(tr("GEOM_HEIGHT"));
|
GroupDimensions->TextLabel2->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
gridLayout1->addWidget(GroupDimensions, 2, 0);
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
|
layout->addWidget( GroupDimensions );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("cylinder.htm");
|
setHelpFileName( "cylinder.htm" );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@ -97,7 +93,7 @@ PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI,
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_CylinderDlg::~PrimitiveGUI_CylinderDlg()
|
PrimitiveGUI_CylinderDlg::~PrimitiveGUI_CylinderDlg()
|
||||||
{
|
{
|
||||||
// no need to delete child widgets, Qt does it all for us
|
// no need to delete child widgets, Qt does it all for us
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -116,49 +112,52 @@ void PrimitiveGUI_CylinderDlg::Init()
|
|||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
/* First constructor : radius */
|
/* First constructor : radius */
|
||||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
|
||||||
/* First constructor : algebric height */
|
/* First constructor : algebric height */
|
||||||
GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
/* Second constructor : radius */
|
/* Second constructor : radius */
|
||||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
|
||||||
/* Second constructor : algebric height */
|
/* Second constructor : algebric height */
|
||||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 );
|
||||||
|
|
||||||
GroupPoints->SpinBox_DX->SetValue(100.0);
|
GroupPoints->SpinBox_DX->setValue( 100.0 );
|
||||||
GroupPoints->SpinBox_DY->SetValue(300.0);
|
GroupPoints->SpinBox_DY->setValue( 300.0 );
|
||||||
GroupDimensions->SpinBox_DX->SetValue(100.0);
|
GroupDimensions->SpinBox_DX->setValue( 100.0 );
|
||||||
GroupDimensions->SpinBox_DY->SetValue(300.0);
|
GroupDimensions->SpinBox_DY->setValue( 300.0 );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DX, SIGNAL(valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DY, SIGNAL(valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DX, SIGNAL(valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DY, SIGNAL(valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
|
|
||||||
|
// VSR: TODO ->>
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName( tr( "GEOM_CYLINDER" ).toLatin1().constData() );
|
initName( tr( "GEOM_CYLINDER" ) );
|
||||||
ConstructorsClicked(0);
|
ConstructorsClicked( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -166,38 +165,39 @@ void PrimitiveGUI_CylinderDlg::Init()
|
|||||||
// function : ConstructorsClicked()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_CylinderDlg::ConstructorsClicked(int constructorId)
|
void PrimitiveGUI_CylinderDlg::ConstructorsClicked( int constructorId )
|
||||||
{
|
{
|
||||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
|
||||||
|
|
||||||
switch(constructorId)
|
switch( constructorId ) {
|
||||||
{
|
case 0 :
|
||||||
case 0 :
|
{
|
||||||
{
|
globalSelection( GEOM_POINT );
|
||||||
globalSelection( GEOM_POINT );
|
|
||||||
|
GroupDimensions->hide();
|
||||||
GroupDimensions->hide();
|
GroupPoints->show();
|
||||||
resize(0, 0);
|
|
||||||
GroupPoints->show();
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
GroupPoints->LineEdit1->setText( "" );
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit2->setText( "" );
|
||||||
GroupPoints->LineEdit1->setText(tr(""));
|
myPoint = myDir = GEOM::GEOM_Object::_nil();
|
||||||
GroupPoints->LineEdit2->setText(tr(""));
|
|
||||||
myPoint = myDir = GEOM::GEOM_Object::_nil();
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
break;
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1 :
|
|
||||||
{
|
|
||||||
GroupPoints->hide();
|
|
||||||
resize( 0, 0 );
|
|
||||||
GroupDimensions->show();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
case 1 :
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
GroupDimensions->show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
updateGeometry();
|
||||||
|
resize( minimumSize() );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,16 +228,6 @@ bool PrimitiveGUI_CylinderDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : ClickOnCancel()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void PrimitiveGUI_CylinderDlg::ClickOnCancel()
|
|
||||||
{
|
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -247,27 +237,26 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
|
|||||||
if ( getConstructorId() != 0 )
|
if ( getConstructorId() != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if(IObjectCount() != 1)
|
if ( IObjectCount() != 1 ) {
|
||||||
{
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
myDir = GEOM::GEOM_Object::_nil();
|
||||||
myDir = GEOM::GEOM_Object::_nil();
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if(!testResult || CORBA::is_nil( aSelectedObject ))
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myPoint = aSelectedObject;
|
myPoint = aSelectedObject;
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myDir = aSelectedObject;
|
myDir = aSelectedObject;
|
||||||
|
|
||||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||||
@ -284,11 +273,11 @@ void PrimitiveGUI_CylinderDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints->PushButton2) {
|
else if ( send == GroupPoints->PushButton2 ) {
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
globalSelection( GEOM_LINE );
|
globalSelection( GEOM_LINE );
|
||||||
}
|
}
|
||||||
@ -305,12 +294,11 @@ void PrimitiveGUI_CylinderDlg::SetEditCurrentArgument()
|
|||||||
void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
|
void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 ||
|
if ( send == GroupPoints->LineEdit1 ||
|
||||||
send == GroupPoints->LineEdit2)
|
send == GroupPoints->LineEdit2 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -321,8 +309,8 @@ void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
|
|||||||
void PrimitiveGUI_CylinderDlg::ActivateThisDialog()
|
void PrimitiveGUI_CylinderDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
ConstructorsClicked( getConstructorId() );
|
ConstructorsClicked( getConstructorId() );
|
||||||
}
|
}
|
||||||
@ -332,9 +320,9 @@ void PrimitiveGUI_CylinderDlg::ActivateThisDialog()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_CylinderDlg::enterEvent(QEvent* e)
|
void PrimitiveGUI_CylinderDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,30 +370,25 @@ bool PrimitiveGUI_CylinderDlg::isValid( QString& msg )
|
|||||||
// function : execute
|
// function : execute
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool PrimitiveGUI_CylinderDlg::execute( ObjectList& objects )
|
bool PrimitiveGUI_CylinderDlg::execute( ObjectList& objects )
|
||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
switch ( getConstructorId() )
|
switch ( getConstructorId() ) {
|
||||||
{
|
case 0 :
|
||||||
case 0 :
|
if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) ) {
|
||||||
{
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderPntVecRH( myPoint, myDir, getRadius(), getHeight() );
|
||||||
if ( !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )) {
|
res = true;
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight());
|
|
||||||
res = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1 :
|
|
||||||
{
|
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderRH(getRadius(), getHeight());
|
|
||||||
res = true;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 1 :
|
||||||
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeCylinderRH( getRadius(), getHeight() );
|
||||||
|
res = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
@ -430,10 +413,10 @@ void PrimitiveGUI_CylinderDlg::closeEvent( QCloseEvent* e )
|
|||||||
double PrimitiveGUI_CylinderDlg::getRadius() const
|
double PrimitiveGUI_CylinderDlg::getRadius() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DX->GetValue();
|
return GroupPoints->SpinBox_DX->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DX->GetValue();
|
return GroupDimensions->SpinBox_DX->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,9 +428,9 @@ double PrimitiveGUI_CylinderDlg::getRadius() const
|
|||||||
double PrimitiveGUI_CylinderDlg::getHeight() const
|
double PrimitiveGUI_CylinderDlg::getHeight() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DY->GetValue();
|
return GroupPoints->SpinBox_DY->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DY->GetValue();
|
return GroupDimensions->SpinBox_DY->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,82 +1,78 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_CylinderDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_CylinderDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_CYLINDER_H
|
#ifndef PRIMITIVEGUI_CYLINDERDLG_H
|
||||||
#define DIALOGBOX_CYLINDER_H
|
#define PRIMITIVEGUI_CYLINDERDLG_H
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
class DlgRef_2Sel2Spin;
|
class DlgRef_2Sel2Spin;
|
||||||
class DlgRef_2Spin;
|
class DlgRef_2Spin;
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_CylinderDlg
|
// class : PrimitiveGUI_CylinderDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class PrimitiveGUI_CylinderDlg : public GEOMBase_Skeleton
|
class PrimitiveGUI_CylinderDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
PrimitiveGUI_CylinderDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~PrimitiveGUI_CylinderDlg();
|
||||||
~PrimitiveGUI_CylinderDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
double getRadius() const;
|
double getRadius() const;
|
||||||
double getHeight() const;
|
double getHeight() const;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myPoint, myDir;
|
private:
|
||||||
|
GEOM::GEOM_Object_var myPoint, myDir;
|
||||||
DlgRef_2Sel2Spin* GroupPoints;
|
|
||||||
DlgRef_2Spin* GroupDimensions;
|
DlgRef_2Sel2Spin* GroupPoints;
|
||||||
|
DlgRef_2Spin* GroupDimensions;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnCancel();
|
void ActivateThisDialog();
|
||||||
void ActivateThisDialog();
|
void DeactivateActiveDialog();
|
||||||
void DeactivateActiveDialog();
|
void LineEditReturnPressed();
|
||||||
void LineEditReturnPressed();
|
void SelectionIntoArgument();
|
||||||
void SelectionIntoArgument();
|
void SetEditCurrentArgument();
|
||||||
void SetEditCurrentArgument();
|
void ConstructorsClicked( int );
|
||||||
void ConstructorsClicked(int);
|
void ValueChangedInSpinBox();
|
||||||
void ValueChangedInSpinBox();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_CYLINDER_H
|
#endif // PRIMITIVEGUI_CYLINDERDLG_H
|
||||||
|
@ -1,47 +1,40 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_SphereDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_SphereDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "PrimitiveGUI_SphereDlg.h"
|
#include "PrimitiveGUI_SphereDlg.h"
|
||||||
#include "DlgRef_1Sel1Spin.h"
|
|
||||||
#include "DlgRef_1Spin.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_SphereDlg()
|
// class : PrimitiveGUI_SphereDlg()
|
||||||
@ -50,38 +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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
:GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_P")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPHERE_P" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_DXYZ")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPHERE_DXYZ" ) ) );
|
||||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_SPHERE_TITLE"));
|
setWindowTitle( tr( "GEOM_SPHERE_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_SPHERE"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_SPHERE" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setIcon(image1);
|
mainFrame()->RadioButton2->setIcon( image1 );
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_1Sel1Spin(this, "GroupPoints");
|
GroupPoints = new DlgRef_1Sel1Spin( centralWidget() );
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_SPHERE_CR"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_SPHERE_CR" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_CENTER"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_CENTER" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_RADIUS"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_RADIUS" ) );
|
||||||
GroupPoints->PushButton1->setIcon(image2);
|
GroupPoints->PushButton1->setIcon( image2 );
|
||||||
|
|
||||||
GroupDimensions = new DlgRef_1Spin(this, "GroupDimensions");
|
GroupDimensions = new DlgRef_1Spin( centralWidget() );
|
||||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_SPHERE_RO"));
|
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_SPHERE_RO" ) );
|
||||||
GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
|
GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
gridLayout1->addWidget(GroupDimensions, 2, 0);
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
|
layout->addWidget( GroupDimensions );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("sphere.htm");
|
setHelpFileName( "sphere.htm" );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@ -111,33 +106,37 @@ void PrimitiveGUI_SphereDlg::Init()
|
|||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes */
|
/* min, max, step and decimals for spin boxes */
|
||||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
|
||||||
GroupPoints->SpinBox_DX->SetValue(100.0);
|
GroupPoints->SpinBox_DX->setValue( 100.0 );
|
||||||
GroupDimensions->SpinBox_DX->SetValue(100.0);
|
GroupDimensions->SpinBox_DX->setValue( 100.0 );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
|
||||||
|
|
||||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
// VSR: TODO ->>
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect(myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
// <<-
|
||||||
|
|
||||||
initName(tr("GEOM_SPHERE").toLatin1().constData());
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
ConstructorsClicked(0);
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
|
initName( tr( "GEOM_SPHERE" ) );
|
||||||
|
|
||||||
|
ConstructorsClicked( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,36 +144,38 @@ void PrimitiveGUI_SphereDlg::Init()
|
|||||||
// function : ConstructorsClicked()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_SphereDlg::ConstructorsClicked(int constructorId)
|
void PrimitiveGUI_SphereDlg::ConstructorsClicked( int constructorId )
|
||||||
{
|
{
|
||||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
|
||||||
|
|
||||||
switch (constructorId)
|
switch ( constructorId ) {
|
||||||
|
case 0:
|
||||||
{
|
{
|
||||||
case 0:
|
globalSelection( GEOM_POINT );
|
||||||
{
|
GroupDimensions->hide();
|
||||||
globalSelection( GEOM_POINT );
|
GroupPoints->show();
|
||||||
GroupDimensions->hide();
|
|
||||||
resize(0, 0);
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
GroupPoints->show();
|
GroupPoints->LineEdit1->setText( "" );
|
||||||
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
|
||||||
GroupPoints->LineEdit1->setText("");
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
break;
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
GroupPoints->hide();
|
|
||||||
resize(0, 0);
|
|
||||||
GroupDimensions->show();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
GroupDimensions->show();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
updateGeometry();
|
||||||
|
resize( minimumSize() );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,17 +206,6 @@ bool PrimitiveGUI_SphereDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : ClickOnCancel()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void PrimitiveGUI_SphereDlg::ClickOnCancel()
|
|
||||||
{
|
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -225,19 +215,18 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
|
|||||||
if ( getConstructorId() != 0 )
|
if ( getConstructorId() != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if(IObjectCount() != 1)
|
if ( IObjectCount() != 1 ) {
|
||||||
{
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* nbSel == 1 ! */
|
/* nbSel == 1 ! */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if (!testResult || CORBA::is_nil( aSelectedObject ))
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myPoint = aSelectedObject;
|
myPoint = aSelectedObject;
|
||||||
@ -254,11 +243,10 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
|
|||||||
void PrimitiveGUI_SphereDlg::LineEditReturnPressed()
|
void PrimitiveGUI_SphereDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1)
|
if ( send == GroupPoints->LineEdit1 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -270,7 +258,7 @@ void PrimitiveGUI_SphereDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
GroupPoints->LineEdit1->setFocus();
|
GroupPoints->LineEdit1->setFocus();
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
@ -286,8 +274,8 @@ void PrimitiveGUI_SphereDlg::SetEditCurrentArgument()
|
|||||||
void PrimitiveGUI_SphereDlg::ActivateThisDialog()
|
void PrimitiveGUI_SphereDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
ConstructorsClicked( getConstructorId() );
|
ConstructorsClicked( getConstructorId() );
|
||||||
}
|
}
|
||||||
@ -307,9 +295,9 @@ void PrimitiveGUI_SphereDlg::DeactivateActiveDialog()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_SphereDlg::enterEvent(QEvent* e)
|
void PrimitiveGUI_SphereDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,14 +335,13 @@ bool PrimitiveGUI_SphereDlg::isValid( QString& msg )
|
|||||||
// function : execute
|
// function : execute
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
|
bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
|
||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
switch ( getConstructorId() )
|
switch ( getConstructorId() ) {
|
||||||
{
|
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
{
|
||||||
if ( !CORBA::is_nil( myPoint ) ) {
|
if ( !CORBA::is_nil( myPoint ) ) {
|
||||||
@ -396,9 +383,9 @@ void PrimitiveGUI_SphereDlg::closeEvent( QCloseEvent* e )
|
|||||||
double PrimitiveGUI_SphereDlg::getRadius() const
|
double PrimitiveGUI_SphereDlg::getRadius() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DX->GetValue();
|
return GroupPoints->SpinBox_DX->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DX->GetValue();
|
return GroupDimensions->SpinBox_DX->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,81 +1,77 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_SphereDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_SphereDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_SPHERE_H
|
#ifndef PRIMITIVEGUI_SPHEREDLG_H
|
||||||
#define DIALOGBOX_SPHERE_H
|
#define PRIMITIVEGUI_SPHEREDLG_H
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
class DlgRef_1Sel1Spin;
|
class DlgRef_1Sel1Spin;
|
||||||
class DlgRef_1Spin;
|
class DlgRef_1Spin;
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_SphereDlg
|
// class : PrimitiveGUI_SphereDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class PrimitiveGUI_SphereDlg : public GEOMBase_Skeleton
|
class PrimitiveGUI_SphereDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
PrimitiveGUI_SphereDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~PrimitiveGUI_SphereDlg();
|
||||||
~PrimitiveGUI_SphereDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
double getRadius() const;
|
double getRadius() const;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myPoint; /* Center point */
|
private:
|
||||||
|
GEOM::GEOM_Object_var myPoint; /* Center point */
|
||||||
DlgRef_1Sel1Spin* GroupPoints;
|
|
||||||
DlgRef_1Spin* GroupDimensions;
|
DlgRef_1Sel1Spin* GroupPoints;
|
||||||
|
DlgRef_1Spin* GroupDimensions;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnCancel();
|
void ActivateThisDialog();
|
||||||
void ActivateThisDialog();
|
void DeactivateActiveDialog();
|
||||||
void DeactivateActiveDialog();
|
void LineEditReturnPressed();
|
||||||
void LineEditReturnPressed();
|
void SelectionIntoArgument();
|
||||||
void SelectionIntoArgument();
|
void SetEditCurrentArgument();
|
||||||
void SetEditCurrentArgument();
|
void ConstructorsClicked( int );
|
||||||
void ConstructorsClicked(int);
|
void ValueChangedInSpinBox();
|
||||||
void ValueChangedInSpinBox();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_SPHERE_H
|
#endif // DIALOGBOX_SPHERE_H
|
||||||
|
@ -1,47 +1,40 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_TorusDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_TorusDlg.cxx
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
// $Header$
|
|
||||||
|
|
||||||
#include "PrimitiveGUI_TorusDlg.h"
|
#include "PrimitiveGUI_TorusDlg.h"
|
||||||
#include "DlgRef_2Sel2Spin.h"
|
|
||||||
#include "DlgRef_2Spin.h"
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include "GeometryGUI.h"
|
#include <GEOM_DlgRef.h>
|
||||||
#include "GEOMBase.h"
|
#include <GeometryGUI.h>
|
||||||
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "LightApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include "GEOMImpl_Types.hxx"
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_TorusDlg()
|
// class : PrimitiveGUI_TorusDlg()
|
||||||
@ -50,42 +43,44 @@ 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
const char* name, bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl )
|
||||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||||
{
|
{
|
||||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_PV")));
|
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_TORUS_PV" ) ) );
|
||||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ")));
|
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_TORUS_DXYZ" ) ) );
|
||||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
|
|
||||||
setWindowTitle(tr("GEOM_TORUS_TITLE"));
|
setWindowTitle( tr( "GEOM_TORUS_TITLE" ) );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors->setTitle(tr("GEOM_TORUS"));
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_TORUS" ) );
|
||||||
RadioButton1->setIcon(image0);
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
RadioButton2->setIcon(image1);
|
mainFrame()->RadioButton2->setIcon( image1 );
|
||||||
RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
||||||
RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
|
GroupPoints = new DlgRef_2Sel2Spin( centralWidget() );
|
||||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
|
GroupPoints->TextLabel1->setText( tr( "GEOM_BASE_POINT" ) );
|
||||||
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
GroupPoints->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
|
||||||
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1"));
|
GroupPoints->TextLabel3->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
|
||||||
GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2"));
|
GroupPoints->TextLabel4->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
|
||||||
GroupPoints->PushButton1->setIcon(image2);
|
GroupPoints->PushButton1->setIcon( image2 );
|
||||||
GroupPoints->PushButton2->setIcon(image2);
|
GroupPoints->PushButton2->setIcon( image2 );
|
||||||
|
|
||||||
GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions");
|
GroupDimensions = new DlgRef_2Spin( centralWidget() );
|
||||||
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
|
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
|
||||||
GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1"));
|
GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS_I" ).arg( 1 ) );
|
||||||
GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2"));
|
GroupDimensions->TextLabel2->setText( tr( "GEOM_RADIUS_I" ).arg( 2 ) );
|
||||||
|
|
||||||
gridLayout1->addWidget(GroupPoints, 2, 0);
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
gridLayout1->addWidget(GroupDimensions, 2, 0);
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
|
layout->addWidget( GroupPoints );
|
||||||
|
layout->addWidget( GroupDimensions );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("turus.htm");
|
setHelpFileName( "turus.htm" );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
@ -97,7 +92,7 @@ PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidge
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
PrimitiveGUI_TorusDlg::~PrimitiveGUI_TorusDlg()
|
PrimitiveGUI_TorusDlg::~PrimitiveGUI_TorusDlg()
|
||||||
{
|
{
|
||||||
// no need to delete child widgets, Qt does it all for us
|
// no need to delete child widgets, Qt does it all for us
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -116,45 +111,48 @@ void PrimitiveGUI_TorusDlg::Init()
|
|||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
|
||||||
GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupPoints->SpinBox_DY, 0.001, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, step, 3 );
|
||||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
|
initSpinBox( GroupDimensions->SpinBox_DY, 0.001, COORD_MAX, step, 3 );
|
||||||
|
|
||||||
GroupPoints->SpinBox_DX->SetValue(300.0);
|
GroupPoints->SpinBox_DX->setValue( 300.0 );
|
||||||
GroupPoints->SpinBox_DY->SetValue(100.0);
|
GroupPoints->SpinBox_DY->setValue( 100.0 );
|
||||||
GroupDimensions->SpinBox_DX->SetValue(300.0);
|
GroupDimensions->SpinBox_DX->setValue( 300.0 );
|
||||||
GroupDimensions->SpinBox_DY->SetValue(100.0);
|
GroupDimensions->SpinBox_DY->setValue( 100.0 );
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
|
|
||||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
|
||||||
|
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
|
connect( GroupPoints->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
|
connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
|
||||||
|
|
||||||
|
// VSR: TODO ->>
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DX, SLOT( SetStep( double ) ) );
|
||||||
|
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupDimensions->SpinBox_DY, SLOT( SetStep( double ) ) );
|
||||||
|
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName( tr( "GEOM_TORUS" ).toLatin1().constData() );
|
initName( tr( "GEOM_TORUS" ) );
|
||||||
ConstructorsClicked(0);
|
|
||||||
|
ConstructorsClicked( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -162,38 +160,40 @@ void PrimitiveGUI_TorusDlg::Init()
|
|||||||
// function : ConstructorsClicked()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
|
void PrimitiveGUI_TorusDlg::ConstructorsClicked( int constructorId )
|
||||||
{
|
{
|
||||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
|
||||||
|
|
||||||
switch(constructorId)
|
switch( constructorId ) {
|
||||||
{
|
case 0 :
|
||||||
case 0 :
|
{
|
||||||
{
|
globalSelection( GEOM_LINE );
|
||||||
globalSelection( GEOM_LINE );
|
|
||||||
|
GroupDimensions->hide();
|
||||||
GroupDimensions->hide();
|
GroupPoints->show();
|
||||||
resize(0, 0);
|
|
||||||
GroupPoints->show();
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
GroupPoints->LineEdit1->setText( "" );
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit2->setText( "" );
|
||||||
GroupPoints->LineEdit1->setText(tr(""));
|
myPoint = myDir = GEOM::GEOM_Object::_nil();
|
||||||
GroupPoints->LineEdit2->setText(tr(""));
|
|
||||||
myPoint = myDir = GEOM::GEOM_Object::_nil();
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
break;
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
case 1 :
|
|
||||||
{
|
|
||||||
GroupPoints->hide();
|
|
||||||
resize( 0, 0 );
|
|
||||||
GroupDimensions->show();
|
|
||||||
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
GroupDimensions->show();
|
||||||
|
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
updateGeometry();
|
||||||
|
resize( minimumSize() );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,16 +224,6 @@ bool PrimitiveGUI_TorusDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : ClickOnCancel()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void PrimitiveGUI_TorusDlg::ClickOnCancel()
|
|
||||||
{
|
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -243,28 +233,26 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
|
|||||||
if ( getConstructorId() != 0 )
|
if ( getConstructorId() != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if(IObjectCount() != 1)
|
|
||||||
{
|
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
|
||||||
myDir = GEOM::GEOM_Object::_nil();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if ( IObjectCount() != 1 ) {
|
||||||
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
|
myDir = GEOM::GEOM_Object::_nil();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
||||||
|
|
||||||
if(!testResult || CORBA::is_nil( aSelectedObject ))
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myPoint = aSelectedObject;
|
myPoint = aSelectedObject;
|
||||||
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myDir = aSelectedObject;
|
myDir = aSelectedObject;
|
||||||
|
|
||||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||||
@ -280,11 +268,11 @@ void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
|
|||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
if(send == GroupPoints->PushButton1) {
|
if ( send == GroupPoints->PushButton1 ) {
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
globalSelection( GEOM_POINT );
|
globalSelection( GEOM_POINT );
|
||||||
}
|
}
|
||||||
else if(send == GroupPoints->PushButton2) {
|
else if ( send == GroupPoints->PushButton2 ) {
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
globalSelection( GEOM_LINE );
|
globalSelection( GEOM_LINE );
|
||||||
}
|
}
|
||||||
@ -301,12 +289,11 @@ void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
|
|||||||
void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
|
void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
if(send == GroupPoints->LineEdit1 ||
|
if ( send == GroupPoints->LineEdit1 ||
|
||||||
send == GroupPoints->LineEdit2)
|
send == GroupPoints->LineEdit2 ) {
|
||||||
{
|
myEditCurrentArgument = send;
|
||||||
myEditCurrentArgument = send;
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -317,8 +304,8 @@ void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
|
|||||||
void PrimitiveGUI_TorusDlg::ActivateThisDialog()
|
void PrimitiveGUI_TorusDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
ConstructorsClicked( getConstructorId() );
|
ConstructorsClicked( getConstructorId() );
|
||||||
}
|
}
|
||||||
@ -328,9 +315,9 @@ void PrimitiveGUI_TorusDlg::ActivateThisDialog()
|
|||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_TorusDlg::enterEvent(QEvent* e)
|
void PrimitiveGUI_TorusDlg::enterEvent( QEvent* )
|
||||||
{
|
{
|
||||||
if ( !GroupConstructors->isEnabled() )
|
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,22 +372,17 @@ bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
switch ( getConstructorId() )
|
switch ( getConstructorId() ) {
|
||||||
{
|
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
|
||||||
if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )){
|
if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )){
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR( myPoint, myDir, getRadius1(), getRadius2() );
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case 1 :
|
case 1 :
|
||||||
{
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR( getRadius1(), getRadius2() );
|
||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR(getRadius1(), getRadius2());
|
res = true;
|
||||||
res = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
@ -427,10 +409,10 @@ void PrimitiveGUI_TorusDlg::closeEvent( QCloseEvent* e )
|
|||||||
double PrimitiveGUI_TorusDlg::getRadius1() const
|
double PrimitiveGUI_TorusDlg::getRadius1() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DX->GetValue();
|
return GroupPoints->SpinBox_DX->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DX->GetValue();
|
return GroupDimensions->SpinBox_DX->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,9 +424,9 @@ double PrimitiveGUI_TorusDlg::getRadius1() const
|
|||||||
double PrimitiveGUI_TorusDlg::getRadius2() const
|
double PrimitiveGUI_TorusDlg::getRadius2() const
|
||||||
{
|
{
|
||||||
int aConstructorId = getConstructorId();
|
int aConstructorId = getConstructorId();
|
||||||
if (aConstructorId == 0)
|
if ( aConstructorId == 0 )
|
||||||
return GroupPoints->SpinBox_DY->GetValue();
|
return GroupPoints->SpinBox_DY->value();
|
||||||
else if (aConstructorId == 1)
|
else if ( aConstructorId == 1 )
|
||||||
return GroupDimensions->SpinBox_DY->GetValue();
|
return GroupDimensions->SpinBox_DY->value();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,82 +1,77 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
//
|
//
|
||||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 2.1 of the License.
|
// version 2.1 of the License.
|
||||||
//
|
//
|
||||||
// This library is distributed in the hope that it will be useful,
|
// This library is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// Lesser General Public License for more details.
|
// Lesser General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
// File : PrimitiveGUI_TorusDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// File : PrimitiveGUI_TorusDlg.h
|
|
||||||
// Author : Lucien PIGNOLONI
|
|
||||||
// Module : GEOM
|
|
||||||
|
|
||||||
#ifndef DIALOGBOX_TORUS_H
|
#ifndef PRIMITIVEGUI_TORUSDLG_H
|
||||||
#define DIALOGBOX_TORUS_H
|
#define PRIMITIVEGUI_TORUSDLG_H
|
||||||
|
|
||||||
#include "GEOMBase_Skeleton.h"
|
#include <GEOMBase_Skeleton.h>
|
||||||
|
|
||||||
class DlgRef_2Sel2Spin;
|
class DlgRef_2Sel2Spin;
|
||||||
class DlgRef_2Spin;
|
class DlgRef_2Spin;
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_TorusDlg
|
// class : PrimitiveGUI_TorusDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class PrimitiveGUI_TorusDlg : public GEOMBase_Skeleton
|
class PrimitiveGUI_TorusDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
PrimitiveGUI_TorusDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||||
const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
|
~PrimitiveGUI_TorusDlg();
|
||||||
~PrimitiveGUI_TorusDlg();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// redefined from GEOMBase_Helper
|
// redefined from GEOMBase_Helper
|
||||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||||
virtual bool isValid( QString& );
|
virtual bool isValid( QString& );
|
||||||
virtual bool execute( ObjectList& objects );
|
virtual bool execute( ObjectList& );
|
||||||
|
|
||||||
virtual void closeEvent( QCloseEvent* e );
|
virtual void closeEvent( QCloseEvent* );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
void enterEvent(QEvent* e);
|
void enterEvent( QEvent* );
|
||||||
double getRadius1() const;
|
double getRadius1() const;
|
||||||
double getRadius2() const;
|
double getRadius2() const;
|
||||||
|
|
||||||
GEOM::GEOM_Object_var myPoint, myDir;
|
GEOM::GEOM_Object_var myPoint, myDir;
|
||||||
|
|
||||||
DlgRef_2Sel2Spin* GroupPoints;
|
DlgRef_2Sel2Spin* GroupPoints;
|
||||||
DlgRef_2Spin* GroupDimensions;
|
DlgRef_2Spin* GroupDimensions;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnCancel();
|
void ActivateThisDialog();
|
||||||
void ActivateThisDialog();
|
void DeactivateActiveDialog();
|
||||||
void DeactivateActiveDialog();
|
void LineEditReturnPressed();
|
||||||
void LineEditReturnPressed();
|
void SelectionIntoArgument();
|
||||||
void SelectionIntoArgument();
|
void SetEditCurrentArgument();
|
||||||
void SetEditCurrentArgument();
|
void ConstructorsClicked( int );
|
||||||
void ConstructorsClicked(int);
|
void ValueChangedInSpinBox();
|
||||||
void ValueChangedInSpinBox();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_TORUS_H
|
#endif // PRIMITIVEGUI_TORUSDLG_H
|
||||||
|
Loading…
Reference in New Issue
Block a user