Salome HOME
IPAL20954 problem loading help pages
[modules/visu.git] / src / VISUGUI / VisuGUI_DeformedShapeAndScalarMapDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU VISUGUI : GUI of VISU component
23 //  File   : VisuGUI_DeformedShapeAndScalarMapDlg.h
24 //  Author : Eugeny Nikolaev
25 //  Module : VISU
26 //
27 #ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
28 #define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
29
30 #include "VisuGUI_Prs3dDlg.h"
31
32 #include "VISUConfig.hh"
33
34 #include <QDialog>
35
36 #include <set>
37 #include <vector>
38
39 class SalomeApp_Module;
40 class VisuGUI_InputPane;
41 class QtxDoubleSpinBox;
42 class QComboBox;
43 class QTabWidget;
44
45 namespace VISU
46 {
47   class DeformedShapeAndScalarMap_i;
48 }
49
50 class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
51 {
52     Q_OBJECT
53
54 public:
55     VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
56     ~VisuGUI_DeformedShapeAndScalarMapDlg();
57
58     double getFactor() const;
59     void setFactor(double theFactor);
60     
61     virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
62                                     bool theInit );
63
64     virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
65
66     int getCurrentScalarFieldNamePos();
67     QString getCurrentScalarFieldName();
68     int getCurrentScalarNbIterations();
69     VISU::Entity getCurrentScalarEntity();
70     void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
71
72 protected:
73   virtual QString GetContextHelpFilePath();
74
75 protected slots:
76   void accept();
77   void reject();
78
79 private slots:
80   void onFieldChanged(int i=0);
81   void onTimeStampChanged(int i=0);
82
83 private:
84  QtxDoubleSpinBox* ScalFact;
85  QTabWidget* myTabBox;
86  VisuGUI_ScalarBarPane* myScalarPane;
87  VisuGUI_InputPane*     myInputPane;
88  QComboBox *myFieldsCombo;
89  QComboBox *myTimeStampsCombo;
90  
91  typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
92  typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
93  typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
94  
95  TEntity2Fields myEntity2Fields;
96  int myCurrScalarIter;
97  bool myIsAnimation;
98  bool myUpdateScalars;
99  std::vector<int> myTimeStampID;
100  
101  _PTR(SObject) mySelectionObj;
102  SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
103  SalomeApp_Module* myVisuGUI;
104  
105 protected:
106  void UpdateScalarField();
107  void SetScalarField( const bool = true );
108  void AddAllFieldNames();
109  void AddAllTimes(const QString& theFieldName);
110  QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
111                                   const std::string& theFieldName,
112                                   int theTimeStampNumber);
113 };
114
115 #endif // VISUGUI_DEFORMEDSHAPEDLS_H