]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge from BR_WIN_INDUS_514 branch 21/03/2011 (Windows industrialization) V6_main_20110322 V6_main_20110323 V6_main_20110324 V6_main_20110325 mergefrom_BR_WIN_INDUS_514_21Mar11
authorvsr <vsr@opencascade.com>
Mon, 21 Mar 2011 16:03:00 +0000 (16:03 +0000)
committervsr <vsr@opencascade.com>
Mon, 21 Mar 2011 16:03:00 +0000 (16:03 +0000)
23 files changed:
doc/salome/gui/VISU/images/viewing13.png
doc/salome/gui/VISU/input/table_3d.doc
doc/salome/gui/VISU/input/viewing_3d_presentations.doc
src/OBJECT/VISU_ActorBase.cxx
src/OBJECT/VISU_ActorBase.h
src/OBJECT/VISU_VectorsAct.cxx
src/OBJECT/VISU_VectorsAct.h
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_PipeLine.hxx
src/PIPELINE/VISU_PipeLineUtils.cxx
src/PIPELINE/VISU_PipeLineUtils.hxx
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_ClippingDlg.h
src/VISUGUI/VisuGUI_TransparencyDlg.cxx
src/VISU_I/VISU_ClippingPlaneMgr.cxx
src/VISU_I/VISU_ClippingPlaneMgr.hxx
src/VISU_I/VISU_PointMap3d_i.cc
src/VISU_I/VISU_Prs3dUtils.cc
src/VISU_I/VISU_Prs3dUtils.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_TimeAnimation.cxx

index 76bd8d54b8fbc5a8476036cc87f3131f20679b2d..934a7a0ec83d34eb8b4f1c4bf575df0da0e87c1f 100755 (executable)
Binary files a/doc/salome/gui/VISU/images/viewing13.png and b/doc/salome/gui/VISU/images/viewing13.png differ
index 7a02dd46bcedc94dd03096bb2a93762f58fc30c3..38cf54b66e8e623f4d104423c046c883600a1117 100644 (file)
@@ -43,7 +43,7 @@ bar displayed with this presentation (\ref scalar_map_page "see also").</li>
 </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".
index d5a679dacd7a742b7f796afd4b2d8c4b5bd2878c..771a121e907afa5cd18a1e18d8aa90e209a963d7 100644 (file)
@@ -83,16 +83,16 @@ are visualized: as straight lines or as arcs of circle.
 \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
index fbb889e389d8489a7cbd5f5d9fd3b43f693ed097..9598883c35413d0c2c0e86f61f65fbd10d50f149 100644 (file)
@@ -194,3 +194,8 @@ void VISU_ActorBase::ConnectToFactory(boost::signal0<void>& theUpdateActorSignal
   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();
+}
index b4e2da399c49945cd149844d4a1762f897249fe8..8651efda4af9d082f40d7ed217c7bc1999955055 100644 (file)
@@ -75,6 +75,12 @@ class VISU_OBJECT_EXPORT VISU_ActorBase: public SALOME_Actor,
 
   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();
index a2e866ba18383f9a0aa0c5c3d6b78e5a4055729f..9b2ee148127d4e0b0167e51aa03d97691bba9597 100644 (file)
@@ -143,3 +143,8 @@ VISU_VectorsAct
 
   return Superclass::GetValLabelsInput();
 }
+
+//--------------------------------------------------------------------------------------
+vtkDataSet* VISU_VectorsAct::GetHighlightedDataSet() {
+  return myPassFilter[3]->GetOutput();
+}
index 2729a6837e3c25fe29fb02d379a73cb2980912c7..b6e533e10aa3a68b437b7cb08852f7cfd920cacd 100644 (file)
@@ -69,6 +69,12 @@ class VISU_OBJECT_EXPORT VISU_VectorsAct : public VISU_ScalarMapAct
   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();
index d9809ae56cc51d9d4114c25bd9885ddd1fe11bb1..58820209514a39709f2383f24c1b31ab2285ca65 100644 (file)
@@ -52,6 +52,8 @@ VISU_PipeLine
   myIsFeatureEdgesAllowed(true)
 {
   if(MYDEBUG) MESSAGE("VISU_PipeLine::VISU_PipeLine - "<<this);
+  
+  vtkMath::UninitializeBounds(myVisibleBounds);
 }
 
 
