</ul>
It is also possible to choose \b Wireframe or \b Shading \b Representation type, change
-such properties as \b Opacity and <b> Line Width </b> and <b> Translate </b> the presentation using the context menu.
+such properties as \b Transparency and <b> Line Width </b> and <b> Translate </b> the presentation using the context menu.
<br><b>See Also</b> a sample TUI Script of
\ref tui_table_3d_page "Table 3D presentation creation".
\image html quadratic.png
- \b Properties
- - \b Opacity - allows to set the value of opacity of the
- presentation between 0 (transparent) and 100 (opaque).
+ - \b Transparency - allows to set the value of transparency of the
+ presentation between 0 (opaque) and 100 (transparent).
\note For a \ref gauss_points_presentations_page "Gauss Points"
presentation, displayed using <b>Point Sprites</b> or <b>OpenGL
Points</b> \ref primitive_types_page "primitives", this property
only allows switching between transparent and opaque modes. The
- textures are drawn in the opaque mode if the opacity is equal to
- 100% and in the transparent mode if the opacity is lower that 100%
- (note that they become invisible when the opacity is equal to
- 0%).\n\n \image html viewing13.png
+ textures are drawn in the opaque mode if the transparency is equal to
+ 0% and in the transparent mode if the transparency is > 0%
+ (note that they become invisible when the transparency is equal to
+ 100%).\n\n \image html viewing13.png
- <b>Line Width</b> - allows to set the width of lines representing
edges of the presentation between 1 (thin) and 100 (thick).\n\n
\image html line_width.png
myUpdateActorsConnection = theUpdateActorSignal.connect(boost::bind(&VISU_ActorBase::UpdateFromFactory,this));
myRemoveFromRendererConnection = theRemoveFromRendererSignal.connect(boost::bind(&VISU_ActorBase::RemoveFromRender,this));
}
+
+//--------------------------------------------------------------------------------------
+vtkDataSet* VISU_ActorBase::GetHighlightedDataSet() {
+ return myPassFilter.back()->GetOutput();
+}
virtual void ConnectToFactory(boost::signal0<void>& , boost::signal0<void>&);
+ //----------------------------------------------------------------------------
+ //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+ //! Redefined from VTKViewer_Actor
+ virtual vtkDataSet* GetHighlightedDataSet();
+
+
protected:
VISU_ActorBase();
virtual ~VISU_ActorBase();
return Superclass::GetValLabelsInput();
}
+
+//--------------------------------------------------------------------------------------
+vtkDataSet* VISU_VectorsAct::GetHighlightedDataSet() {
+ return myPassFilter[3]->GetOutput();
+}
virtual
vtkDataSet*
GetValLabelsInput();
+
+ //----------------------------------------------------------------------------
+ //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+ //! Redefined from VTKViewer_Actor
+ virtual vtkDataSet* GetHighlightedDataSet();
+
protected:
VISU_VectorsAct();
myIsFeatureEdgesAllowed(true)
{
if(MYDEBUG) MESSAGE("VISU_PipeLine::VISU_PipeLine - "<<this);
+
+ vtkMath::UninitializeBounds(myVisibleBounds);
}
{
GetMapperHolder()->ShallowCopy(thePipeLine->GetMapperHolder(),
theIsCopyInput);
+ for( int i =0 ; i < 6 ; i++)
+ myVisibleBounds[i] = thePipeLine->myVisibleBounds[i];
+
+ myVisibleComputeTime = thePipeLine->myVisibleComputeTime;
}
thePlane->SetNormal(theDir);
vtkFloatingPointType anOrigin[3];
- VISU::DistanceToPosition(GetInput(),
+
+ //Make sure that bounds are calculated
+ ComputeVisibleBounds();
+ VISU::DistanceToPosition(myVisibleBounds,
theDir,
theDist,
anOrigin);
vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
-
+
vtkFloatingPointType anOrigin[3];
thePlane->GetOrigin(anOrigin);
-
- VISU::PositionToDistance(GetInput(),
- theDir,
- anOrigin,
- theDist);
+
+ //Make sure that bounds are calculated
+ ComputeVisibleBounds();
+ VISU::PositionToDistance(myVisibleBounds,
+ theDir,
+ anOrigin,
+ theDist);
}
}
+//----------------------------------------------------------------------------
+// Re-compute visible bounds if need
+void VISU_PipeLine::ComputeVisibleBounds() {
+ if(GetMTime() > myVisibleComputeTime) {
+ VISU::ComputeVisibleBounds(GetMapperHolder()->GetOutput(), myVisibleBounds);
+ myVisibleComputeTime.Modified();
+ }
+}
+
+//----------------------------------------------------------------------------
+void VISU_PipeLine::GetVisibleBounds(vtkFloatingPointType theBounds[6]) {
+ // Compute or get cached bounds
+ ComputeVisibleBounds();
+ for (int i=0; i<6; i++) {
+ theBounds[i] = myVisibleBounds[i];
+ }
+}
+
//----------------------------------------------------------------------------
class vtkDataSet;
class vtkPointSet;
class vtkImplicitFunction;
+class vtkTimeStamp;
class VISU_MapperHolder;
vtkFloatingPointType& theDist,
vtkPlane* thePlane);
+ void
+ GetVisibleBounds(vtkFloatingPointType theBounds[6]);
+
//----------------------------------------------------------------------------
static
size_t
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
bool theIsCopyInput);
+
+ virtual
+ void
+ ComputeVisibleBounds();
//----------------------------------------------------------------------------
vtkDataSet*
void
SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ //Visible bounds xmin, xmax, ymin, ymax, zmin, zmax
+ vtkFloatingPointType myVisibleBounds[6];
+ vtkTimeStamp myVisibleComputeTime; // Time at which visible bounds computed
private:
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void
- ComputeBoundsParam(vtkDataSet* theDataSet,
+ ComputeBoundsParam(vtkFloatingPointType theBounds[6],
vtkFloatingPointType theDirection[3],
vtkFloatingPointType theMinPnt[3],
vtkFloatingPointType& theMaxBoundPrj,
vtkFloatingPointType& theMinBoundPrj)
{
vtkFloatingPointType aBounds[6];
- theDataSet->GetBounds(aBounds);
+ for(int i = 0; i < 6; i++)
+ aBounds[i] = theBounds[i];
//Enlarge bounds in order to avoid conflicts of precision
for(int i = 0; i < 6; i += 2){
//----------------------------------------------------------------------------
void
- DistanceToPosition(vtkDataSet* theDataSet,
+ DistanceToPosition(vtkFloatingPointType theBounds[6],
vtkFloatingPointType theDirection[3],
vtkFloatingPointType theDist,
vtkFloatingPointType thePos[3])
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
- ComputeBoundsParam(theDataSet,
+ ComputeBoundsParam(theBounds,
theDirection,
aMinPnt,
aMaxBoundPrj,
//----------------------------------------------------------------------------
void
- PositionToDistance(vtkDataSet* theDataSet,
+ PositionToDistance(vtkFloatingPointType theBounds[6],
vtkFloatingPointType theDirection[3],
vtkFloatingPointType thePos[3],
vtkFloatingPointType& theDist)
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
- ComputeBoundsParam(theDataSet,
+ ComputeBoundsParam(theBounds,
theDirection,
aMinPnt,
aMaxBoundPrj,
vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos);
theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj);
}
-
-
+
//----------------------------------------------------------------------------
bool
IsQuadraticData(vtkDataSet* theDataSet)
return false;
}
-
//----------------------------------------------------------------------------
+ //Compute bounds of the visible part of the dataset
+ void
+ ComputeVisibleBounds(vtkDataSet* theDataSet, vtkFloatingPointType theBounds[6]) {
+ int nbCells, i, j, minIdx, maxIdx;
+ vtkFloatingPointType cellBounds[6];
+
+ if( theDataSet && (nbCells = theDataSet->GetNumberOfCells()) ) {
+ theDataSet->GetCellBounds(0,theBounds);
+ for ( i = 1; i < nbCells; i++ ) {
+ theDataSet->GetCellBounds(i, cellBounds);
+ for ( j = 0; j < 3; j++ ) {
+ minIdx = 2*j;
+ maxIdx = 2*j+1;
+ if ( cellBounds[minIdx] < theBounds[minIdx] ) {
+ theBounds[minIdx] = cellBounds[minIdx];
+ }
+ if ( cellBounds[maxIdx] > theBounds[maxIdx] ) {
+ theBounds[maxIdx] = cellBounds[maxIdx];
+ }
+ }
+ }
+ } else {
+ vtkMath::UninitializeBounds(theBounds);
+ }
+ }
+
+ //----------------------------------------------------------------------------
+ //Compute center of the box, box defined as xmin, xmax, ymin, ymax, zmin, zmax
+ void
+ ComputeBoxCenter(vtkFloatingPointType theBounds[6], vtkFloatingPointType theCenter[3]) {
+ for (int i=0; i<3; i++) {
+ theCenter[i] = (theBounds[2*i+1] + theBounds[2*i]) / 2.0;
+ }
+ }
+
+ //----------------------------------------------------------------------------
+ //Compute length of the box diagonal, box defined as xmin, xmax, ymin, ymax, zmin, zmax
+ double
+ ComputeBoxDiagonal(vtkFloatingPointType theBounds[6]) {
+ double diff, len=0.0;
+ int i;
+ for (i=0; i<3; i++) {
+ diff = (double)(theBounds[2*i+1]) - (double)(theBounds[2*i]);
+ len += diff * diff;
+ }
+ diff = sqrt(len);
+ return diff;
+ }
}
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
- ComputeBoundsParam(vtkDataSet* theDataSet,
+ ComputeBoundsParam(vtkFloatingPointType theBounds[6],
vtkFloatingPointType theDirection[3],
vtkFloatingPointType theMinPnt[3],
vtkFloatingPointType& theMaxBoundPrj,
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
- DistanceToPosition(vtkDataSet* theDataSet,
+ DistanceToPosition(vtkFloatingPointType theBounds[6],
vtkFloatingPointType theDirection[3],
vtkFloatingPointType theDist,
vtkFloatingPointType thePos[3]);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
- PositionToDistance(vtkDataSet* theDataSet,
+ PositionToDistance(vtkFloatingPointType theBounds[6],
vtkFloatingPointType theDirection[3],
vtkFloatingPointType thePos[3],
vtkFloatingPointType& theDist);
//----------------------------------------------------------------------------
bool VISU_PIPELINE_EXPORT
IsQuadraticData(vtkDataSet* theDataSet);
+
+ //----------------------------------------------------------------------------
+ void VISU_PIPELINE_EXPORT
+ ComputeVisibleBounds(vtkDataSet* theDataSet,
+ vtkFloatingPointType theBounds[6]);
+
+ //----------------------------------------------------------------------------
+ void VISU_PIPELINE_EXPORT
+ ComputeBoxCenter(vtkFloatingPointType theBounds[6], vtkFloatingPointType theCenter[3]);
+
+ //----------------------------------------------------------------------------
+ double VISU_PIPELINE_EXPORT
+ ComputeBoxDiagonal(vtkFloatingPointType theBounds[6]);
+
}
#endif
<translation>Shading Off</translation>
</message>
<message>
- <source>MEN_OPACITY</source>
- <translation>Opacity</translation>
+ <source>MEN_TRANSPARENCY</source>
+ <translation>Transparency</translation>
</message>
<message>
<source>MEN_PARALLEL_ANIMATION</source>
</message>
<message>
<source>TRANSPARENCY_TITLE</source>
- <translation>Change Transparency</translation>
+ <translation>Transparency</translation>
</message>
<message>
<source>TRANSPARENCY_TRANSPARENT</source>
tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
this, SLOT(OnChangeWireframeColor()));
- createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIcon(),
- tr("MEN_OPACITY"), "", 0, aParent, false,
+ createAction( VISU_OPACITY, tr("MEN_TRANSPARENCY"), QIcon(),
+ tr("MEN_TRANSPARENCY"), "", 0, aParent, false,
this, SLOT(OnChangeOpacity()));
createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIcon(),
action(VISU_RENAME )->setEnabled(true); // Rename: Key_F2
((VisuGUI_ClippingPanel*) myPanels[ClippingPlanesPanelId])->init();
-
+ GetVisuGen( this )->GetClippingPlaneMgr().SetStudy(GetCStudy(dynamic_cast<SalomeApp_Study*>(theStudy)),true);
emit moduleActivated();
return aResult;
#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_PipeLine.hxx"
+#include "VISU_PipeLineUtils.hxx"
#include "VISU_DataSetActor.h"
#include <SalomeApp_IntSpinBox.h>
myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane);
- vtkDataSet* aDataSet = myPrs3d->GetInput();
- vtkFloatingPointType *aPnt = aDataSet->GetCenter();
+ //Get bounds of the visible part of the dataset
+ vtkFloatingPointType aBounds[6];
+ myPrs3d->GetPipeLine()->GetVisibleBounds(aBounds);
- vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
- vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
+ //Get center
+ vtkFloatingPointType aPnt[3];
+ VISU::ComputeBoxCenter(aBounds,aPnt);
+ vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
+
+ //Get Length of the diagonal
+ vtkFloatingPointType aDel = VISU::ComputeBoxDiagonal(aBounds)/2.0;
+
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
{aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
-
+
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
aPnt[1] - aDelta[0][1] - aDelta[1][1],
aPnt[2] - aDelta[0][2] - aDelta[1][2]};
// purpose : set non structured parameters by IJK parameters
//=================================================================================
void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
-{
+{
if (myPlanes.empty() || myIsSelectPlane || !WidgetIJKTab->isEnabled())
return;
// find index value
double v = SpinBoxDistance->value();
// reverse value?
-// bool reverse = (normal * axDir < 0); // normal and axis are opposite
-// if (gridDir * axDir < 0) // grid dir and axis are opposite
-// reverse = !reverse;
-// if (reverse)
-// v = 1. - v;
+ bool reverse = (normal * axDir < 0); // normal and axis are opposite
+ if (gridDir * axDir < 0) // grid dir and axis are opposite
+ reverse = !reverse;
+ if (reverse)
+ v = 1. - v;
for (i = 0; i < values->size(); ++i)
if ((*values)[ i ] > v)
break;
--i;
// set control values
+ onIJKAxisChanged(gridAxId); // first of all update label and range of index
myIsSelectPlane = true;
CheckBoxIJKPlaneReverse->setChecked(normal * axDir < 0);
SpinBoxIJKIndex->setValue(i);
ButtonGroupIJKAxis->button(gridAxId)->setChecked( true );
- onIJKAxisChanged(gridAxId); // update label and range of index
myIsSelectPlane = false;
SetCurrentPlaneIJKParam();
void ClickOnHelp();
};
-#endif // DIALOGBOX_TRANSPARENCYDLG_H
+#endif // DIALOGBOX_CLIPPING_H
GroupC1Layout->setMargin(11);
TextLabelTransparent = new QLabel(tr("TRANSPARENCY_TRANSPARENT" ), GroupC1);
- TextLabelTransparent->setAlignment(Qt::AlignLeft);
- GroupC1Layout->addWidget(TextLabelTransparent, 0, 0);
+ TextLabelTransparent->setAlignment(Qt::AlignRight);
+ GroupC1Layout->addWidget(TextLabelTransparent, 0, 2);
ValueLab = new QLabel(GroupC1);
ValueLab->setAlignment(Qt::AlignCenter);
GroupC1Layout->addWidget(ValueLab, 0, 1);
TextLabelOpaque = new QLabel(tr("TRANSPARENCY_OPAQUE" ), GroupC1);
- TextLabelOpaque->setAlignment(Qt::AlignRight);
- GroupC1Layout->addWidget(TextLabelOpaque, 0, 2);
+ TextLabelOpaque->setAlignment(Qt::AlignLeft);
+ GroupC1Layout->addWidget(TextLabelOpaque, 0, 1);
Slider1 = new QSlider( Qt::Horizontal, GroupC1 );
Slider1->setMinimum( 0 );
{
if( myViewWindow ) {
SUIT_OverrideCursor wc;
- float opacity = this->Slider1->value() / 100.;
+ float opacity = (100 - this->Slider1->value() ) / 100.;
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList);
}
}
}
- Slider1->setValue( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity );
+ Slider1->setValue( 100 - ( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity ) );
}
ValueHasChanged();
}
}
//*************************************************************
-void VISU_ClippingPlaneMgr::SetStudy(_PTR(Study) theStudy)
+void VISU_ClippingPlaneMgr::SetStudy(_PTR(Study) theStudy, bool reinitStudy)
{
- if (myStudy == theStudy) return;
+ if (myStudy == theStudy && !reinitStudy) return;
myStudy = theStudy;
myPlanes->RemoveAllItems();
if (!myStudy) return;
aPlane->setAuto(false);
applyPlaneToAll(aPlane);
- myPlanes->AddItem(aPlane);
+
+ myPlanes->AddItem(aPlane);
}
}
}
VISU_ClippingPlaneMgr();
~VISU_ClippingPlaneMgr();
- void SetStudy(_PTR(Study) theStudy);
+ void SetStudy(_PTR(Study) theStudy, bool reinitStudy = false);
long CreateClippingPlane(double X,double Y, double Z,
//----------------------------------------------------------------
void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz)
{
+ VISU::TSetModified aModified(this);
myOffset[0] = theDx;
myOffset[1] = theDy;
myOffset[2] = theDz;
// Module : VISU
//
#include "VISU_Prs3dUtils.hh"
+#include "VISU_Prs3d_i.hh"
+#include "VISU_PointMap3d_i.hh"
#include "SalomeApp_Study.h"
#include "SALOME_Event.h"
{
//----------------------------------------------------------------------------
TSetModified
- ::TSetModified(VISU::Prs3d_i* thePrs3d):
- myPrs3d(thePrs3d)
+ ::TSetModified(VISU::PrsObject_i* thePrsObject):
+ myPrsObject(thePrsObject)
{
this->Modified();
}
void
Execute()
{
- VISU::Prs3d_i* aPrs3d = mySetModified->myPrs3d;
-
- if(!aPrs3d || aPrs3d->GetActorEntry() == "")
- return;
+ VISU::PrsObject_i* aPrsObject = mySetModified->myPrsObject;
+ if(!aPrsObject)
+ return;
+
+ VISU::Prs3d_i* aPrs3d;
+ VISU::PointMap3d_i* aPntMap;
+ SalomeApp_Study* aStudy;
+ unsigned long int time;
+ if( (aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aPrsObject)) && aPrs3d->GetActorEntry() != "" ) {
+ aStudy = aPrs3d->GetGUIStudy();
+ time = aPrs3d->GetMTime();
+ } else if ( aPntMap = dynamic_cast<VISU::PointMap3d_i*>(aPrsObject) ) {
+ aStudy = aPntMap->GetGUIStudy();
+ time = aPntMap->GetMTime();
+ } else
+ return;
- if(aPrs3d->GetMTime() > mySetModified->GetMTime()){
- if(SalomeApp_Study* aStudy = aPrs3d->GetGUIStudy())
+ if(time > mySetModified->GetMTime()){
+ if(aStudy)
aStudy->Modified();
}
- }
- };
+ }
+ };
ProcessVoidEvent(new TEvent(this));
}
#ifndef __VISU_PRS3D_UTILS_H__
#define __VISU_PRS3D_UTILS_H__
-#include "VISU_Prs3d_i.hh"
+#include "VISU_PrsObject_i.hh"
#include <vtkTimeStamp.h>
//----------------------------------------------------------------------------
struct TSetModified: vtkTimeStamp
{
- VISU::Prs3d_i* myPrs3d;
+ VISU::PrsObject_i* myPrsObject;
- TSetModified(VISU::Prs3d_i* thePrs3d);
+ TSetModified(VISU::PrsObject_i* thePrsObject);
~TSetModified();
};
-
- Standard_EXPORT std::string ToFormat( const int thePrec );
- Standard_EXPORT int ToPrecision( const char* theFormat );
-
+
+ VISU_I_EXPORT std::string ToFormat( const int thePrec );
+ VISU_I_EXPORT int ToPrecision( const char* theFormat );
+
//----------------------------------------------------------------------------
}
VISU::Prs3d_i
::SetOffset(const CORBA::Float* theOffsets)
{
+ VISU::TSetModified aModified(this);
myOffset[0] = theOffsets[0];
myOffset[1] = theOffsets[1];
myOffset[2] = theOffsets[2];
CORBA::Float theDy,
CORBA::Float theDz)
{
+ VISU::TSetModified aModified(this);
myOffset[0] = theDx;
myOffset[1] = theDy;
myOffset[2] = theDz;
// add missing files
if (anIndexList.count() > 1) {
- QString aFFile = aDirPath + QDir::separator() + aBaseName;
+ QString aFFile = aDirPath + "/" + aBaseName;
aFFile += QString("_%1.jpeg");
int aStartIndex = anIndexList[0], anEndIndex;
for (int i = 1; i < anIndexList.count(); i++) {
anEndIndex = anIndexList[i];
QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0'));
QStringList aCommands;
+ QString aSeparator;
for (int j = aStartIndex+1; j < anEndIndex; j++) {
QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0'));
+#ifndef WIN32
aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+ aSeparator = QString(" ; \\\n");
+#else
+ aCommands.append(QString("COPY /Y %1 %2 > NUL").arg(QString(aCurFile).replace("/","\\\\")).arg(QString(aFile).replace("/","\\\\")));
+ aSeparator = QString(" & ");
+#endif
}
- system(aCommands.join(" ; \\\n").toLatin1().data());
+ system(aCommands.join(aSeparator).toLatin1().data());
aStartIndex = anEndIndex;
}
}
// make AVI file
- QString aPattern = aDirPath + QDir::separator() + aBaseName;
+ QString aPattern = aDirPath + "/" + aBaseName;
aPattern += "_\%08d.jpeg";
QString aCmd = myAVIMaker;
aCmd += QString(" -f %1").arg(aFPS);
// aCmd += QString(" -n %1").arg(aNbFiles);
aCmd += QString(" -n %1").arg(myFileIndex+1);
- aCmd += QString(" -j %1").arg(aPattern);
+ aCmd += QString(" -j \"%1\"").arg(aPattern);
aCmd += " | yuv2lav";
- aCmd += QString(" -o %1").arg(myDumpPath);
+ aCmd += QString(" -o \"%1\"").arg(myDumpPath);
+ #ifdef WIN32
+ aCmd += " -f aA";
+ #endif
system(aCmd.toLatin1().data());
// remove temporary jpeg files
+#ifndef WIN32
aCmd = "( ";
aCmd += QString("cd %1").arg(aDirPath);
aCmd += "; ls";
aCmd += QString(" | egrep '%1_[0-9]*.jpeg'").arg(aBaseName);
aCmd += " | xargs rm";
aCmd += " )";
+#else
+ QString tmpFile = QString("_") + aBaseName + "_tempfile";
+ QString diskName = aDirPath.split("/")[0];
+ aCmd = diskName + " && (cd " + aDirPath.replace("/","\\\\") +
+ " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + tmpFile +
+ ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
+#endif
system(aCmd.toLatin1().data());
}
aDumpFormats.indexOf("jpeg") < 0)
return false;
- QString aCmd("which ");
- aCmd += myAVIMaker;
- aCmd += " 2> /dev/null";
+ QString aCmd;
+#ifndef WIN32
+ aCmd = "which " + myAVIMaker + " 2> /dev/null";
+#else
+ aCmd = "setlocal & set P2=.;%PATH% & (for %e in (%PATHEXT%) do @for %i in (" + myAVIMaker + "%e) do @if NOT \"%~$P2:i\"==\"\" exit /b 0) & exit /b 1";
+#endif
int iErr = system(aCmd.toLatin1().data());
return (iErr == 0);
}