1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU VISUGUI : GUI of VISU component
23 // File : VisuGUI_DeformedShapeAndScalarMapDlg.h
24 // Author : Eugeny Nikolaev
27 #ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
28 #define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
30 #include "VisuGUI_Prs3dDlg.h"
32 #include "VISUConfig.hh"
39 class SalomeApp_Module;
40 class VisuGUI_InputPane;
41 class QtxDoubleSpinBox;
47 class DeformedShapeAndScalarMap_i;
50 class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
55 VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
56 ~VisuGUI_DeformedShapeAndScalarMapDlg();
58 double getFactor() const;
59 void setFactor(double theFactor);
61 virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
64 virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
66 int getCurrentScalarFieldNamePos();
67 QString getCurrentScalarFieldName();
68 int getCurrentScalarNbIterations();
69 VISU::Entity getCurrentScalarEntity();
70 void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
72 bool IsScalarFieldValid() const { return myIsScalarFieldValid; }
75 virtual QString GetContextHelpFilePath();
82 void onFieldChanged(int i=0);
83 void onTimeStampChanged(int i=0);
86 QtxDoubleSpinBox* ScalFact;
88 VisuGUI_ScalarBarPane* myScalarPane;
89 VisuGUI_InputPane* myInputPane;
90 QComboBox *myFieldsCombo;
91 QComboBox *myTimeStampsCombo;
92 QPushButton* myButtonOk;
94 typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
95 typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
96 typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
98 TEntity2Fields myEntity2Fields;
101 bool myUpdateScalars;
102 std::vector<int> myTimeStampID;
104 _PTR(SObject) mySelectionObj;
105 SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
106 SalomeApp_Module* myVisuGUI;
108 bool myIsScalarFieldValid;
111 void UpdateScalarField();
112 void SetScalarField( const bool = true );
113 void AddAllFieldNames();
114 void AddAllTimes(const QString& theFieldName);
115 QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
116 const std::string& theFieldName,
117 int theTimeStampNumber);
118 void updateControls();
121 #endif // VISUGUI_DEFORMEDSHAPEDLS_H