void VVTK_MainWindow::OnStartRecording()
{
//QString aFileName = "/data/pkv/IMAGES/TMP/abc";
- QString aFileName=QFileDialog::getSaveFileName( getenv( "VISU_ROOT_DIR"), "*.avi", this );
+ QString aFileName=QFileDialog::getSaveFileName( getenv( "HOME"), "*.avi", this );
if( aFileName.isNull() ){
return;
}
\r
#include "VVTK_Recorder.h"\r
\r
-#include <unistd.h>\r
+#include "VVTK_ImageWriter.h"\r
+#include "VVTK_ImageWriterMgr.h"\r
\r
#include <vtkObjectFactory.h>\r
#include <vtkObject.h>\r
#include <vtkJPEGWriter.h>\r
#include <vtkImageData.h>\r
\r
-#include "VVTK_ImageWriter.h"\r
-#include "VVTK_ImageWriterMgr.h"\r
-//\r
+#include <unistd.h>\r
+#include <qfileinfo.h>\r
+\r
+\r
static \r
void GetNameJPEG(const char *pName, \r
const int aIndex,\r
void* theClientData, \r
void* vtkNotUsed(theCallData))\r
{\r
- if(vtkObject* pObj=reinterpret_cast<vtkObject*>(theClientData)) { \r
- if(VVTK_Recorder* pSelf=reinterpret_cast<VVTK_Recorder*>(pObj)) {\r
+ if(vtkObject* anObj=reinterpret_cast<vtkObject*>(theClientData)){ \r
+ if(VVTK_Recorder* aSelf=dynamic_cast<VVTK_Recorder*>(anObj)){\r
if(theEvent==vtkCommand::EndEvent){\r
- if (pSelf->State()==VVTK_Recorder::VVTK_Recorder_Record){\r
- pSelf->DoRecord();\r
+ if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){\r
+ aSelf->DoRecord();\r
}\r
}\r
}\r
}\r
}\r
+\r
//===============================================\r
// function: Record\r
// purpose :\r
myNameAVIMaker, iNbFPS, myNbWrittenFrames, myName, fmt, myName);\r
//\r
myErrorStatus=system(aCmd);\r
+\r
+ QFileInfo aFileInfo(myName);\r
+ QString aDirPath = aFileInfo.dirPath(TRUE);\r
+ QString aBaseName = aFileInfo.baseName(TRUE);\r
+ QString aCommand = \r
+ QString("(cd ") + aDirPath + \r
+ "; ls " +\r
+ " | egrep '" + aBaseName + "_[0-9]*.jpeg'" +\r
+ " | xargs rm " +\r
+ ")";\r
+ system(aCommand.latin1());\r
}\r
//===============================================\r
// function: GetNameJPEG\r