@@ -111,6 +113,10 @@ VISU_PipeLine
 {
   GetMapperHolder()->ShallowCopy(thePipeLine->GetMapperHolder(),
                                  theIsCopyInput);
+  for( int i =0 ; i < 6 ; i++)
+    myVisibleBounds[i] = thePipeLine->myVisibleBounds[i];
+  
+  myVisibleComputeTime = thePipeLine->myVisibleComputeTime;
 }
 
 
@@ -394,7 +400,10 @@ VISU_PipeLine
   thePlane->SetNormal(theDir);
 
   vtkFloatingPointType anOrigin[3];
-  VISU::DistanceToPosition(GetInput(),
+
+  //Make sure that bounds are calculated
+  ComputeVisibleBounds();
+  VISU::DistanceToPosition(myVisibleBounds,
                            theDir,
                            theDist,
                            anOrigin);
@@ -411,14 +420,16 @@ VISU_PipeLine
                 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);
 }
 
 
@@ -465,4 +476,22 @@ VISU_PipeLine
 }
 
 
+//----------------------------------------------------------------------------
+// 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];
+  }
+}
+
 //----------------------------------------------------------------------------
index d2bf38a5a069db9e51c1f5a3b82055ac9088c7f0..c712e05c67b9af686d95db23a18e25a10e460886 100644 (file)
@@ -40,6 +40,7 @@ class vtkMapper;
 class vtkDataSet;
 class vtkPointSet;
 class vtkImplicitFunction;
+class vtkTimeStamp;
 
 class VISU_MapperHolder;
 
@@ -179,6 +180,9 @@ public:
                 vtkFloatingPointType& theDist, 
                 vtkPlane* thePlane);
 
+  void                
+  GetVisibleBounds(vtkFloatingPointType theBounds[6]);
+
   //----------------------------------------------------------------------------
   static
   size_t
@@ -209,6 +213,10 @@ protected:
   void
   DoShallowCopy(VISU_PipeLine *thePipeLine,
                 bool theIsCopyInput);
+                
+  virtual
+  void
+  ComputeVisibleBounds();
 
   //----------------------------------------------------------------------------
   vtkDataSet* 
@@ -219,6 +227,10 @@ protected:
 
   void 
   SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+  
+  //Visible bounds xmin, xmax, ymin, ymax, zmin, zmax
+  vtkFloatingPointType myVisibleBounds[6];
+  vtkTimeStamp myVisibleComputeTime;       // Time at which visible bounds computed
 
 private:
   //----------------------------------------------------------------------------
index b048a04c4c470fc3fc5512e5417dfe2356671670..0219054d2aa7a5ef856d31835981cf24f991e84a 100644 (file)
@@ -162,14 +162,15 @@ namespace VISU
 
   //----------------------------------------------------------------------------
   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){
@@ -211,13 +212,13 @@ namespace VISU
 
   //----------------------------------------------------------------------------
   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,
@@ -231,13 +232,13 @@ namespace VISU
 
   //----------------------------------------------------------------------------
   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,
@@ -245,8 +246,7 @@ namespace VISU
     vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos);
     theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj);
   }
-
-
+  
   //----------------------------------------------------------------------------
   bool
   IsQuadraticData(vtkDataSet* theDataSet)
@@ -258,6 +258,53 @@ namespace VISU
     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;
+  }
 }
index ca2e2d542a0fc036869d82aacff4f98180d8f9aa..a77dd31d0e943b7b11bbce66c4bb33dc4349520c 100644 (file)
@@ -126,7 +126,7 @@ namespace VISU
 
   //----------------------------------------------------------------------------
   void VISU_PIPELINE_EXPORT
