1 // File : VISU_TimeAnimation.h
2 // Created : 10 / 04 / 2003
3 // Author : Vitaly SMETANNIKOV
6 // Copyright : Open CASCADE
8 #ifndef VISU_TIMEANIMATION_H
9 #define VISU_TIMEANIMATION_H
12 #include <qvaluelist.h>
14 #include "VISU_Actor.h"
15 #include "VISU_PrsObject_i.hh"
16 #include "VTKViewer_ViewFrame.h"
21 VISU::VISUType myPrsType;
22 SALOMEDS::SObject_var myField; // field label
23 long myNbTimes; // number of Timestamps
24 VISU::ScalarMap_i** myPrs; // Presentations
25 VISU_Actor** myActors; // Actors
26 double* myTiming; // time values
30 class VISU_TimeAnimation: public QObject, public QThread
34 static VISU::Result_i* createPresent(SALOMEDS::SObject_var theField);
35 static VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
36 static double getTimeValue(SALOMEDS::SObject_var theTimestamp);
38 VISU_TimeAnimation(SALOMEDS::Study_var theStudy);
39 ~VISU_TimeAnimation();
41 void addField(SALOMEDS::SObject_var theField);
42 FieldData& getFieldData(int theNum) { return myFieldsLst[theNum]; }
44 bool generateFrames();
45 void generatePresentations(int theFieldNum);
46 void setViewer(VTKViewer_ViewFrame* theView) { myView = theView; }
47 VTKViewer_ViewFrame* getViewer() { return myView; }
49 void clearData(FieldData& theData);
52 void startAnimation();
57 void gotoFrame(long theFrame);
59 int getNbFields() { return myFieldsLst.size(); }
61 bool isRunning() { return myIsActive; }
62 long getCurrentFrame() { return myFrame; }
64 VISU::ScalarMap_i* getPresentation(int theField, long theFrame);
66 void setPresentationType(int theFieldNum, VISU::VISUType theType) { myFieldsLst[theFieldNum].myPrsType = theType; }
67 VISU::VISUType getPresentationType(int theFieldNum) { return myFieldsLst[theFieldNum].myPrsType; }
69 void setSpeed(int theSpeed);
70 int getSpeed() { return mySpeed; }
72 bool isProportional() { return myProportional; }
74 void setAnimationRange(double theMin, double theMax)
75 { myMaxVal = theMax; myMinVal = theMin; }
77 double getMinRange() { return myMinVal; }
78 double getMaxRange() { return myMaxVal; }
79 bool isRangeDefined() { return ((myMaxVal!=0) && (myMinVal != 0)); }
81 void dumpTo(QString thePath) { myDumpPath = thePath; }
84 void setProportional(bool theProp) { myProportional = theProp; }
87 void frameChanged(long theNewFrame, double theTime);
94 QValueList<FieldData> myFieldsLst;
99 SALOMEDS::Study_var myStudy;
101 double myMaxVal, myMinVal;
103 VTKViewer_ViewFrame* myView;
106 #endif //VISU_TIMEANIMATION_H