};
+ //------------------------------------------------------------------------
+ class DumpPath
+ {
+ QString myPath;
+ QMutex myPathMutex;
+ public:
+ DumpPath(QString thePath = QString())
+ : myPath(thePath) {}
+
+ QString GetPath() {
+ QString aPath;
+ myPathMutex.lock();
+ aPath = myPath;
+ myPathMutex.unlock();
+ return aPath;
+ }
+ void SetPath(QString thePath) {
+ myPathMutex.lock();
+ myPath = thePath;
+ myPathMutex.unlock();
+ }
+ };
+
+
//------------------------------------------------------------------------
struct TCompositeMinMaxController : virtual TVTKMinMaxController
{
myAnimEntry = "";
- myDumpPath = "";
+ myDumpPath = new VISU::DumpPath( "" );
+
myAVIMaker = "jpeg2yuv";
myDumpMode = VISU::GetResourceMgr()->integerValue("VISU", "dump_mode", 0);
delete myExecutionState;
- myDumpPath = "";
+ delete myDumpPath;
/* Terminates the execution of the thread.
* The thread may or may not be terminated immediately,
}
}
int delay = (int)(1000. * k / mySpeed);
- theIsDumping = !myDumpPath.isEmpty();
+ theIsDumping = !myDumpPath->GetPath().isEmpty();
if (delay < 1 && theIsDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
delay = 1;
}
}
int delay = (int)(1000. * k / mySpeed);
- theIsDumping = !myDumpPath.isEmpty();
+ theIsDumping = !myDumpPath->GetPath().isEmpty();
if (delay < 1 && theIsDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
delay = 1;
QList<int>& theIndexList )
{
if (myDumpFormat.compare("AVI") != 0) {
- QString aFile(myDumpPath);
+ QString aFile(myDumpPath->GetPath());
int aFrameNb = myFrame; // parallel animation mode
if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) // successive animation mode
ProcessEvent(new TMemFun2ArgEvent<SUIT_ViewWindow,bool,const QString&,const QString&>
(myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
} else {
- QFileInfo aFileInfo(myDumpPath);
+ QFileInfo aFileInfo(myDumpPath->GetPath());
QString aDirPath = aFileInfo.absolutePath();
QString aBaseName = aFileInfo.fileName();
return;
}
- bool isDumping = !myDumpPath.isEmpty();
+ bool isDumping = !myDumpPath->GetPath().isEmpty();
myFileIndex = 0;
QList<int> anIndexList;
if (isDumping && myDumpFormat.compare("AVI") == 0 && myExecutionState->IsActive()) {
double aFPS = 17.3 * mySpeed / myTimeStampFrequency;
- QFileInfo aFileInfo(myDumpPath);
+ QFileInfo aFileInfo(myDumpPath->GetPath());
QString aDirPath = aFileInfo.absolutePath();
QString aBaseName = aFileInfo.fileName();
aCmd += QString(" -n %1").arg(myFileIndex+1);
aCmd += QString(" -j \"%1\"").arg(aPattern);
aCmd += " | yuv2lav";
- aCmd += QString(" -o \"%1\"").arg(myDumpPath);
+ aCmd += QString(" -o \"%1\"").arg(myDumpPath->GetPath());
#ifdef WIN32
aCmd += " -f aA";
#endif
return isCorrect;
}
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::dumpTo(const char* thePath)
+{
+ myDumpPath->SetPath( QString( thePath ) );
+}
+
//------------------------------------------------------------------------
std::string VISU_TimeAnimation::setDumpFormat(const char* theFormat)
{
//class Result_i;
class ColoredPrs3d_i;
class ExecutionState;
+ class DumpPath;
}
struct FieldData
bool getIndicesFromSequence( QString theSequence, QList<long>& theIndices );
- void dumpTo(const char* thePath) { myDumpPath = thePath; }
+ void dumpTo(const char* thePath);
std::string setDumpFormat(const char* theFormat);
void setTimeStampFrequency(CORBA::Long theFrequency);
bool myCleaningMemoryAtEachFrame;
_PTR(Study) myStudy;
+ VISU::DumpPath* myDumpPath;
+
VISU::Animation::AnimationMode myAnimationMode;
double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation
QString mySequence;
- QString myDumpPath;
QString myDumpFormat;
QString myAVIMaker;
long myFileIndex;