1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // VISU VISUGUI : GUI of VISU component
21 // File : VisuGUI_DeformedShapeAndScalarMapDlg.h
22 // Author : Eugeny Nikolaev
25 #ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
26 #define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
28 #include "VisuGUI_Prs3dDlg.h"
30 #include "VISUConfig.hh"
37 class SalomeApp_Module;
38 class VisuGUI_InputPane;
39 class SalomeApp_DoubleSpinBox;
45 class DeformedShapeAndScalarMap_i;
48 class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
53 VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
54 ~VisuGUI_DeformedShapeAndScalarMapDlg();
56 double getFactor() const;
57 void setFactor(double theFactor);
59 virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
62 virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
64 int getCurrentScalarFieldNamePos();
65 QString getCurrentScalarFieldName();
66 int getCurrentScalarNbIterations();
67 VISU::Entity getCurrentScalarEntity();
68 void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
70 bool IsScalarFieldValid() const { return myIsScalarFieldValid; }
73 virtual QString GetContextHelpFilePath();
80 void onFieldChanged(int i=0);
81 void onTimeStampChanged(int i=0);
84 SalomeApp_DoubleSpinBox* ScalFact;
86 VisuGUI_ScalarBarPane* myScalarPane;
87 VisuGUI_InputPane* myInputPane;
88 QComboBox *myFieldsCombo;
89 QComboBox *myTimeStampsCombo;
90 QPushButton* myButtonOk;
92 typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
93 typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
94 typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
96 TEntity2Fields myEntity2Fields;
100 std::vector<int> myTimeStampID;
102 _PTR(SObject) mySelectionObj;
103 SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
104 SalomeApp_Module* myVisuGUI;
106 bool myIsScalarFieldValid;
109 void UpdateScalarField();
110 void SetScalarField( const bool = true );
111 void AddAllFieldNames();
112 void AddAllTimes(const QString& theFieldName);
113 QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
114 const std::string& theFieldName,
115 int theTimeStampNumber);
116 void updateControls();
119 #endif // VISUGUI_DEFORMEDSHAPEDLS_H