#include "GEOMBase.h"
-#include "GEOMBase_aParameterDlg.h"
-
#include <GeometryGUI.h>
#include <GEOM_Client.hxx>
}
-//=======================================================================
-// function : Parameter()
-// purpose : return a parameter (float) from a dialog box
-//
-// avalue1 : is a float or integer used as a default value displayed
-// aTitle1 : is the title for aValue1
-// aTitle : is the main title
-// bottom : maximum value to be entered
-// top : minimum value to be entered
-// decimals : number of decimals
-//=======================================================================
-double GEOMBase::Parameter(Standard_Boolean& res, const char* aValue1, const char* aTitle1, const char* aTitle, const double bottom, const double top, const int decimals)
-{
- GEOMBase_aParameterDlg * Dialog = new GEOMBase_aParameterDlg(aValue1, aTitle1, SUIT_Session::session()->activeApplication()->desktop(),
- aTitle, TRUE, 0, bottom, top, decimals);
- int r = Dialog->exec();
- float X = 0.0;
- if(r == QDialog::Accepted) {
- res = Standard_True;
- X = Dialog->getValue();
- }
- else
- res = Standard_False;
- delete Dialog;
- return X;
-}
-
-
//=======================================================================
// function : SelectionByNameInDialogs()
// purpose : Called when user has entered a name of object in a LineEdit.
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMBase.h
-// Author : Damien COQUERET
+// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#ifndef GEOMBASE_H
static bool LinearEdgeExtremities(const TopoDS_Shape& S, gp_Pnt& P1, gp_Pnt& P2);
static void GetBipointDxDyDz(gp_Pnt P1, gp_Pnt P2, double& dx, double& dy, double& dz);
- /* User dialog 1 parameter returned */
- static double Parameter(Standard_Boolean& res,
- const char* aValue1 = 0, const char* aTitle1 = 0,
- const char* aTitle = 0, const double bottom = -1E6,
- const double top = +1E6, const int decimals = 6);
-
/* Simulation management */
static bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone);
+++ /dev/null
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : GEOMBase_aParameterDlg.cxx
-// Author : Lucien PIGNOLONI
-//
-
-#include "GEOMBase_aParameterDlg.h"
-#include <QtxDoubleSpinBox.h>
-
-#include <QGroupBox>
-#include <QLabel>
-#include <QPushButton>
-#include <QGridLayout>
-
-#ifndef WNT
-using namespace std;
-#endif
-
-
-//======================================================================================
-// function : GEOMBase_aParameterDlg()
-// purpose : Constructs a GEOMBase_aParametertDlg which is a child of 'parent', with the
-// name 'name' and widget flags set to 'f'
-//
-// avalue1 : is a float or integer used as default value in edit line
-// aTitle1 : is the prompt for aValue1
-// aTitle : is the title for the user in dialog box
-//
-// bottom : the minimal value to be entered
-// top : the maximum value to be entered
-// decimals : number of decimals to be entered
-//
-// The dialog will by default be modeless, unless you set 'modal' to
-// TRUE to construct a modal dialog.
-//
-//======================================================================================
-GEOMBase_aParameterDlg::GEOMBase_aParameterDlg(const char *aValue1, const char *aTitle1, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl, const double bottom, const double top, const int decimals)
- :QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
-{
- if(!name)
- setObjectName( "MyParameterDialog" );
- else
- setObjectName( name );
-
- setModal( modal );
-
- resize(288, 81);
- setWindowTitle(name); /* appears on the title bar */
- setSizeGripEnabled(TRUE);
-
- QGridLayout* topLayout = new QGridLayout(this);
- topLayout->setSpacing(6);
- topLayout->setMargin(11);
-
- QGroupBox* mainGrp = new QGroupBox(this);
- mainGrp->setObjectName("mainGrp");
- QGridLayout* mainGrpLayout = new QGridLayout(mainGrp);
- mainGrpLayout->setAlignment(Qt::AlignTop);
- mainGrpLayout->setSpacing(6);
- mainGrpLayout->setMargin(11);
- topLayout->addWidget(mainGrp, 0, 0);
-
- /* aTitle1 : text prompt on left of edit line */
- QLabel* TextLabel1 = new QLabel(mainGrp);
- TextLabel1->setObjectName("TextLabel1");
- TextLabel1->setText(tr(aTitle1));
- mainGrpLayout->addWidget(TextLabel1, 0, 0);
-
- mySpinBox = new QtxDoubleSpinBox(mainGrp);
- mySpinBox->setObjectName("mySpinBox");
- mySpinBox->setDecimals(decimals);
- mySpinBox->setRange(bottom, top);
- mySpinBox->setValue(QString(aValue1).toDouble());
- mainGrpLayout->addWidget(mySpinBox, 0, 1);
-
- QGroupBox* btnGrp = new QGroupBox(this);
- btnGrp->setObjectName("btnGrp");
- QGridLayout* btnGrpLayout = new QGridLayout(btnGrp);
- btnGrpLayout->setAlignment(Qt::AlignTop);
- btnGrpLayout->setSpacing(6);
- btnGrpLayout->setMargin(11);
- topLayout->addWidget(btnGrp, 1, 0);
-
- /* Ok button */
- myButtonOk = new QPushButton(btnGrp);
- myButtonOk->setObjectName("buttonOk");
- myButtonOk->setText(tr("GEOM_BUT_OK"));
- myButtonOk->setAutoDefault(TRUE);
- myButtonOk->setDefault(TRUE);
- btnGrpLayout->addWidget(myButtonOk, 0, 0);
-
- btnGrpLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
-
- /* Cancel button */
- myButtonCancel = new QPushButton(btnGrp);
- myButtonCancel->setObjectName("buttonCancel");
- myButtonCancel->setText(tr("GEOM_BUT_CANCEL"));
- myButtonCancel->setAutoDefault(TRUE);
- btnGrpLayout->addWidget(myButtonCancel, 0, 2);
-
- /* signals and slots connections */
- connect(myButtonOk, SIGNAL(clicked()), this, SLOT(accept()));
- connect(myButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
-
- /* Move widget on the botton right corner of main widget */
- //mzn: QAD_Tools::centerWidget(this, parent);
-}
-
-
-//======================================================================================
-// function : ~GEOMBase_aParameterDlg() destructor
-// purpose : Destroys the object and frees any allocated resources
-//======================================================================================
-GEOMBase_aParameterDlg::~GEOMBase_aParameterDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-
-//======================================================================================
-// function : GEOMBase_aParameterDlg::setValue
-// purpose : sets value
-//======================================================================================
-void GEOMBase_aParameterDlg::setValue(double val)
-{
- mySpinBox->setValue(val);
-}
-
-
-//======================================================================================
-// function : GEOMBase_aParameterDlg::getValue
-// purpose : gets value
-//======================================================================================
-double GEOMBase_aParameterDlg::getValue()
-{
- return mySpinBox->value();
-}
+++ /dev/null
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : GEOMBase_aParameterDlg.h
-// Author : Lucien PIGNOLONI
-//
-
-#ifndef GEOMBASE_APARAMETERDLG_H
-#define GEOMBASE_APARAMETERDLG_H
-
-#include "GEOM_GEOMBase.hxx"
-
-#include <QDialog>
-
-class QPushButton;
-class QtxDoubleSpinBox;
-
-//=================================================================================
-// class : GEOMBase_aParameterDlg
-// purpose :
-//=================================================================================
-class GEOMBASE_EXPORT GEOMBase_aParameterDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- GEOMBase_aParameterDlg(const char* aValue1 = "25", const char* aTitle1 = "Value :", QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0, const double bottom = -1E6, const double top = +1E6, const int decimals = 6);
- ~GEOMBase_aParameterDlg();
-
- void setValue(double val);
- double getValue();
-
-private:
- QPushButton* myButtonOk;
- QPushButton* myButtonCancel;
- QtxDoubleSpinBox* mySpinBox;
-
-};
-
-#endif // GEOMBASE_APARAMETERDLG_H
try {
myIOperation->StartOperation();
}
- catch( const SALOME::SALOME_Exception& e ) {
+ catch ( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools:: QtCatchCorbaException( e );
}
}
try {
myIOperation->FinishOperation();
}
- catch( const SALOME::SALOME_Exception& e ) {
+ catch ( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools:: QtCatchCorbaException( e );
}
}
try {
myIOperation->AbortOperation();
}
- catch( const SALOME::SALOME_Exception& e ) {
+ catch ( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools::QtCatchCorbaException( e );
}
}
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(GEOM_Gen)
-
class GEOMBASE_EXPORT GEOM_Operation : public SUIT_Operation
{
public:
protected:
// Reimplemented from SUIT_Operation
- virtual void startOperation();
- virtual void commitOperation();
- virtual void suspendOperation();
- virtual void resumeOperation();
- virtual void abortOperation();
+ virtual void startOperation();
+ virtual void commitOperation();
+ virtual void suspendOperation();
+ virtual void resumeOperation();
+ virtual void abortOperation();
private:
GEOM::GEOM_IOperations_var myIOperation;
dist_libGEOMBase_la_SOURCES = \
GEOMBase.cxx \
GEOMBase_Skeleton.cxx \
- GEOMBase_aParameterDlg.cxx \
GEOMBase_Helper.cxx \
GEOM_Operation.cxx
MOC_FILES = \
- GEOMBase_Skeleton_moc.cxx \
- GEOMBase_aParameterDlg_moc.cxx
+ GEOMBase_Skeleton_moc.cxx
nodist_libGEOMBase_la_SOURCES = \
$(MOC_FILES)
id == 33 || // MENU EDIT - DELETE
id == 411 || // MENU SETTINGS - ADD IN STUDY
id == 412 || // MENU SETTINGS - SHADING COLOR
- id == 413 || // MENU SETTINGS - ISOS
- id == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
id == 5103 || // MENU TOOLS - CHECK GEOMETRY
id == 8032 || // POPUP VIEWER - COLOR
id == 8033 || // POPUP VIEWER - TRANSPARENCY
createGeomAction( 5103, "CHECK_GEOMETRY" );
createGeomAction( 412, "SHADING_COLOR" );
- createGeomAction( 413, "ISOS" );
- createGeomAction( 414, "STEP_VALUE" );
createGeomAction( 211, "SHADING" );
createGeomAction( 212, "DISPLAY_ALL" );
//createMenu( separator(), prefId, -1 );
//int geomId = createMenu( tr( "MEN_PREFERENCES_GEOM" ), prefId, -1 );
//createMenu( 412, geomId, -1 );
- //createMenu( 413, geomId, -1 );
- //createMenu( 414, geomId, -1 );
//createMenu( separator(), prefId, -1 );
int viewId = createMenu( tr( "MEN_VIEW" ), -1, -1 );
action( 607 )->setEnabled( ViewOCC ); // RemoveInternalWires
action( 608 )->setEnabled( ViewOCC ); // AddPointOnEdge
// action( 609 )->setEnabled( ViewOCC ); // Free boundaries
- action( 413 )->setEnabled( ViewOCC ); // Isos Settings
action( 800 )->setEnabled( ViewOCC ); // Create Group
action( 801 )->setEnabled( ViewOCC ); // Edit Group
OnSettingsColor();
break;
}
- case 413: // SETTINGS - ISOS
- {
- OnSettingsIsos();
- break;
- }
- case 414: // SETTINGS : STEP VALUE FOR SPIN BOXES
- {
- OnSettingsStep();
- break;
- }
case 804: // ADD IN STUDY - POPUP VIEWER
{
// SAN -- TO BE REMOVED !!!!
void OnEditDelete();
void OnSettingsColor();
- void OnSettingsIsos();
- void OnSettingsStep();
void OnRename();
void OnCheckGeometry();
}
}
-void GEOMToolsGUI::OnSettingsIsos()
-{
-/*
- SUIT_Session* sess = SUIT_Session::session();
- SUIT_ResourceMgr* resMgr = sess->resourceMgr();
- SUIT_Desktop* desk = sess->activeApplication()->desktop();
-
- SUIT_ViewManager* vman = desk->activeWindow()->getViewManager();
- QString type = vman->getType();
-
- if ( type != OCCViewer_Viewer::Type() )
- return;
-
- OCCViewer_Viewer* vm = (OCCViewer_Viewer*)vman->getViewModel();
- Handle (AIS_InteractiveContext) ic = vm->getAISContext();
-
- int IsoU = resMgr->integerValue( "Geometry:SettingsIsoU", 1 );
- int IsoV = resMgr->integerValue( "Geometry:SettingsIsoV", 1 );
-
- ic->DefaultDrawer()->UIsoAspect()->SetNumber( IsoU );
- ic->DefaultDrawer()->VIsoAspect()->SetNumber( IsoV );
-
- GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(desk, tr("GEOM_MEN_ISOS"), TRUE);
-
- NbIsosDlg->SpinBoxU->setValue(IsoU);
- NbIsosDlg->SpinBoxV->setValue(IsoV);
-
- if(NbIsosDlg->exec()) {
- IsoU = NbIsosDlg->SpinBoxU->text().toInt();
- IsoV = NbIsosDlg->SpinBoxV->text().toInt();
-
- ic->DefaultDrawer()->UIsoAspect()->SetNumber(UIso);
- ic->DefaultDrawer()->VIsoAspect()->SetNumber(VIso);
- resMgr->setValue("Geometry:SettingsIsoU", isoU);
- resMgr->setValue("Geometry:SettingsIsoV", isoV);
- }
-*/
-}
-
-void GEOMToolsGUI::OnSettingsStep()
-{
- SUIT_Session* sess = SUIT_Session::session();
- SUIT_ResourceMgr* resMgr = sess->resourceMgr();
-
- double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100. );
-
- Standard_Boolean res = false;
- double dd = GEOMBase::Parameter( res, QString("%1").arg(step).toLatin1().constData(),
- tr("GEOM_MEN_STEP_LABEL").toLatin1().constData(),
- tr("GEOM_STEP_TITLE").toLatin1().constData(), 0.001, 10000.0, 3);
- if(res) {
- resMgr->setValue( "Geometry", "SettingsGeomStep", dd );
-
- /* Emit signal to GeometryGUI_SpinBoxes */
- getGeometryGUI()->EmitSignalDefaultStepValueChanged( dd );
- }
- else
- sess->activeApplication()->putInfo(tr("GEOM_PRP_ABORT"));
-}
-
void GEOMToolsGUI::OnRename()
{
SALOME_ListIO selected;