]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
*** empty log message ***
authorvsv <vsv@opencascade.com>
Fri, 29 Aug 2008 08:52:02 +0000 (08:52 +0000)
committervsv <vsv@opencascade.com>
Fri, 29 Aug 2008 08:52:02 +0000 (08:52 +0000)
src/VISUGUI/Makefile.am
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx [new file with mode: 0644]
src/VISUGUI/VisuGUI_FilterScalarsDlg.h [new file with mode: 0644]

index 9c20dd4d60617d7f5c7ea84bf7c903b681116c64..0954550d0e8b26959c8635549b92b727a3872f13 100644 (file)
@@ -80,7 +80,8 @@ dist_libVISU_la_SOURCES= \
        VisuGUI_InputPane.cxx \
        VisuGUI_FieldFilter.cxx \
        VisuGUI_ClippingPanel.cxx \
-       VisuGUI_ClippingPlaneDlg.cxx
+       VisuGUI_ClippingPlaneDlg.cxx \
+       VisuGUI_FilterScalarsDlg.cxx
 
 MOC_FILES= \
        VisuGUI_moc.cxx \
@@ -119,7 +120,8 @@ MOC_FILES= \
        VisuGUI_Sweep_moc.cxx \
        VisuGUI_InputPane_moc.cxx \
        VisuGUI_ClippingPanel_moc.cxx \
-       VisuGUI_ClippingPlaneDlg_moc.cxx
+       VisuGUI_ClippingPlaneDlg_moc.cxx \
+       VisuGUI_FilterScalarsDlg_moc.cxx
 
 
 nodist_libVISU_la_SOURCES=$(MOC_FILES)
index a3afb3ec9fea417411ddb21c165af327ddeab45d..e43466e1c0f1e4fee0553e5934b712326a332dbd 100644 (file)
@@ -1230,6 +1230,10 @@ Please, refer to the documentation.</translation>
             <source>MEN_WIREFRAME</source>
             <translation>Wireframe</translation>
         </message>
+        <message>
+            <source>MEN_FILTER_SCALARS</source>
+            <translation>Filter by scalars...</translation>
+        </message>
         <message><source>TOOL_IMPORT</source><translation>Import</translation></message>
         <message><source>TOOL_REPRESENTATION</source><translation>Representation</translation></message>
         <message><source>TOOL_SELECTION</source><translation>Selection</translation></message>
@@ -3658,4 +3662,23 @@ Please, refer to the documentation.</translation>
             <translation>Rotation around %1</translation>
         </message>
     </context>
+    <context>
+        <name>VisuGUI_FilterScalarsDlg</name>
+        <message>
+            <source>TITLE</source>
+            <translation>Filtering by scalars</translation>
+        </message>
+        <message>
+            <source>BOXTITLE</source>
+            <translation>Filter by scalar range</translation>
+        </message>
+        <message>
+            <source>MINLBL</source>
+            <translation>Min:</translation>
+        </message>
+        <message>
+            <source>MAXLBL</source>
+            <translation>Max:</translation>
+        </message>
+    </context>
 </TS>
index 51317a5919b5274739baf7e0cdffde9b2ed8601a..c6ec2d9dd6dbdb62c1fb22a078c9a2f5c408f58f 100644 (file)
 #include "VisuGUI_BuildProgressDlg.h"
 #include "VisuGUI_TransparencyDlg.h"
 #include "VisuGUI_ClippingPanel.h"
+#include "VisuGUI_FilterScalarsDlg.h"
 
 #include "VISU_ScalarMap_i.hh"
 #include "VisuGUI_ScalarBarDlg.h"
@@ -2404,6 +2405,10 @@ VisuGUI
   createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIcon(aPixmap),
                 tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
                 this, SLOT(OnMultiprViewHide()));
+
+  createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
+                tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
+                this, SLOT(OnFilterScalars()));
 }
 
 void
@@ -2519,6 +2524,8 @@ VisuGUI
   mgr->insert( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
 
+  mgr->insert( action( VISU_FILTERSCALARS ), -1, -1, -1 );
+
   // rename
   mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
 
@@ -2647,6 +2654,9 @@ VisuGUI
   mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule );
   mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule );
 
+  aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
+  mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
+
   // view parameters
   aRule = "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'";
   mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule );
@@ -3799,3 +3809,8 @@ void VisuGUI::OnMultiprChangeRes(VISU::Result::Resolution theResolution)
   QApplication::restoreOverrideCursor();
 }
 
+void VisuGUI::OnFilterScalars()
+{
+  VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg(this);
+  aDlg->show();
+}
index df9aec95350ce004766c3077632e28a2fd61793a..8aa5c5d5efe4763f9c01d25931d63312ca58b16d 100644 (file)
@@ -183,6 +183,8 @@ protected slots:
 
   void OnManageCache();
 
+  void OnFilterScalars();
+
   // MULTIPR
   void OnMultiprViewFullRes();
   void OnMultiprViewMediumRes();
