Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef VISUGUI_TIMEANIMATION_H
00028 #define VISUGUI_TIMEANIMATION_H
00029
00030 #include <SalomeApp_DoubleSpinBox.h>
00031 #include "SALOMEDSClient_Study.hxx"
00032
00033 #include "VTKViewer.h"
00034
00035 #include <QDialog>
00036 #include <QButtonGroup>
00037 #include <QStackedWidget>
00038 #include <QMap>
00039
00040
00041 #include "SALOMEconfig.h"
00042 #include CORBA_SERVER_HEADER(VISU_Gen)
00043
00044 #include <vector>
00045 #include <map>
00046
00047 class VisuGUI;
00048 class SalomeApp_Module;
00049 class SalomeApp_IntSpinBox;
00050 class VISU_TimeAnimation;
00051
00052 namespace VISU
00053 {
00054 class Prs3d_i;
00055 class PointMap3d_i;
00056 }
00057
00058 class SVTK_ViewWindow;
00059
00060 class QLabel;
00061 class QSlider;
00062 class QListWidget;
00063 class QLineEdit;
00064 class QCheckBox;
00065 class QComboBox;
00066 class QGroupBox;
00067 class QToolButton;
00068
00072 class ArrangeDlg: public QDialog
00073 {
00074 Q_OBJECT
00075 public:
00076 enum { AutoMode, ManualMode };
00077 enum { XAxis, YAxis, ZAxis };
00078
00079 ArrangeDlg(QWidget* theParent,
00080 VISU_TimeAnimation* theAnimator);
00081
00082 ArrangeDlg(QWidget* theParent,
00083 const SalomeApp_Module* theModule,
00084 SVTK_ViewWindow* theViewWindow);
00085
00086 ~ArrangeDlg() {};
00087
00088 int getMode() const { return myStackWgt->indexOf(myStackWgt->currentWidget()); }
00089 double getDistance() const { return myDistVal->value(); }
00090 int getAxis() const { return myAxisGrp->id(myAxisGrp->checkedButton()); }
00091
00092 protected slots:
00093 virtual void accept();
00094 void onFieldChange(int);
00095
00096 private:
00097 struct Offset {
00098 vtkFloatingPointType myOffset[3];
00099 };
00100
00101
00102 void init();
00103 void acceptAnimation();
00104 void acceptViewWindow();
00105
00106 VISU_TimeAnimation* myAnimator;
00107 SVTK_ViewWindow * myViewWindow;
00108
00109 QStackedWidget* myStackWgt;
00110 QButtonGroup* myAxisGrp;
00111 SalomeApp_DoubleSpinBox* myDistVal;
00112 QListWidget* myFieldLst;
00113 SalomeApp_DoubleSpinBox* myCoord[3];
00114 QList<Offset> myOffsets;
00115
00116 QCheckBox* mySaveChk;
00117
00118 int myCurrent;
00119 QMap<VISU::Prs3d_i*, int> myPrsMap;
00120 QMap<VISU::PointMap3d_i*, int> myPointMapPrsMap;
00121 };
00122
00123
00124 class SetupDlg : public QDialog
00125 {
00126 Q_OBJECT
00127
00128 class LineEdit;
00129
00130 public:
00131 SetupDlg( QWidget* theParent, VisuGUI* theModule,
00132 VISU_TimeAnimation* theAnimator );
00133 ~SetupDlg() {};
00134
00135 public:
00136 void initialize();
00137
00138 bool isRegenerate() const { return myIsRegenerate; }
00139 void setIsRegenerate( const bool on ) { myIsRegenerate = on; }
00140
00141 private slots:
00142 void onClose();
00143 void onFieldChange(int theIndex);
00144 void onTypeChanged(int theIndex);
00145
00146 void onPreferencesDlg();
00147 void onRangeCheck(bool theCheck);
00148
00149
00150 void onMinValue();
00151 void onMaxValue();
00152 void onMinValueEdit(const QString&);
00153 void onMaxValueEdit(const QString&);
00154 void onSequenceCheck(bool theCheck);
00155 void onIndicesChanged(const QString& theIndices);
00156 void onValuesChanged();
00157 void onArrangeDlg();
00158
00159 private:
00160 VisuGUI* myModule;
00161 VISU_TimeAnimation* myAnimator;
00162
00163 bool myIsRegenerate;
00164
00165 QListWidget* myFieldLst;
00166 QComboBox* myTypeCombo;
00167 std::vector<int> myComboId2TypeId;
00168 std::map<int,int> myTypeId2ComboId;
00169
00170 QPushButton* myPropBtn;
00171 QPushButton* myArrangeBtn;
00172 QGroupBox* myUseRangeBox;
00173
00174
00175 QLineEdit* myMinVal;
00176 QLineEdit* myMaxVal;
00177
00178 QGroupBox* myUseSequenceBox;
00179 QLineEdit* myIndices;
00180 QListWidget* myValues;
00181 };
00182
00183 class VisuGUI_TimeAnimationDlg: public QDialog
00184 {
00185 Q_OBJECT
00186 public:
00187 VisuGUI_TimeAnimationDlg(VisuGUI* theModule,
00188 _PTR(Study) theStudy,
00189 VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
00190 ~VisuGUI_TimeAnimationDlg();
00191
00192 bool addField(_PTR(SObject) theField);
00193 void clearView();
00194
00195 void restoreFromStudy(_PTR(SObject) theAnimation);
00196
00197 protected:
00198 virtual void closeEvent(QCloseEvent* theEvent);
00199 virtual void showEvent(QShowEvent* theEvent);
00200 virtual void keyPressEvent(QKeyEvent* theEvent);
00201 void stopAnimation();
00202
00203 private slots:
00204 void onTypeChange(int index);
00205 void onPlayPressed();
00206 void onBackPressed();
00207 void onForvardPressed();
00208 void onLastPressed();
00209 void onFirstPressed();
00210 void onSetupDlg();
00211 void onWindowChanged(int index);
00212 void createFrames();
00213 void onSpeedChange(double theSpeed);
00214 void onExecution(long theNewFrame, double theTime);
00215 void onBrowse();
00216 void onBrowseAVI();
00217 void onCheckDump(bool);
00218 void onStop();
00219 void onHelp();
00220 void saveToStudy();
00221 void publishToStudy();
00223 void onPicsFormatChanged();
00225 void onPathChanged();
00226
00227 private:
00228
00229 VisuGUI* myModule;
00230 VISU_TimeAnimation* myAnimator;
00231
00232
00233 QSlider* mySlider;
00234 QComboBox* myTypeCombo;
00235 QPushButton* myPropBtn;
00236 QPushButton* myPlayBtn;
00237 QLabel* myTimeLbl;
00238 QPushButton* mySetupBtn;
00239 QPushButton* myGenBtn;
00240
00241 QFrame* myPlayFrame;
00242 SetupDlg* mySetupDlg;
00243
00244 QCheckBox* mySaveCheck;
00245 QComboBox* myPicsFormat;
00246 QLineEdit* myPathEdit;
00247
00248 QCheckBox* mySaveAVICheck;
00249 QLineEdit* myPathAVIEdit;
00250 QLabel* myPathAVILbl;
00251 QPushButton* myBrowseAVIBtn;
00252 QLabel* myFrequencyLbl;
00253 SalomeApp_IntSpinBox* myFrequencySpin;
00254
00255 QPushButton* myPublishBtn;
00256 QPushButton* mySaveBtn;
00257 };
00258
00259 #endif //VISUGUI_TIMEANIMATION_H