-  ComputeBoundsParam(vtkDataSet* theDataSet,
+  ComputeBoundsParam(vtkFloatingPointType theBounds[6],
                      vtkFloatingPointType theDirection[3], 
                      vtkFloatingPointType theMinPnt[3],
                      vtkFloatingPointType& theMaxBoundPrj, 
@@ -135,7 +135,7 @@ namespace VISU
 
   //----------------------------------------------------------------------------
   void VISU_PIPELINE_EXPORT
-  DistanceToPosition(vtkDataSet* theDataSet,
+  DistanceToPosition(vtkFloatingPointType theBounds[6],
                      vtkFloatingPointType theDirection[3], 
                      vtkFloatingPointType theDist, 
                      vtkFloatingPointType thePos[3]);
@@ -143,7 +143,7 @@ namespace VISU
 
   //----------------------------------------------------------------------------
   void VISU_PIPELINE_EXPORT
-  PositionToDistance(vtkDataSet* theDataSet,
+  PositionToDistance(vtkFloatingPointType theBounds[6],
                      vtkFloatingPointType theDirection[3], 
                      vtkFloatingPointType thePos[3], 
                      vtkFloatingPointType& theDist);
@@ -152,6 +152,20 @@ namespace VISU
   //----------------------------------------------------------------------------
   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
index b67b34b77f178f8229577cb041d0a1b52f62d85d..af51cd2172560b5115dbe82aebdc318aba8bdea3 100644 (file)
@@ -900,8 +900,8 @@ Input value precision can be adjusted using
         <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>
@@ -3214,7 +3214,7 @@ Please, refer to the QT documentation.</translation>
     </message>
     <message>
         <source>TRANSPARENCY_TITLE</source>
-        <translation>Change Transparency</translation>
+        <translation>Transparency</translation>
     </message>
     <message>
         <source>TRANSPARENCY_TRANSPARENT</source>
index 0377e2866ea41af07ab6d3aa2e63483b5c2e96c7..bd5497082d3736d18df5a6964ec67d6e0e6a9b6f 100644 (file)
@@ -2796,8 +2796,8 @@ VisuGUI
                 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(),
@@ -3693,7 +3693,7 @@ VisuGUI
   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;
index 0f9bea8d3ad1e75a63fa9603f95cc4c915483286..458a8058cd3fbc89a6c491cc7fa6e86b53a293bc 100644 (file)
@@ -31,6 +31,7 @@
 #include "VISU_ColoredPrs3dHolder_i.hh"
 
 #include "VISU_PipeLine.hxx"
+#include "VISU_PipeLineUtils.hxx"
 #include "VISU_DataSetActor.h"
 
 #include <SalomeApp_IntSpinBox.h>
@@ -948,16 +949,23 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam()
 
   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]};
@@ -1014,7 +1022,7 @@ void VisuGUI_ClippingDlg::onTabChanged(QWidget* newTab)
 // purpose  : set non structured parameters by IJK parameters
 //=================================================================================
 void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
-{
+{  
   if (myPlanes.empty() || myIsSelectPlane || !WidgetIJKTab->isEnabled())
     return;
 
@@ -1139,11 +1147,11 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
   // 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;
@@ -1153,11 +1161,11 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
     --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();
index a40cd1c02dfd382171649781203e695d87f2fd28..18daf564b50981776d7dd8e6452677c1cb8e14e7 100644 (file)
@@ -213,6 +213,6 @@ public slots:
     void ClickOnHelp();
 };
 
-#endif // DIALOGBOX_TRANSPARENCYDLG_H
+#endif // DIALOGBOX_CLIPPING_H
 
 
index f14baab8ba105d6a46439d95cf88d3794219d2dd..6ea3a861ede334e754154ca8a51caad3ab1828a5 100644 (file)
@@ -92,8 +92,8 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
   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);
@@ -102,8 +102,8 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
   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 );
@@ -207,7 +207,7 @@ void VisuGUI_TransparencyDlg::SetTransparency()
 {
   if( myViewWindow ) {
     SUIT_OverrideCursor wc;
-    float opacity = this->Slider1->value() / 100.;
+    float opacity = (100 - this->Slider1->value() ) / 100.;
 
     SALOME_ListIO aList;
     mySelectionMgr->selectedObjects(aList);
@@ -274,7 +274,7 @@ void VisuGUI_TransparencyDlg::onSelectionChanged()
        }
       }
     }
