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
13 #include <qvaluelist.h>
15 #include "VISU_Actor.h"
16 #include "VISU_PrsObject_i.hh"
17 #include "VISU_ViewManager_i.hh"
18 #include "VTKViewer_ViewFrame.h"
23 VISU::VISUType myPrsType;
24 SALOMEDS::SObject_var myField; // field label
25 long myNbTimes; // number of Timestamps
26 long myNbFrames; // number of created Frames
27 VISU::ScalarMap_i** myPrs; // Presentations
28 VISU_Actor** myActors; // Actors
29 double* myTiming; // time values
33 class VISU_TimeAnimation: public QObject, public QThread,
34 public virtual POA_VISU::Animation,
35 public virtual VISU::Base_i
39 static VISU::Result_i* createPresent(SALOMEDS::SObject_var theField);
40 static VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
41 static double getTimeValue(SALOMEDS::SObject_var theTimestamp);
43 VISU_TimeAnimation(SALOMEDS::Study_var theStudy, VISU::View3D_ptr theView3D = VISU::View3D::_nil());
44 ~VISU_TimeAnimation();
46 virtual VISU::VISUType GetType() { return VISU::TNONE;};
48 void addField(SALOMEDS::SObject_ptr theField);
49 FieldData& getFieldData(int theNum) { return myFieldsLst[theNum]; }
51 CORBA::Boolean generateFrames();
52 void generatePresentations(CORBA::Long theFieldNum);
53 void setViewer(VTKViewer_ViewFrame* theView) { myView = theView; }
54 VTKViewer_ViewFrame* getViewer() { return myView; }
56 void clearData(FieldData& theData);
59 void startAnimation();
64 void gotoFrame(CORBA::Long theFrame);
66 CORBA::Long getNbFields() { return myFieldsLst.size(); }
67 CORBA::Long getNbFrames();
68 CORBA::Boolean isRunning() { return myIsActive; }
69 CORBA::Long getCurrentFrame() { return myFrame; }
71 VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
73 void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType) { myFieldsLst[theFieldNum].myPrsType = theType; }
74 VISU::VISUType getPresentationType(CORBA::Long theFieldNum) { return myFieldsLst[theFieldNum].myPrsType; }
76 void setSpeed(CORBA::Long theSpeed);
77 CORBA::Long getSpeed() { return mySpeed; }
79 CORBA::Boolean isProportional() { return myProportional; }
81 void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
82 { myMaxVal = theMax; myMinVal = theMin; }
84 CORBA::Double getMinRange() { return myMinVal; }
85 CORBA::Double getMaxRange() { return myMaxVal; }
86 CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
88 void dumpTo(const char* thePath) { myDumpPath = thePath; }
90 QString getLastErrorMsg() { return myLastError; }
92 CORBA::Boolean isCycling() { return myCycling; }
94 CORBA::Double getMinTime() { return myTimeMin;}
95 CORBA::Double getMaxTime() { return myTimeMax;}
97 void setProportional(CORBA::Boolean theProp) { myProportional = theProp; }
98 void setCycling(CORBA::Boolean theCycle) { myCycling = theCycle; }
101 void setProportionalSlot(bool theProp) { myProportional = theProp; }
102 void setCyclingSlot(bool theCycle) { myCycling = theCycle; }
105 void frameChanged(long theNewFrame, double theTime);
114 QValueList<FieldData> myFieldsLst;
120 SALOMEDS::Study_var myStudy;
122 double myMaxVal, myMinVal;
123 double myTimeMin, myTimeMax;
125 VTKViewer_ViewFrame* myView;
128 #endif //VISU_TIMEANIMATION_H