1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : VISU_TimeAnimation.h
6 // Author : Vitaly SMETANNIKOV
9 #ifndef VISU_TIMEANIMATION_H
10 #define VISU_TIMEANIMATION_H
12 #include "VISUConfig.hh"
14 class VTKViewer_ViewFrame;
18 #include <qvaluelist.h>
28 VISU::VISUType myPrsType;
29 SALOMEDS::SObject_var myField; // field label
30 long myNbTimes; // number of Timestamps
31 long myNbFrames; // number of created Frames
32 VISU::ScalarMap_i** myPrs; // Presentations
33 VISU_Actor** myActors; // Actors
34 double* myTiming; // time values
38 class VISU_TimeAnimation: public QObject, public QThread,
39 public virtual POA_VISU::Animation,
40 public virtual VISU::Base_i
44 static VISU::Result_i* createPresent(SALOMEDS::SObject_var theField);
45 static VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
46 static double getTimeValue(SALOMEDS::SObject_var theTimestamp);
48 VISU_TimeAnimation(SALOMEDS::Study_var theStudy, VISU::View3D_ptr theView3D = VISU::View3D::_nil());
49 ~VISU_TimeAnimation();
51 virtual VISU::VISUType GetType() { return VISU::TNONE;};
53 void addField(SALOMEDS::SObject_ptr theField);
54 FieldData& getFieldData(int theNum) { return myFieldsLst[theNum]; }
56 CORBA::Boolean generateFrames();
57 void generatePresentations(CORBA::Long theFieldNum);
58 void setViewer(VTKViewer_ViewFrame* theView) { myView = theView; }
59 VTKViewer_ViewFrame* getViewer() { return myView; }
61 void clearData(FieldData& theData);
64 void startAnimation();
69 void gotoFrame(CORBA::Long theFrame);
71 CORBA::Long getNbFields() { return myFieldsLst.size(); }
72 CORBA::Long getNbFrames();
73 CORBA::Boolean isRunning() { return myIsActive; }
74 CORBA::Long getCurrentFrame() { return myFrame; }
76 VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
78 void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType) { myFieldsLst[theFieldNum].myPrsType = theType; }
79 VISU::VISUType getPresentationType(CORBA::Long theFieldNum) { return myFieldsLst[theFieldNum].myPrsType; }
81 void setSpeed(CORBA::Long theSpeed);
82 CORBA::Long getSpeed() { return mySpeed; }
84 CORBA::Boolean isProportional() { return myProportional; }
86 void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
87 { myMaxVal = theMax; myMinVal = theMin; }
89 CORBA::Double getMinRange() { return myMinVal; }
90 CORBA::Double getMaxRange() { return myMaxVal; }
91 CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
93 void dumpTo(const char* thePath) { myDumpPath = thePath; }
95 QString getLastErrorMsg() { return myLastError; }
97 CORBA::Boolean isCycling() { return myCycling; }
99 CORBA::Double getMinTime() { return myTimeMin;}
100 CORBA::Double getMaxTime() { return myTimeMax;}
102 void setProportional(CORBA::Boolean theProp) { myProportional = theProp; }
103 void setCycling(CORBA::Boolean theCycle) { myCycling = theCycle; }
106 void setProportionalSlot(bool theProp) { myProportional = theProp; }
107 void setCyclingSlot(bool theCycle) { myCycling = theCycle; }
110 void frameChanged(long theNewFrame, double theTime);
119 QValueList<FieldData> myFieldsLst;
125 SALOMEDS::Study_var myStudy;
127 double myMaxVal, myMinVal;
128 double myTimeMin, myTimeMax;
130 VTKViewer_ViewFrame* myView;
133 #endif //VISU_TIMEANIMATION_H