index 8c310db81f2d864ff3a32485dd596a091139671f..d7d22f85fb4272dc6438747a22cb0dab7722a3e1 100644 (file)
 
 #define VISU_SLIDER_PANEL           4200
 #define VISU_SWEEP_PANEL            4300
-#define VISU_GLOBALCLIPPING         4301
+#define VISU_FILTERSCALARS          4301
 
 #endif
diff --git a/src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx b/src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx
new file mode 100644 (file)
index 0000000..8482b7b
--- /dev/null
@@ -0,0 +1,122 @@
+// Copyright (C) 2005  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
+//
+
+#include "VisuGUI_FilterScalarsDlg.h"
+
+#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
+
+#include <LightApp_Application.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <QPushButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QDoubleValidator>
+  
+
+VisuGUI_FilterScalarsDlg::VisuGUI_FilterScalarsDlg(VisuGUI* theModule)
+  : QDialog(VISU::GetDesktop(theModule), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+    myVisuGUI(theModule)
+{
+  setModal( false );
+  setWindowTitle(tr("TITLE"));
+  setSizeGripEnabled(true);
+  setAttribute( Qt::WA_DeleteOnClose, true );
+  
+  QVBoxLayout* aMainLayout = new QVBoxLayout(this);
+  
+  QGroupBox* aRangeBox = new QGroupBox(this);
+  aRangeBox->setTitle(tr("BOXTITLE"));
+  aRangeBox->setCheckable(true);
+  aMainLayout->addWidget(aRangeBox);
+
+  QHBoxLayout* aBoxLayout = new QHBoxLayout(aRangeBox);
+  aBoxLayout->addWidget(new QLabel(tr("MINLBL"), aRangeBox));
+  myMinEdit = new QLineEdit( aRangeBox );
+  myMinEdit->setValidator( new QDoubleValidator(myMinEdit) );
+  aBoxLayout->addWidget(myMinEdit);
+
+  aBoxLayout->addWidget(new QLabel(tr("MAXLBL"), aRangeBox));
+  myMaxEdit = new QLineEdit( aRangeBox );
+  myMaxEdit->setValidator( new QDoubleValidator(myMaxEdit) );
+  aBoxLayout->addWidget(myMaxEdit);
+
+  QGroupBox* aGroupButtons = new QGroupBox(this);
+  QHBoxLayout* aButtonsLayout = new QHBoxLayout(aGroupButtons);
+
+  QPushButton* aBtnOk = new QPushButton(tr("BUT_OK"), aGroupButtons);
+  aBtnOk->setAutoDefault(true);
+  aBtnOk->setDefault(true);
+  aButtonsLayout->addWidget(aBtnOk);
+
+  QPushButton* aBtnCancel = new QPushButton(tr("BUT_CANCEL"), aGroupButtons);
+  aBtnCancel->setAutoDefault(true);
+  aButtonsLayout->addWidget(aBtnCancel);
+
+  aButtonsLayout->addStretch();
+
+  QPushButton* aBtnHelp = new QPushButton(tr("BUT_HELP"), aGroupButtons);
+  aBtnHelp->setAutoDefault(true);
+  aButtonsLayout->addWidget(aBtnHelp);
+
+  aMainLayout->addWidget(aGroupButtons);
+
+  connect(aBtnOk,     SIGNAL(clicked()), this, SLOT(accept()));
+  connect(aBtnCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(aBtnHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
+}
+
+
+void VisuGUI_FilterScalarsDlg::accept()
+{
+  QDialog::accept();
+}
+
+void VisuGUI_FilterScalarsDlg::reject()
+{
+  QDialog::reject();
+}
+  
+void VisuGUI_FilterScalarsDlg::onHelp()
+{
+  QString aHelpFileName = "filterbyscalars_page.html";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  else {
+    QString platform;
+#ifdef WIN32
+    platform = "winapplication";
+#else
+    platform = "application";
+#endif
+    SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+                             tr("BUT_OK"));
+  }
+}
diff --git a/src/VISUGUI/VisuGUI_FilterScalarsDlg.h b/src/VISUGUI/VisuGUI_FilterScalarsDlg.h
new file mode 100644 (file)
index 0000000..fa9e2e0
--- /dev/null
@@ -0,0 +1,63 @@
+//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   : VisuGUI_FilterScalarsDlg.h
+//  Author : vsv
+//  Module : VISU
+
+
+#ifndef VISUGUI_FILTERSCALARSDLG_H
+#define VISUGUI_FILTERSCALARSDLG_H
+
+#include <QDialog>
+
+class QLineEdit;
+class VisuGUI;
+
+
+class VisuGUI_FilterScalarsDlg: public QDialog
+{
+  Q_OBJECT;
+
+ public:
+  VisuGUI_FilterScalarsDlg(VisuGUI* theModule);
+  ~VisuGUI_FilterScalarsDlg() {};
+
+protected slots:
+
+  virtual void accept();
+  virtual void reject(); 
+
+private slots:
+
+  void onHelp();
+
+private:
+  VisuGUI* myVisuGUI;
+
+  QLineEdit* myMinEdit;
+  QLineEdit* myMaxEdit;
+};
+
+
+#endif