//----------------------------------------------------------------------------
inline
void
- GetNameJPEG(const std::string& thePreffix,
+ GetNameJPEG(const std::string& thePreffix,
const int theIndex,
std::string& theName)
{
myFilter(vtkWindowToImageFilter::New()),
myWriterMgr(new SVTK_ImageWriterMgr)
{
- myCommand->SetClientData(this);
+ myCommand->SetClientData(this);
myCommand->SetCallback(SVTK_Recorder::ProcessEvents);
}
myName = theName;
}
-const char*
+const char*
SVTK_Recorder::Name() const
{
return myName.c_str();
//----------------------------------------------------------------------------
-void
+void
SVTK_Recorder
::SetRenderWindow(vtkRenderWindow* theRenderWindow)
{
myRenderWindow = theRenderWindow;
}
-vtkRenderWindow*
+vtkRenderWindow*
SVTK_Recorder
::RenderWindow()
{
//----------------------------------------------------------------------------
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<vtkObject*>(theClientData)){
+ if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){
if(SVTK_Recorder* aSelf = dynamic_cast<SVTK_Recorder*>(anObj)){
if(theEvent==vtkCommand::EndEvent){
if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){
{
QApplication::setOverrideCursor( Qt::WaitCursor );
- if(myState == SVTK_Recorder_Record){
+ if(myState == SVTK_Recorder_Record){
if(!myPaused)
DoRecord();
//----------------------------------------------------------------------------
-inline
+inline
int
GetFrameIndex(double theStartTime,
double theFPS)
if(aLastFrameIndex < 0){
myFrameIndexes.back() = abs(myFrameIndexes.back());
double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
- if(MYDEBUG)
+ if(MYDEBUG)
cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
"; aPauseTime = "<<aPauseTime<<endl;
myTimeStart += aPauseTime;
PreWrite();
- vtkImageData *anImageData = vtkImageData::New();
+ vtkImageData *anImageData = vtkImageData::New();
anImageData->DeepCopy(myFilter->GetOutput());
myWriterMgr->StartImageWriter(myFilter,anImageData,aName,myProgressiveMode,myQuality);
" -j \""<<myName<<"_%06d.jpeg\" "<<
"| yuv2lav"<<" -o \""<<myName<<"\"";
#ifdef WIN32
- aStream<<" -f aA";
+ aStream<<" -f aA";
#endif
std::string aString(aStream.str());
myErrorStatus = system(aString.c_str());
QString aBaseName = aFileInfo.fileName();
QString aCommand;
#ifndef WIN32
- aCommand = QString("(cd ") + aDirPath +
+ aCommand = QString("(cd ") + aDirPath +
"; ls " +
" | egrep '" + aBaseName + "_[0-9]*.jpeg'" +
" | xargs rm " +
#else
QString tmpFile = QString("_") + aBaseName + "_tempfile";
QString diskName = aDirPath.split("/")[0];
- aCommand = diskName + " && (cd " + aDirPath.replace("/","\\\\") +
- " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + 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
// Author : Laurent CORNABE with help of Nicolas REJNERI
// Module : SALOME
//
+
#include "VTKViewer_Transform.h"
#include <vtkObjectFactory.h>
vtkStandardNewMacro(VTKViewer_Transform)
/*!Sets matrix scale.*/
-void VTKViewer_Transform::SetMatrixScale(double theScaleX, double theScaleY, double theScaleZ){
- double aMatrix[16] = {theScaleX,0,0,0,
- 0,theScaleY,0,0,
- 0,0,theScaleZ,0,
+void VTKViewer_Transform::SetMatrixScale(double theScaleX, double theScaleY, double theScaleZ){
+ double aMatrix[16] = {theScaleX,0,0,0,
+ 0,theScaleY,0,0,
+ 0,0,theScaleZ,0,
0,0,0,1.0000000};
this->SetMatrix(aMatrix);
}
/*!Checks: Is matrix identity, where used EPS value.
*If |aScaleX-1|<EPS && |aScaleY-1|<EPS && |aScaleY-1|<EPS return 1, esle 0.
*/
-int VTKViewer_Transform::IsIdentity(){
+int VTKViewer_Transform::IsIdentity(){
double aScale[3];
this->GetMatrixScale(aScale);
- return (fabs(aScale[0] - 1.0) < EPS &&
- fabs(aScale[1] - 1.0) < EPS &&
+ return (fabs(aScale[0] - 1.0) < EPS &&
+ fabs(aScale[1] - 1.0) < EPS &&
fabs(aScale[2] - 1.0) < EPS);
}