Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/visu.git] / src / VISU_I / VISU_TimeAnimation.h
index 43f2667ebce20f75c11036ea77bde33d113849f0..bb1925a80348bf7b1432a6fc46fe849038347d3f 100644 (file)
@@ -22,7 +22,7 @@ class VISU_Actor;
 
 namespace VISU{
   class Result_i;
-  class ScalarMap_i;
+  class ColoredPrs3d_i;
 }
 
 struct FieldData
@@ -31,7 +31,7 @@ struct FieldData
   _PTR(SObject) myField; // field label
   long myNbTimes;        // number of Timestamps
   long myNbFrames;       // number of created Frames
-  std::vector<VISU::ScalarMap_i*> myPrs;     // Presentations
+  std::vector<VISU::ColoredPrs3d_i*> myPrs;     // Presentations
   std::vector<VISU_Actor*> myActors;         // Actors
   std::vector<double> myTiming;              // time values
   float myOffset[3];
@@ -66,6 +66,7 @@ class VISU_TimeAnimation: public QObject, public QThread
   SVTK_ViewWindow* getViewer() { return myView; }
   void clearView();
   void clearData(FieldData& theData);
+  void clearFieldData() { myFieldsLst.clear();};
 
   void stopAnimation();
   void startAnimation();
@@ -80,7 +81,7 @@ class VISU_TimeAnimation: public QObject, public QThread
   CORBA::Boolean isRunning() { return myIsActive; }
   CORBA::Long getCurrentFrame() { return myFrame; }
 
-  VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
+  VISU::ColoredPrs3d_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
 
   void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType)
     { myFieldsLst[theFieldNum].myPrsType = theType; }
@@ -93,13 +94,14 @@ class VISU_TimeAnimation: public QObject, public QThread
   CORBA::Boolean isProportional() { return myProportional; }
 
   void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
-    { myMaxVal = theMax; myMinVal = theMin; }
+    { myTimeMinVal = theMin; myTimeMaxVal = theMax; }
 
-  CORBA::Double getMinRange() { return myMinVal; }
-  CORBA::Double getMaxRange() { return myMaxVal; }
-  CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
+  CORBA::Double getMinRange() { return myTimeMinVal; }
+  CORBA::Double getMaxRange() { return myTimeMaxVal; }
+  CORBA::Boolean isRangeDefined() { return !((myTimeMaxVal == 0) && (myTimeMinVal == myTimeMaxVal)); }
 
   void dumpTo(const char* thePath) { myDumpPath = thePath; }
+  std::string setDumpFormat(const char* theFormat);
 
   QString getLastErrorMsg() { return myLastError; }
 
@@ -113,6 +115,7 @@ class VISU_TimeAnimation: public QObject, public QThread
 
   SALOMEDS::SObject_ptr publishInStudy();
   void restoreFromStudy(SALOMEDS::SObject_ptr theField);
+  void restoreFromStudy(_PTR(SObject) theField);
   void saveAnimation();
   bool isSavedInStudy() const { return !myAnimEntry.isEmpty(); }
 
@@ -128,6 +131,9 @@ class VISU_TimeAnimation: public QObject, public QThread
   void run();
   QString GenerateName();
 
+ private slots:
+   void onViewDeleted();
+
  private:
   QString myLastError;
 
@@ -139,9 +145,10 @@ class VISU_TimeAnimation: public QObject, public QThread
   bool myCycling;
   _PTR(Study) myStudy;
 
-  double myMaxVal, myMinVal;
-  double myTimeMin, myTimeMax;
+  double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
+  double myTimeMin   , myTimeMax   ; //!< Range of time stams, available for animation
   QString myDumpPath;
+  QString myDumpFormat;
   SVTK_ViewWindow* myView;
 
   QString myAnimEntry;
@@ -182,7 +189,7 @@ public:
   virtual CORBA::Boolean isRunning();
   virtual CORBA::Long getCurrentFrame();
 
-  virtual VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
+  virtual VISU::ColoredPrs3d_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
 
   virtual void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType);
   virtual VISU::VISUType getPresentationType(CORBA::Long theFieldNum);
@@ -199,6 +206,7 @@ public:
   virtual CORBA::Boolean isRangeDefined();
 
   virtual void dumpTo(const char* thePath);
+  virtual char* setDumpFormat(const char* theFormat);
 
   virtual CORBA::Boolean isCycling();