#include "VISU_ScalarBarActor.hxx"
#include "VISU_Actor.h"
+#include "SALOME_Event.hxx"
+
#include "VTKViewer_ViewFrame.h"
#include "QAD_Config.h"
//QWaitCondition myCondition;
static int MYDELAY = 1;
+
//************************************************************************
-VISU_TimeAnimation::VISU_TimeAnimation(SALOMEDS::Study_var theStudy, VISU::View3D_ptr theView3D) {
- myStudy = theStudy;
+VISU_TimeAnimation::VISU_TimeAnimation(SALOMEDS::Study_ptr theStudy, VISU::View3D_ptr theView3D) {
+ myStudy = SALOMEDS::Study::_duplicate(theStudy);
myIsActive = false;
myFrame = 0;
mySpeed = 1;
//************************************************************************
-CORBA::Boolean VISU_TimeAnimation::generateFrames() {
+CORBA::Boolean VISU_TimeAnimation::generateFrames(){
if (!myView) {
MESSAGE("Viewer is nod defined for animation");
return false;
}
myLastError = QString("Frame(s) for ");
bool aNoError = true;
- VISU::Mutex mt(myMutex,qApp,MYDELAY);
clearView();
vtkRenderer* aRen = myView->getRenderer();
for (int i = 0; i < getNbFields(); i++) {
MESSAGE("Viewer is nod defined for animation");
return;
}
- VISU::Mutex mt(myMutex,qApp,MYDELAY);
vtkRenderer* aRen = myView->getRenderer();
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
void VISU_TimeAnimation::setSpeed(CORBA::Long theSpeed) {
mySpeed = (theSpeed<1)? 1 : theSpeed;
}
+
+
+//========================================================================
+VISU_TimeAnimation_i::VISU_TimeAnimation_i(SALOMEDS::Study_ptr theStudy, VISU::View3D_ptr theView3D){
+ myAnim = new VISU_TimeAnimation(theStudy,theView3D);
+}
+
+
+VISU_TimeAnimation_i::~VISU_TimeAnimation_i(){
+ delete myAnim;
+}
+
+
+void VISU_TimeAnimation_i::addField(SALOMEDS::SObject_ptr theField){
+ myAnim->addField(theField);
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::generateFrames(){
+ return ProcessEvent(new TMemFunEvent<VISU_TimeAnimation,bool>(myAnim,&VISU_TimeAnimation::generateFrames));
+}
+
+
+void VISU_TimeAnimation_i::generatePresentations(CORBA::Long theFieldNum){
+ myAnim->generatePresentations(theFieldNum);
+}
+
+
+void VISU_TimeAnimation_i::clearView(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::clearView));
+}
+
+
+void VISU_TimeAnimation_i::stopAnimation(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::stopAnimation));
+}
+
+
+void VISU_TimeAnimation_i::startAnimation(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::startAnimation));
+}
+
+
+void VISU_TimeAnimation_i::nextFrame(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::nextFrame));
+}
+
+
+void VISU_TimeAnimation_i::prevFrame(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::prevFrame));
+}
+
+
+void VISU_TimeAnimation_i::firstFrame(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::firstFrame));
+}
+
+
+void VISU_TimeAnimation_i::lastFrame(){
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::lastFrame));
+}
+
+
+void VISU_TimeAnimation_i::gotoFrame(CORBA::Long theFrame){
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TimeAnimation,CORBA::Long>(myAnim,&VISU_TimeAnimation::gotoFrame,theFrame));
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getNbFields(){
+ return myAnim->getNbFields();
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getNbFrames(){
+ return myAnim->getNbFrames();
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isRunning(){
+ return myAnim->isRunning();
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getCurrentFrame(){
+ return myAnim->getCurrentFrame();
+}
+
+
+VISU::ScalarMap_ptr VISU_TimeAnimation_i::getPresentation(CORBA::Long theField, CORBA::Long theFrame){
+ return myAnim->getPresentation(theField,theFrame);
+}
+
+
+void VISU_TimeAnimation_i::setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType){
+ myAnim->setPresentationType(theFieldNum,theType);
+}
+
+
+VISU::VISUType VISU_TimeAnimation_i::getPresentationType(CORBA::Long theFieldNum){
+ return myAnim->getPresentationType(theFieldNum);
+}
+
+
+void VISU_TimeAnimation_i::setSpeed(CORBA::Long theSpeed){
+ myAnim->setSpeed(theSpeed);
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getSpeed(){
+ return myAnim->getSpeed();
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isProportional(){
+ return myAnim->isProportional();
+}
+
+
+void VISU_TimeAnimation_i::setAnimationRange(CORBA::Double theMin, CORBA::Double theMax){
+ myAnim->setAnimationRange(theMin,theMax);
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMinRange(){
+ return myAnim->getMinRange();
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMaxRange(){
+ return myAnim->getMaxRange();
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isRangeDefined(){
+ return myAnim->isRangeDefined();
+}
+
+
+void VISU_TimeAnimation_i::dumpTo(const char* thePath){
+ myAnim->dumpTo(thePath);
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isCycling(){
+ return myAnim->isCycling();
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMinTime(){
+ return myAnim->getMinTime();
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMaxTime(){
+ return myAnim->getMaxTime();
+}
+
+
+void VISU_TimeAnimation_i::setProportional(CORBA::Boolean theProp){
+ myAnim->setProportional(theProp);
+}
+
+
+void VISU_TimeAnimation_i::setCycling(CORBA::Boolean theCycle){
+ myAnim->setCycling(theCycle);
+}
+
+
};
-class VISU_TimeAnimation: public QObject, public QThread,
- public virtual POA_VISU::Animation,
- public virtual VISU::Base_i
+class VISU_TimeAnimation: public QObject, public QThread
{
Q_OBJECT;
public:
static VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
static double getTimeValue(SALOMEDS::SObject_var theTimestamp);
- VISU_TimeAnimation(SALOMEDS::Study_var theStudy, VISU::View3D_ptr theView3D = VISU::View3D::_nil());
+ VISU_TimeAnimation(SALOMEDS::Study_ptr theStudy, VISU::View3D_ptr theView3D = VISU::View3D::_nil());
~VISU_TimeAnimation();
virtual VISU::VISUType GetType() { return VISU::TNONE;};
VTKViewer_ViewFrame* myView;
};
+
+class VISU_TimeAnimation_i: public virtual POA_VISU::Animation,
+ public virtual VISU::Base_i
+{
+ VISU_TimeAnimation* myAnim;
+public:
+ VISU_TimeAnimation_i(SALOMEDS::Study_ptr theStudy,
+ VISU::View3D_ptr theView3D = VISU::View3D::_nil());
+ ~VISU_TimeAnimation_i();
+
+ virtual VISU::VISUType GetType(){ return VISU::TNONE;}
+
+ virtual void addField(SALOMEDS::SObject_ptr theField);
+
+ virtual CORBA::Boolean generateFrames();
+ virtual void generatePresentations(CORBA::Long theFieldNum);
+
+ virtual void clearView();
+
+ virtual void stopAnimation();
+ virtual void startAnimation();
+ virtual void nextFrame();
+ virtual void prevFrame();
+ virtual void firstFrame();
+ virtual void lastFrame();
+ virtual void gotoFrame(CORBA::Long theFrame);
+
+ virtual CORBA::Long getNbFields();
+ virtual CORBA::Long getNbFrames();
+ virtual CORBA::Boolean isRunning();
+ virtual CORBA::Long getCurrentFrame();
+
+ virtual VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
+
+ virtual void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType);
+ virtual VISU::VISUType getPresentationType(CORBA::Long theFieldNum);
+
+ virtual void setSpeed(CORBA::Long theSpeed);
+ virtual CORBA::Long getSpeed();
+
+ virtual CORBA::Boolean isProportional();
+
+ virtual void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax);
+
+ virtual CORBA::Double getMinRange();
+ virtual CORBA::Double getMaxRange();
+ virtual CORBA::Boolean isRangeDefined();
+
+ virtual void dumpTo(const char* thePath);
+
+ virtual CORBA::Boolean isCycling();
+
+ virtual CORBA::Double getMinTime();
+ virtual CORBA::Double getMaxTime();
+
+ virtual void setProportional(CORBA::Boolean theProp);
+ virtual void setCycling(CORBA::Boolean theCycle);
+};
+
+
#endif //VISU_TIMEANIMATION_H