]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge from BR_WIN_INDUS_514 branch 21/03/2011 (Windows industrialization)
authorvsr <vsr@opencascade.com>
Mon, 21 Mar 2011 13:38:38 +0000 (13:38 +0000)
committervsr <vsr@opencascade.com>
Mon, 21 Mar 2011 13:38:38 +0000 (13:38 +0000)
src/LightApp/LightApp_ShowHideOp.cxx
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_Recorder.cxx
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_ConvexTool.cxx

index d9672e12295cf2cc8cabb449a9b3975ab2c1ed2d..e04d6f09fc5015bc25f218071e6e6c8ae437453e 100644 (file)
@@ -142,17 +142,20 @@ void LightApp_ShowHideOp::startOperation()
       else
         entries.append( entry );
     }
-  
+
   // be sure to use real obejct entries
   QStringList objEntries;
   QStringList::const_iterator it = entries.begin(), last = entries.end();
   for ( ; it!=last; ++it )
     objEntries.append( study->referencedToEntry( *it ) ); 
   
-  if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY )
+  if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY ) {
     d->Display( objEntries, false, 0 );
-  else if( myActionType==ERASE )
+    mgr->setSelectedObjects(selObjs);
+  }
+  else if( myActionType==ERASE ) {
     d->Erase( objEntries, false, false, 0 );
+  }
   
   d->UpdateViewer();
   commit();
index 13b2a0224223f11c9730a02396f8bd230280cb57..fc102935b301470415fc6ca78a7ec13e844c950a 100644 (file)
@@ -459,7 +459,8 @@ SALOME_Actor
 ::highlight(bool theIsHighlight)
 {
   vtkFloatingPointType aBounds[6];
-  GetInput()->GetBounds(aBounds);
+  vtkDataSet * aDataSet = GetHighlightedDataSet();
+  aDataSet->GetBounds(aBounds);
   myOutline->SetBounds(aBounds);
   myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight );
 
index 2b4758590aea0cb3485ef182ce57e029eaf07da2..e7be327b76dbdcab71db615020d971caa7741223 100755 (executable)
@@ -116,7 +116,11 @@ SVTK_Recorder
   myErrorStatus = 0;
   using namespace std;
   ostringstream aStream;
+#ifndef WIN32
   aStream<<"which "<<myNameAVIMaker<<" 2> /dev/null";
+#else
+  aStream<<"setlocal & set P2=.;%PATH% & (for %e in (%PATHEXT%) do @for %i in ("<<myNameAVIMaker<<"%e) do @if NOT \"%~$P2:i\"==\"\" exit /b 0) & exit /b 1";
+#endif
   std::string anAVIMakeCheck = aStream.str();
   int iErr = system(anAVIMakeCheck.c_str());
   if(iErr != 0)
@@ -430,10 +434,19 @@ SVTK_Recorder
       myNbWrittenFrames++;
       std::string anCurrentName;
       GetNameJPEG(myName,anIndex,anCurrentName);
+  #ifndef WIN32
       aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";
+  #else
+      aStream<<"COPY /Y "<<QString::fromStdString(anInitialName).replace("/","\\\\").toStdString()<<
+                 " "<<QString::fromStdString(anCurrentName).replace("/","\\\\").toStdString()<<" > NUL";
+  #endif
       if(anIndex + 1 < aFinishIndex)
+  #ifndef WIN32
         aStream<<" \\";
-      aStream<<endl;
+        aStream<<endl;
+  #else
+        aStream<<" & ";
+  #endif
     }
     std::string aString(aStream.str());
     system(aString.c_str());
@@ -455,10 +468,11 @@ SVTK_Recorder
     //" -f "<<int(myNbFPS)<<" "<<
     " -f "<<myNbFPS<<" "<<
     " -n "<<myNbWrittenFrames<<" "<<
-    " -j "<<myName<<"_\%06d.jpeg "<<
-    "| yuv2lav"<<
-    " -o "<<myName;
-   
+    " -j \""<<myName<<"_\%06d.jpeg\" "<<
+    "| yuv2lav"<<" -o \""<<myName<<"\"";
+#ifdef WIN32
+  aStream<<" -f aA";   
+#endif
   std::string aString(aStream.str());
   myErrorStatus = system(aString.c_str());
 
@@ -467,12 +481,20 @@ SVTK_Recorder
   QFileInfo aFileInfo(myName.c_str());
   QString aDirPath = aFileInfo.absoluteDir().path();
   QString aBaseName = aFileInfo.fileName();
-  QString aCommand = 
-    QString("(cd ") + aDirPath + 
+  QString aCommand;
+#ifndef WIN32
+  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 + 
+       ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
+#endif
 
   if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<<endl;
   system((const char*)aCommand.toLatin1());
index 7db52596a4520ad59fce84dcea0077a1edfc7e4c..0f99cae9f53c237c67c2a48fc98953ddaa00f3c4 100755 (executable)
@@ -712,6 +712,13 @@ vtkFloatingPointType VTKViewer_Actor::GetQuadraticArcAngle() const{
   return myGeomFilter->GetQuadraticArcAngle();
 }
 
+/*!
+ * Return pointer to the dataset, which used to calculation of the bounding box of the actor.
+ * By default it is the input dataset.
+ */
+vtkDataSet* VTKViewer_Actor::GetHighlightedDataSet() {
+  return GetInput();
+}
 
 
 
index af13d6c9609368b3b4d1ed2440d69a686c584db0..58e1d9f68b167830a67e0e30583155ef0e0dbad3 100755 (executable)
@@ -315,6 +315,9 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   virtual void   SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
   virtual vtkFloatingPointType GetQuadraticArcAngle() const;
 
+  //----------------------------------------------------------------------------
+  //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+  virtual vtkDataSet* GetHighlightedDataSet();
 
  protected:
   //----------------------------------------------------------------------------
index ce1327a86593df7b75b048276db25dc25ae488e8..115335c5cb10742c31387514a75473a9cf6fb6d4 100644 (file)
@@ -623,14 +623,17 @@ VTKViewer_OrderedTriangulator
 
     vtkFloatingPointType aBounds[6];
     myPoints->GetBounds(aBounds);
-
+    vtkFloatingPointType xSize, ySize, zSize;
+    xSize = aBounds[1] - aBounds[0];
+    ySize = aBounds[3] - aBounds[2];
+    zSize = aBounds[5] - aBounds[4];
     vtkFloatingPointType anAbsoluteCoord[3];
     vtkFloatingPointType aParamentrucCoord[3];
     for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
       myPoints->GetPoint(aPntId, anAbsoluteCoord);
-      aParamentrucCoord[0] = (anAbsoluteCoord[0] - aBounds[0]) / (aBounds[1] - aBounds[0]);
-      aParamentrucCoord[1] = (anAbsoluteCoord[1] - aBounds[2]) / (aBounds[3] - aBounds[2]);
-      aParamentrucCoord[2] = (anAbsoluteCoord[2] - aBounds[4]) / (aBounds[5] - aBounds[4]);
+      aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize);
+      aParamentrucCoord[1] = ySize==0. ? 0. : ((anAbsoluteCoord[1] - aBounds[2]) / ySize);
+      aParamentrucCoord[2] = zSize==0. ? 0. : ((anAbsoluteCoord[2] - aBounds[4]) / zSize);
       myTriangulator->InsertPoint(aPntId, anAbsoluteCoord, aParamentrucCoord, 0);
     }