X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSVTK%2FSVTK_Recorder.cxx;h=1be7fe354deca8cd4f6b05875ef891775545302c;hb=320eb776e5eb37ade130d10326bf5cee4559ee86;hp=11cce2b5b75d5d31bd479e3eb7f0bed850a69b86;hpb=9952c8ed69cf4d1c8aa82ec1b4f3dc1970f5788e;p=modules%2Fgui.git diff --git a/src/SVTK/SVTK_Recorder.cxx b/src/SVTK/SVTK_Recorder.cxx old mode 100755 new mode 100644 index 11cce2b5b..1be7fe354 --- a/src/SVTK/SVTK_Recorder.cxx +++ b/src/SVTK/SVTK_Recorder.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -34,6 +34,7 @@ #include #include #include +#include #ifndef WIN32 #include @@ -43,13 +44,7 @@ #include #include -//#include "utilities.h" - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif +#include "utilities.h" namespace @@ -57,7 +52,7 @@ namespace //---------------------------------------------------------------------------- inline void - GetNameJPEG(const std::string& thePreffix, + GetNameJPEG(const std::string& thePreffix, const int theIndex, std::string& theName) { @@ -68,30 +63,30 @@ namespace } //---------------------------------------------------------------------------- -vtkStandardNewMacro(SVTK_Recorder); +vtkStandardNewMacro(SVTK_Recorder) //---------------------------------------------------------------------------- SVTK_Recorder ::SVTK_Recorder(): - myRenderWindow(NULL), myState(SVTK_Recorder_Stop), + myPaused(0), + myErrorStatus(0), + myPriority(0.0), + myTimeStart(0.0), + myFrameIndex(0), + myNbWrittenFrames(0), myNbFPS(5.5), myQuality(100), myProgressiveMode(true), myUseSkippedFrames(true), - myErrorStatus(0), + myNameAVIMaker("jpeg2yuv"), myCommand(vtkCallbackCommand::New()), - myPriority(0.0), - myTimeStart(0.0), - myFrameIndex(0), - myPaused(0), + myRenderWindow(NULL), myFilter(vtkWindowToImageFilter::New()), - myWriterMgr(new SVTK_ImageWriterMgr), - myNbWrittenFrames(0), - myNameAVIMaker("jpeg2yuv") + myWriterMgr(new SVTK_ImageWriterMgr) { - myCommand->SetClientData(this); + myCommand->SetClientData(this); myCommand->SetCallback(SVTK_Recorder::ProcessEvents); } @@ -133,7 +128,7 @@ SVTK_Recorder myName = theName; } -const char* +const char* SVTK_Recorder::Name() const { return myName.c_str(); @@ -173,14 +168,14 @@ SVTK_Recorder //---------------------------------------------------------------------------- -void +void SVTK_Recorder ::SetRenderWindow(vtkRenderWindow* theRenderWindow) { myRenderWindow = theRenderWindow; } -vtkRenderWindow* +vtkRenderWindow* SVTK_Recorder ::RenderWindow() { @@ -239,12 +234,12 @@ SVTK_Recorder //---------------------------------------------------------------------------- void SVTK_Recorder -::ProcessEvents(vtkObject* vtkNotUsed(theObject), +::ProcessEvents(vtkObject* vtkNotUsed(theObject), unsigned long theEvent, - void* theClientData, + void* theClientData, void* vtkNotUsed(theCallData)) { - if(vtkObject* anObj = reinterpret_cast(theClientData)){ + if(vtkObject* anObj = reinterpret_cast(theClientData)){ if(SVTK_Recorder* aSelf = dynamic_cast(anObj)){ if(theEvent==vtkCommand::EndEvent){ if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){ @@ -284,7 +279,7 @@ SVTK_Recorder { QApplication::setOverrideCursor( Qt::WaitCursor ); - if(myState == SVTK_Recorder_Record){ + if(myState == SVTK_Recorder_Record){ if(!myPaused) DoRecord(); @@ -312,13 +307,15 @@ SVTK_Recorder myPaused = myPaused ? 0 : 1; if(myPaused && !myFrameIndexes.empty()){ myFrameIndexes.back() *= -1; - if(MYDEBUG) cout<<"SVTK_Recorder::Pause - myFrameIndexes.back() = "< NUL"; #endif - if(anIndex + 1 < aFinishIndex) + if(anIndex + 1 < aFinishIndex) { #ifndef WIN32 aStream<<" \\"; aStream< " + tmpFile + + aCommand = diskName + " && (cd " + aDirPath.replace("/","\\\\") + + " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + tmpFile + ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL"; #endif - if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<