VisuGUI_InputPane.cxx \
VisuGUI_FieldFilter.cxx \
VisuGUI_ClippingPanel.cxx \
- VisuGUI_ClippingPlaneDlg.cxx
+ VisuGUI_ClippingPlaneDlg.cxx \
+ VisuGUI_FilterScalarsDlg.cxx
MOC_FILES= \
VisuGUI_moc.cxx \
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)
<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>
<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>
#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"
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
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 );
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 );
QApplication::restoreOverrideCursor();
}
+void VisuGUI::OnFilterScalars()
+{
+ VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg(this);
+ aDlg->show();
+}
void OnManageCache();
+ void OnFilterScalars();
+
// MULTIPR
void OnMultiprViewFullRes();
void OnMultiprViewMediumRes();
#define VISU_SLIDER_PANEL 4200
#define VISU_SWEEP_PANEL 4300
-#define VISU_GLOBALCLIPPING 4301
+#define VISU_FILTERSCALARS 4301
#endif
--- /dev/null
+// 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"));
+ }
+}
--- /dev/null
+// 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