-    Slider1->setValue( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity );
+    Slider1->setValue( 100 - ( opacity == UNDEF_OPACITY ? DEFAULT_OPACITY : opacity ) );
   }
   ValueHasChanged();
 }
index 7a169cca7d3934cfc859b04733a21276374c6ff7..50f63e7a6a0c54b44daf236b93f54ccd733fd4b9 100644 (file)
@@ -49,9 +49,9 @@ VISU_ClippingPlaneMgr::~VISU_ClippingPlaneMgr()
 }
 
 //*************************************************************
-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;
@@ -79,7 +79,8 @@ void VISU_ClippingPlaneMgr::SetStudy(_PTR(Study) theStudy)
         aPlane->setAuto(false);
 
       applyPlaneToAll(aPlane);
-      myPlanes->AddItem(aPlane);
+
+         myPlanes->AddItem(aPlane);
     }
   }
 }
index 7841a1a094df246120073c9b5791b4bce9e713e3..9357547bf86503f246a69e7bb6c624bf83a7d705 100644 (file)
@@ -76,7 +76,7 @@ public:
   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, 
index 973918268e3b371996d67fbeeff6da1328d5b1cf..f151528b21426a6310aa3880a20db9ab890ca8ac 100644 (file)
@@ -712,6 +712,7 @@ void VISU::PointMap3d_i::RemoveFromStudy()
 //----------------------------------------------------------------
 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;
index 60781b56423ccce1c83e27956b8c59d31ce2367b..77675648ba550e04d8ca47014677bf9a49e89571 100644 (file)
@@ -23,6 +23,8 @@
 //  Module : VISU
 //
 #include "VISU_Prs3dUtils.hh"
+#include "VISU_Prs3d_i.hh"
+#include "VISU_PointMap3d_i.hh"
 #include "SalomeApp_Study.h"
 #include "SALOME_Event.h"
 
@@ -31,8 +33,8 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   TSetModified
-  ::TSetModified(VISU::Prs3d_i* thePrs3d):
-    myPrs3d(thePrs3d)
+  ::TSetModified(VISU::PrsObject_i* thePrsObject):
+    myPrsObject(thePrsObject)
   {
     this->Modified();
   }
@@ -53,17 +55,29 @@ namespace VISU
       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));
   }
index 13d3abb1a09f71073f4b468cfc968721df0bc900..51d325751598bc4dd61e154534cf5cee9e893025 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef __VISU_PRS3D_UTILS_H__
 #define __VISU_PRS3D_UTILS_H__
 
-#include "VISU_Prs3d_i.hh"
+#include "VISU_PrsObject_i.hh"
 
 #include <vtkTimeStamp.h>
 
@@ -34,16 +34,16 @@ namespace VISU
   //----------------------------------------------------------------------------
   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 );
+  
 
   //----------------------------------------------------------------------------
 }
index 2ad74b3289ec4238e1f7ced4e54e8c8a861ab551..b66b023e2509f7041ceef4ec6459c8aa433ffa3c 100644 (file)
@@ -675,6 +675,7 @@ void
 VISU::Prs3d_i
 ::SetOffset(const CORBA::Float* theOffsets)
 {
+  VISU::TSetModified aModified(this);
   myOffset[0] = theOffsets[0];
   myOffset[1] = theOffsets[1];
   myOffset[2] = theOffsets[2];
@@ -688,6 +689,7 @@ VISU::Prs3d_i
            CORBA::Float theDy,
            CORBA::Float theDz)
 {
+  VISU::TSetModified aModified(this);
   myOffset[0] = theDx;
   myOffset[1] = theDy;
   myOffset[2] = theDz;
index 24d6ffae5e051fd065310a0887250c49e2c9e0c3..497166a38e43062e3488d62a6ccc8d0dd027c31b 100644 (file)
@@ -1500,24 +1500,31 @@ void VISU_TimeAnimation::run()
 
     // 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;
@@ -1526,18 +1533,29 @@ void VISU_TimeAnimation::run()
     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());
   }
 
@@ -1683,9 +1701,12 @@ bool VISU_TimeAnimation::checkAVIMaker() const
       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);
 }