From ddad9485528d6fda8a25a530410d96dd7bcc3ae9 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 25 Aug 2005 14:21:43 +0000 Subject: [PATCH] To introduce Gauss Points IDL interface --- src/VISUGUI/Makefile.in | 2 + src/VISUGUI/VISUM_msg_en.po | 6 ++ src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 102 +++++++++++++++++++++++++ src/VISUGUI/VisuGUI_GaussPointsDlg.h | 66 ++++++++++++++++ src/VISUGUI/VisuGUI_Module.cxx | 6 +- 5 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 src/VISUGUI/VisuGUI_GaussPointsDlg.cxx create mode 100644 src/VISUGUI/VisuGUI_GaussPointsDlg.h diff --git a/src/VISUGUI/Makefile.in b/src/VISUGUI/Makefile.in index 746ff260..49bb32e2 100644 --- a/src/VISUGUI/Makefile.in +++ b/src/VISUGUI/Makefile.in @@ -65,6 +65,7 @@ LIB_SRC = VisuGUI.cxx \ VisuGUI_Plot3DDlg.cxx \ VisuGUI_NonIsometricDlg.cxx \ VisuGUI_ScalarBarDlg.cxx \ + VisuGUI_GaussPointsDlg.cxx \ VisuGUI_DeformedShapeDlg.cxx \ VisuGUI_IsoSurfacesDlg.cxx \ VisuGUI_CutLinesDlg.cxx \ @@ -87,6 +88,7 @@ LIB_MOC = VisuGUI.h \ VisuGUI_Plot3DDlg.h \ VisuGUI_NonIsometricDlg.h \ VisuGUI_ScalarBarDlg.h \ + VisuGUI_GaussPointsDlg.h \ VisuGUI_DeformedShapeDlg.h \ VisuGUI_IsoSurfacesDlg.h \ VisuGUI_CutLinesDlg.h \ diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po index 13cc9994..0845b4f9 100644 --- a/src/VISUGUI/VISUM_msg_en.po +++ b/src/VISUGUI/VISUM_msg_en.po @@ -93,5 +93,11 @@ msgstr "Number of steps between two positions" msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS" msgstr "Gauss Points" +msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE" +msgstr "Gauss Points Preferences" + +msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE" +msgstr "Gauss Points Properties" + msgid "VVTK_ViewManager::VTK_VIEW_TITLE" msgstr "VISU scene:%1 - viewer:%2" diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx new file mode 100644 index 00000000..e912e220 --- /dev/null +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -0,0 +1,102 @@ +// VISU VISUGUI : GUI of VISU component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : VisuGUI_MagnitudeDlg.cxx +// Author : Laurent CORNABE & Hubert ROLLAND +// Module : VISU +// $Header$ + +#include "VisuGUI_GaussPointsDlg.h" + +#include "VisuGUI_Tools.h" + +#include "VISU_GaussPoints_i.hh" + +#include "SalomeApp_Module.h" +#include "SUIT_Desktop.h" + +#include "QtxDblSpinBox.h" + +#include +#include + +using namespace std; + +/*! + * Constructor + */ +VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool SetPref): + QDialog(VISU::GetDesktop(theModule), + "VisuGUI_GaussPointsDlg", true, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +{ + setName("VisuGUI_ScalarBarDlg"); + setCaption(SetPref ? tr("DLG_PREF_TITLE") : tr("DLG_PROP_TITLE")); + setSizeGripEnabled(TRUE); + + QVBoxLayout* TopLayout = new QVBoxLayout(this); + TopLayout->setSpacing(6); + TopLayout->setMargin(11); + + myScalarPane = new VisuGUI_ScalarBarPane(this, SetPref); + TopLayout->addWidget(myScalarPane); + + // Common buttons =========================================================== + QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); + GroupButtons->setColumnLayout(0, Qt::Vertical ); + GroupButtons->layout()->setSpacing( 0 ); + GroupButtons->layout()->setMargin( 0 ); + QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); + GroupButtonsLayout->setAlignment( Qt::AlignTop ); + GroupButtonsLayout->setSpacing( 6 ); + GroupButtonsLayout->setMargin( 11 ); + + QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" ); + buttonOk->setAutoDefault( TRUE ); + buttonOk->setDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); + GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); + + QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); + buttonCancel->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + + TopLayout->addWidget( GroupButtons ); + + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); +} + +void VisuGUI_GaussPointsDlg::initFromPrsObject (VISU::GaussPoints_i* thePrs) +{ + myScalarPane->initFromPrsObject(thePrs); +} + +int VisuGUI_GaussPointsDlg::storeToPrsObject(VISU::GaussPoints_i* thePrs) +{ + return myScalarPane->storeToPrsObject(thePrs); +} + +void VisuGUI_GaussPointsDlg::accept() { + if (myScalarPane->check()) QDialog::accept(); +} diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h new file mode 100644 index 00000000..782e1b74 --- /dev/null +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -0,0 +1,66 @@ +// VISU VISUGUI : GUI of VISU component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : VisuGUI_MagnitudeDlg.h +// Author : Laurent CORNABE & Hubert ROLLAND +// Module : VISU +// $Header$ + +#ifndef VISUGUI_GAUSSPOINTSDLS_H +#define VISUGUI_GAUSSPOINTSDLS_H + +#include "VisuGUI_ScalarBarDlg.h" + + +#include +#include +#include +#include +#include + +class SalomeApp_Module; + +namespace VISU +{ + class GaussPoints_i; +} + +class VisuGUI_GaussPointsDlg : public QDialog +{ + Q_OBJECT + +public: + VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule, bool SetPref = FALSE); + ~VisuGUI_GaussPointsDlg() {}; + + void initFromPrsObject(VISU::GaussPoints_i* thePrs); + int storeToPrsObject(VISU::GaussPoints_i* thePrs); + +protected slots: + void accept(); + + private: + VisuGUI_ScalarBarPane* myScalarPane; +}; + +#endif // VISUGUI_GAUSSPOINTSDLS_H diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index de35766a..526157b6 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -52,7 +52,7 @@ #include "VisuGUI_Prs3dTools.h" #include "VISU_GaussPoints_i.hh" -#include "VisuGUI_ScalarBarDlg.h" +#include "VisuGUI_GaussPointsDlg.h" #include "VISU_Gen_i.hh" #include "VISU_Result_i.hh" @@ -354,7 +354,7 @@ void VisuGUI_Module ::OnCreateGaussPoints() { - CreatePrs3d(this); + CreatePrs3d(this); } void @@ -450,7 +450,7 @@ OnEditGaussPoints() { Handle(SALOME_InteractiveObject) anIO; if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); + EditPrs3d(this, aPrs3d); if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){ aViewWindow->highlight(anIO, 1); } -- 2.39.2