]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merging from BR_DEBUG_3_2_0b1
authorouv <ouv@opencascade.com>
Mon, 19 Jun 2006 10:23:07 +0000 (10:23 +0000)
committerouv <ouv@opencascade.com>
Mon, 19 Jun 2006 10:23:07 +0000 (10:23 +0000)
194 files changed:
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_ImplicitFunctionWidget.hxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_PipeLineUtils.hxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_Plot3DPL.hxx
src/PIPELINE/VISU_ScalarBarActor.cxx
src/PIPELINE/VISU_ScalarBarActor.hxx
src/PIPELINE/VISU_ScalarBarCtrl.cxx
src/PIPELINE/VISU_ScalarBarCtrl.hxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx
src/PIPELINE/VISU_SphereWidget.cxx
src/PIPELINE/VISU_SphereWidget.hxx
src/PIPELINE/VISU_StreamLinesPL.cxx
src/PIPELINE/VISU_StreamLinesPL.hxx
src/PIPELINE/VISU_UsedPointsFilter.cxx
src/PIPELINE/VISU_UsedPointsFilter.hxx
src/PIPELINE/VISU_VectorsPL.cxx
src/PIPELINE/VISU_VectorsPL.hxx
src/PIPELINE/VISU_WidgetCtrl.cxx
src/PIPELINE/VISU_WidgetCtrl.hxx
src/PIPELINE/VISU_img2vti.cxx
src/VISUGUI/Makefile.in
src/VISUGUI/VISU_images.po
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_BuildProgressDlg.cxx
src/VISUGUI/VisuGUI_BuildProgressDlg.h
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_ClippingDlg.h
src/VISUGUI/VisuGUI_CursorDlg.cxx
src/VISUGUI/VisuGUI_CursorDlg.h
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.h
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.h
src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_DeformedShapeDlg.h
src/VISUGUI/VisuGUI_DialogRunner.cxx
src/VISUGUI/VisuGUI_DialogRunner.h
src/VISUGUI/VisuGUI_Displayer.cxx
src/VISUGUI/VisuGUI_Displayer.h
src/VISUGUI/VisuGUI_EditContainerDlg.cxx
src/VISUGUI/VisuGUI_EditContainerDlg.h
src/VISUGUI/VisuGUI_Factory.cxx
src/VISUGUI/VisuGUI_FileDlg.cxx
src/VISUGUI/VisuGUI_FileDlg.h
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.h
src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx
src/VISUGUI/VisuGUI_IsoSurfacesDlg.h
src/VISUGUI/VisuGUI_Module.cxx
src/VISUGUI/VisuGUI_Module.h
src/VISUGUI/VisuGUI_NameDlg.cxx
src/VISUGUI/VisuGUI_NameDlg.h
src/VISUGUI/VisuGUI_OffsetDlg.cxx
src/VISUGUI/VisuGUI_OffsetDlg.h
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.h
src/VISUGUI/VisuGUI_PopupTools.cxx
src/VISUGUI/VisuGUI_PopupTools.h
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx
src/VISUGUI/VisuGUI_ScalarBarDlg.h
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h
src/VISUGUI/VisuGUI_Selection.cxx
src/VISUGUI/VisuGUI_Selection.h
src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx
src/VISUGUI/VisuGUI_SetupPlot2dDlg.h
src/VISUGUI/VisuGUI_StreamLinesDlg.cxx
src/VISUGUI/VisuGUI_StreamLinesDlg.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_TimeAnimation.h
src/VISUGUI/VisuGUI_Timer.cxx
src/VISUGUI/VisuGUI_Timer.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_Tools.h
src/VISUGUI/VisuGUI_TransparencyDlg.cxx
src/VISUGUI/VisuGUI_TransparencyDlg.h
src/VISUGUI/VisuGUI_VectorsDlg.cxx
src/VISUGUI/VisuGUI_VectorsDlg.h
src/VISUGUI/VisuGUI_ViewTools.cxx
src/VISUGUI/VisuGUI_ViewTools.h
src/VISU_I/Makefile.in
src/VISU_I/VISUConfig.cc
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.hxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_I.cxx
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Plot3D_i.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_PrsObject_i.cc
src/VISU_I/VISU_PrsObject_i.hh
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_Result_i.hh
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_Table_i.hh
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.h
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh
src/VISU_I/VISU_ViewManager_i.cc
src/VISU_I/VISU_ViewManager_i.hh
src/VISU_I/VISU_View_i.cc
src/VISU_I/VISU_View_i.hh
src/VISU_SWIG/Makefile.in
src/VISU_SWIG/VISU_Example_01.py
src/VISU_SWIG/VISU_Example_02.py
src/VISU_SWIG/VISU_Example_03.py
src/VISU_SWIG/VISU_Example_04.py
src/VISU_SWIG/VISU_Example_05.py
src/VISU_SWIG/VISU_Example_06.py
src/VISU_SWIG/VISU_Gen_s.cc
src/VISU_SWIG/VISU_Gen_s.hh
src/VISU_SWIG/VISU_shared_modules.py
src/VISU_SWIG/batch_test_events.py
src/VISU_SWIG/batchmode_visu.py
src/VISU_SWIG/batchmode_visu_table.py
src/VISU_SWIG/batchmode_visu_view.py
src/VISU_SWIG/batchmode_visu_view3d.py
src/VISU_SWIG/libVISU_Swig.i
src/VISU_SWIG/test_events.py
src/VISU_SWIG/visu.py
src/VISU_SWIG/visu_big_table.py
src/VISU_SWIG/visu_delete.py
src/VISU_SWIG/visu_gui.py
src/VISU_SWIG/visu_med.py
src/VISU_SWIG/visu_prs_example.py
src/VISU_SWIG/visu_split_views.py
src/VISU_SWIG/visu_swig_test.py
src/VISU_SWIG/visu_table.py
src/VISU_SWIG/visu_view.py
src/VISU_SWIG/visu_view3d.py
src/VVTK/Makefile.in
src/VVTK/VVTK.h
src/VVTK/VVTK_ImageWriter.cxx
src/VVTK/VVTK_ImageWriter.h
src/VVTK/VVTK_ImageWriterMgr.cxx
src/VVTK/VVTK_ImageWriterMgr.h
src/VVTK/VVTK_InteractorStyle.cxx
src/VVTK/VVTK_InteractorStyle.h
src/VVTK/VVTK_MainWindow.cxx
src/VVTK/VVTK_MainWindow.h
src/VVTK/VVTK_PickingDlg.cxx
src/VVTK/VVTK_PickingDlg.h
src/VVTK/VVTK_PrimitiveBox.cxx
src/VVTK/VVTK_PrimitiveBox.h
src/VVTK/VVTK_Recorder.cxx
src/VVTK/VVTK_Recorder.h
src/VVTK/VVTK_RecorderDlg.cxx
src/VVTK/VVTK_RecorderDlg.h
src/VVTK/VVTK_Renderer.cxx
src/VVTK/VVTK_Renderer.h
src/VVTK/VVTK_SegmentationCursorDlg.cxx
src/VVTK/VVTK_SegmentationCursorDlg.h
src/VVTK/VVTK_SizeBox.cxx
src/VVTK/VVTK_SizeBox.h
src/VVTK/VVTK_ViewManager.cxx
src/VVTK/VVTK_ViewManager.h
src/VVTK/VVTK_ViewModel.cxx
src/VVTK/VVTK_ViewModel.h
src/VVTK/VVTK_ViewWindow.cxx
src/VVTK/VVTK_ViewWindow.h

index 9ef8be9188272715b39f9837d0b6d1c1d4d5dae4..3ffc756480d8959e83d6a04f045c343d064e6cec 100644 (file)
@@ -196,7 +196,6 @@ VISU_GaussPointsPL
   Superclass::Init();
 
   vtkDataSet* aDataSet = GetParentMesh();
-
   vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
 
   vtkFloatingPointType* aScalarRange = GetScalarRange();
index 9302f044569ed442c8b0405715199a5a14477dcf..55632fd5ebf4c841e631f64ffb38cfb5330c3176 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "VISUPipeline.hxx"
 
+#include "VTKViewer.h"
+
 class VISU_UnScaledActor: public vtkFollower
 {
   
index 4bd9a959737b2c377d6a5542d5ed55561c5cc283..9e4f8d8e1490eedfe56e977fb178c4d76fcdccb2 100755 (executable)
@@ -767,7 +767,7 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(vtkPoints *thePoints,
     aVertex.vy = aCoords[1];
     aVertex.vz = aCoords[2];
 
-    int aRed, aGreen, aBlue;
+    int aRed = 0, aGreen = 0, aBlue = 0;
     if( theColors && this->PointSpriteMode != 1 )
     {
       unsigned char *col = theColors->GetPointer(pts[0] << 2);
index dcf331ec89778455beefee863b794352383b9512..4f87eaea64dc7ee0f7cbd7e0d5a0885ad82124e5 100644 (file)
 
 #endif
 
-namespace VISU{
-  VISU_PIPELINE_EXPORT void Mul(const float A[3], float b, float C[3]); // C = A * b
-  VISU_PIPELINE_EXPORT void Sub(const float A[3], const float B[3], float C[3]); // C = A - B
+namespace VISU
+{
+  void
+  Mul(const vtkFloatingPointType A[3], 
+      vtkFloatingPointType b, 
+      vtkFloatingPointType C[3]); // C = A * b
+  
+  void
+  Sub(const vtkFloatingPointType A[3], 
+      const vtkFloatingPointType B[3], 
+      vtkFloatingPointType C[3]); // C = A - B
 
   template<class TItem> 
   void
index 164d9a7ac6fb06377105d9c7d98417f243364dd4..2b87e56f32ba96130af4c7a0868ce2f8f0164a7b 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.cxx
@@ -86,9 +86,9 @@ GetOrientation(vtkDataSet* theDataSet)
 {
   theDataSet->Update();
 
-  float aBounds[6];
+  vtkFloatingPointType aBounds[6];
   theDataSet->GetBounds(aBounds);
-  float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
+  vtkFloatingPointType aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
 
   if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2])
     if(aDelta[1] >= aDelta[2])
@@ -111,18 +111,18 @@ GetOrientation(vtkDataSet* theDataSet)
   return VISU_CutPlanesPL::XY;
 }
 
-float
+vtkFloatingPointType
 VISU_Plot3DPL::
 GetScaleFactor(vtkDataSet* theDataSet)
 {
   theDataSet->Update();
-  float aLength = theDataSet->GetLength(); // diagonal length
+  vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length
 
-  float aScalarRange[2];
+  vtkFloatingPointType aScalarRange[2];
   GetSourceRange(aScalarRange);
 
-  static float EPS = 0.3;
-  float aRange = aScalarRange[1];
+  static vtkFloatingPointType EPS = 0.3;
+  vtkFloatingPointType aRange = aScalarRange[1];
   if(aRange > 0.0)
     return aLength / aRange * EPS;
 
@@ -150,8 +150,8 @@ void
 VISU_Plot3DPL::
 Update()
 {
-  float aPlaneNormal[3];
-  float anOrigin[3];
+  vtkFloatingPointType aPlaneNormal[3];
+  vtkFloatingPointType anOrigin[3];
   GetBasePlane( anOrigin, aPlaneNormal );
 
   vtkPolyData* aPolyData = 0;
@@ -198,7 +198,7 @@ Update()
     }else
       myContourFilter->SetInput(aPolyData);
 
-    float aScalarRange[2];
+    vtkFloatingPointType aScalarRange[2];
     GetSourceRange(aScalarRange);
 
     myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange);
@@ -232,13 +232,13 @@ GetNumberOfContours() const
 
 void
 VISU_Plot3DPL::
-SetScaleFactor(float theScaleFactor)
+SetScaleFactor(vtkFloatingPointType theScaleFactor)
 {
   myScaleFactor = theScaleFactor;
   myWarpScalar->SetScaleFactor(theScaleFactor);
 }
 
-float
+vtkFloatingPointType
 VISU_Plot3DPL::
 GetScaleFactor() const
 {
@@ -247,7 +247,7 @@ GetScaleFactor() const
 
 void
 VISU_Plot3DPL::
-SetPlanePosition(float thePosition,
+SetPlanePosition(vtkFloatingPointType thePosition,
                 bool theIsRelative)
 {
   myIsRelative = theIsRelative;
@@ -269,7 +269,7 @@ GetPlaneOrientation() const
 }
 
 
-float
+vtkFloatingPointType
 VISU_Plot3DPL::
 GetRotateX()
 {
@@ -281,7 +281,7 @@ GetRotateX()
   return 0;
 }
 
-float
+vtkFloatingPointType
 VISU_Plot3DPL::
 GetRotateY(){
   switch(myOrientation){
@@ -295,8 +295,8 @@ GetRotateY(){
 void
 VISU_Plot3DPL::
 SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
-              float theXAngle,
-              float theYAngle)
+              vtkFloatingPointType theXAngle,
+              vtkFloatingPointType theYAngle)
 {
   switch(theOrientation){
   case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break;
@@ -311,7 +311,7 @@ SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
   myOrientation = theOrientation;
 }
 
-float
+vtkFloatingPointType
 VISU_Plot3DPL::
 GetPlanePosition() const
 {
@@ -323,14 +323,14 @@ GetPlanePosition() const
 //purpose  :
 //=======================================================================
 
-void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
-                                 float theNormal[3],
+void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3],
+                                 vtkFloatingPointType theNormal[3],
                                  bool  theCenterOrigine ) const
 {
   VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
 
-  float aPosition = myPosition;
-  float aBounds[6], aBoundPrj[3];
+  vtkFloatingPointType aPosition = myPosition;
+  vtkFloatingPointType aBounds[6], aBoundPrj[3];
   if ( myIsRelative )
   {
     GetInput()->GetBounds(aBounds);
@@ -342,7 +342,7 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
   if ( theCenterOrigine ) {
     // move theOrigin to the center of aBounds projections to the plane
     GetInput2()->GetBounds(aBounds);
-    float boundPoints[8][3] = {
+    vtkFloatingPointType boundPoints[8][3] = {
       {aBounds[0],aBounds[2],aBounds[4]},
       {aBounds[1],aBounds[2],aBounds[4]},
       {aBounds[0],aBounds[3],aBounds[4]},
@@ -351,9 +351,9 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
       {aBounds[1],aBounds[2],aBounds[5]},
       {aBounds[0],aBounds[3],aBounds[5]},
       {aBounds[1],aBounds[3],aBounds[5]}};
-    float newOrigin[3] = { 0,0,0 };
+    vtkFloatingPointType newOrigin[3] = { 0,0,0 };
     for(int i = 0; i < 8; i++) {
-      float proj[3];
+      vtkFloatingPointType proj[3];
       vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj );
       newOrigin[0] += proj[0];
       newOrigin[1] += proj[1];
@@ -370,9 +370,10 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
 //purpose  : return absolute position range
 //=======================================================================
 
-void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const
+void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos, 
+                                      vtkFloatingPointType& maxPos ) const
 {
-  float aBounds[6], aBoundPrj[3], aNormal[3];
+  vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
   VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
   GetInput()->GetBounds(aBounds);
   VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal);
@@ -385,14 +386,14 @@ void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const
 //purpose  :
 //=======================================================================
 
-void VISU_Plot3DPL::SetMapScale(float theMapScale)
+void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale)
 {
   VISU_ScalarMapPL::SetMapScale(theMapScale);
 
   if ( myIsContour ) {
-    float aRange[2];
+    vtkFloatingPointType aRange[2];
     GetSourceRange(aRange);
-    float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
+    vtkFloatingPointType aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
     myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange);
   }
   myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale);
index 0f620c384f235f870ca9912d205106db716cf6cb..d98d7b3887a08d2c2ad34b46e760b3aa24b41208 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_CutPlanesPL.hxx
@@ -53,31 +53,31 @@ public:
   VISU_CutPlanesPL::PlaneOrientation
   GetPlaneOrientation() const;
 
-  float
+  vtkFloatingPointType
   GetRotateX();
 
-  float
+  vtkFloatingPointType
   GetRotateY();
 
   void
   SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
-                float theXAngle = 0.0,
-                float theYAngle = 0.0);
+                vtkFloatingPointType theXAngle = 0.0,
+                vtkFloatingPointType theYAngle = 0.0);
 
-  float
+  vtkFloatingPointType
   GetPlanePosition() const;
 
   bool
   IsPositionRelative() const;
 
   void
-  SetPlanePosition(float thePosition,
+  SetPlanePosition(vtkFloatingPointType thePosition,
                   bool theIsRelative);
 
   void
-  SetScaleFactor(float theScaleFactor);
+  SetScaleFactor(vtkFloatingPointType theScaleFactor);
 
-  float
+  vtkFloatingPointType
   GetScaleFactor() const;
 
   void
@@ -92,11 +92,12 @@ public:
   int
   GetNumberOfContours() const;
 
-  void GetBasePlane (float theOrigin[3],
-                     float theNormal[3],
+  void GetBasePlane (vtkFloatingPointType theOrigin[3],
+                     vtkFloatingPointType theNormal[3],
                      bool  theCenterOrigine = false ) const;
 
-  void GetMinMaxPosition( float& minPos, float& maxPos ) const;
+  void GetMinMaxPosition( vtkFloatingPointType& minPos, 
+                         vtkFloatingPointType& maxPos ) const;
 
 public:
   virtual void Init();
@@ -106,17 +107,17 @@ public:
   VISU_CutPlanesPL::PlaneOrientation
   GetOrientation(vtkDataSet* theDataSet);
 
-  float
+  vtkFloatingPointType
   GetScaleFactor(vtkDataSet* theDataSet);
 
-  void SetMapScale(float theMapScale);
+  void SetMapScale(vtkFloatingPointType theMapScale);
 
 protected:
   virtual THook* DoHook();
 
-  float myAngle[3];
+  vtkFloatingPointType myAngle[3];
   bool myIsRelative, myIsContour;
-  float myPosition, myScaleFactor;
+  vtkFloatingPointType myPosition, myScaleFactor;
   VISU_CutPlanesPL::PlaneOrientation myOrientation;
 
   TVTKSmartPtr<vtkCellDataToPointData> myCellDataToPointData;
index 9c503acec01af1e58da0b18ef52a80ff7e98b0b0..058f302554e47b2d8431031304ef44b9949f5650 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.hxx
@@ -258,7 +258,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     
     // we hard code how many steps to display
     int numColors = this->MaximumNumberOfColors;
-    float *range = lut->GetRange();
+    vtkFloatingPointType *range = lut->GetRange();
 
     int numPts = 2*(numColors + 1);
     vtkPoints *pts = vtkPoints::New();
@@ -315,13 +315,13 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     this->NumberOfLabelsBuilt = this->NumberOfLabels;
     
     // generate points
-    float x[3]; x[2] = 0.0;
-    float delta, val;
+    vtkFloatingPointType x[3]; x[2] = 0.0;
+    vtkFloatingPointType delta, val;
     if ( this->Orientation == VTK_ORIENT_VERTICAL )
       {
       barWidth = size[0] - 4 - labelSize[0];
       barHeight = (int)(0.86*size[1]);
-      delta=(float)barHeight/numColors;
+      delta=(vtkFloatingPointType)barHeight/numColors;
       for (i=0; i<numPts/2; i++)
         {
         x[0] = 0;
@@ -335,7 +335,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       {
       barWidth = size[0];
       barHeight = (int)(0.4*size[1]);
-      delta=(float)barWidth/numColors;
+      delta=(vtkFloatingPointType)barWidth/numColors;
       for (i=0; i<numPts/2; i++)
         {
         x[0] = i*delta;
@@ -358,12 +358,12 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       polys->InsertNextCell(4,ptIds);
 
       if ( isLogTable ){ //SALOME specific
-        float rgbval = log10(range[0]) + 
+        vtkFloatingPointType rgbval = log10(range[0]) + 
           i*(log10(range[1])-log10(range[0]))/(numColors -1);
         rgba = lut->MapValue(rgbval);
       }else{
         rgba = lut->MapValue(range[0] + (range[1] - range[0])*
-                             ((float)i /(numColors-1.0)));
+                             ((vtkFloatingPointType)i /(numColors-1.0)));
       }
 
       rgb = colors->GetPointer(3*i); //write into array directly
@@ -383,7 +383,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       
       for (i=0; i < this->NumberOfLabels; i++)
         {
-        val = (float)i/(this->NumberOfLabels-1) *barHeight;
+        val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight;
         this->TextMappers[i]->GetSize(viewport,sizeTextData);
         this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft();
         this->TextActors[i]->SetPosition(barWidth+3,
@@ -397,7 +397,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
       for (i=0; i < this->NumberOfLabels; i++)
         {
         this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered();
-        val = (float)i/(this->NumberOfLabels-1) * barWidth;
+        val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth;
         this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
         }
       }
@@ -503,7 +503,7 @@ void VISU_ScalarBarActor::ShallowCopy(vtkProp *prop)
 
 void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
                                               vtkViewport *viewport,
-                                              float *range)
+                                              vtkFloatingPointType *range)
 {
   labelSize[0] = labelSize[1] = 0;
 
@@ -512,7 +512,7 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
 
   char string[512];
 
-  float val;
+  vtkFloatingPointType val;
   int i;
   
   // TODO: this should be optimized, maybe by keeping a list of
@@ -529,11 +529,11 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
     this->TextMappers[i] = vtkTextMapper::New();
 
     if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific
-      float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) *
+      vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) *
         (log10(range[1])-log10(range[0]));
       val = pow((double)10,(double)lval);
     }else{
-      val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
+      val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
     }
     sprintf(string, this->LabelFormat, val);
     this->TextMappers[i]->SetInput(string);
index dfaaf137518400c8dd41071257c74c3923e5670e..598f70ae18b668bc1c695b0a8e41b2a5b432e5bb 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.hxx
@@ -139,7 +139,7 @@ protected:
 
   vtkTextMapper **TextMappers;
   virtual void AllocateAndSizeLabels(int *labelSize, int *size,
-                                     vtkViewport *viewport, float *range);
+                                     vtkViewport *viewport, vtkFloatingPointType *range);
 
 private:
   vtkTextMapper *TitleMapper;
index 561b243289bbba59fe0e05bffbaaede08b486c49..624159f5a83a2e46e70caa1851fb322031f410ab 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_ScalarBarCtrl.cxx
@@ -45,7 +45,7 @@ namespace
   inline
   void
   MarkValueByColor(vtkLookupTable* theTable,
-                  float theValue,
+                  vtkFloatingPointType theValue,
                   unsigned char* theColor)
   { 
     vtkIdType anIndex = theTable->GetIndex(theValue);
@@ -81,12 +81,12 @@ namespace
     unsigned char aRedPtr[3] = {255, 0, 0};
     unsigned char aBluePtr[3] = {0, 0, 255};
 
-    float aRange[2];
+    vtkFloatingPointType aRange[2];
     theTable->GetTableRange(aRange);
     vtkIdType aNbColors = theTable->GetNumberOfColors();
 
-    float aDelta = (aRange[1]-aRange[0])/aNbColors;
-    float aValue = aRange[0]+0.5*aDelta;
+    vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
+    vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
     for(int i = 0; i < aNbColors; i++){
       vtkIdType anIndex = theTable->GetIndex(aValue);
       unsigned char* aTablePtr = theTable->GetPointer(anIndex);
@@ -206,15 +206,15 @@ VISU_ScalarBarCtrl
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetRangeLocal(float *theRange)
+::SetRangeLocal(vtkFloatingPointType *theRange)
 {
   myLocalLookupTable->SetTableRange(theRange);
 }
 
 void
 VISU_ScalarBarCtrl
-::SetRangeLocal(float theMin,
-               float theMax)
+::SetRangeLocal(vtkFloatingPointType theMin,
+               vtkFloatingPointType theMax)
 {
   myLocalLookupTable->SetTableRange(theMin,theMax);
 }
@@ -223,15 +223,15 @@ VISU_ScalarBarCtrl
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetRangeGlobal(float *theRange)
+::SetRangeGlobal(vtkFloatingPointType *theRange)
 {
   myGlobalLookupTable->SetTableRange(theRange);
 }
 
 void
 VISU_ScalarBarCtrl
-::SetRangeGlobal(float theMin,
-                float theMax)
+::SetRangeGlobal(vtkFloatingPointType theMin,
+                vtkFloatingPointType theMax)
 {
   myGlobalLookupTable->SetTableRange(theMin,theMax);
 }
@@ -298,13 +298,13 @@ VISU_ScalarBarCtrl
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetWidth(float theWidth)
+::SetWidth(vtkFloatingPointType theWidth)
 {
   myGlobalScalarBar->SetWidth(theWidth);
   myLocalScalarBar->SetWidth(theWidth);
 }
 
-float
+vtkFloatingPointType
 VISU_ScalarBarCtrl
 ::GetWidth() const
 {
@@ -315,14 +315,14 @@ VISU_ScalarBarCtrl
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetHeight(float theHeight)
+::SetHeight(vtkFloatingPointType theHeight)
 {
   myGlobalScalarBar->SetHeight(theHeight);
   myLocalScalarBar->SetHeight(theHeight);
 }
 
 
-float
+vtkFloatingPointType
 VISU_ScalarBarCtrl
 ::GetHeight() const
 {
@@ -333,13 +333,13 @@ VISU_ScalarBarCtrl
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetPosition(const float* thePosition)
+::SetPosition(const vtkFloatingPointType* thePosition)
 {
   myPosition[0] = thePosition[0];
   myPosition[1] = thePosition[1];
 }
 
-const float
+const vtkFloatingPointType
 VISU_ScalarBarCtrl::GetPosition() const
 {
   return myPosition;
@@ -349,12 +349,12 @@ VISU_ScalarBarCtrl::GetPosition() const
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
 {
   myDistance = theSpacing;
 }
 
-float
+vtkFloatingPointType
 VISU_ScalarBarCtrl
 ::GetSpacing() const
 {
@@ -381,12 +381,12 @@ VISU_ScalarBarCtrl
 //----------------------------------------------------------------------------
 void
 VISU_ScalarBarCtrl
-::SetMarkValue(const float theValue) 
+::SetMarkValue(const vtkFloatingPointType theValue) 
 {
   myMarkedValue = theValue;
 }
 
-float
+vtkFloatingPointType
 VISU_ScalarBarCtrl
 ::GetMarkValue() const
 {
@@ -441,7 +441,7 @@ VISU_ScalarBarCtrl
     }
   }
   if(myGlobalRangeIsDefined){
-    float aLocalRange[2];
+    vtkFloatingPointType aLocalRange[2];
     myLocalLookupTable->GetTableRange(aLocalRange);
     MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack);
     MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack);
@@ -459,10 +459,10 @@ VISU_ScalarBarCtrl
   vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate();
   aCoordinate->SetCoordinateSystemToNormalizedViewport();
   if(theScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL){
-    float aWidth = theScalarBarActor->GetWidth();
+    vtkFloatingPointType aWidth = theScalarBarActor->GetWidth();
     aCoordinate->SetValue(myPosition[0]+theId*(aWidth+myDistance), myPosition[1]);
   }else{ 
-    float aHeight = theScalarBarActor->GetHeight();
+    vtkFloatingPointType aHeight = theScalarBarActor->GetHeight();
     aCoordinate->SetValue(myPosition[0], myPosition[1]+theId*(aHeight+myDistance));
   }
   // Initialize Lookup Tables and Scalar Bars 
index 2d8387bfc881083dd772e2c6c049507041e6ee2d..17f754144659bd825cf4dc5ab1d719ac5cde5bdb 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_ScalarBarCtrl.hxx
@@ -31,6 +31,8 @@
 
 #include <vtkObject.h>
 
+#include "VTKViewer.h"
+
 class vtkRenderer;
 class vtkLookupTable;
 class vtkScalarBarActor;
@@ -39,88 +41,147 @@ class VISU_PIPELINE_EXPORT VISU_ScalarBarCtrl :  public vtkObject
 {
 public:
   vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
-  static VISU_ScalarBarCtrl* New();
+  static
+  VISU_ScalarBarCtrl* 
+  New();
 
   enum EMode {eSimple, eGlobal, eLocal};
 
   // Mode
-  void SetMode(EMode theMode);
-  EMode GetMode() const;
+  void
+  SetMode(EMode theMode);
+
+  EMode 
+  GetMode() const;
 
   // Ranges
-  void SetRangeGlobal(float theMin,
-                     float theMax);
-  void SetRangeGlobal(float *theRange);
+  void
+  SetRangeGlobal(vtkFloatingPointType theMin,
+                vtkFloatingPointType theMax);
+  void 
+  SetRangeGlobal(vtkFloatingPointType *theRange);
 
-  void SetGlobalRangeIsDefined(bool theIsDefined);
+  void
+  SetGlobalRangeIsDefined(bool theIsDefined);
   
-  void SetRangeLocal(float theMin,
-                    float theMax);
-  void SetRangeLocal(float *theRange);
+  void
+  SetRangeLocal(vtkFloatingPointType theMin,
+               vtkFloatingPointType theMax);
+  void 
+  SetRangeLocal(vtkFloatingPointType *theRange);
   
   // Selectors
-  vtkScalarBarActor* GetLocalBar();
-  vtkLookupTable* GetLocalTable();
+  vtkScalarBarActor* 
+  GetLocalBar();
+
+  vtkLookupTable* 
+  GetLocalTable();
+
+  vtkScalarBarActor* 
+  GetGlobalBar();
 
-  vtkScalarBarActor* GetGlobalBar();
-  vtkLookupTable* GetGlobalTable();
+  vtkLookupTable* 
+  GetGlobalTable();
   //
   // Renderer
-  void AddToRender(vtkRenderer* theRenderer); 
-  void RemoveFromRender(vtkRenderer* theRenderer);
+  void
+  AddToRender(vtkRenderer* theRenderer); 
+
+  void
+  RemoveFromRender(vtkRenderer* theRenderer);
   //
   // Visibility
-  void SetVisibility(int theFlag);
-  int  GetVisibility() const;
-  //
+  void
+  SetVisibility(int theFlag);
+
+  int
+  GetVisibility() const;
+
   // Visibility
-  void SetCtrlVisibility(int theFlag);
-  int GetCtrlVisibility() const;
-  //
+  void
+  SetCtrlVisibility(int theFlag);
+
+  int
+  GetCtrlVisibility() const;
+
   // Build
   void Update();
-  //
+
   // Position
-  void  SetWidth(const float theWidth);
-  float GetWidth()const;
-  void  SetHeight(const float theHeight);
-  float GetHeight()const;
-  void  SetPosition(const float* thePosition);
-  const float* GetPosition()const;
+  void
+  SetWidth(const vtkFloatingPointType theWidth);
+
+  vtkFloatingPointType
+  GetWidth() const;
+
+  void  
+  SetHeight(const vtkFloatingPointType theHeight);
+
+  vtkFloatingPointType
+  GetHeight() const;
+
+  void
+  SetPosition(const vtkFloatingPointType* thePosition);
+  
+  const vtkFloatingPointType* 
+  GetPosition() const;
   //
   // Spacing
-  void  SetSpacing(const float theSpacing);
-  float GetSpacing()const;
+  void
+  SetSpacing(const vtkFloatingPointType theSpacing);
+
+  vtkFloatingPointType
+  GetSpacing() const;
   //
   // Rainbow/bicolor
-  bool  GetBicolor() const;
-  void  SetBicolor(const bool theBicolor);
+  bool
+  GetBicolor() const;
+
+  void
+  SetBicolor(const bool theBicolor);
   //
   // Misc
-  void  SetMarkValue (const float theValue);
-  float GetMarkValue  ()const;
-  void  SetIsMarked(const bool theFlag);
-  bool  GetIsMarked()const;
+  void  
+  SetMarkValue(const vtkFloatingPointType theValue);
+
+  vtkFloatingPointType
+  GetMarkValue() const;
+
+  void
+  SetIsMarked(const bool theFlag);
+
+  bool
+  GetIsMarked()const;
   //
 protected:
   VISU_ScalarBarCtrl();
-  virtual ~VISU_ScalarBarCtrl();
+
+  virtual
+  ~VISU_ScalarBarCtrl();
   
-  void UpdateForBicolor();
-  void UpdateForColor();
-  void UpdateMarkValue();
-  void PrepareTables();
+  void
+  UpdateForBicolor();
+
+  void
+  UpdateForColor();
+
+  void
+  UpdateMarkValue();
+
+  void
+  PrepareTables();
   
-  void PrepareTables(vtkScalarBarActor* theScalarBarActor,
-                    vtkLookupTable *theLookupTable,
-                    vtkIdType theId);
+  void
+  PrepareTables(vtkScalarBarActor* theScalarBarActor,
+               vtkLookupTable *theLookupTable,
+               vtkIdType theId);
   
 protected:
   EMode myMode;
   bool myGlobalRangeIsDefined;
 
-  float myDistance;
-  float myPosition[2];
+  vtkFloatingPointType myDistance;
+  vtkFloatingPointType myPosition[2];
   bool  myBicolor;
   int   myCtrlVisibility;
 
@@ -128,7 +189,7 @@ protected:
   unsigned char myGrey[3];
   //
   bool  myMarked;
-  float myMarkedValue;
+  vtkFloatingPointType myMarkedValue;
   //
   vtkScalarBarActor *myGlobalScalarBar;
   vtkLookupTable *myGlobalLookupTable; 
index 0d0ccad5785aaaf080fb39e8d92dccd83e4e4160..14412af80da28366683e390e0d53cb47f92bf96f 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_ScalarMapOnDeformedShapePL.cxx
@@ -48,7 +48,9 @@ vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL)
  * Merge filter which unify the deformation and scalars
  * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
 */
-VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::VISU_ScalarMapOnDeformedShapePL()
+{
   myDeformVectors = vtkWarpVector::New();
   myMergeFilter   = vtkMergeFilter::New();
   myExtractorScalars = VISU_Extractor::New();
@@ -59,7 +61,9 @@ VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){
  * Destructor.
  * Delete all fields.
 */
-VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::~VISU_ScalarMapOnDeformedShapePL()
+{
   myDeformVectors->UnRegisterAllOutputs();
   myDeformVectors->Delete();
 
@@ -76,13 +80,15 @@ VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){
 /*!
  * Initial method
  */
-void VISU_ScalarMapOnDeformedShapePL::Init(){
-
+void
+VISU_ScalarMapOnDeformedShapePL
+::Init()
+{
   if (GetScalars() == NULL) SetScalars(GetInput2());
   
   Superclass::Init();
   
-  float aScalarRange[2];
+  vtkFloatingPointType aScalarRange[2];
   GetSourceRange(aScalarRange);
   static double EPS = 1.0 / VTK_LARGE_FLOAT;
   if(aScalarRange[1] > EPS)
@@ -102,7 +108,9 @@ void VISU_ScalarMapOnDeformedShapePL::Init(){
  * Build method
  * Building of deformation and puts result to merge filter.
  */
-void VISU_ScalarMapOnDeformedShapePL::Build()
+void
+VISU_ScalarMapOnDeformedShapePL
+::Build()
 {
   // Set input for extractor
   myExtractor->SetInput(GetInput2());
@@ -119,12 +127,15 @@ void VISU_ScalarMapOnDeformedShapePL::Build()
 /*!
  *  Update method
  */
-void VISU_ScalarMapOnDeformedShapePL::Update(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::Update()
+{
   this->UpdateScalars();
   
-  float aRange[2];
+  vtkFloatingPointType aRange[2];
   GetSourceRange(aRange);
-  float aScalarRange[2] = {aRange[0], aRange[1]};
+  vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
   
   if(myBarTable->GetScale() == VTK_SCALE_LOG10)
     VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
@@ -143,7 +154,10 @@ void VISU_ScalarMapOnDeformedShapePL::Update(){
  * Update scalars method.
  * Put scalars to merge filter.
  */
-void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::UpdateScalars()
+{
   if(myScalars->GetCellData()->GetVectors() != NULL ||
      myScalars->GetPointData()->GetVectors() != NULL)
     myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
@@ -155,12 +169,15 @@ void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){
  * Copy information about pipline.
  * Copy scale and scalars.
  */
-void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_ScalarMapOnDeformedShapePL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
   VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
   if(aPipeLine){
      SetScale(aPipeLine->GetScale());
      SetScalars(aPipeLine->GetScalars());
-     float aRange[2];
+     vtkFloatingPointType aRange[2];
      aPipeLine->GetSourceRange(aRange);
      SetScalarRange(aRange);
   }
@@ -171,7 +188,10 @@ void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
  * Set scalars.
  * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
  */
-void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalars(vtkDataSet *theScalars)
+{
   myScalars = theScalars;
   vtkUnstructuredGrid* aScalars = GetScalars();
   myExtractorScalars->SetInput(aScalars);
@@ -181,14 +201,20 @@ void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){
 /*!
  * Get pointer to input scalars.
  */
-vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){
+vtkUnstructuredGrid* 
+VISU_ScalarMapOnDeformedShapePL
+::GetScalars()
+{
   return myScalars.GetPointer();
 }
 
 /*!
  * Sets scale for deformed shape
  */
-void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) {
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScale(vtkFloatingPointType theScale) 
+{
   if(myScaleFactor == theScale) return;
   myScaleFactor = theScale;
   myDeformVectors->SetScaleFactor(myScaleFactor);
@@ -198,15 +224,21 @@ void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) {
 /*!
  * Gets scale of deformed shape.
  */
-float VISU_ScalarMapOnDeformedShapePL::GetScale() {
-  float aScale=myDeformVectors->GetScaleFactor();
+vtkFloatingPointType
+VISU_ScalarMapOnDeformedShapePL
+::GetScale() 
+{
+  vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor();
   return aScale;
 }
 
 /*!
  * Set scale factor of deformation.
  */
-void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
   myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale);
   Modified();
 }
@@ -214,7 +246,10 @@ void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){
 /*!
  * Gets scalar mode.
  */
-int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){
+int
+VISU_ScalarMapOnDeformedShapePL
+::GetScalarMode()
+{
   int aMode=myExtractorScalars->GetScalarMode();
   return aMode;
 }
@@ -222,7 +257,10 @@ int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){
 /*!
  * Sets scalar mode.
  */
-void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalarMode(int theScalarMode)
+{
   myExtractorScalars->SetScalarMode(theScalarMode);
   Modified();
 }
@@ -233,7 +271,10 @@ void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){
  * \li theRange[0] - minimum value
  * \li theRange[1] - maximum value
  */
-void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){
+void 
+VISU_ScalarMapOnDeformedShapePL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
   myExtractorScalars->Update();
   myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange);
 }
index 69ecbe0ca06c8931bc99b4420783a0fcc5568b0a..797c91d85dbef05948a794a6f7129824148fbee9 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_ScalarMapOnDeformedShapePL.hxx
@@ -51,13 +51,13 @@ public:
 
   virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
 
-  virtual void SetScale(float theScale);
-  virtual float GetScale();
+  virtual void SetScale(vtkFloatingPointType theScale);
+  virtual vtkFloatingPointType GetScale();
 
   virtual int GetScalarMode();
   virtual void SetScalarMode(int theScalarMode = 0);
 
-  virtual void GetSourceRange(float theRange[2]);
+  virtual void GetSourceRange(vtkFloatingPointType theRange[2]);
 
   virtual void SetScalars(vtkDataSet *theScalars);
   virtual vtkUnstructuredGrid* GetScalars();
@@ -82,10 +82,10 @@ public:
   void
   UpdateScalars();
   
-  virtual void SetMapScale(float theMapScale = 1.0);
+  virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0);
   
 protected:
-  float myScaleFactor;
+  vtkFloatingPointType myScaleFactor;
   vtkWarpVector  *myDeformVectors;
   vtkMergeFilter *myMergeFilter;
   vtkSmartPointer<vtkUnstructuredGrid> myScalars;
index daaa24e689af776bfd498cc6b9c65aed5d312303..0c6b990328b57d3bff5dabf721b35ae914757bd5 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -142,7 +142,7 @@ VISU_ScalarMapPL
 
 
 //----------------------------------------------------------------------------
-float
+vtkFloatingPointType
 VISU_ScalarMapPL
 ::GetScalarRange() 
 {
@@ -151,7 +151,7 @@ VISU_ScalarMapPL
 
 void
 VISU_ScalarMapPL
-::SetScalarRange(float theRange[2])
+::SetScalarRange(vtkFloatingPointType theRange[2])
 {
   myFieldTransform->SetScalarRange(theRange);
   myBarTable->SetRange(theRange);
@@ -160,17 +160,17 @@ VISU_ScalarMapPL
 
 void
 VISU_ScalarMapPL
-::SetScalarMin(float theValue)
+::SetScalarMin(vtkFloatingPointType theValue)
 {
-  float aScalarRange[2] = {theValue, GetScalarRange()[1]};
+  vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
   SetScalarRange(aScalarRange);
 }
 
 void
 VISU_ScalarMapPL
-::SetScalarMax(float theValue)
+::SetScalarMax(vtkFloatingPointType theValue)
 {
-  float aScalarRange[2] = {GetScalarRange()[0], theValue};
+  vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
   SetScalarRange(aScalarRange);
 }
 
@@ -224,8 +224,8 @@ void
 VISU_ScalarMapPL
 ::Update() 
 { 
-  float *aRange = myFieldTransform->GetScalarRange();
-  float aScalarRange[2] = {aRange[0], aRange[1]};
+  vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange();
+  vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
   if(myBarTable->GetScale() == VTK_SCALE_LOG10)
     VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
   myMapperTable->SetRange(aScalarRange);
@@ -259,13 +259,13 @@ VISU_ScalarMapPL
 //----------------------------------------------------------------------------
 void 
 VISU_ScalarMapPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
 {
   myMapperTable->SetMapScale(theMapScale);
   myMapperTable->Build();
 }
 
-float
+vtkFloatingPointType
 VISU_ScalarMapPL::GetMapScale()
 {
   return myMapperTable->GetMapScale();
@@ -275,7 +275,7 @@ VISU_ScalarMapPL::GetMapScale()
 //----------------------------------------------------------------------------
 void
 VISU_ScalarMapPL
-::GetSourceRange(float theRange[2])
+::GetSourceRange(vtkFloatingPointType theRange[2])
 {
   myExtractor->Update();
   myExtractor->GetOutput()->GetScalarRange(theRange);
@@ -285,7 +285,7 @@ void
 VISU_ScalarMapPL
 ::SetSourceRange()
 {
-  float aRange[2];
+  vtkFloatingPointType aRange[2];
   GetSourceRange(aRange);
   SetScalarRange(aRange);
 }
index 0672dbd510f9b7aec31ed9f0c8f89ba4ae2b1c45..b1b328a197aae0fe619ccb4d8cbcd28c51b7b41f 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -77,20 +77,20 @@ public:
   SetScaling(int theScaling = VTK_SCALE_LINEAR);
   
   virtual
-  float
+  vtkFloatingPointType
   GetScalarRange();
 
   virtual
   void
-  SetScalarRange(float theRange[2]);
+  SetScalarRange(vtkFloatingPointType theRange[2]);
 
   virtual
   void
-  SetScalarMin(float theValue);
+  SetScalarMin(vtkFloatingPointType theValue);
 
   virtual
   void
-  SetScalarMax(float theValue);
+  SetScalarMax(vtkFloatingPointType theValue);
   
   virtual
   void
@@ -124,15 +124,15 @@ public:
 
   virtual 
   void
-  SetMapScale(float theMapScale = 1.0);
+  SetMapScale(vtkFloatingPointType theMapScale = 1.0);
 
   virtual
-  float
+  vtkFloatingPointType
   GetMapScale();
 
   virtual
   void
-  GetSourceRange(float theRange[2]);
+  GetSourceRange(vtkFloatingPointType theRange[2]);
 
   virtual
   void
index 2134aeb72f7326d540fd3cc868a1464ea7a04239..3ae4c7b5d9053e6a5960184a1b883a8aab5779b0 100755 (executable)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #include "VISU_SphereWidget.hxx"
 
 #include <vtkActor.h>
@@ -43,7 +62,7 @@ VISU_SphereWidget::VISU_SphereWidget()
   mySphereActor->SetMapper(mySphereMapper);
   //
   // Define the point coordinates
-  float bounds[6];
+  vtkFloatingPointType bounds[6];
   for(int i = 0; i < 6; i += 2){
     bounds[i]=-.5;
     bounds[i+1]=-bounds[i];
@@ -126,7 +145,7 @@ int VISU_SphereWidget::GetPhiResolution()
 // function: SetRadius
 // purpose :
 //====================================================================
-void VISU_SphereWidget::SetRadius(float theRadius) 
+void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius) 
 {
   if ( theRadius <= myRmin ) {
     theRadius = myRmin;
@@ -138,7 +157,7 @@ void VISU_SphereWidget::SetRadius(float theRadius)
 // function: GetRadius
 // purpose :
 //====================================================================
-float VISU_SphereWidget::GetRadius()
+vtkFloatingPointType VISU_SphereWidget::GetRadius()
 { 
   return mySphereSource->GetRadius(); 
 }
@@ -146,7 +165,7 @@ float VISU_SphereWidget::GetRadius()
 // function: SetCenter
 // purpose :
 //====================================================================
-void VISU_SphereWidget::SetCenter(float theCenter[3]) 
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3]) 
 {
   mySphereSource->SetCenter(theCenter);
   mySphere->SetCenter(theCenter);
@@ -155,9 +174,9 @@ void VISU_SphereWidget::SetCenter(float theCenter[3])
 // function: SetCenter
 // purpose :
 //====================================================================
-void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ) 
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ) 
 {
-  float aCenter[3] = {theX, theY, theZ};
+  vtkFloatingPointType aCenter[3] = {theX, theY, theZ};
   SetCenter(aCenter);
 }
 
@@ -165,7 +184,7 @@ void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ)
 // function: GetCenter
 // purpose :
 //====================================================================
-float*  VISU_SphereWidget::GetCenter() 
+vtkFloatingPointType*  VISU_SphereWidget::GetCenter() 
 {
   return mySphereSource->GetCenter();
 }
@@ -173,7 +192,7 @@ float*  VISU_SphereWidget::GetCenter()
 // function: GetCenter
 // purpose :
 //====================================================================
-void  VISU_SphereWidget::GetCenter(float theCenter[3]) 
+void  VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3]) 
 {
   mySphereSource->GetCenter(theCenter);
 }
@@ -469,7 +488,7 @@ void VISU_SphereWidget::OnMiddleButtonUp()
 //====================================================================
 void VISU_SphereWidget::Translate(double *p1, double *p2)
 {
-  float v[3], aC[3], aC1[3];
+  vtkFloatingPointType v[3], aC[3], aC1[3];
   //
   v[0] = p2[0] - p1[0];
   v[1] = p2[1] - p1[1];
@@ -495,7 +514,7 @@ void VISU_SphereWidget::Scale(double *p1, double *p2,
   v[1] = p2[1] - p1[1];
   v[2] = p2[2] - p1[2];
   //
-  float aC[3], aR, sf, aR1;
+  vtkFloatingPointType aC[3], aR, sf, aR1;
   aR=mySphereSource->GetRadius();
   mySphereSource->GetCenter(aC);
   sf=vtkMath::Norm(v)/aR;
@@ -561,12 +580,12 @@ void VISU_SphereWidget::CreateDefaultProperties()
 // function:PlaceWidget
 // purpose:
 //====================================================================
-void VISU_SphereWidget::PlaceWidget(float bds[6])
+void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6])
 {
-  float bounds[6], center[3], radius;
+  vtkFloatingPointType bounds[6], center[3], radius;
 
   this->AdjustBounds(bds, bounds, center);
-  float dX, dY, dZ;
+  vtkFloatingPointType dX, dY, dZ;
   //
   dX=bounds[1]-bounds[0];
   dY=bounds[3]-bounds[2];
@@ -591,7 +610,7 @@ void VISU_SphereWidget::PlaceWidget(float bds[6])
                        (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
                        (bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
 
-  static float EPS = 1.0E-1;
+  static vtkFloatingPointType EPS = 1.0E-1;
   myRmin = EPS*InitialLength;
 
 }
index 6efadaffc325da40bb99840abafd1ea36d41426c..1248d273dd5ed26bd0a3454c01fb4516f7fea2d8 100755 (executable)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifndef __VISU_SphereWidget_h
 #define __VISU_SphereWidget_h
 
@@ -34,7 +53,7 @@ public:
   virtual void SetEnabled(int);
   //
   //PlaceWidget
-  virtual void PlaceWidget(float bounds[6]);
+  virtual void PlaceWidget(vtkFloatingPointType bounds[6]);
   //
   // Description:
   // Set/Get the resolution of the sphere in the Theta direction.
@@ -47,22 +66,24 @@ public:
 
   // Description:
   // Set/Get the radius of sphere. Default is .5.
-  void SetRadius(float r); 
-  float GetRadius();
+  void SetRadius(vtkFloatingPointType r); 
+  vtkFloatingPointType GetRadius();
   
 
   // Description:
   // Set/Get the center of the sphere.
-  void SetCenter(float x, float y, float z); 
-  void SetCenter(float x[3]); 
+  void SetCenter(vtkFloatingPointType x, 
+                vtkFloatingPointType y, 
+                vtkFloatingPointType z); 
+  void SetCenter(vtkFloatingPointType x[3]); 
   
-  float* GetCenter(); 
-  void GetCenter(float xyz[3]); 
+  vtkFloatingPointType* GetCenter(); 
+  void GetCenter(vtkFloatingPointType xyz[3]); 
   
   // Description:
   // Set the ratio of the radius changing.
-  void SetRatio(float r) { myRatio = r; } 
-  float GetRatio() { return myRatio; } 
+  void SetRatio(vtkFloatingPointType r) { myRatio = r; } 
+  vtkFloatingPointType GetRatio() { return myRatio; } 
 
   void ChangeRadius(bool up);
 
@@ -123,10 +144,10 @@ protected:
   // the manipulator in general.
   vtkProperty *mySphereProperty;
   vtkProperty *mySelectedSphereProperty;
-  float myRmin;
+  vtkFloatingPointType myRmin;
   vtkSphere *mySphere;
   vtkImplicitSum* myImplicitSum;
-  float myRatio;
+  vtkFloatingPointType myRatio;
 private:
   VISU_SphereWidget(const VISU_SphereWidget&);  //Not implemented
   void operator=(const VISU_SphereWidget&);  //Not implemented
index 89e3f71b3a07041075f11111bf6bac93eb42316c..b5a16a3df7f533b9dbe76b71fd92dfed96e5c2aa 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.cxx
@@ -42,10 +42,10 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
-static float EPS = 1.0e-7;
-static float aMinNbOfSteps = 1.0E+2;
-//static float aMaxNbOfSteps = 1.0E+3;
-static float aCoeffOfIntStep = 1.0E+1;
+static vtkFloatingPointType EPS = 1.0e-7;
+static vtkFloatingPointType aMinNbOfSteps = 1.0E+2;
+//static vtkFloatingPointType aMaxNbOfSteps = 1.0E+3;
+static vtkFloatingPointType aCoeffOfIntStep = 1.0E+1;
 
 
 vtkStandardNewMacro(VISU_StreamLinesPL);
@@ -86,49 +86,57 @@ void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
 }
 
 
-float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
-                                                float thePropogationTime, float thePercents)
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
+                        vtkFloatingPointType theStepLength,
+                        vtkFloatingPointType thePropogationTime, 
+                        vtkFloatingPointType thePercents)
 {
-  static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2;
-  static float aStreamArraySize = aStreamPointSize*1024; // == 69632
+  static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2;
+  static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632
 
-  float aNbCells = thePercents*theNbOfPoints*2.0;
-  float aNbPointsPerCell = thePropogationTime/theStepLength;
-  float aCellsSize = aNbCells*(1+aNbPointsPerCell);
-  float aPointsSize = aCellsSize*3.0*sizeof(float);
+  vtkFloatingPointType aNbCells = thePercents*theNbOfPoints*2.0;
+  vtkFloatingPointType aNbPointsPerCell = thePropogationTime/theStepLength;
+  vtkFloatingPointType aCellsSize = aNbCells*(1+aNbPointsPerCell);
+  vtkFloatingPointType aPointsSize = aCellsSize*3.0*sizeof(vtkFloatingPointType);
 
-  float aConnectivitySize = aCellsSize*sizeof(vtkIdType);
-  float aTypesSize = aNbCells*sizeof(char);
-  float aLocationsSize = aNbCells*sizeof(int);
-  //float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
-  float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
+  vtkFloatingPointType aConnectivitySize = aCellsSize*sizeof(vtkIdType);
+  vtkFloatingPointType aTypesSize = aNbCells*sizeof(char);
+  vtkFloatingPointType aLocationsSize = aNbCells*sizeof(int);
+  //vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+  vtkFloatingPointType aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
 
-  float anAssignedDataSize = aCellsSize*4.0*sizeof(float);
-  float anOutputDataSetSize = aMeshSize + anAssignedDataSize;
+  vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
+  vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
 
-  float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
+  vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
   return aResult;
 }
 
-int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
-                                          float& thePropogationTime, float& thePercents)
+int
+VISU_StreamLinesPL
+::FindPossibleParams(vtkPointSet* theDataSet, 
+                    vtkFloatingPointType& theStepLength,
+                    vtkFloatingPointType& thePropogationTime, 
+                    vtkFloatingPointType& thePercents)
 {
-  static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
+  static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
   vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
-  float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+  vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
   int isPoss = CheckAvailableMemory(aSize);
   if(!isPoss){
-    float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
-    float aMinStepLength = GetMinStepLength(theDataSet);
-    float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
+    vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
+    vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
+    vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
     for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){
-      float aStepLength = theStepLength + aDeltaStepLength;
+      vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength;
       if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
       else if(aStepChanged){
        aStepLength = aMaxStepLength;
        aStepChanged = 0;
       }
-      float aPercents = thePercents /= aPercentsDecrease;
+      vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease;
       if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
       else if(aPerecentsChanged) {
        thePercents = 1.1 / aNbOfPoints;
@@ -146,13 +154,15 @@ int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theSt
 }
 
 
-int VISU_StreamLinesPL::SetParams(float theIntStep,
-                                 float thePropogationTime,
-                                 float theStepLength,
-                                 vtkPointSet* theSource,
-                                 float thePercents,
-                                 int theDirection,
-                                 int isOnlyTry)
+int
+VISU_StreamLinesPL
+::SetParams(vtkFloatingPointType theIntStep,
+           vtkFloatingPointType thePropogationTime,
+           vtkFloatingPointType theStepLength,
+           vtkPointSet* theSource,
+           vtkFloatingPointType thePercents,
+           int theDirection,
+           int isOnlyTry)
 {
   vtkPointSet* aDataSet = theSource? theSource: myFieldTransform->GetUnstructuredGridOutput();
   aDataSet->Update();
@@ -187,31 +197,50 @@ int VISU_StreamLinesPL::SetParams(float theIntStep,
 }
 
 
-vtkPointSet* VISU_StreamLinesPL::GetSource() {
+vtkPointSet* 
+VISU_StreamLinesPL
+::GetSource() 
+{
   return mySource;
 }
 
-float VISU_StreamLinesPL::GetUsedPoints() {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetUsedPoints() 
+{
   return myPercents;
 }
 
-vtkDataSet* VISU_StreamLinesPL::GetStreamerSource(){
+vtkDataSet* 
+VISU_StreamLinesPL
+::GetStreamerSource()
+{
   return myStream->GetSource();
 }
 
-float VISU_StreamLinesPL::GetVelocityCoeff(){
+vtkFloatingPointType 
+VISU_StreamLinesPL
+::GetVelocityCoeff()
+{
   return GetVelocityCoeff(myExtractor->GetOutput());
 }
 
-float VISU_StreamLinesPL::GetVelocityCoeff(vtkPointSet* theDataSet){
-  float* aScalarRange = theDataSet->GetScalarRange();
+vtkFloatingPointType 
+VISU_StreamLinesPL
+::GetVelocityCoeff(vtkPointSet* theDataSet)
+{
+  vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange();
   return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
 }
 
 
-int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){
-  float aStepLength = GetBaseStepLength(theDataSet);
-  float aBasePropTime = GetBasePropagationTime(theDataSet);
+int
+VISU_StreamLinesPL
+::IsPossible(vtkPointSet* theDataSet, 
+            vtkFloatingPointType thePercents)
+{
+  vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet);
+  vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet);
   VISU_UsedPointsFilter *aPointsFilter = VISU_UsedPointsFilter::New();
   aPointsFilter->SetInput(theDataSet);
   vtkPointSet* aDataSet = aPointsFilter->GetOutput();
@@ -223,71 +252,105 @@ int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){
 }
 
 
-float VISU_StreamLinesPL::GetIntegrationStep(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetIntegrationStep()
+{
   return myStream->GetIntegrationStepLength();
 }
-float VISU_StreamLinesPL::GetStepLength() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetStepLength() 
+{
   return myStream->GetStepLength();
 }
-float VISU_StreamLinesPL::GetPropagationTime() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetPropagationTime() 
+{
   return myStream->GetMaximumPropagationTime();
 }
-int VISU_StreamLinesPL::GetDirection(){
+
+int
+VISU_StreamLinesPL
+::GetDirection()
+{
   return myStream->GetIntegrationDirection();
 }
 
 
-float VISU_StreamLinesPL::GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep(vtkPointSet* theDataSet, 
+                       vtkFloatingPointType thePercents) 
+{
   if(!theDataSet) return -1.0;
-  float aVolume = 1.0;
+  vtkFloatingPointType aVolume = 1.0;
   int degree = 0;
   theDataSet->Update();
-  float* aBounds = theDataSet->GetBounds();
+  vtkFloatingPointType* aBounds = theDataSet->GetBounds();
   for(int i = 0, j = 0; i < 3; ++i, j = 2*i){
-    float tmp = aBounds[j+1] - aBounds[j];
+    vtkFloatingPointType tmp = aBounds[j+1] - aBounds[j];
     if (tmp > EPS ) {
       aVolume *= tmp;
       degree += 1;
     }
   }
   if (degree < 1) return 0.0; // absolutely empty object
-  float anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
-  float aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
+  vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
+  vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
   thePercents = 1.0;
   vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
-  float aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
-  float aRealSize = GetAvailableMemory(aSize);
-  float anAverageVolume = aVolume / aRealSize;
-  float aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
+  vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+  vtkFloatingPointType aRealSize = GetAvailableMemory(aSize);
+  vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
+  vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
   return aStep;
 }
-float VISU_StreamLinesPL::GetMinIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep()
+{
   return GetMinIntegrationStep(myExtractor->GetOutput(),GetUsedPoints());
 }
 
 
-float VISU_StreamLinesPL::GetMaxIntegrationStep(vtkPointSet* theDataSet) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep(vtkPointSet* theDataSet) 
+{
   if(!theDataSet) return -1.0;
   theDataSet->Update();
-  float aLength = theDataSet->GetLength();
-  float* aBounds = theDataSet->GetBounds();
-  float aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
-  float aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
-  float aMinMax = (aBounds[1] - aBounds[0])/aLength;
+  vtkFloatingPointType aLength = theDataSet->GetLength();
+  vtkFloatingPointType* aBounds = theDataSet->GetBounds();
+  vtkFloatingPointType aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
+  vtkFloatingPointType aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
+  vtkFloatingPointType aMinMax = (aBounds[1] - aBounds[0])/aLength;
   if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) aMinMax = aMaxSizeY;
   if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) aMinMax = aMaxSizeZ;
   return aMinMax*aLength/2.0;
 }
-float VISU_StreamLinesPL::GetMaxIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep()
+{
   return GetMaxIntegrationStep(myExtractor->GetOutput());
 }
 
-float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseIntegrationStep(vtkPointSet* theDataSet, 
+                        vtkFloatingPointType thePercents)
+{
   theDataSet->Update();
-  float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
-  float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
-  float anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
-  float aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
+  vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+  vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+  vtkFloatingPointType anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
+  vtkFloatingPointType aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
   if(aMinMax > anIntegrationStep)
     anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep;
   if(aMinIntegrationStep > anIntegrationStep)
@@ -295,10 +358,15 @@ float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float
   return anIntegrationStep;
 }
 
-float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectIntegrationStep(vtkFloatingPointType theStep, 
+                        vtkPointSet* theDataSet, 
+                        vtkFloatingPointType thePercents)
+{
   theDataSet->Update();
-  float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
-  float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+  vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+  vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
   if(aMinIntegrationStep > theStep)
     theStep = aMinIntegrationStep;
   if(aMaxIntegrationStep < theStep)
@@ -307,99 +375,156 @@ float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* the
 }
 
 
-float VISU_StreamLinesPL::GetMinPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime(vtkPointSet* theDataSet)
+{
   if(!theDataSet) return -1.0;
   return GetMinStepLength(theDataSet);
 }
-float VISU_StreamLinesPL::GetMinPropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime()
+{
   return GetMinPropagationTime(myExtractor->GetOutput());
 }
 
-float VISU_StreamLinesPL::GetMaxPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxPropagationTime(vtkPointSet* theDataSet)
+{
   if(!theDataSet) return -1.0;
   return GetBasePropagationTime(theDataSet)*aMinNbOfSteps;
 }
-float VISU_StreamLinesPL::GetMaxPropagationTime(){
+
+vtkFloatingPointType VISU_StreamLinesPL::GetMaxPropagationTime(){
   return GetMaxPropagationTime(myExtractor->GetOutput());
 }
 
-float VISU_StreamLinesPL::CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet){
-  float aMinPropagationTime = GetMinPropagationTime(theDataSet);
-  float aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectPropagationTime(vtkFloatingPointType thePropagationTime, 
+                        vtkPointSet* theDataSet)
+{
+  vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet);
+  vtkFloatingPointType aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
   if(aMinPropagationTime > thePropagationTime)
     thePropagationTime = aMinPropagationTime;
   if(aMaxPropagationTime < thePropagationTime)
     thePropagationTime = aMaxPropagationTime;
   return thePropagationTime;
 }
-float VISU_StreamLinesPL::GetBasePropagationTime(vtkPointSet* theDataSet){
+
+vtkFloatingPointType 
+VISU_StreamLinesPL
+::GetBasePropagationTime(vtkPointSet* theDataSet)
+{
   if(!theDataSet) return -1.0;
   theDataSet->Update();
-  float aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
+  vtkFloatingPointType aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
   return aPropagationTime;
 }
-float VISU_StreamLinesPL::GetBasePropagationTime(){
+
+vtkFloatingPointType 
+VISU_StreamLinesPL
+::GetBasePropagationTime()
+{
   return GetBasePropagationTime(myExtractor->GetOutput());
 }
 
 
-float VISU_StreamLinesPL::GetMinStepLength(vtkPointSet* theDataSet){
-  static float aNbOfStepsOfIntStep = 1.0E+1;
-  float anIntStep = GetMinIntegrationStep(theDataSet);
-  float aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
+vtkFloatingPointType 
+VISU_StreamLinesPL
+::GetMinStepLength(vtkPointSet* theDataSet)
+{
+  static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1;
+  vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet);
+  vtkFloatingPointType aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
   return aStepLength;
 }
-float VISU_StreamLinesPL::GetMinStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength()
+{
   return GetMinStepLength(myExtractor->GetOutput());
 }
 
-float VISU_StreamLinesPL::GetMaxStepLength(vtkPointSet* theDataSet){
-  float aStepLength = GetBasePropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength(vtkPointSet* theDataSet)
+{
+  vtkFloatingPointType aStepLength = GetBasePropagationTime(theDataSet);
   return aStepLength;
 }
-float VISU_StreamLinesPL::GetMaxStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength()
+{
   return GetMaxStepLength(myExtractor->GetOutput());
 }
 
-float VISU_StreamLinesPL::CorrectStepLength(float theStep, vtkPointSet* theDataSet){
-  float aMinStep = GetMinStepLength(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectStepLength(vtkFloatingPointType theStep, 
+                   vtkPointSet* theDataSet)
+{
+  vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet);
   if(theStep < aMinStep) theStep = aMinStep;
-  float aMaxStep = GetMaxStepLength(theDataSet);
+  vtkFloatingPointType aMaxStep = GetMaxStepLength(theDataSet);
   if(theStep > aMaxStep) theStep = aMaxStep;
   return theStep;
 }
-float VISU_StreamLinesPL::GetBaseStepLength(vtkPointSet* theDataSet){
-  static float anAvgNbOfSteps = 1.0E+2;
-  float aPropagationTime = GetBasePropagationTime(theDataSet);
-  float aStepLength = aPropagationTime/anAvgNbOfSteps;
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseStepLength(vtkPointSet* theDataSet)
+{
+  static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2;
+  vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet);
+  vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps;
   aStepLength = CorrectStepLength(aStepLength,theDataSet);
   return aStepLength;
 }
 
 
-void VISU_StreamLinesPL::Init(){
+void
+VISU_StreamLinesPL
+::Init()
+{
   VISU_ScalarMapPL::Init();
   vtkPointSet* aDataSet = myExtractor->GetOutput();
-  float anIntStep = GetBaseIntegrationStep(aDataSet);
-  float aPropagationTime = GetBasePropagationTime(aDataSet);
-  float aStepLength = GetBaseStepLength(aDataSet);
+  vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
+  vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
+  vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet);
   SetParams(anIntStep,aPropagationTime,aStepLength);
 }
 
-VISU_ScalarMapPL::THook* VISU_StreamLinesPL::DoHook(){
+VISU_ScalarMapPL::THook* 
+VISU_StreamLinesPL
+::DoHook()
+{
   GetInput2()->Update();
   VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform);
-  float *aBounds = GetInput2()->GetBounds();
+  vtkFloatingPointType *aBounds = GetInput2()->GetBounds();
   myGeomFilter->SetExtent(aBounds);
   myGeomFilter->ExtentClippingOn();
   myGeomFilter->SetInput(myStream->GetOutput());
   return myGeomFilter->GetOutput();
 }
 
-void VISU_StreamLinesPL::Update(){
+void
+VISU_StreamLinesPL
+::Update()
+{
   VISU_ScalarMapPL::Update();
 }
 
-void VISU_StreamLinesPL::SetMapScale(float theMapScale){
+void
+VISU_StreamLinesPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
   VISU_ScalarMapPL::SetMapScale(theMapScale);
 }
index 05976293d22aaedc3192d5c0cfc145a9c8ca50c5..bcee487f6fbe3a3206278a4ff2f16a4bb55e033c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.hxx
@@ -42,78 +42,192 @@ class VISU_PIPELINE_EXPORT VISU_StreamLinesPL : public VISU_DeformedShapePL{
 protected:
   VISU_StreamLinesPL();
   VISU_StreamLinesPL(const VISU_StreamLinesPL&);
+
+  virtual
+  ~VISU_StreamLinesPL();
+
 public:
   vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL);
-  static VISU_StreamLinesPL* New();
-  virtual ~VISU_StreamLinesPL();
-  virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
-
-  virtual int SetParams(float theIntStep, 
-                       float thePropogationTime,
-                       float theStepLength,
-                       vtkPointSet* theSource = NULL, 
-                       float thePercents = 0.3,
-                       int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
-                       int isOnlyTry = false);
-  virtual vtkPointSet* GetSource();
-  virtual float GetUsedPoints();
-  virtual float GetIntegrationStep();
-  virtual float GetPropagationTime();
-  virtual float GetStepLength();
-  virtual int GetDirection();
-
-  virtual vtkDataSet* GetStreamerSource();
-  virtual float GetVelocityCoeff();
-
-  virtual float GetMaxIntegrationStep();
-  virtual float GetMinIntegrationStep();
-
-  virtual float GetMinStepLength();
-  virtual float GetMaxStepLength();
-
-  virtual float GetMinPropagationTime();
-  virtual float GetMaxPropagationTime();
-  virtual float GetBasePropagationTime();
+
+  static
+  VISU_StreamLinesPL* 
+  New();
+
+  virtual
+  void
+  ShallowCopy(VISU_PipeLine *thePipeLine);
+
+  virtual
+  int 
+  SetParams(vtkFloatingPointType theIntStep, 
+           vtkFloatingPointType thePropogationTime,
+           vtkFloatingPointType theStepLength,
+           vtkPointSet* theSource = NULL, 
+           vtkFloatingPointType thePercents = 0.3,
+           int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
+           int isOnlyTry = false);
+
+  virtual
+  vtkPointSet*
+  GetSource();
+
+  virtual
+  vtkFloatingPointType
+  GetUsedPoints();
+
+  virtual
+  vtkFloatingPointType 
+  GetIntegrationStep();
+
+  virtual
+  vtkFloatingPointType
+  GetPropagationTime();
+
+  virtual
+  vtkFloatingPointType
+  GetStepLength();
+
+  virtual
+  int
+  GetDirection();
+
+  virtual
+  vtkDataSet* 
+  GetStreamerSource();
+
+  virtual
+  vtkFloatingPointType 
+  GetVelocityCoeff();
+
+  virtual
+  vtkFloatingPointType
+  GetMaxIntegrationStep();
+
+  virtual
+  vtkFloatingPointType
+  GetMinIntegrationStep();
+
+  virtual
+  vtkFloatingPointType
+  GetMinStepLength();
+
+  virtual
+  vtkFloatingPointType
+  GetMaxStepLength();
+
+  virtual
+  vtkFloatingPointType
+  GetMinPropagationTime();
+
+  virtual
+  vtkFloatingPointType
+  GetMaxPropagationTime();
+
+  virtual
+  vtkFloatingPointType
+  GetBasePropagationTime();
 
 public:
-  virtual THook* DoHook();
-  virtual void Init();
-  virtual void Update();
-  virtual void SetMapScale(float theMapScale = 1.0);
+  virtual
+  THook* 
+  DoHook();
+
+  virtual
+  void
+  Init();
+
+  virtual
+  void
+  Update();
+
+  virtual
+  void
+  SetMapScale(vtkFloatingPointType theMapScale = 1.0);
 
 public:
-  static float GetMaxIntegrationStep(vtkPointSet* theDataSet);
-  static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
-  static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
+  static
+  vtkFloatingPointType
+  GetMaxIntegrationStep(vtkPointSet* theDataSet);
+
+  static
+  vtkFloatingPointType
+  GetMinIntegrationStep(vtkPointSet* theDataSet, 
+                       vtkFloatingPointType thePercents = 0.3);
+  static
+  vtkFloatingPointType
+  GetBaseIntegrationStep(vtkPointSet* theDataSet, 
+                        vtkFloatingPointType thePercents = 0.3);
   
-  static float GetMinPropagationTime(vtkPointSet* theDataSet);
-  static float GetMaxPropagationTime(vtkPointSet* theDataSet);
-  static float GetBasePropagationTime(vtkPointSet* theDataSet);
+  static 
+  vtkFloatingPointType
+  GetMinPropagationTime(vtkPointSet* theDataSet);
+
+  static
+  vtkFloatingPointType
+  GetMaxPropagationTime(vtkPointSet* theDataSet);
+
+  static
+  vtkFloatingPointType
+  GetBasePropagationTime(vtkPointSet* theDataSet);
+
+  static
+  vtkFloatingPointType
+  GetMinStepLength(vtkPointSet* theDataSet);
+
+  static
+  vtkFloatingPointType
+  GetMaxStepLength(vtkPointSet* theDataSet);
 
-  static float GetMinStepLength(vtkPointSet* theDataSet);
-  static float GetMaxStepLength(vtkPointSet* theDataSet);
-  static float GetBaseStepLength(vtkPointSet* theDataSet);
+  static
+  vtkFloatingPointType
+  GetBaseStepLength(vtkPointSet* theDataSet);
 
-  static float GetVelocityCoeff(vtkPointSet* theDataSet);
+  static
+  vtkFloatingPointType
+  GetVelocityCoeff(vtkPointSet* theDataSet);
 
-  static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3);
+  static
+  int
+  IsPossible(vtkPointSet* theDataSet, 
+            vtkFloatingPointType thePercents = 0.3);
 
 protected:
-  static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, 
-                                     float thePropogationTime, float thePercents = 0.3);
-  static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, 
-                               float& thePropogationTime, float& thePercents);
+  static 
+  vtkFloatingPointType
+  GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
+                        vtkFloatingPointType theStepLength, 
+                        vtkFloatingPointType thePropogationTime, 
+                        vtkFloatingPointType thePercents = 0.3);
+
+  static
+  int
+  FindPossibleParams(vtkPointSet* theDataSet, 
+                    vtkFloatingPointType& theStepLength, 
+                    vtkFloatingPointType& thePropogationTime, 
+                    vtkFloatingPointType& thePercents);
   
-  static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3);
-  static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet);
-  static float CorrectStepLength(float theStep, vtkPointSet* theDataSet);
+  static 
+  vtkFloatingPointType
+  CorrectIntegrationStep(vtkFloatingPointType theStep, 
+                        vtkPointSet* theDataSet, 
+                        vtkFloatingPointType thePercents = 0.3);
+
+  static 
+  vtkFloatingPointType
+  CorrectPropagationTime(vtkFloatingPointType thePropagationTime, 
+                        vtkPointSet* theDataSet);
+
+  static
+  vtkFloatingPointType
+  CorrectStepLength(vtkFloatingPointType theStep, 
+                   vtkPointSet* theDataSet);
 
   vtkStreamLine* myStream;
   vtkPointSet* mySource;
   vtkCellCenters* myCenters;
   VTKViewer_GeometryFilter *myGeomFilter;
   VISU_UsedPointsFilter *myPointsFilter;
-  float myPercents;
+  vtkFloatingPointType myPercents;
 };
 
 
index 311248cf0a57e3546e09f5b570a6bb8d30e67f85..9c49ea25cc6ac49138ded13680438468058b9293 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_StreamLinesPL.cxx
index 273ab3d2cebca5baff7a259f5d78273b74f7b9bc..dd20877ad4ffe857f1e686e56db370cde537f4c3 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_UsedPointsFilter.hxx
index 92a5e57591f621e2630166c5afd44252110c2384..3fa4bd6654f27e2da0eabc70a57075e9111950a6 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.cxx
@@ -101,7 +101,7 @@ VISU_VectorsPL
 
 void
 VISU_VectorsPL
-::SetScale(float theScale) 
+::SetScale(vtkFloatingPointType theScale) 
 {
   if(myScaleFactor == theScale) 
     return;
@@ -114,7 +114,7 @@ VISU_VectorsPL
   Modified();
 }
 
-float
+vtkFloatingPointType
 VISU_VectorsPL
 ::GetScale() 
 {
@@ -219,7 +219,7 @@ VISU_VectorsPL
 
 void
 VISU_VectorsPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
 {
   VISU_ScalarMapPL::SetMapScale(theMapScale);
 
index 7f849663d2d0abfd4489997aea1d3e381658b4ad..6b5add7c6acbed0e07e50655834d27d94be33d3c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_PipeLine.hxx
@@ -44,37 +44,89 @@ class VISU_PIPELINE_EXPORT VISU_VectorsPL : public VISU_DeformedShapePL{
 protected:
   VISU_VectorsPL();
   VISU_VectorsPL(const VISU_VectorsPL&);
+
+  virtual
+  ~VISU_VectorsPL();
+
 public:
   vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL);
-  static VISU_VectorsPL* New();
-  virtual ~VISU_VectorsPL();
-  virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
 
-  virtual void SetScale(float theScale);
-  virtual float GetScale();
+  static
+  VISU_VectorsPL* 
+  New();
+
+  virtual
+  void
+  ShallowCopy(VISU_PipeLine *thePipeLine);
+
+  virtual
+  void
+  SetScale(vtkFloatingPointType theScale);
+
+  virtual
+  vtkFloatingPointType
+  GetScale();
 
   enum GlyphType{ ARROW, CONE2, CONE6, NONE};
-  virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;}
-  virtual GlyphType GetGlyphType() { return myTypeGlyph;}
+
+  virtual
+  void
+  SetGlyphType(GlyphType theType) 
+  {
+    myTypeGlyph = theType;
+  }
+
+  virtual
+  GlyphType
+  GetGlyphType() 
+  {
+    return myTypeGlyph;
+  }
     
   enum GlyphPos{ CENTER, TAIL,HEAD};
-  virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;}
-  virtual GlyphPos GetGlyphPos() { return myPosGlyph;}
+
+  virtual
+  void
+  SetGlyphPos(GlyphPos thePos) 
+  { 
+    myPosGlyph = thePos;
+  }
+
+  virtual
+  GlyphPos
+  GetGlyphPos() 
+  {
+    return myPosGlyph;
+  }
 
 public:
-  virtual void Init();
-  virtual void Update();
+  virtual
+  void
+  Init();
+
+  virtual
+  void
+  Update();
 
   vtkDataSet* 
   GetOutput();
 
-  virtual void SetTransform(VTKViewer_Transform* theTransform); 
-  virtual VTKViewer_Transform* GetTransform();
+  virtual
+  void
+  SetTransform(VTKViewer_Transform* theTransform); 
+
+  virtual
+  VTKViewer_Transform* 
+  GetTransform();
   
-  virtual void SetMapScale(float theMapScale = 1.0);
+  virtual
+  void
+  SetMapScale(vtkFloatingPointType theMapScale = 1.0);
 
 protected:
-  virtual THook* DoHook();
+  virtual
+  THook* 
+  DoHook();
 
   GlyphType myTypeGlyph;
   GlyphPos myPosGlyph;
index bb62dc630599e5adac54175b432c2d9188a5be50..452b8e9307cf5d78192f3fd4d5c23c1baaaa7027 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -268,7 +268,7 @@ VISU_SphereWidget* VISU_WidgetCtrl::GetSphereWidget()
 // function: PlaceWidget
 // purpose :
 //==================================================================
-void VISU_WidgetCtrl::PlaceWidget(float theBounds[6])
+void VISU_WidgetCtrl::PlaceWidget(vtkFloatingPointType theBounds[6])
 {
   for (int i=0; i<myNbWidgets; ++i) { 
     myWidgets[i]->PlaceWidget(theBounds);
@@ -298,7 +298,7 @@ vtkRenderWindowInteractor* VISU_WidgetCtrl::GetInteractor()
 // function: SetPlaceFactor
 // purpose :
 //==================================================================
-void VISU_WidgetCtrl::SetPlaceFactor(float theFactor)
+void VISU_WidgetCtrl::SetPlaceFactor(vtkFloatingPointType theFactor)
 {
   for (int i=0; i<myNbWidgets; ++i) {
     myWidgets[i]->SetPlaceFactor(theFactor);
@@ -310,7 +310,7 @@ void VISU_WidgetCtrl::SetPlaceFactor(float theFactor)
 // function: GetPlaceFactor
 // purpose :
 //==================================================================
-float VISU_WidgetCtrl::GetPlaceFactor()
+vtkFloatingPointType VISU_WidgetCtrl::GetPlaceFactor()
 {
   return myWidgets[0]->GetPlaceFactor();
 }
@@ -324,9 +324,9 @@ vtkImplicitFunction* VISU_WidgetCtrl::ImplicitFunction()
 }
 
 //==================================================================
-float  
+vtkFloatingPointType   
 VISU_WidgetCtrl
-::EvaluateFunction(float theX[3])
+::EvaluateFunction(vtkFloatingPointType theX[3])
 {
   if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
     if(vtkImplicitFunction* aFunction = aWidget->ImplicitFunction())
@@ -338,7 +338,8 @@ VISU_WidgetCtrl
 //==================================================================
 void   
 VISU_WidgetCtrl
-::EvaluateGradient(float theX[3], float theG[3])
+::EvaluateGradient(vtkFloatingPointType theX[3], 
+                  vtkFloatingPointType theG[3])
 {
   theG[0] = theG[1] = theG[2] = 0.0;
   if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
index 174252765c4b06fde8a933c33e3c2fdb0b66f747..78c283d83665a236e6ceb56a4cedc77ec31e5c57 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 #define __VISU_WidgetCtrl_hxx
 
 #include "VISUPipeline.hxx"
-
 #include <vtkImplicitFunction.h>
 
+#include "VTKViewer.h"
+
 class vtkImplicitFunction;
 class vtkObject;
 class vtkRenderWindowInteractor;
@@ -52,18 +53,19 @@ public:
   vtkImplicitFunction* ImplicitFunction();
 
   virtual
-  float        
-  EvaluateFunction(float theX[3]);
+  vtkFloatingPointType         
+  EvaluateFunction(vtkFloatingPointType theX[3]);
 
   virtual
   void         
-  EvaluateGradient(float theX[3], float theG[3]);
+  EvaluateGradient(vtkFloatingPointType theX[3], 
+                  vtkFloatingPointType theG[3]);
 
   virtual
   unsigned long
   GetMTime();
 
-  void PlaceWidget(float theBounds[6]);
+  void PlaceWidget(vtkFloatingPointType theBounds[6]);
   void SetEnabled(int theFlag);
   int  GetEnabled();
   void On() {SetEnabled(1);}
@@ -72,8 +74,11 @@ public:
   void SetInteractor(vtkRenderWindowInteractor* theRWI);
   vtkRenderWindowInteractor* GetInteractor();
   //
-  void  SetPlaceFactor(float theFactor);
-  float GetPlaceFactor();
+  void  
+  SetPlaceFactor(vtkFloatingPointType theFactor);
+
+  vtkFloatingPointType
+  GetPlaceFactor();
   //
   void SetActiveIndex(const int theFlag);
   int  GetActiveIndex()const;
@@ -106,7 +111,7 @@ protected:
   int myActiveIndex;
   int myCounter;
   int myDisableAll;
-  float myPriority;
+  vtkFloatingPointType myPriority;
   VISU_ImplicitFunctionWidget *myWidgets[2];
   VISU_ImplicitFunctionWidget *myDummyWidget;
   VISU_PlanesWidget *myPlanesWidget;
index 8cc0a475ebadc79b41b09a99617e4163d07f7511..bba49bfc2da7cab5cd767cd5b86050222796fe3f 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_img2vti.cxx
index 1c2f20f1a0ccf5c4d08d4660ef354f765ca299ea..b3eaeb69b5f368fcb6ee53c1f6ffdae978796f10 100644 (file)
@@ -17,7 +17,7 @@
 #  License along with this library; if not, write to the Free Software 
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 # 
-#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #
 #
@@ -39,7 +39,7 @@ EXPORT_HEADERS= \
 
 # .po files to transform in .qm
 PO_FILES = \
-          VISU_msg_en.po VISU_images.po VISUM_msg_en.po VISUM_images.po
+          VISU_msg_en.po VISU_images.po
 
 # Libraries targets
 LIB = libVISU.la
@@ -119,17 +119,17 @@ LIB_SERVER_IDL =
 
 CPPFLAGS +=  -ftemplate-depth-32 $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) \
        $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \
-       -I${KERNEL_ROOT_DIR}/include/salome \
-       -I${MED_ROOT_DIR}/include/salome \
+       $(KERNEL_CXXFLAGS) \
+       $(MED_CXXFLAGS) \
        $(BOOST_CPPFLAGS)
 CXXFLAGS +=  -ftemplate-depth-32 $(OCC_CXXFLAGS) \
-       -I${KERNEL_ROOT_DIR}/include/salome \
-       -I${GUI_ROOT_DIR}/include/salome
+       $(KERNEL_CXXFLAGS) \
+       $(GUI_CXXFLAGS)
 
 LDFLAGS += $(QWT_LIBS) -lSalomeNS \
        -lSVTK -lVVTK -lSPlot2d -lVisuObject -lVISUEngineImpl -lVISUGUITOOLS \
-       -L${KERNEL_ROOT_DIR}/lib/salome \
-       -L${GUI_ROOT_DIR}/lib/salome
+       $(KERNEL_LDFLAGS) \
+       $(GUI_LDFLAGS)
 
 
 @CONCLUDE@
index 7357d06ad1b182d654982454dc64b9cfaa24abd5..afee2ba532d05975ed8447d23cce6030d4d9c833 100644 (file)
@@ -17,7 +17,7 @@
 #  License along with this library; if not, write to the Free Software 
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 # 
-#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #
 #
@@ -32,6 +32,8 @@ msgstr ""
 "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
+msgid "ICON_IMPORT_MED"
+msgstr "Visu_import_med.png"
 
 msgid "ICON_OBJBROWSER_Visu"
 msgstr "Visu_tree_visu.png"
@@ -86,8 +88,6 @@ msgstr "Visu_selectonly.png"
 msgid "ICON_SCALING"
 msgstr "Visu_scaling.png"
 
-#
-
 msgid "ICON_TIMEANIMATION"
 msgstr "Visu_anim.png"
 
@@ -99,3 +99,36 @@ msgstr "Visu_plot3d.png"
 
 msgid "ICON_CUBE_AXES"
 msgstr "Visu_graduated_axes.png"
+
+msgid "ICON_GAUSS_NEW_VIEWER"
+msgstr "Visu_points.png"
+
+msgid "ICON_GAUSS_POINTS"
+msgstr "Visu_gauss_points.png"
+
+msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Visu_vvtk_switch.png"
+
+msgid "ICON_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Visu_points.png"
+
+msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Visu_PlaneSegmentation.png"
+
+msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Visu_SphereSegmentation.png"
+
+msgid "ICON_VVTK_RECORDING_START"
+msgstr "Visu_recording_start.png"
+
+msgid "ICON_VVTK_RECORDING_PLAY"
+msgstr "Visu_recording_play.png"
+
+msgid "ICON_VVTK_RECORDING_PAUSE"
+msgstr "Visu_recording_pause.png"
+
+msgid "ICON_VVTK_RECORDING_STOP"
+msgstr "Visu_recording_stop.png"
+
+msgid "ICON_LOAD_TEXTURE"
+msgstr "Visu_load_texture.png"
index eb50916fbfffa6d6a0d46405da72ae53bd25756a..c5683bd15ca902d8a2879fffa02485ae692b59b4 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
@@ -6,18 +25,6 @@ msgstr ""
 "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
-msgid "BUT_OK"
-msgstr "OK"
-
-msgid "BUT_APPLY"
-msgstr "Apply"
-
-msgid "BUT_CLOSE"
-msgstr "Close"
-
-msgid "BUT_CANCEL"
-msgstr "Cancel"
-
 msgid "WRN_VISU"
 msgstr "Post-Pro Warning"
 
@@ -155,22 +162,31 @@ msgstr "MED files import"
 msgid "VISU_PREF_MED_FULL_LOAD"
 msgstr "Full MED loading"
 
-msgid "VISU_PREF_REPRESENT_PROPS"
+msgid "VISU_REPRESENT_PROPS"
 msgstr "Representation properties"
 
-msgid "VISU_PREF_SHADING"
+msgid "VISU_USE_SHADING"
 msgstr "Use Shading"
 
+msgid "VISU_SHRINK"
+msgstr "Shrink"
+
 #: VisuGUI.cxx
 
+msgid "VisuGUI::MEN_IMPORT"
+msgstr "Import"
+
 msgid "VisuGUI::MEN_IMPORT_FROM_FILE"
+msgstr "MED file"
+
+msgid "VisuGUI::IMPORT_FROM_FILE"
 msgstr "Import from File"
 
-msgid "VisuGUI::MEN_EXPLORE_MED_FILE"
-msgstr "Explore MED File"
+msgid "VisuGUI::USE_BUILD_PROGRESS"
+msgstr "Use build progress"
 
 msgid "VisuGUI::MEN_IMPORT_TABLE"
-msgstr "Import table from File"
+msgstr "Table from file"
 
 msgid "VisuGUI::MEN_SCALAR_MAP"
 msgstr "Scalar Map"
@@ -184,6 +200,9 @@ msgstr "Scalar Map on Deformed Shape"
 msgid "VisuGUI::MEN_VISUALIZATION"
 msgstr "Visualization"
 
+msgid "VisuGUI::TOOL_IMPORT"
+msgstr "Import Toolbar"
+
 msgid "VisuGUI::TOOL_VISUALISATION"
 msgstr "Visualization Toolbar"
 
@@ -379,9 +398,9 @@ msgstr "Use Field Range"
 msgid "VisuGUI::MEN_ARRANGE_ACTORS"
 msgstr "Arrange Actors"
 
+msgid "VisuGUI::MEN_PLOT3D_FROM_CUTPLANE"
+msgstr "Plot3d"
 
-msgid "VisuGUI::ERR_ERROR_IN_THE_FILE"
-msgstr "Error in the file"
 
 msgid "VisuGUI::ERR_ERROR_DURING_EXPORT"
 msgstr "Error has been occured during exporting to file"
@@ -1275,3 +1294,806 @@ msgstr "Yes"
 msgid "VisuGUI_SetupPlot2dDlg::QUE_WANT_SAME_UNITS"
 msgstr "Do you want to choose all items with the same units for vertical axis?"
 
+msgid "INF_VISU"
+msgstr "Post-Pro Info"
+
+msgid "IMPORT_DONE"
+msgstr "Importing is done"
+
+msgid "VisuGUI_Module::MEN_VISUALISATION"
+msgstr "Visualization"
+
+msgid "VisuGUI_Module::TOOL_IMPORT"
+msgstr "Import Toolbar"
+
+msgid "VisuGUI_Module::TOOL_VISUALISATION"
+msgstr "Visualization Toolbar"
+
+msgid "VisuGUI_Module::MEN_SAVE_CONFIGURATION"
+msgstr "Store current configuration"
+
+msgid "VisuGUI_Module::MEN_OVERWRITE_CONFIGURATION"
+msgstr "Overwrite current configuration"
+
+msgid "VisuGUI_Module::MEN_RESTORE_CONFIGURATION"
+msgstr "Restore current configuration"
+
+msgid "VisuGUI_Module::MEN_GAUSS"
+msgstr "Gauss"
+
+msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER"
+msgstr "Points view"
+
+msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TTL"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL"
+msgstr "Primitive"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE"
+msgstr "Primitive Type"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE"
+msgstr "Point sprite"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT"
+msgstr "OpenGL point"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE"
+msgstr "Geometrical sphere"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP"
+msgstr "Maximum Size (Clamp)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAIN_TEXTURE"
+msgstr "Main Texture (16x16)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_TEXTURE"
+msgstr "Alpha Channel Texture (16x16)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_THRESHOLD"
+msgstr "Alpha Channel Threshold"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_RESOLUTION"
+msgstr "Geometrical sphere resolution"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_FACE_LIMIT"
+msgstr "Notify when number of faces exceeds"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE_GROUP_TTL"
+msgstr "Size"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MIN_SIZE"
+msgstr "Range value for min size (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAX_SIZE"
+msgstr "Range value for max size (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION"
+msgstr "Magnification (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_INCREMENT"
+msgstr "+/- Ratio"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOM_GROUP_TTL"
+msgstr "Geometry"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE"
+msgstr "Size of points (%)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR"
+msgstr "Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALE_FACTOR"
+msgstr "Scale factor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL"
+msgstr "Gauss Points Scalar Bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL"
+msgstr "Gauss Points Scalar Bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_ACTIVE_BAR"
+msgstr "Active bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_LOCAL"
+msgstr "Local"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_GLOBAL"
+msgstr "Global"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_DISPLAY_GLOBAL"
+msgstr "Display global bar"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALAR_BAR_MODE"
+msgstr "Scalar bar mode"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_BICOLOR"
+msgstr "Bicolor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_RAINBOW"
+msgstr "Rainbow"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_SPACING"
+msgstr "Spacing"
+
+msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Inside Cursor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL"
+msgstr "Magnification (Inside and Outside)"
+
+msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL"
+msgstr "Outside Cursor"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL"
+msgstr "Color"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TAB_TTL"
+msgstr "Picking"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL"
+msgstr "Cursor"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE"
+msgstr "Size of the cursor"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT"
+msgstr "Height of the pyramids"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_SELECTION_COLOR"
+msgstr "Selection cursor color"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TOLERANCE_GROUP_TTL"
+msgstr "Tolerance"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE"
+msgstr "Point selection tolerance"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL"
+msgstr "Information window"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TRANSPARENCY"
+msgstr "Transparency"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_POSITION"
+msgstr "Position"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_BELOW_POINT"
+msgstr "Centered below the point"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_TOP_LEFT_CORNER"
+msgstr "Top-left corner of the 3D view"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_CAMERA_GROUP_TTL"
+msgstr "Movement of the camera"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_ZOOM_FACTOR"
+msgstr "Zoom at first selected point (ratio)"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_STEP_NUMBER"
+msgstr "Number of steps between two positions"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_PARENT_MESH_TTL"
+msgstr "Parent mesh element"
+
+msgid "VisuGUI_Module::VISU_PICKING_PREF_DISPLAY_PARENT_MESH"
+msgstr "Display parent mesh element"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_TAB_TLT"
+msgstr "Navigation"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT"
+msgstr "Mouse"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF"
+msgstr "Mouse behaviour"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD"
+msgstr "Salome standard controls"
+
+msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE"
+msgstr "Keyboard free"
+
+msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL"
+msgstr "Keyboard"
+
+msgid "VisuGUI_Module::VISU_KEYBOARD_PREF"
+msgstr "[+]/[-] Speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF"
+msgstr "Spacemouse"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1"
+msgstr "Decrease speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2"
+msgstr "Increase speed increment"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3"
+msgstr "Decrease Gauss points magnification"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4"
+msgstr "Increase Gauss points magnification"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5"
+msgstr "Dominant / combined switch"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1"
+msgstr "Button 1"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2"
+msgstr "Button 2"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3"
+msgstr "Button 3"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4"
+msgstr "Button 4"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5"
+msgstr "Button 5"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6"
+msgstr "Button 6"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7"
+msgstr "Button 7"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8"
+msgstr "Button 8"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10"
+msgstr "Button 10"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11"
+msgstr "Button 11"
+
+msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*"
+msgstr "Button *"
+
+msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL"
+msgstr "Camera movements"
+
+msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF"
+msgstr "Number of steps between two positions"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_TAB_TTL"
+msgstr "Recorder"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_GROUP_TTL"
+msgstr "Settings"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_RECORDING_MODE"
+msgstr "Mode"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_SKIPPED_FRAMES"
+msgstr "Recording at a given FPS"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES"
+msgstr "Recording all displayed frames"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_FPS"
+msgstr "FPS"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_QUALITY"
+msgstr "Quality"
+
+msgid "VisuGUI_Module::VISU_RECORDER_PREF_PROGRESSIVE"
+msgstr "Progressive"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE"
+msgstr "Gauss Points Preferences"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE"
+msgstr "Gauss Points Properties"
+
+msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE"
+msgstr "Build progress"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS"
+msgstr "Settings"
+
+msgid "VisuGUI_BuildProgressDlg::FILE_NAME"
+msgstr "Import file : "
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE"
+msgstr "Build at once"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_ALL"
+msgstr "Build all"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS"
+msgstr "Import progress"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES"
+msgstr "Build entities"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS"
+msgstr "Build fields"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS"
+msgstr "Build groups"
+
+msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX"
+msgstr "Build min/max"
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME"
+msgstr "Time"
+
+msgid "VisuGUI_BuildProgressDlg::TIME"
+msgstr "Elapsed time : "
+
+msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE"
+msgstr "Import from File"
+
+msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES"
+msgstr "All Files (*.*)"
+
+msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES"
+msgstr "MED Files (*.med)"
+
+msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH"
+msgstr "Close dialog at finish"
+
+msgid "VisuGUI_BuildProgressDlg::START"
+msgstr "Start"
+
+msgid "VisuGUI_BuildProgressDlg::CLOSE"
+msgstr "Close"
+
+msgid "VisuGUI_BuildProgressDlg::HELP"
+msgstr "Help"
+
+msgid "VisuGUI_BuildProgressDlg::ERR_ERROR_IN_THE_FILE"
+msgstr "Error in the file"
+
+msgid "VVTK_RecorderDlg::DLG_RECORDER_TITLE"
+msgstr "Recorder"
+
+msgid "VVTK_RecorderDlg::SETTINGS"
+msgstr "Settings"
+
+msgid "VVTK_RecorderDlg::FILE_NAME"
+msgstr "Save to file : "
+
+msgid "VVTK_RecorderDlg::FLT_ALL_FILES"
+msgstr "All Files (*.*)"
+
+msgid "VVTK_RecorderDlg::FLT_AVI_FILES"
+msgstr "AVI Files (*.avi)"
+
+msgid "VVTK_RecorderDlg::RECORDING_MODE"
+msgstr "Mode : "
+
+msgid "VVTK_RecorderDlg::SKIPPED_FRAMES"
+msgstr "Recording at a given FPS"
+
+msgid "VVTK_RecorderDlg::ALL_DISLPAYED_FRAMES"
+msgstr "Recording all displayed frames"
+
+msgid "VVTK_RecorderDlg::FPS"
+msgstr "FPS : "
+
+msgid "VVTK_RecorderDlg::QUALITY"
+msgstr "Quality : "
+
+msgid "VVTK_RecorderDlg::PROGRESSIVE"
+msgstr "Progressive"
+
+msgid "VVTK_RecorderDlg::START"
+msgstr "Start"
+
+msgid "VVTK_RecorderDlg::CLOSE"
+msgstr "Close"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TITLE"
+msgstr "Change Transparency"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TRANSPARENT"
+msgstr "Transparent"
+
+msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_OPAQUE"
+msgstr "Opaque"
+
+msgid "VisuGUI_TransparencyDlg::BUT_CLOSE"
+msgstr "Close"
+
+msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
+msgstr "Gauss scene:%1 - viewer:%2"
+
+msgid "VVTK_MainWindow::LBL_TOOLBAR_RECORD_LABEL"
+msgstr "Recording Operations"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START"
+msgstr "Start recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY"
+msgstr "Play recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE"
+msgstr "Pause recording"
+
+msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP"
+msgstr "Stop recording"
+
+msgid "VVTK_MainWindow1::LBL_TOOLBAR_GAUSS_LABEL"
+msgstr "Gauss Viewer Tools"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Interaction Style Switch"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_INTERACTOR_STYLE_SWITCH"
+msgstr "Interaction Style Switch"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Selection Mode Switch"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH"
+msgstr "Selection Mode Switch"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation"
+
+msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation"
+
+msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"
+msgstr "Sphere Segmentation"
+
+msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE"
+msgstr "Primitive"
+
+msgid "VVTK_PrimitiveBox::POINT_SPRITE"
+msgstr "Point Sprite"
+
+msgid "VVTK_PrimitiveBox::OPENGL_POINT"
+msgstr "OpenGL Point"
+
+msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE"
+msgstr "Geometrical Sphere"
+
+msgid "VVTK_PrimitiveBox::CLAMP"
+msgstr "Maximum Size (Clamp) : "
+
+msgid "VVTK_PrimitiveBox::MAIN_TEXTURE"
+msgstr "Main Texture (16x16) : "
+
+msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE"
+msgstr "Alpha Channel Texture (16x16) : "
+
+msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD"
+msgstr "Alpha Channel Threshold : "
+
+msgid "VVTK_PrimitiveBox::RESOLUTION"
+msgstr "Resolution : "
+
+msgid "VVTK_PrimitiveBox::FACE_NUMBER"
+msgstr "Number of faces : "
+
+msgid "VVTK_PrimitiveBox::FACE_LIMIT"
+msgstr "Notify when number of faces exceeds : "
+
+msgid "VVTK_SizeBox::SIZE_TITLE"
+msgstr "Size"
+
+msgid "VVTK_SizeBox::OUTSIDE_SIZE"
+msgstr "Percentage of normal size(%) : "
+
+msgid "VVTK_SizeBox::GEOM_SIZE"
+msgstr "Size of points (%) : "
+
+msgid "VVTK_SizeBox::MIN_SIZE"
+msgstr "Range values for min size (%) : "
+
+msgid "VVTK_SizeBox::MAX_SIZE"
+msgstr "max size (%) : "
+
+msgid "VVTK_SizeBox::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VVTK_SizeBox::INCREMENT"
+msgstr "+/- Ratio : "
+
+msgid "VVTK_SizeBox::COLOR_TITLE"
+msgstr "Color"
+
+msgid "VVTK_SizeBox::UNIFORM_COLOR"
+msgstr "Uniform Color"
+
+msgid "VVTK_SizeBox::COLOR"
+msgstr "Color : "
+
+msgid "VisuGUI_GaussPointsDlg::&Cancel"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::&OK"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::WARNING"
+msgstr "Warning"
+
+msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
+msgstr "Scalar Bar"
+
+msgid "VisuGUI_GaussPointsDlg::PRS_TITLE"
+msgstr "Presentation"
+
+msgid "VisuGUI_GaussPointsDlg::RESULTS"
+msgstr "Results"
+
+msgid "VisuGUI_GaussPointsDlg::GEOMETRY"
+msgstr "Geometry"
+
+msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE_TITLE"
+msgstr "Deformed Shape"
+
+msgid "VisuGUI_GaussPointsDlg::SCALE_FACTOR"
+msgstr "Scale Factor :"
+
+msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP"
+msgstr "Active bar"
+
+msgid "VisuGUI_GaussScalarBarPane::LOCAL"
+msgstr "Local"
+
+msgid "VisuGUI_GaussScalarBarPane::GLOBAL"
+msgstr "Global"
+
+msgid "VisuGUI_GaussScalarBarPane::DISPLAYED"
+msgstr "Displayed"
+
+msgid "VisuGUI_GaussScalarBarPane::SCALAR_RANGE_GRP"
+msgstr "Scalar range"
+
+msgid "VisuGUI_GaussScalarBarPane::LOGARITHMIC_SCALING"
+msgstr "Logarithmic scaling"
+
+msgid "VisuGUI_GaussScalarBarPane::FIELD_RANGE_BTN"
+msgstr "Use field range"
+
+msgid "VisuGUI_GaussScalarBarPane::IMPOSED_RANGE_BTN"
+msgstr "Use imposed range"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_MIN"
+msgstr "Min:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_MAX"
+msgstr "Max:"
+
+msgid "VisuGUI_GaussScalarBarPane::COLORS_LABELS_GRP"
+msgstr "Colors and labels"
+
+msgid "VisuGUI_GaussScalarBarPane::BICOLOR"
+msgstr "Bicolor"
+
+msgid "VisuGUI_GaussScalarBarPane::RAINBOW"
+msgstr "Rainbow"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_NB_COLORS"
+msgstr "Nb. of colors:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_NB_LABELS"
+msgstr "Nb. of labels:"
+
+msgid "VisuGUI_GaussScalarBarPane::ORIENTATION_GRP"
+msgstr "Orientation"
+
+msgid "VisuGUI_GaussScalarBarPane::VERTICAL_BTN"
+msgstr "Vertical"
+
+msgid "VisuGUI_GaussScalarBarPane::HORIZONTAL_BTN"
+msgstr "Horizontal"
+
+msgid "VisuGUI_GaussScalarBarPane::ORIGIN_GRP"
+msgstr "Origin"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_X"
+msgstr "X:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_Y"
+msgstr "Y:"
+
+msgid "VisuGUI_GaussScalarBarPane::DIMENSIONS_GRP"
+msgstr "Dimensions"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_WIDTH"
+msgstr "Width:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_HEIGHT"
+msgstr "Height:"
+
+msgid "VisuGUI_GaussScalarBarPane::LBL_SPACING"
+msgstr "Spacing:"
+
+msgid "VisuGUI_GaussScalarBarPane::SAVE_DEFAULT_CHK"
+msgstr "Save as default values"
+
+msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL"
+msgstr "GAUSS viewer tools"
+
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_DLG_TITLE"
+msgstr "Segmentation Cursor"
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_TITLE"
+msgstr "Origin"
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_X"
+msgstr "X: "
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_Y"
+msgstr "Y: "
+
+msgid "VVTK_SegmentationCursorDlg::ORIGIN_Z"
+msgstr "Z: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_TITLE"
+msgstr "Direction"
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DX"
+msgstr "DX: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DY"
+msgstr "DY: "
+
+msgid "VVTK_SegmentationCursorDlg::DIRECTION_DZ"
+msgstr "DZ: "
+
+msgid "VVTK_SegmentationCursorDlg::DEPTH_TITLE"
+msgstr "Depth"
+
+msgid "VVTK_SegmentationCursorDlg::DEPTH"
+msgstr "Depth of the cursor: "
+
+msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE"
+msgstr "Radius"
+
+msgid "VVTK_SegmentationCursorDlg::RADIUS"
+msgstr "Radius of the cursor :"
+
+msgid "VVTK_SegmentationCursorDlg::RATIO"
+msgstr "+/- Ratio :"
+
+msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB"
+msgstr "Segmentation Cursor"
+
+msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS"
+msgstr "Inside Cursor Gauss Points Presentation"
+
+msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS"
+msgstr "Outside Cursor Gauss Points Presentation"
+
+msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION_TITLE"
+msgstr "Magnification"
+
+msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VVTK_SegmentationCursorDlg::INCREMENT"
+msgstr "+/- Ratio : "
+
+msgid "VVTK_PickingDlg::PICKING_DLG_TITLE"
+msgstr "Picking"
+
+msgid "VVTK_PickingDlg::CURSOR_TITLE"
+msgstr "Cursor"
+
+msgid "VVTK_PickingDlg::CURSOR_SIZE"
+msgstr "Size of the cursor :"
+
+msgid "VVTK_PickingDlg::PYRAMID_HEIGHT"
+msgstr "Height of the pyramids :"
+
+msgid "VVTK_PickingDlg::SELECTION_COLOR"
+msgstr "Selection cursor color :"
+
+msgid "VVTK_PickingDlg::TOLERANCE_TITLE"
+msgstr "Tolerance"
+
+msgid "VVTK_PickingDlg::POINT_TOLERANCE"
+msgstr "Point tolerance :"
+
+msgid "VVTK_PickingDlg::INFO_WINDOW_TITLE"
+msgstr "Information window"
+
+msgid "VVTK_PickingDlg::TRANSPARENCY"
+msgstr "Transparency :"
+
+msgid "VVTK_PickingDlg::POSITION"
+msgstr "Position :"
+
+msgid "VVTK_PickingDlg::BELOW_POINT"
+msgstr "Centered below the point"
+
+msgid "VVTK_PickingDlg::TOP_LEFT_CORNER"
+msgstr "Top-left corner of the 3D view"
+
+msgid "VVTK_PickingDlg::CAMERA_TITLE"
+msgstr "Movement of the camera"
+
+msgid "VVTK_PickingDlg::ZOOM_FACTOR"
+msgstr "Zoom at first selected point (ratio) :"
+
+msgid "VVTK_PickingDlg::STEP_NUMBER"
+msgstr "Number of steps between two positions :"
+
+msgid "VVTK_PickingDlg::PARENT_MESH_TITLE"
+msgstr "Parent mesh element"
+
+msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH"
+msgstr "Display parent mesh element"
+
+msgid "VisuGUI_Module::TOT_DESK_FILE_SAVE_GUI_STATE"
+msgstr "Save VISU state"
+
+msgid "VisuGUI_Module::MEN_DESK_FILE_SAVE_GUI_STATE"
+msgstr "Save VISU state"
+
+msgid "VisuGUI_Module::PRP_DESK_FILE_SAVE_GUI_STATE"
+msgstr "Saves current state of viewers, displayed objects, etc."
+
+msgid "VISU_MESH"
+msgstr "Mesh"
+
+msgid "VISU_SCALAR_MAP"
+msgstr "Scalar Map"
+
+msgid "VISU_ISO_SURFACES"
+msgstr "Iso Surfaces"
+
+msgid "VISU_CUT_PLANES"
+msgstr "Cut Planes"
+
+msgid "VISU_CUT_LINES"
+msgstr "Cut Lines"
+
+msgid "VISU_DEFORMED_SHAPE"
+msgstr "Deformed Shape"
+
+msgid "VISU_VECTORS"
+msgstr "Vectors"
+
+msgid "VISU_STREAM_LINES"
+msgstr "Stream Lines"
+
+msgid "VISU_PLOT3D"
+msgstr "Plot3D"
+
+msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
+msgstr "Scalar Map on Def. Shape"
\ No newline at end of file
index 3aa0b6a61d086ea88520990de5edb958fa53050b..9ef0a4ab1e9324ca9c23d3b6daddb4bcc852591e 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -73,6 +73,7 @@
 #include "SalomeApp_Application.h"
 #include "SalomeApp_DataModel.h"
 #include "SalomeApp_Study.h"
+#include "SalomeApp_CheckFileDlg.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_Selection.h"
 #include "LightApp_Preferences.h"
@@ -95,7 +96,6 @@
 
 #include "VisuGUI_PopupTools.h"
 #include "VisuGUI_NameDlg.h"
-#include "VisuGUI_FileDlg.h"
 #include "VisuGUI_CursorDlg.h"
 #include "VisuGUI_Selection.h"
 #include "VisuGUI_TimeAnimation.h"
 
 #include "VisuGUI_Timer.h"
 
+#include "VVTK_ViewModel.h"
+
 using namespace VISU;
 
 #ifdef _DEBUG_
@@ -176,55 +178,68 @@ OnImportFromFile()
   if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
   if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
     return;
+  
+  SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
 
-  VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
-  aBuildProgressDlg->setGenerator( GetVisuGen(this) );
-  aBuildProgressDlg->show();
-}
-
-
-void
-VisuGUI::
-OnExploreMEDFile()
-{
-  if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()");
-  _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
-  if ( CheckLock(aStudy,GetDesktop(this)) )
-    return;
-
-  SALOME_MED::MED_Gen_var aGen = GetMEDEngine();
-
+  // Get file name
   QStringList aFilter;
-  aFilter.append( tr("FLT_MED_FILES") );
-  aFilter.append( tr("FLT_ALL_FILES") );
-
-  QFileInfo aFileInfo =
-    SUIT_FileDlg::getFileName(GetDesktop(this),
-                              "",
-                              aFilter,
-                              tr("MEN_EXPLORE_MED_FILE"),
-                              true);
-  if(aFileInfo.exists()){
-    application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
-    std::string aStudyName = aStudy->Name();
-    try
+  aFilter.append( tr( "FLT_MED_FILES" ) );
+  aFilter.append( tr( "FLT_ALL_FILES" ) );
+  
+  bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
+
+  SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
+  fd->setCaption( tr( "IMPORT_FROM_FILE" ) );
+  fd->setFilters( aFilter );
+  fd->SetChecked( toUseBuildProgress );
+  fd->exec();
+  QFileInfo aFileInfo( fd->selectedFile() );
+  toUseBuildProgress = fd->IsChecked();
+  delete fd;
+  
+  // Check the file name
+  if ( !aFileInfo.exists() )
+    return;
+  
+  if ( !toUseBuildProgress )
     {
-      aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
+      bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
+      bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
+      bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
+      bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
+      bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
+      
+      QString anInfo("Importing From File " + aFileInfo.filePath() + "..." ); 
+      application()->putInfo( anInfo );
+
+      QApplication::setOverrideCursor(Qt::waitCursor);
+      VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath() );
+
+      if (CORBA::is_nil(aResult.in())) {
+       SUIT_MessageBox::warn1(GetDesktop(this),
+                              tr("WRN_VISU"),
+                              VisuGUI_BuildProgressDlg::tr("ERR_ERROR_IN_THE_FILE"),
+                              tr("BUT_OK"));
+       QApplication::restoreOverrideCursor();
+      }else{
+       aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+       aResult->SetBuildGroups( toBuildGroups );
+       aResult->Build( toBuildAll, toBuildAtOnce );
+
+       UpdateObjBrowser(this);
+       application()->putInfo( anInfo + tr("INF_DONE"));
+       QApplication::restoreOverrideCursor();
+      }
     }
-    catch(...)
+  else
     {
-      SUIT_MessageBox::warn1(GetDesktop(this),
-                             tr("WRN_VISU"),
-                             tr("ERR_ERROR_IN_THE_FILE"),
-                             tr("BUT_OK"));
+      VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+      aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+      aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+      aBuildProgressDlg->show();
     }
-    application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
-    getApp()->updateObjectBrowser(true); // as need to update MED tree
-    getApp()->updateActions();
-  }
 }
 
-
 void
 VisuGUI::
 OnImportTableFromFile()
@@ -426,11 +441,33 @@ CreateCurves( SalomeApp_Module* theModule,
     _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
     for (; aIter->More(); aIter->Next()) {
       _PTR(SObject) aTblObj = aIter->Value();
-      if ( aTblObj ) {
+      if( aTblObj ) {
         _PTR(GenericAttribute) anAttr;
         if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
+
+         _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
+         SalomeApp_Study* salome_study = GetAppStudy( theModule );
+         for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
+           salome_study->deleteReferencesTo( aChildIter->Value() );
+           _PTR(SObject) aSO = aChildIter->Value();
+           if(aSO){
+             if (getValue(aSO, "myComment") == QString("CURVE")) {
+               CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
+               if(!CORBA::is_nil(aCORBAObject)){
+                 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+                 VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(aServant.in());
+                 if(pCrv){
+                   PlotRemoveCurve(theModule,pCrv);
+                 }
+               }
+             }
+           }
+           
+         }
+
           aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
-         UpdateObjBrowser(theModule,true,aTblObj);
+
+         //UpdateObjBrowser(theModule,true,aTblObj);
           break;
         }
       }
@@ -476,9 +513,10 @@ OnCreateMesh()
     return;
 
   // create a VTK view window if it does not exist
-  GetViewWindow( this, /*create=*/true );
+  SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
 
-  CreateMesh(this, anIO);
+  // create mesh presentation and display it in aViewWindow
+  CreateMesh(this, anIO, aViewWindow);
 }
 
 void
@@ -490,7 +528,7 @@ OnCreateManyMesh()
     return;
 
   // create a VTK view window if it does not exist
-  GetViewWindow( this, /*create=*/true );
+  SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
 
   // Get selected SObject
   LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
@@ -502,7 +540,8 @@ OnCreateManyMesh()
     if (anIO.IsNull() || !anIO->hasEntry())
       return;
 
-    CreateMesh(this, anIO);
+    // create mesh presentation and display it in aViewWindow
+    CreateMesh(this, anIO, aViewWindow);
   }
 }
 
@@ -585,62 +624,65 @@ OnDisplayPrs()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
 
+  LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
+  if (!mgr) return;
+
   QApplication::setOverrideCursor(Qt::waitCursor);
+
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
+
   SALOME_ListIO aSel, aList;
-  LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
-  mgr->selectedObjects( aSel );
+  mgr->selectedObjects(aSel);
+  extractContainers(aSel, aList);
 
-  extractContainers( aSel, aList );
+  for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+    Handle(SALOME_InteractiveObject) anIO = it.Value();
+    CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
 
-  Handle(SALOME_InteractiveObject) anIO;
-  for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
-    anIO = it.Value();
-    CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-    if ( !CORBA::is_nil( anObject ) ) {
+    if (!CORBA::is_nil(anObject)) {
       // is it Prs3d object ?
       VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
-      if(aPrsObject){
+      if (aPrsObject) {
         if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
         //UpdateViewer( this, aPrsObject );
-       SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
-        if ( vw )
-       {
-         displayer()->Display( anIO->getEntry() );
+        if (vw) {
+         displayer()->Display(anIO->getEntry());
          vw->highlight(anIO, 1);
         }
         continue;
       }
       // is it Curve ?
       VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
-      if(aCurve){
+      if (aCurve) {
         if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
         //PlotCurve( this, aCurve, VISU::eDisplay );
-       displayer()->Display( anIO->getEntry() );
+       displayer()->Display(anIO->getEntry());
         continue;
       }
       // is it Container ?
       VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
-      if(aContainer){
+      if (aContainer) {
         if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
         //PlotContainer( this, aContainer, VISU::eDisplay );
-       displayer()->Display( anIO->getEntry() );
+       displayer()->Display(anIO->getEntry());
         continue;
       }
       // is it Table ?
       VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
-      if(aTable){
+      if (aTable) {
         if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
         //PlotTable( this, aTable, VISU::eDisplay );
-       displayer()->Display( anIO->getEntry() );
+       displayer()->Display(anIO->getEntry());
         continue;
       }
     }
   }
-  SVTK_ViewWindow* vw = GetViewWindow( this );
-  if ( vw ) {
+
+  if (vw) {
     vw->getRenderer()->ResetCameraClippingRange();
     vw->Repaint();
   }
+
   QApplication::restoreOverrideCursor();
 }
 
@@ -660,27 +702,24 @@ OnErasePrs()
 
   QApplication::setOverrideCursor(Qt::waitCursor);
 
-  SVTK_ViewWindow* vw = GetViewWindow( this );
-  if (vw)
-    vw->unHighlightAll();
+  //SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
+  //if (vw)
+  //  vw->unHighlightAll();
 
   SALOME_ListIO aList, aSel;
   LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
-  mgr->selectedObjects( aSel );
+  mgr->selectedObjects(aSel);
+  extractContainers(aSel, aList);
 
-  extractContainers( aSel, aList );
-
-  Handle(SALOME_InteractiveObject) anIO;
-  for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
-    anIO = it.Value();
-    CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-    if (!CORBA::is_nil(anObject))
-      RemoveScalarBarPosition(this,anObject);
-    ErasePrs( this, anObject, false );
+  for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+    Handle(SALOME_InteractiveObject) anIO = it.Value();
+    CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+    //ErasePrs(this, anObject, /*repaint_view_window = */false);
+    ErasePrs(this, anObject, /*repaint_view_window = */true);
   }
 
-  if (vw)
-    vw->Repaint();
+  //if (vw)
+  //  vw->Repaint();
 
   QApplication::restoreOverrideCursor();
 }
@@ -690,7 +729,7 @@ VisuGUI::
 OnEraseAll()
 {
   startOperation( myEraseAll );
-  if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
+  if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
     vw->unHighlightAll();
     if (vtkRenderer *aRen = vw->getRenderer()) {
       vtkActor *anActor;
@@ -698,7 +737,7 @@ OnEraseAll()
       for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
         if (anActor->GetVisibility() > 0)
           if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
-           RemoveScalarBarPosition(this,anVISUActor->GetPrs3d());
+           RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
             anVISUActor->VisibilityOff();
           }
       }
@@ -715,26 +754,17 @@ VisuGUI::
 OnEditScalarMap()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
 }
 
-
 void
 VisuGUI::
 OnEditDeformedShape()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg, 1>(this, anIO, aPrs3d);
 }
 
 void
@@ -742,12 +772,8 @@ VisuGUI::
 OnEditScalarMapOnDeformedShape()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg, 1>(this, anIO, aPrs3d);
 }
 
 void
@@ -755,82 +781,53 @@ VisuGUI::
 OnEditCutPlanes()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg, 0>(this, anIO, aPrs3d);
 }
 
-
 void
 VisuGUI::
 OnEditCutLines()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
 }
 
-
 void
 VisuGUI::
 OnEditIsoSurfaces()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg, 1>(this, anIO, aPrs3d);
 }
 
-
 void
 VisuGUI::
 OnEditVectors()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg, 1>(this, anIO, aPrs3d);
 }
 
-
 void
 VisuGUI::
 OnEditStreamLines()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg, 1>(this, anIO, aPrs3d);
 }
 
-
 void
 VisuGUI::
 OnEditPlot3D()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
-      aViewWindow->highlight(anIO, 1);
-    }
-  }
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO))
+    EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg, 0>(this, anIO, aPrs3d);
 }
 
 
@@ -903,7 +900,7 @@ OnChangeColor()
   VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
   if (!aPrs3d) return;
 
-  SVTK_ViewWindow* vw = GetViewWindow(this);
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
   if (!vw) return;
 
   VISU_Actor* anActor = GetActor(aPrs3d, vw);
@@ -975,7 +972,7 @@ OnChangeWireframeColor()
   VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
   if (!aPrs3d) return;
 
-  SVTK_ViewWindow* vw = GetViewWindow(this);
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
   if (!vw) return;
 
   VISU_Actor* anActor = GetActor(aPrs3d, vw);
@@ -1010,7 +1007,7 @@ OnChangeOpacity()
   VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
   if (!aPrsObject) return;
 
-  SVTK_ViewWindow* vw = GetViewWindow(this);
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
   if (!vw) return;
 
   VISU_Actor* anActor = GetActor(aPrsObject, vw);
@@ -1033,7 +1030,7 @@ OnChangeLines()
   VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
   if (!aPrsObject) return;
 
-  SVTK_ViewWindow* vw = GetViewWindow(this);
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
   if (!vw) return;
 
   VISU_Actor* anActor = GetActor(aPrsObject, vw);
@@ -1114,7 +1111,8 @@ void
 VisuGUI::
 OnDeleteObjects()
 {
-  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+  SalomeApp_Study* anAppStudy = GetAppStudy(this);
+  _PTR(Study) aCStudy = GetCStudy(anAppStudy);
   if (CheckLock(aCStudy,GetDesktop(this)))
     return;
 
@@ -1141,8 +1139,44 @@ OnDeleteObjects()
   for (i = 0; i < nbSelected; i++) {
     _PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
     if (aSObject) {
-      DeleteSObject(this, aCStudy, aSObject);
-      UpdateObjBrowser(this, true, aSObject);
+      _PTR(SObject) aRefObj;
+      if (aSObject->ReferencedObject(aRefObj)) {
+        // It can be a reference on curve, published under a container.
+        // In this case the curve should be removed from the container.
+        // See bug 10441.
+        CORBA::Object_var aCorbaObj = VISU::GetSelectedObj(anAppStudy, aRefObj->GetID().c_str());
+        if (!CORBA::is_nil(aCorbaObj)) {
+          VISU::Base_var aVisuObj = VISU::Base::_narrow(aCorbaObj);
+          if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TMESH)
+         {
+           DeleteSObject(this, aCStudy, aRefObj);
+           UpdateObjBrowser(this, true, aRefObj);
+         }
+          else if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
+            VISU::Curve_ptr aCurve = VISU::Curve::_narrow(aVisuObj);
+            _PTR(SObject) aParentSO = aSObject->GetFather();
+            aCorbaObj = VISU::GetSelectedObj(anAppStudy, aParentSO->GetID().c_str());
+            if (!CORBA::is_nil(aCorbaObj) && !CORBA::is_nil(aCurve)) {
+              aVisuObj = VISU::Base::_narrow(aCorbaObj);
+              if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCONTAINER) {
+                // Container object
+                CORBA::Object_ptr aCnt = VISU::Container::_narrow(aVisuObj);
+                if (!CORBA::is_nil(aCnt)) {
+                  VISU::Container_i* aContainer =
+                    dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
+                  if (aContainer && aContainer->GetNbCurves() > 0) {
+                    aContainer->RemoveCurve(aCurve);
+                    UpdateObjBrowser(this, true, aParentSO);
+                  }
+                }
+              }
+            }
+          }
+        }
+      } else {
+        DeleteSObject(this, aCStudy, aSObject);
+        UpdateObjBrowser(this, true, aSObject);
+      }
     }
   }
 
@@ -1150,6 +1184,7 @@ OnDeleteObjects()
 
   // Finish transaction
   aStudyBuilder->CommitCommand();
+  mgr->clearSelected();
 }
 
 void
@@ -1443,7 +1478,8 @@ OnRestoreViewParams()
   //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
   _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
-  VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
+  if ( aSObj )
+    VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
 }
 
 void
@@ -1559,7 +1595,7 @@ OnSweep()
   VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
   if (!aPrsObject) return;
 
-  SVTK_ViewWindow* vw = GetViewWindow(this);
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
   if (!vw) return;
 
   VISU_Actor* aActor = GetActor(aPrsObject, vw);
@@ -1602,7 +1638,7 @@ void
 VisuGUI::
 OnTimeAnimation()
 {
-  if(!VISU::GetViewWindow(this))
+  if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
     return;
 
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
@@ -1641,7 +1677,7 @@ void
 VisuGUI::
 OnShowAnimation()
 {
-  if(!VISU::GetViewWindow(this))
+  if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
     return;
 
   LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
@@ -1699,7 +1735,6 @@ OnCopyPresentation()
       VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
       VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
       aSameMesh->SameAs(aMeshPrs);
-      UpdateViewer(this, aSameMesh);
     }
     break;
   case VISU::TSCALARMAP:
@@ -1707,7 +1742,6 @@ OnCopyPresentation()
       VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
       VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
       aSameScalar->SameAs(aScalarPrs);
-      UpdateViewer(this, aSameScalar);
     }
     break;
   case VISU::TDEFORMEDSHAPE:
@@ -1715,15 +1749,15 @@ OnCopyPresentation()
       VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
       VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
       aSameDeformed->SameAs(aDefPrs);
-      UpdateViewer(this, aSameDeformed);
     }
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE:
     {
-      VISU::ScalarMapOnDeformedShape_i* aDefPrs = dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
-      VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed = new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
+      VISU::ScalarMapOnDeformedShape_i* aDefPrs =
+        dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>(aPrsObject);
+      VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed =
+        new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true);
       aSameScalarMapOnDeformed->SameAs(aDefPrs);
-      UpdateViewer(this, aSameScalarMapOnDeformed);
     }
     break;
   case VISU::TCUTPLANES:
@@ -1731,7 +1765,6 @@ OnCopyPresentation()
       VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
       VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
       aSameCut->SameAs(aCutPrs);
-      UpdateViewer(this, aSameCut);
     }
     break;
   case VISU::TCUTLINES:
@@ -1739,7 +1772,6 @@ OnCopyPresentation()
       VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
       VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
       aSameCut->SameAs(aCutPrs);
-      UpdateViewer(this, aSameCut);
     }
     break;
   case VISU::TISOSURFACE:
@@ -1747,7 +1779,6 @@ OnCopyPresentation()
       VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
       VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
       aSameIso->SameAs(aIsoPrs);
-      UpdateViewer(this, aSameIso);
     }
     break;
   case VISU::TSTREAMLINES:
@@ -1755,7 +1786,6 @@ OnCopyPresentation()
       VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
       VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
       aSameLines->SameAs(aLinesPrs);
-      UpdateViewer(this, aSameLines);
     }
     break;
   case VISU::TVECTORS:
@@ -1763,7 +1793,6 @@ OnCopyPresentation()
       VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
       VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
       aSameVectors->SameAs(aVectorsPrs);
-      UpdateViewer(this, aSameVectors);
     }
     break;
   case VISU::TPLOT3D:
@@ -1771,7 +1800,6 @@ OnCopyPresentation()
       VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
       VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
       aSamePlot3D->SameAs(aPlot3DPrs);
-      UpdateViewer(this, aSamePlot3D);
     }
     break;
   }
@@ -1782,7 +1810,7 @@ void
 VisuGUI::
 OnSelectionInfo()
 {
-  if (GetViewWindow(this))
+  if (GetActiveViewWindow<SVTK_ViewWindow>(this))
     (new VisuGUI_SelectionDlg(this))->show();
   else
     SUIT_MessageBox::warn1(GetDesktop(this),
@@ -1845,11 +1873,9 @@ OnMergeScalarBars()
     }
   }
   if (update) {
-    if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
-        vw->getRenderer()->ResetCameraClippingRange();
-        vw->Repaint();
-//}
+    if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
+      vw->getRenderer()->ResetCameraClippingRange();
+      vw->Repaint();
     }
   }
 }
@@ -1884,11 +1910,9 @@ OnFreeScalarBars()
     }
   }
   if (update) {
-    if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
-        vw->getRenderer()->ResetCameraClippingRange();
-        vw->Repaint();
-//}
+    if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
+      vw->getRenderer()->ResetCameraClippingRange();
+      vw->Repaint();
     }
   }
 }
@@ -1932,7 +1956,7 @@ void
 VisuGUI::
 OnArrangeActors()
 {
-  SVTK_ViewWindow* vw = GetViewWindow(this);
+  SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
   if (vw) {
     ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
     aDlg->exec();
@@ -1962,14 +1986,15 @@ createActions()
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   // Create actions
-  createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
+  //createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
+  //              tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
+  //              this, SLOT(OnImportFromFile()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED"));
+  createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIconSet(aPixmap),
                 tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
                 this, SLOT(OnImportFromFile()));
 
-  createAction( VISU_EXPLORE_MED, "", QIconSet(),
-                tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
-                this, SLOT(OnExploreMEDFile()));
-
   createAction( VISU_IMPORT_TABLE, "", QIconSet(),
                 tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
                 this, SLOT(OnImportTableFromFile()));
@@ -2249,18 +2274,21 @@ createActions()
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
   createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
                 tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
-                //this, SLOT(OnEraseAll()));
                 this);
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
   createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
                 tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
-                //this, SLOT(OnEraseAll()));
                 this);
 
   createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
                 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
                 this, SLOT(OnShowAnimation()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
+  createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIconSet(aPixmap),
+                tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
+                this, SLOT(OnPlot3dFromCutPlane()));
 }
 
 void
@@ -2271,9 +2299,10 @@ createMenus()
   int aMenuId;
   aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
   createMenu( separator(), aMenuId, -1, 10 );
-  createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
-  createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
-  createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
+  
+  int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
+  createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
+  createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
 
   aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
   createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
@@ -2304,7 +2333,10 @@ void
 VisuGUI::
 createToolBars()
 {
-  int aToolId = createTool(tr("TOOL_VISUALISATION"));
+  int aToolId = createTool( tr("TOOL_IMPORT") );
+  createTool( VISU_IMPORT_FROM_FILE, aToolId );
+
+  aToolId = createTool(tr("TOOL_VISUALISATION"));
   createTool( VISU_SCALAR_MAP, aToolId );
   createTool( VISU_DEFORMED_SHAPE, aToolId );
   createTool( VISU_VECTORS, aToolId );
@@ -2464,7 +2496,7 @@ createPopupMenus()
   QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
   QString aPrsVisible   = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
   QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
-  QString aComponent = "( selcount=1 and canBeDisplayed and isComponent )";
+  QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
 
   QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
     " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent;
@@ -2499,7 +2531,9 @@ createPopupMenus()
   // 3D presentations commands
   QString aPrsType    = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
   QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
-  QString aSurfType   = " and $type in {'VISU::TMESH'}";
+  QString aSurfFrameType   = " and $type in {'VISU::TMESH'}";
+  QString aSurfType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+                        " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
   QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
                         "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
   QString aLineType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
@@ -2517,9 +2551,9 @@ createPopupMenus()
 
   mgr->setRule( action( VISU_POINTS )      , aRule + aPrsType + aNotPoints, true );
   mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType + aNotWirefr, true );
-  mgr->setRule( action( VISU_SURFACE )     , aRule + aPrsType + aNotSurfac, true );
+  mgr->setRule( action( VISU_SURFACE )     , aRule + aSurfType + aNotSurfac, true );
   mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true );
-  mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true );
+  mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr, true );
 
   mgr->setRule( action( VISU_SHRINK )  , aRule + aShrinkType + " and isShrunk=0", true );
   mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
@@ -2622,6 +2656,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
 
     if (!anIO.IsNull() && anIO->hasEntry()) {
       _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+      if ( !aSObject )
+       continue;
       CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
       if (CORBA::is_nil(aCORBAObject)) {
         _PTR(GenericAttribute) anAttr;
@@ -2647,28 +2683,23 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
       }
     }
   }
-
   if (nbPrs > 1) {
     theMenu->insertSeparator();
     action( VISU_MERGE_SCALAR_BARS )->addTo(theMenu);
     action( VISU_FREE_SCALAR_BARS  )->addTo(theMenu);
   }
 
-  theMenu->insertSeparator();
-
-  // Check if some (nb > 0) removable objects selected
-  if (isOBClient && IsRemovableSelected(this)) {
-    action( VISU_DELETE_OBJS )->addTo(theMenu);
-  }
-
   // Check if some curves selected (for bug PAL10611)
   bool isCurves = false;
+  bool isOneCutPlane = false;
   SALOME_ListIteratorOfListIO It1 (aListIO);
   for (; It1.More() && !isCurves; It1.Next()) {
     Handle(SALOME_InteractiveObject)& anIO = It1.Value();
 
     if (!anIO.IsNull() && anIO->hasEntry()) {
       _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+      if ( !aSObject )
+       continue;
       _PTR(GenericAttribute) anAttr;
       if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
         _PTR(AttributeComment) aComment (anAttr);
@@ -2678,12 +2709,35 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
         VISU::Storable::StrToMap(strIn, pMap);
         bool isExist;
         VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
-        if (isExist && aType == VISU::TCURVE) {
+       if (isExist && aType == VISU::TCURVE) {
           isCurves = true;
-        }
+        }  else {
+         CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+         if (!CORBA::is_nil(anObject)) {
+          VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
+          if (aPrsObject) {
+            if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+              VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+              if (aCutPrs) {
+                isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
+              }
+            }
+          }
+         }
+       }
       }
     }
   }
+
+  if (isOneCutPlane)
+    action( VISU_PLOT3D_FROM_CUTPLANE )->addTo(theMenu);
+
+  theMenu->insertSeparator();
+
+  // Check if some (nb > 0) removable objects selected
+  if (isOBClient && IsRemovableSelected(this)) {
+    action( VISU_DELETE_OBJS )->addTo(theMenu);
+  }
   if (isCurves) {
     action( myDisplay     )->removeFrom(theMenu);
     action( myErase       )->removeFrom(theMenu);
@@ -2699,6 +2753,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
   CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
 
   _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
+  if ( !SO )
+    return;
   bool isExist;
   VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
 
@@ -2757,7 +2813,12 @@ VisuGUI::
 viewManagers( QStringList& theList ) const
 {
   theList.clear();
-  theList.append( SVTK_Viewer::Type() );
+  // append SVTK viewer only if there is no opened VVTK
+  SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
+  if( vm && vm->getViewsCount()>0 )
+    theList.append( VVTK_Viewer::Type() );
+  else
+    theList.append( SVTK_Viewer::Type() );
 }
 
 
@@ -2778,6 +2839,10 @@ activateModule( SUIT_Study* theStudy )
   studyActivated();
   setMenuShown( true );
   setToolShown( true );
+
+  // Reset actions accelerator keys
+  action(VISU_IMPORT_FROM_FILE)->setAccel(QKeySequence(CTRL + Key_I));
+
   return true;
 }
 
@@ -2789,6 +2854,9 @@ deactivateModule( SUIT_Study* theStudy )
   setMenuShown( false );
   setToolShown( false );
 
+  // Unset actions accelerator keys
+  action(VISU_IMPORT_FROM_FILE)->setAccel(QKeySequence());
+
   SalomeApp_Module::deactivateModule( theStudy );
   return true;
 }
@@ -2980,6 +3048,7 @@ void VisuGUI::createPreferences()
   // group: "MED files import"
   int importGr = addPreference( tr( "MED files import" ), srangeTab );
   setPreferenceProperty( importGr, "columns", 1 );
+  addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
   addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
   addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
   addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
@@ -2987,9 +3056,91 @@ void VisuGUI::createPreferences()
   addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
   addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
 
-  // group: "Representation properties"
-  int representGr = addPreference( tr( "VISU_PREF_REPRESENT_PROPS" ), srangeTab );
-  addPreference( tr( "VISU_PREF_SHADING" ), representGr,
+  // TAB: Representation ; group: "Representation properties"
+  int representationTab = addPreference( tr( "Representation" ) );
+  
+  int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
+  
+  QStringList mesh_modes;
+  mesh_modes.append( "Points" );
+  mesh_modes.append( "Wireframe" );
+  mesh_modes.append( "Insideframe" );
+  mesh_modes.append( "Surfaceframe" );
+  mesh_modes.append( "Surface" );
+  QValueList<QVariant> mesh_indices;
+  mesh_indices.append( 0 );
+  mesh_indices.append( 1 );
+  mesh_indices.append( 3 );
+  mesh_indices.append( 4 );
+  mesh_indices.append( 2 );
+  
+  QStringList modes1 = mesh_modes;
+  modes1.remove( "Surfaceframe" );
+  QValueList<QVariant> indices1 = mesh_indices;
+  indices1.remove( 4 );
+  
+  QStringList modes2 = modes1;
+  modes2.remove( "Insideframe" );
+  QValueList<QVariant> indices2 = indices1;
+  indices2.remove( 3 );
+
+  QStringList modes3 = modes2;
+  modes3.remove( "Surface" );
+  QValueList<QVariant> indices3 = indices2;
+  indices3.remove( 2 );
+  
+  
+  int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
+  setPreferenceProperty( mesh_represent, "strings", mesh_modes );
+  setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
+  addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" );
+
+  int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" );
+  setPreferenceProperty( scalar_map_represent, "strings", modes1 );
+  setPreferenceProperty( scalar_map_represent, "indexes", indices1 );
+  addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" );
+
+  int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
+  setPreferenceProperty( iso_surfaces_represent, "strings", modes2 );
+  setPreferenceProperty( iso_surfaces_represent, "indexes", indices2 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
+  setPreferenceProperty( cut_planes_represent, "strings", modes2 );
+  setPreferenceProperty( cut_planes_represent, "indexes", indices2 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
+  setPreferenceProperty( cut_lines_represent, "strings", modes3 );
+  setPreferenceProperty( cut_lines_represent, "indexes", indices3 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
+  setPreferenceProperty( deformed_shape_represent, "strings", modes1 );
+  setPreferenceProperty( deformed_shape_represent, "indexes", indices1 );
+  addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" );
+
+  int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" );
+  setPreferenceProperty( vectors_represent, "strings", modes3 );
+  setPreferenceProperty( vectors_represent, "indexes", indices3 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" );
+  setPreferenceProperty( stream_lines_represent, "strings", modes3 );
+  setPreferenceProperty( stream_lines_represent, "indexes", indices3 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
+  setPreferenceProperty( plot3d_represent, "strings", modes2 );
+  setPreferenceProperty( plot3d_represent, "indexes", indices2 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  int scalar_def_represent = addPreference( tr( "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
+  setPreferenceProperty( scalar_def_represent, "strings", modes2 );
+  setPreferenceProperty( scalar_def_represent, "indexes", indices2 );
+  addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
+  
+  addPreference( tr( "VISU_USE_SHADING" ), representGr,
                  LightApp_Preferences::Bool, "VISU", "represent_shading" );
 }
 
@@ -2999,11 +3150,12 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b)
   if (b == QString("scalar_bar_orientation")) return;
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
   float sbX1,sbY1,sbW,sbH;
+  float aTol = 1.00000009999999;
   std::string aWarning;
   if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
     sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1);
     sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW);
-    if(sbX1+sbW > 1.0){
+    if(sbX1+sbW > aTol){
       aWarning = "Origin and Size Vertical: X+Width > 1\n";
       sbX1=0.01;
       sbW=0.05;
@@ -3014,7 +3166,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b)
   else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
     sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1);
     sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH);
-    if(sbY1+sbH > 1.0){
+    if(sbY1+sbH > aTol){
       aWarning = "Origin and Size Vertical: Y+Height > 1\n";
       sbY1=0.01;
       sbH=0.5;
@@ -3025,7 +3177,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b)
   else if(b ==  QString("scalar_bar_horizontal_x") || b ==  QString("scalar_bar_horizontal_width")){
     sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1);
     sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW);
-    if(sbX1+sbW > 1.0){
+    if(sbX1+sbW > aTol){
       aWarning = "Origin and Size Horizontal: X+Width > 1\n";
       sbX1=0.2;
       sbW=0.6;
@@ -3036,7 +3188,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b)
   else if(b ==  QString("scalar_bar_horizontal_y") || b ==  QString("scalar_bar_horizontal_height")){
     sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1);
     sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH);
-    if(sbY1+sbH > 1.0){
+    if(sbY1+sbH > aTol){
       aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
       sbY1=0.01;
       sbH=0.12;
@@ -3068,3 +3220,103 @@ LightApp_Displayer* VisuGUI::displayer()
     
   return myDisplayer;
 }
+
+
+void VisuGUI::OnPlot3dFromCutPlane()
+{
+ _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+ if (CheckLock(aCStudy, GetDesktop(this)))
+   return;
+
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+
+ if (aListIO.Extent() < 1) return;
+
+
+ VISU::CutPlanes_i* aCutPrs = 0;
+ Handle(SALOME_InteractiveObject) anIO;
+ _PTR(SObject) aSObject;
+ SALOME_ListIteratorOfListIO It (aListIO);
+ for (; It.More(); It.Next()) {
+   anIO = It.Value();
+
+   if (!anIO.IsNull() && anIO->hasEntry()) {
+     aSObject = aCStudy->FindObjectID(anIO->getEntry());
+     if ( !aSObject )
+       continue;
+     CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry());
+     if (!CORBA::is_nil(anObject)) {
+       VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
+       if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+         aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+         if (aCutPrs) 
+           break;
+       }
+     }
+   }
+ }
+
+ if (aCutPrs) {
+   _PTR(SObject) aTimeStampSObj = aSObject->GetFather();
+   if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) {
+     QString aType = aViewManager->getType();
+     bool isVVTK = aType == VVTK_Viewer::Type();
+
+     Storable::TRestoringMap aMap = getMapOfValue(aTimeStampSObj);
+     bool isExist;
+     aType = Storable::FindValue(aMap,"myType",&isExist);
+     if (!isExist || aType.toInt() != TTIMESTAMP )
+       return;
+     
+     QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
+     QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
+     QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
+     QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
+
+     int aPos;
+     SUIT_ViewWindow* aViewWindow = 0;
+     if (isVVTK) {
+       aViewWindow = GetViewWindow<VVTK_Viewer>(this);
+       aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
+     } else {
+       aViewWindow = GetViewWindow<SVTK_Viewer>(this);
+       aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
+     }
+     GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
+     
+     VISU::Plot3D_i* aPrs3d = CreatePrs3d<VISU::Plot3D_i>(this, aTimeStampSObj, aMeshName.latin1(), (Entity)anEntity.toInt(),
+                                                          aFieldName.latin1(), aTimeStampId.toInt());
+     if (aPrs3d) {
+       SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+       int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
+       if (!aValue) {
+         VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
+         aDlg->initFromPrsObject(aPrs3d);
+         int    aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
+         double aRotX = aCutPrs->GetRotateX();
+         double aRotY = aCutPrs->GetRotateY();
+         double aPlanePos = aCutPrs->GetPlanePosition(0);
+         aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
+           
+         if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
+           DeletePrs3d(this, aPrs3d, anIO);
+           delete aDlg;
+           return;
+         }
+         delete aDlg;
+         UpdateObjBrowser(this, true, aTimeStampSObj);
+       }
+       SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+       if ( aSVtkWindow ) {
+         PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
+         aSVtkWindow->onFitAll();
+         
+         AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
+       }
+     }
+   }
+   application()->putInfo(QObject::tr("INF_DONE"));
+ }
+}
index 3e74e246ef56fa81e7cdfd5c606444f6165211b9..806b73068222c7cbef84938fcf2625e5109f82f6 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -81,7 +81,6 @@ public slots:
 
 protected slots:
   void OnImportFromFile();
-  void OnExploreMEDFile();
   void OnImportTableFromFile();
   void OnExportTableToFile();
   void OnImportMedField();
@@ -155,6 +154,7 @@ protected slots:
 
   void OnTranslatePrs();
   void OnArrangeActors();
+  void OnPlot3dFromCutPlane();
 
 protected:
   virtual LightApp_Selection* createSelection() const;
index 1fe7a7b2b1506fe94bfd8674032cc18307d967b1..0eaa8676cf8ef30994cac14f492ebf8a4cd6e5a6 100644 (file)
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #ifndef VISUGUI_ACTIONSDEF
 #define VISUGUI_ACTIONSDEF
 
 //#define VISU_IMPORT_FROM_FILE       112
-//#define VISU_EXPLORE_MED            113
 //#define VISU_IMPORT_MED             114
 //#define VISU_IMPORT_TABLE           199
 #define VISU_IMPORT_FROM_FILE       4002
-#define VISU_EXPLORE_MED            4003
-#define VISU_IMPORT_TABLE           4004
-#define VISU_IMPORT_MED_STRUCTURE   4005
-#define VISU_IMPORT_MED_TIMESTAMP   4006
-#define VISU_IMPORT_MED_FIELD       4007
+#define VISU_IMPORT_TABLE           4003
+#define VISU_IMPORT_MED_STRUCTURE   4004
+#define VISU_IMPORT_MED_TIMESTAMP   4005
+#define VISU_IMPORT_MED_FIELD       4006
 
 #define VISU_SCALAR_MAP             4011
 #define VISU_DEFORMED_SHAPE         4012
 #define VISU_FREE_SCALAR_BARS       4081
 #define VISU_SHOW_ANIMATION         4082
 
+#define VISU_PLOT3D_FROM_CUTPLANE   4085
+
 #endif
index 7705f32dcb5685727a68606d4095aa19715e9255..88db6399fc25fbe9185c27387dcf0026c3e8e856 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include "VisuGUI_BuildProgressDlg.h"
 
+#include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
 
 #include "SUIT_FileDlg.h"
+#include "SUIT_Session.h"
 #include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 
+#include "LightApp_Application.h"
+
 #include <vtkTimerLog.h>
 
 #include <qcheckbox.h>
  * Constructor
  */
 VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
-  QDialog( theParent, "VisuGUI_BuildProgressBar", false ),
+  QDialog( theParent, 
+          "VisuGUI_BuildProgressBar", 
+          false,
+          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
   myIsRaiseColor( false )
 {
   setCaption( tr( "DLG_BUILD_PROGRESS_TITLE" ) );
@@ -108,14 +115,11 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   aProgressLayout->setSpacing( 6 );
   aProgressLayout->setMargin( 11 );
 
-  myBuildEntitiesCheckBox = new QCheckBox( tr( "BUILD_ENTITIES" ), myProgressBox );
-  myBuildEntitiesCheckBox->setChecked( true );
-  myBuildEntitiesCheckBox->setEnabled( false );
+  QLabel* aBuildEntitiesLabel = new QLabel( tr( "BUILD_ENTITIES" ), myProgressBox );
   myBuildEntitiesButton = new QPushButton( myProgressBox );
   myBuildEntitiesButton->setEnabled( false );
   myBuildEntitiesButton->setFixedSize( 30, 30 );
   myBuildEntitiesButton->setPaletteBackgroundColor( Qt::red );
-  connect( myBuildEntitiesCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
 
   myBuildFieldsCheckBox = new QCheckBox( tr( "BUILD_FIELDS" ), myProgressBox );
   myBuildFieldsCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_fields", true ) );
@@ -141,7 +145,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildGroupsButton->setPaletteBackgroundColor( Qt::red );
   connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
 
-  aProgressLayout->addWidget( myBuildEntitiesCheckBox, 0, 0 );
+  aProgressLayout->addWidget( aBuildEntitiesLabel, 0, 0 );
   aProgressLayout->addWidget( myBuildEntitiesButton,   0, 1 );
   aProgressLayout->addWidget( myBuildFieldsCheckBox,   1, 0 );
   aProgressLayout->addWidget( myBuildFieldsButton,     1, 1 );
@@ -192,8 +196,13 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   aCloseButton->setAutoDefault( true );
   CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
 
+  QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup );
+  aHelpButton->setAutoDefault( true );
+  CommonGroupLayout->addWidget( aHelpButton, 0, 3 );
+
   connect( myStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
   connect(  aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+  connect(  aHelpButton,  SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 
   myTimer = new QTimer( this );
   connect( myTimer, SIGNAL( timeout() ), this, SLOT( onTimer() ) );
@@ -205,7 +214,7 @@ VisuGUI_BuildProgressDlg::~VisuGUI_BuildProgressDlg()
 
 void VisuGUI_BuildProgressDlg::show()
 {
-  if( onBrowseFile() )
+  if( !myFileName.isNull() || onBrowseFile() )
     QWidget::show();
 }
 
@@ -214,37 +223,35 @@ void VisuGUI_BuildProgressDlg::onStart()
   if( myFileName.isNull() )
     return;
 
-  bool aBuildAll = myBuildAllCheckBox->isChecked();
-  bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked();
-
   myResult = myGenerator->CreateResult( myFileName );
 
-  myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
-  myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
-
-  //setModal( false );
-  myFileNameLineEdit->setReadOnly( true );
-  /*
-  myBuildAllCheckBox->setNoChange();
-  myBuildAtOnceCheckBox->setNoChange();
-  myBuildEntitiesCheckBox->setNoChange();
-  myBuildFieldsCheckBox->setNoChange();
-  myBuildMinMaxCheckBox->setNoChange();
-  myBuildGroupsCheckBox->setNoChange();
-  */
-
-  myStartButton->setEnabled( false );
+  if (CORBA::is_nil(myResult.in())) {
+    SUIT_MessageBox::warn1(this,
+                          tr("WRN_VISU"),
+                          tr("ERR_ERROR_IN_THE_FILE"),
+                          tr("BUT_OK"));
+    onClose();
+  }else{
+    myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
+    myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
+    
+    //setModal( false );
+    myFileNameLineEdit->setReadOnly( true );
+    myStartButton->setEnabled( false );
+    
+    bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked();
+    if( aBuildAtOnce )
+    {
+      QApplication::setOverrideCursor( Qt::waitCursor );
+      myCurrentTime = vtkTimerLog::GetCurrentTime();
+    }
 
-  if( aBuildAtOnce )
-  {
-    QApplication::setOverrideCursor( Qt::waitCursor );
-    myCurrentTime = vtkTimerLog::GetCurrentTime();
+    myTime.setHMS( 0, 0, 0 );
+    myTimer->start( 100 );
+    
+    bool aBuildAll = myBuildAllCheckBox->isChecked();
+    myResult->Build( aBuildAll, aBuildAtOnce );
   }
-
-  myTime.setHMS( 0, 0, 0 );
-  myTimer->start( 100 );
-
-  myResult->Build( aBuildAll, aBuildAtOnce );
 }
 
 void VisuGUI_BuildProgressDlg::onClose()
@@ -252,6 +259,22 @@ void VisuGUI_BuildProgressDlg::onClose()
   done( 0 );
 }
 
+void VisuGUI_BuildProgressDlg::onHelp()
+{
+  QString aHelpFileName = "/files/importing_med_objects.htm"; // ?
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 bool VisuGUI_BuildProgressDlg::onBrowseFile()
 {
   QString aRootDir = QString( getenv( "VISU_ROOT_DIR") );
@@ -390,3 +413,12 @@ void VisuGUI_BuildProgressDlg::onBuildCheckBoxClicked()
     myBuildGroupsButton->setPaletteBackgroundColor( aColor );
 
 }
+
+void VisuGUI_BuildProgressDlg::setFileName( const QString& theFileName )
+{
+  if ( !theFileName.isNull() )
+    {
+      myFileName = theFileName;
+      myFileNameLineEdit->setText( myFileName.section( '/', -1 ) );
+    }
+}
index 4d8805968b1320bc91613f6cfcd8f702edde1c76..0d56a0dc5e81f3d046eb7e80e1b6c20f5706a4d9 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -54,12 +54,14 @@ public:
   virtual void     show();
 
   QString          fileName() const { return myFileName; }
+  void             setFileName( const QString& theFileName );
 
 protected slots:
   void             done( int );
 
   void             onStart();
   void             onClose();
+  void             onHelp();
 
   bool             onBrowseFile();
   void             onTimer();
@@ -85,7 +87,6 @@ private:
 
   QGroupBox*       myProgressBox;
 
-  QCheckBox*       myBuildEntitiesCheckBox;
   QPushButton*     myBuildEntitiesButton;
 
   QCheckBox*       myBuildFieldsCheckBox;
index 2c9f7f1bb2f2f628096e2f1f4d177d1bc0c17d25..f9889dd02f5700546e6c6e7c9232abcb567cab47 100644 (file)
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "VisuGUI_ClippingDlg.h"
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Prs3d_i.hh"
 #include "VISU_Result_i.hh"
@@ -29,6 +30,7 @@
 #include "VISU_PipeLine.hxx"
 
 #include "LightApp_SelectionMgr.h"
+#include "LightApp_Application.h"
 
 #include "SVTK_ViewWindow.h"
 
@@ -101,128 +103,124 @@ namespace VISU {
 //class    : OrientedPlane
 //purpose  :
 //=================================================================================
-class OrientedPlane: public vtkPlane
+OrientedPlane* OrientedPlane::New() 
 {
-  SVTK_ViewWindow* myViewWindow;
-
-  vtkDataSetMapper* myMapper;
-
-public:
-  static OrientedPlane * New() {
-    return new OrientedPlane();
-  }
-  static OrientedPlane * New (SVTK_ViewWindow* vw) {
-    return new OrientedPlane(vw);
-  }
-  vtkTypeMacro(OrientedPlane, vtkPlane);
-
-
-  VISU::Orientation myOrientation;
-  float myDistance;
-  double myAngle[2];
-
-  vtkPlaneSource* myPlaneSource;
-  SALOME_Actor *myActor;
-
-  void SetOrientation(VISU::Orientation theOrientation) {myOrientation = theOrientation;}
-  VISU::Orientation GetOrientation() {return myOrientation;}
-
-  void SetDistance(float theDistance) {myDistance = theDistance;}
-  float GetDistance() {return myDistance;}
-
-  void ShallowCopy(OrientedPlane* theOrientedPlane){
-    SetNormal(theOrientedPlane->GetNormal());
-    SetOrigin(theOrientedPlane->GetOrigin());
-
-    myOrientation = theOrientedPlane->GetOrientation();
-    myDistance = theOrientedPlane->GetDistance();
-
-    myAngle[0] = theOrientedPlane->myAngle[0];
-    myAngle[1] = theOrientedPlane->myAngle[1];
-
-    myPlaneSource->SetNormal(theOrientedPlane->myPlaneSource->GetNormal());
-    myPlaneSource->SetOrigin(theOrientedPlane->myPlaneSource->GetOrigin());
-    myPlaneSource->SetPoint1(theOrientedPlane->myPlaneSource->GetPoint1());
-    myPlaneSource->SetPoint2(theOrientedPlane->myPlaneSource->GetPoint2());
-  }
-
-protected:
-  OrientedPlane(SVTK_ViewWindow* vw):
-    myOrientation(VISU::XY),
-    myDistance(0.5),
-    myViewWindow(vw)
-  {
-    Init();
-    myViewWindow->AddActor(myActor);
-  }
-
-  OrientedPlane():
-    myOrientation(VISU::XY),
-    myDistance(0.5),
-    myViewWindow(NULL)
-  {
-    Init();
-  }
+  return new OrientedPlane();
+}
 
-  void Init(){
-    myPlaneSource = vtkPlaneSource::New();
+OrientedPlane* OrientedPlane::New (SVTK_ViewWindow* vw) 
+{
+  return new OrientedPlane(vw);
+}
 
-    myAngle[0] = myAngle[1] = 0.0;
+void OrientedPlane::SetOrientation(VISU::Orientation theOrientation) 
+{
+  myOrientation = theOrientation;
+}
 
-    // Create and display actor
-    myMapper = vtkDataSetMapper::New();
-    myMapper->SetInput(myPlaneSource->GetOutput());
+VISU::Orientation OrientedPlane::GetOrientation() 
+{
+  return myOrientation;
+}
 
-    myActor = SALOME_Actor::New();
-    myActor->VisibilityOff();
-    myActor->PickableOff();
-    myActor->SetInfinitive(true);
-    myActor->SetMapper(myMapper);
+void OrientedPlane::SetDistance(float theDistance) 
+{
+  myDistance = theDistance;
+}
 
-    vtkProperty* aProp = vtkProperty::New();
-    float anRGB[3];
+float OrientedPlane::GetDistance() 
+{
+  return myDistance;
+}
 
-    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+void OrientedPlane::ShallowCopy(OrientedPlane* theOrientedPlane)
+{
+  SetNormal(theOrientedPlane->GetNormal());
+  SetOrigin(theOrientedPlane->GetOrigin());
+  
+  myOrientation = theOrientedPlane->GetOrientation();
+  myDistance = theOrientedPlane->GetDistance();
+  
+  myAngle[0] = theOrientedPlane->myAngle[0];
+  myAngle[1] = theOrientedPlane->myAngle[1];
+  
+  myPlaneSource->SetNormal(theOrientedPlane->myPlaneSource->GetNormal());
+  myPlaneSource->SetOrigin(theOrientedPlane->myPlaneSource->GetOrigin());
+  myPlaneSource->SetPoint1(theOrientedPlane->myPlaneSource->GetPoint1());
+  myPlaneSource->SetPoint2(theOrientedPlane->myPlaneSource->GetPoint2());
+}
 
-    QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255));
-    anRGB[0] = aFillColor.red()/255.;
-    anRGB[1] = aFillColor.green()/255.;
-    anRGB[2] = aFillColor.blue()/255.;
-    aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-    aProp->SetOpacity(0.75);
-    myActor->SetProperty(aProp);
-    aProp->Delete();
-
-    vtkProperty* aBackProp = vtkProperty::New();
-    QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));//@
-    anRGB[0] = aBackFaceColor.red()/255.;
-    anRGB[1] = aBackFaceColor.green()/255.;
-    anRGB[2] = aBackFaceColor.blue()/255.;
-    aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-    aBackProp->SetOpacity(0.75);
-    myActor->SetBackfaceProperty(aBackProp);
-    aBackProp->Delete();
-  }
+OrientedPlane::OrientedPlane(SVTK_ViewWindow* vw):
+  myOrientation(VISU::XY),
+  myDistance(0.5),
+  myViewWindow(vw)
+{
+  Init();
+  myViewWindow->AddActor(myActor);
+}
 
-  ~OrientedPlane()
-  {
-    if (myViewWindow)
-      myViewWindow->RemoveActor(myActor);
+OrientedPlane::OrientedPlane():
+  myOrientation(VISU::XY),
+  myDistance(0.5),
+  myViewWindow(NULL)
+{
+  Init();
+}
 
-    myActor->Delete();
+void OrientedPlane::Init()
+{
+  myPlaneSource = vtkPlaneSource::New();
+  
+  myAngle[0] = myAngle[1] = 0.0;
+
+  // Create and display actor
+  myMapper = vtkDataSetMapper::New();
+  myMapper->SetInput(myPlaneSource->GetOutput());
+
+  myActor = SALOME_Actor::New();
+  myActor->VisibilityOff();
+  myActor->PickableOff();
+  myActor->SetInfinitive(true);
+  myActor->SetMapper(myMapper);
+  
+  vtkProperty* aProp = vtkProperty::New();
+  float anRGB[3];
+  
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  
+  QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255));
+  anRGB[0] = aFillColor.red()/255.;
+  anRGB[1] = aFillColor.green()/255.;
+  anRGB[2] = aFillColor.blue()/255.;
+  aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  aProp->SetOpacity(0.75);
+  myActor->SetProperty(aProp);
+  aProp->Delete();
+  
+  vtkProperty* aBackProp = vtkProperty::New();
+  QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));//@
+  anRGB[0] = aBackFaceColor.red()/255.;
+  anRGB[1] = aBackFaceColor.green()/255.;
+  anRGB[2] = aBackFaceColor.blue()/255.;
+  aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  aBackProp->SetOpacity(0.75);
+  myActor->SetBackfaceProperty(aBackProp);
+  aBackProp->Delete();
+}
 
-    myMapper->RemoveAllInputs();
-    myMapper->Delete();
+OrientedPlane::~OrientedPlane()
+{
+  if (myViewWindow)
+    myViewWindow->RemoveActor(myActor);
 
-    myPlaneSource->UnRegisterAllOutputs();
-    myPlaneSource->Delete();
-  };
+  myActor->Delete();
 
-private:
-  // Not implemented.
-  OrientedPlane(const OrientedPlane&);
-  void operator=(const OrientedPlane&);
-};
+  myMapper->RemoveAllInputs();
+  myMapper->Delete();
+  
+  myPlaneSource->UnRegisterAllOutputs();
+  myPlaneSource->Delete();
+}
 
 struct TSetVisiblity {
   TSetVisiblity(int theIsVisible): myIsVisible(theIsVisible){}
@@ -319,6 +317,10 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule,
   GroupButtonsLayout->setAlignment(Qt::AlignTop);
   GroupButtonsLayout->setSpacing(6);
   GroupButtonsLayout->setMargin(11);
+  buttonHelp = new QPushButton (GroupButtons, "buttonHelp");
+  buttonHelp->setText(tr("BUT_HELP"));
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
   buttonCancel = new QPushButton (GroupButtons, "buttonCancel");
   buttonCancel->setText(tr("BUT_CLOSE"));
   buttonCancel->setAutoDefault(TRUE);
@@ -375,6 +377,7 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule,
   connect(buttonOk    , SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+  connect(buttonHelp  , SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
 
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
 
@@ -389,7 +392,7 @@ VisuGUI_ClippingDlg::~VisuGUI_ClippingDlg()
 {
   // no need to delete child widgets, Qt does it all for us
   std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
-  VISU::RenderViewWindow(VISU::GetViewWindow(myVisuGUI));
+  VISU::RenderViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI));
 }
 
 //=================================================================================
@@ -481,9 +484,13 @@ void VisuGUI_ClippingDlg::ClickOnApply()
   if (!myPrs3d)
     return;
 
-  if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
     SUIT_OverrideCursor wc;
 
+    QWidget *aCurrWid = this->focusWidget();
+    aCurrWid->clearFocus();
+    aCurrWid->setFocus();
+
     // Save clipping planes, currently applied to the presentation
     // to enable restoring this state in case of failure.
     // Refer to bugs IPAL8849, IPAL8850 for more information.
@@ -559,13 +566,31 @@ void VisuGUI_ClippingDlg::ClickOnCancel()
   close();
 }
 
+//=================================================================================
+// function : ClickOnHelp()
+// purpose  :
+//=================================================================================
+void VisuGUI_ClippingDlg::ClickOnHelp()
+{
+  QString aHelpFileName = "clipping.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 //=================================================================================
 // function : onSelectionChanged()
 // purpose  : Called when selection is changed
 //=================================================================================
 void VisuGUI_ClippingDlg::onSelectionChanged()
 {
-  if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
     Handle(SALOME_InteractiveObject) anIO;
     CORBA::Object_var anObject = VISU::GetSelectedObj(myVisuGUI, &anIO);
     myIO = anIO;
@@ -578,8 +603,8 @@ void VisuGUI_ClippingDlg::onSelectionChanged()
       std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
       myPlanes.clear();
 
-      float anOffset [3];
-      myPrs3d->GetOffset(anOffset);
+      CORBA::Float anOffset[3];
+      myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
 
       vtkIdType anId = 0, anEnd = myPrs3d->GetNumberOfClippingPlanes();
       for (; anId < anEnd; anId++) {
@@ -589,7 +614,7 @@ void VisuGUI_ClippingDlg::onSelectionChanged()
             VISU::TVTKPlane aTVTKPlane(anOrientedPlane);
             anOrientedPlane->Delete();
             aTVTKPlane->ShallowCopy(aPlane);
-            aTVTKPlane->myActor->SetPosition(anOffset);
+            aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]);
             myPlanes.push_back(aTVTKPlane);
           }
         }
@@ -650,17 +675,20 @@ void VisuGUI_ClippingDlg::onSelectPlane(int theIndex)
 //=================================================================================
 void VisuGUI_ClippingDlg::ClickOnNew()
 {
+  if(!AutoApplyCheckBox->isChecked())
+    ClickOnApply();
+  
   if (!myPrs3d)
     return;
 
-  if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) {
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI)) {
     OrientedPlane* aPlane = OrientedPlane::New(aViewWindow);
     VISU::TVTKPlane aTVTKPlane(aPlane);
     myPlanes.push_back(aTVTKPlane);
 
-    float anOffset [3];
-    myPrs3d->GetOffset(anOffset);
-    aTVTKPlane->myActor->SetPosition(anOffset);
+    CORBA::Float anOffset[3];
+    myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+    aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]);
 
     if (PreviewCheckBox->isChecked())
       aTVTKPlane->myActor->VisibilityOn();
@@ -689,7 +717,7 @@ void VisuGUI_ClippingDlg::ClickOnDelete()
     ClickOnApply();
 
   Sinchronize();
-  if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI))
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
     VISU::RenderViewWindow(aViewWindow);
 }
 
@@ -785,18 +813,18 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam()
 
   OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer();
 
-  float aNormal[3];
+  vtkFloatingPointType aNormal[3];
   VISU::Orientation anOrientation;
-  float aDir[3][3] = {{0, 0, 0}, {0, 0, 0}};
+  vtkFloatingPointType aDir[3][3] = {{0, 0, 0}, {0, 0, 0}};
   {
     static double aCoeff = vtkMath::Pi()/180.0;
 
-    float aRot[2] = {getRotation1(), getRotation2()};
+    vtkFloatingPointType aRot[2] = {getRotation1(), getRotation2()};
     aPlane->myAngle[0] = aRot[0];
     aPlane->myAngle[1] = aRot[1];
 
-    float anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])};
-    float aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])};
+    vtkFloatingPointType anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])};
+    vtkFloatingPointType aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])};
     aV[0] = aRot[0] > 0? aV[0]: -aV[0];
     aV[1] = aRot[1] > 0? aV[1]: -aV[1];
 
@@ -844,37 +872,37 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam()
   myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane);
 
   vtkDataSet* aDataSet = myPrs3d->GetInput();
-  float *aPnt = aDataSet->GetCenter();
+  vtkFloatingPointType *aPnt = aDataSet->GetCenter();
 
-  float* anOrigin = aPlane->GetOrigin();
-  float aDel = aDataSet->GetLength()/2.0;
+  vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
+  vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
 
-  float 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}};
-  float aParam, aPnt0[3], aPnt1[3], aPnt2[3];
+  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];
 
-  float 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]};
-  float aPnt02[3] = {aPnt01[0] + aNormal[0],
-                     aPnt01[1] + aNormal[1],
-                     aPnt01[2] + aNormal[2]};
+  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]};
+  vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
+                                   aPnt01[1] + aNormal[1],
+                                   aPnt01[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
 
-  float aPnt11[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]};
-  float aPnt12[3] = {aPnt11[0] + aNormal[0],
-                    aPnt11[1] + aNormal[1],
-                    aPnt11[2] + aNormal[2]};
+  vtkFloatingPointType aPnt11[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]};
+  vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
+                                   aPnt11[1] + aNormal[1],
+                                   aPnt11[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
 
-  float aPnt21[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]};
-  float aPnt22[3] = {aPnt21[0] + aNormal[0],
-                    aPnt21[1] + aNormal[1],
-                    aPnt21[2] + aNormal[2]};
+  vtkFloatingPointType aPnt21[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]};
+  vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
+                                   aPnt21[1] + aNormal[1],
+                                   aPnt21[2] + aNormal[2]};
   vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
 
   vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
@@ -886,7 +914,7 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam()
   if (AutoApplyCheckBox->isChecked())
     ClickOnApply();
 
-  if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI))
+  if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
     VISU::RenderViewWindow(vw);
 }
 
@@ -921,14 +949,14 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
   int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected());
   VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId;
   gp_Dir dir;
-  const vector<float> * values =
+  const vector<vtkFloatingPointType> * values =
     result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
   if (!values)
     return;
 
   // find distance;
   int index = SpinBoxIJKIndex->value();
-  float distance = 0;
+  vtkFloatingPointType distance = 0;
   if (index < values->size())
     distance = (*values)[ index ];
 
@@ -945,14 +973,14 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
     }
   }
   // find rotation angles
-  float angle[2];
+  vtkFloatingPointType angle[2];
   int rotId[2] = {
     (axId == 0) ? 2 : axId - 1,
     (axId == 2) ? 0 : axId + 1
     };
   static double aCoeff = 180.0/vtkMath::Pi();
   for (i = 0; i < 2; ++i) {
-    float cosin = cos[ rotId[ i ]];
+    vtkFloatingPointType cosin = cos[ rotId[ i ]];
     if (maxCos < 0)
       cosin = -cosin;
     angle[ i ] = asin(cosin) * aCoeff;
@@ -989,7 +1017,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
   int planeIndex = ComboBoxPlanes->currentItem();
   OrientedPlane* plane = myPlanes[ planeIndex ].GetPointer();
   vtkPlaneSource* planeSource = plane->myPlaneSource;
-  float * planeNormal = planeSource->GetNormal();
+  vtkFloatingPointType * planeNormal = planeSource->GetNormal();
   gp_Dir normal(planeNormal[0], planeNormal[1], planeNormal[2]);
 
   // find a grid axis most co-directed with plane normal
@@ -997,7 +1025,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
   int i, maxAx = 0, gridAxId = 0;
   gp_Dir dir, gridDir;
   double maxDot = 0;
-  const vector<float> *curValues, *values = 0;
+  const vector<vtkFloatingPointType> *curValues, *values = 0;
   VISU::Result_i* result = myPrs3d->GetResult();
   for (i = 0; i < 3; ++i) {
     VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
@@ -1072,8 +1100,8 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId)
   if (result) {
     VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
     gp_Dir dir;
-    const vector<float> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
-                                                        axis, dir);
+    const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
+                                                                      axis, dir);
     if (indices)
       maxIndex = indices->size() - 1;
   }
@@ -1094,6 +1122,6 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId)
 void VisuGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled)
 {
   std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled));
-  if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI))
+  if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI))
     VISU::RenderViewWindow(vw);
 }
index 0a2b61b694df8bf974c3d150677168174cbebe0f..c649dd9328083d6e91c31faf3c477732b0853de3 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef DIALOGBOX_CLIPPING_H
@@ -45,12 +45,19 @@ class QHButtonGroup;
 class QSpinBox;
 class QTabWidget;
 
+class SALOME_Actor;
+
 class QtxDblSpinBox;
 
+class SVTK_ViewWindow;
+
 class LightApp_SelectionMgr;
 
 class VisuGUI;
 
+class vtkPlaneSource;
+class vtkDataSetMapper;
+
 class OrientedPlane;
 
 namespace VISU {
@@ -61,6 +68,47 @@ namespace VISU {
   enum Orientation {XY, YZ, ZX};
 };
 
+//=================================================================================
+//class    : OrientedPlane
+//purpose  :
+//=================================================================================
+class OrientedPlane: public vtkPlane
+{
+  SVTK_ViewWindow* myViewWindow;
+  vtkDataSetMapper* myMapper;
+
+public:
+  static OrientedPlane* New();
+  static OrientedPlane* New (SVTK_ViewWindow* vw);
+
+  vtkTypeMacro(OrientedPlane, vtkPlane);
+
+  VISU::Orientation myOrientation;
+  float myDistance;
+  double myAngle[2];
+
+  vtkPlaneSource* myPlaneSource;
+  SALOME_Actor* myActor;
+
+  void SetOrientation(VISU::Orientation theOrientation);
+  VISU::Orientation GetOrientation();
+
+  void SetDistance(float theDistance);
+  float GetDistance();
+
+  void ShallowCopy(OrientedPlane* theOrientedPlane);
+
+protected:
+  OrientedPlane();
+  OrientedPlane(SVTK_ViewWindow* vw);
+  ~OrientedPlane();
+
+  void Init();
+
+private:
+  OrientedPlane(const OrientedPlane&);
+  void operator=(const OrientedPlane&);
+};
 
 //=================================================================================
 // class    : VisuGUI_ClippingDlg
@@ -122,6 +170,7 @@ private:
     QPushButton*      buttonOk;
     QPushButton*      buttonCancel;
     QPushButton*      buttonApply;
+    QPushButton*      buttonHelp;
 
     bool myIsSelectPlane;
 
@@ -146,6 +195,7 @@ public slots:
     void ClickOnOk();
     void ClickOnCancel();
     void ClickOnApply();
+    void ClickOnHelp();
 };
 
 #endif // DIALOGBOX_TRANSPARENCYDLG_H
index 871007414cc7e691d77c657a2460c609442aed5d..5091a490f847d64b79c97b3361b1829ef2615f16 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include <string>
 using namespace std;
+
+#include "VisuGUI.h"
 #include "VisuGUI_CursorDlg.h"
+
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+
+#include "LightApp_Application.h"
+
 #include <qlayout.h>
 
 /*!
@@ -94,12 +103,17 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent,  const char* name, bool m
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
 
+  buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
   TopLayout->addWidget(TopGroupBox,  0, 0);
   TopLayout->addWidget(GroupButtons, 1, 0);
 
   // signals and slots connections
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 }
 
 /*!
@@ -108,3 +122,23 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent,  const char* name, bool m
 VisuGUI_CursorDlg::~VisuGUI_CursorDlg()
 {
 }
+
+/*!
+  function : onHelp()
+  purpose  :
+*/
+void VisuGUI_CursorDlg::onHelp()
+{
+  QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Width";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index 018709cf97a51d0cf166100a6ee353699a5caba4..82a910d867dabe195b562f5c867d3fa4169f5d14 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -50,6 +50,11 @@ public:
     QGroupBox*   GroupButtons;
     QPushButton* buttonOk;
     QPushButton* buttonCancel;
+    QPushButton* buttonHelp;
+
+private slots:
+    void onHelp();
+
 };
 
 #endif // VISUGUI_CURSORDLG_H
index a9983bf396bc30b2772be4eae45a0fa39e263874..0a5172adb429e699de72ddadf42b35fe9dab4f39 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_CutLinesDlg.cxx
 //  Author : VSV
@@ -12,6 +25,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Gen_i.hh"
 #include "VISU_CutLines_i.hh"
 
 #include "SVTK_ViewWindow.h"
 
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 #include "SalomeApp_Study.h"
 
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include "OB_Browser.h"
 
@@ -105,7 +122,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   QHBox* aPosBox = new QHBox (aPlanePane);
   aPosBox->setSpacing(5);
-  QLabel* aPosLbl = new QLabel (tr("LBL_POS"), aPosBox);
+  new QLabel (tr("LBL_POS"), aPosBox);
   myPosSpn = new QtxDblSpinBox (0, 1, 0.1, aPosBox);
   myPosSpn->setValue(0.5);
   aPlaneLayout->addWidget(aPosBox);
@@ -166,7 +183,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   QHBox* aNbBox = new QHBox(aLinesPane);
   aNbBox->setSpacing(5);
-  QLabel* aNbLbl = new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
+  new QLabel( tr( "LBL_NB_PLANS" ), aNbBox );
   myNbSpn = new QtxDblSpinBox( 1, 100, 1, aNbBox );
   myNbSpn->setValue( 10 );
 
@@ -186,7 +203,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   QHBox* aPosBox2 = new QHBox(aLinesPane);
   aPosBox2->setSpacing(5);
-  QLabel* aPosLbl2 = new QLabel( tr( "LBL_POS" ), aPosBox2 );
+  new QLabel( tr( "LBL_POS" ), aPosBox2 );
   myPosSpn2 = new QtxDblSpinBox( 0, 1, 0.1, aPosBox2 );
   myPosSpn2->setValue( 0.5 );
   aLinesLayout->addWidget( aPosBox2 );
@@ -219,6 +236,9 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
   QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox);
   aBtnLayout->addWidget(aCloseBtn);
 
+  QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
+  aBtnLayout->addWidget(aHelpBtn);
+
   aMainLayout->addWidget(aBtnBox);
 
   myCutLines = NULL;
@@ -243,6 +263,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
   //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
   //connect(VisuGUI::application()->desktop(),
   //        SIGNAL(windowActivated(SUIT_ViewWindow*)),
@@ -258,7 +279,7 @@ VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg()
   deletePlanes();
   if (myCutLines) //delete myCutLines;
     myCutLines->Destroy();
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->Repaint();
 }
 
@@ -327,7 +348,7 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::CutLines_i* thePrs)
 //------------------------------------------------------------------------------
 void VisuGUI_CutLinesDlg::createPlanes()
 {
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView == NULL) return;
   if (myCutLines == NULL) return;
   if (myPreviewActor != 0) return;
@@ -339,7 +360,7 @@ void VisuGUI_CutLinesDlg::createPlanes()
   aPlaneMapper->SetInput(aPolyData->GetOutput());
   aPlaneMapper->ScalarVisibilityOff();
   
-  myPreviewActorGlyphs = myPreviewActorGlyphs = SALOME_Actor::New();
+  myPreviewActorGlyphs = SALOME_Actor::New();
   myPreviewActorGlyphs->PickableOff();
   updateGlyphs(false);
   
@@ -357,10 +378,23 @@ void VisuGUI_CutLinesDlg::createPlanes()
 void VisuGUI_CutLinesDlg::deletePlanes()
 {
   if (myPreviewActor == 0) return;
-  if (SVTK_ViewWindow* aView = VISU::GetViewWindow()){
-    aView->RemoveActor(myPreviewActor);
-    aView->RemoveActor(myPreviewActorGlyphs);
-  }
+  SVTK_ViewWindow* aView;
+  vtkRenderer* aRend       = myPreviewActor->GetRenderer();
+  vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer();
+  
+  vtkRenderWindow* aWnd1 = aRend->GetRenderWindow();
+  vtkRenderWindow* aWnd2 = aRendGlyphs->GetRenderWindow();
+  if(aRend && aWnd1)
+    myPreviewActor->RemoveFromRender(aRend);
+  if(aRendGlyphs && aWnd2)
+    myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs);
+
+//   Bug IPAL11962: preview is still in the viewer, if viewer not active.
+//   if (aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
+//     aView->RemoveActor(myPreviewActor);
+//     aView->RemoveActor(myPreviewActorGlyphs);
+//   } 
+
   myPreviewActor->Delete();
   myPreviewActorGlyphs->Delete();
   myPreviewActor = 0;
@@ -414,7 +448,7 @@ void VisuGUI_CutLinesDlg::onCutSelect (int theId, bool theUpdate)
     myRotXLbl2->setText( tr("LBL_ROT_Z"));
     myRotYLbl2->setText( tr("LBL_ROT_X"));
   }
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
       /*myCutLines->SetOrientation2(getOrientaion(false),
@@ -443,7 +477,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate)
     /*    float aPos = myCutLines->GetBasePlanePosition();
     myBasePlanePos->setText( QString::number(aPos) );
     myBasePlanePos->setEnabled(false);*/
-    SVTK_ViewWindow* aView = VISU::GetViewWindow();
+    SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
       if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
         //myCutLines->SetBasePlanePosition(aPos);
@@ -453,7 +487,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate)
         //aView->Repaint();
       }
     }
-    float aPos = myCutLines->GetBasePlanePosition();
+    vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition();
     myBasePlanePos->setText( QString::number(aPos) );
     myBasePlanePos->setEnabled(false);
   } else {
@@ -515,7 +549,7 @@ void VisuGUI_CutLinesDlg::DrawTable()
     vh->setLabel( i, str.arg(i+1) );
   }
   // Update preview
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
       //      myCutLines->GetPL()->Update();
@@ -528,26 +562,26 @@ void VisuGUI_CutLinesDlg::DrawTable()
 
 void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
   if (myPreviewActorGlyphs == 0 ) return;
-  const float *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn();
-  const float *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
-  float aSecondPnt[3];
-  float aBoundCenter[3];
+  const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetRealDirLn();
+  const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
+  vtkFloatingPointType aSecondPnt[3];
+  vtkFloatingPointType aBoundCenter[3];
 
   vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
   aPlaneMapper->SetInput(aPolyData->GetOutput());
-  float bounds[6];
+  vtkFloatingPointType bounds[6];
   aPlaneMapper->GetBounds(bounds);
 
   for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0;
   for(int i=0; i<3; i++){ 
     if (!myAllCurvesInvertedCheck->isChecked())
-      aSecondPnt[i] = aBasePnt[i] + aDirLn[i];
+      aSecondPnt[i] = aDirLn[i];
     else
-      aSecondPnt[i] = -aBasePnt[i] - aDirLn[i];
+      aSecondPnt[i] = - aDirLn[i];
   }
   
-  float max_bound = 0;
+  vtkFloatingPointType max_bound = 0;
   max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound;
   max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound;
   max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound;
@@ -559,10 +593,9 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
   vtkGlyphSource2D* source = vtkGlyphSource2D::New();
   
   source->FilledOn();
-  source->SetCenter(aBoundCenter);
   source->SetGlyphTypeToArrow();
   
-  aPoints->InsertNextPoint(aBasePnt);
+  aPoints->InsertNextPoint(aBoundCenter);
   profile->SetPoints(aPoints);
   
   aFloatArray->SetNumberOfComponents(3);
@@ -593,7 +626,7 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
   source->Delete();
   aPlaneMapper->Delete();
 
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     if (update)
       vf->Repaint();
 }
@@ -684,7 +717,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
     QString aTxt = myPosTable->text(theRow, 0);
     bool isChanged = !aTxt.isEmpty();
     ((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged);
-    SVTK_ViewWindow* aView = VISU::GetViewWindow();
+    SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
       if (myPreviewCheck->isChecked()) {
        //Update Preview
@@ -700,7 +733,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
     if (isDefault) {
       //myCutLines->SetDefaultPosition(theRow);
       // myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
-      SVTK_ViewWindow* aView = VISU::GetViewWindow();
+      SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
       if (aView) {
        if (myPreviewCheck->isChecked()) {
          //Update Preview
@@ -820,7 +853,7 @@ void VisuGUI_CutLinesDlg::reject()
 
 void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
 {
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       //storeToPrsObject(myCutLines);
       //      myCutLines->GetPL()->Update();
@@ -851,7 +884,7 @@ void VisuGUI_CutLinesDlg::onAllCurvesInvertedCheck(bool theInvert)
 void VisuGUI_CutLinesDlg::onRotation (double theValue)
 {
   if (myCutLines == NULL) return;
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
 
@@ -872,7 +905,7 @@ void VisuGUI_CutLinesDlg::onRotation (double theValue)
 void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
 {
   if (myCutLines == NULL) return;
-  SVTK_ViewWindow* aView = VISU::GetViewWindow();
+  SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
       //myCutLines->SetBasePlanePosition(theValue.toDouble());
@@ -884,6 +917,22 @@ void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
   }
 }
 
+void VisuGUI_CutLinesDlg::onHelp()
+{
+  QString aHelpFileName = "/files/cut_lines_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 //jfa tmp:void VisuGUI_CutLinesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
 //jfa tmp:{
 //jfa tmp:  if (theWnd != myStudyWnd)
index f196660e1b36519e59d9e0e4902969a713c99040..596798bd7ea83ffd45c9a51f1b5d9db0d613464e 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_CutLinesDlg.h
 //  Author : VSV
@@ -52,6 +65,7 @@ private slots:
   void onAllCurvesInvertedCheck(bool theInvert);
   void onRotation (double theValue);
   void onPlanePos (const QString& theValue);
+  void onHelp();
   //jfa tmp:void onWindowActivated (SUIT_ViewWindow*);
 
 private:
index c4072907cd942daefde932fd03132643960e4129..53647c489a0e94477937d81b2975f825a83d204c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -30,6 +30,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_CutPlanes_i.hh"
 #include "VISU_CutPlanesPL.hxx"
 
 #include "SVTK_ViewWindow.h"
 
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 
 #include "SUIT_Application.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_ViewWindow.h"
 #include "SUIT_ViewManager.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include <qlayout.h>
 #include <qcheckbox.h>
@@ -166,11 +170,10 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent)
 
 VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
 {
-  cout<<"### VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane"<<endl;
   deletePlanes();
   if (myCutPlanes)
     myCutPlanes->Destroy();
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->Repaint();
 }
 
@@ -194,7 +197,7 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
 
 void VisuGUI_CutPlanesPane::createPlanes()
 {
-  if (VISU::GetViewWindow() == NULL) return;
+  if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
   if (myCutPlanes == NULL) return;
   if (myPreviewActor != 0) return;
 
@@ -211,7 +214,7 @@ void VisuGUI_CutPlanesPane::createPlanes()
   myPreviewActor->PickableOff();
   myPreviewActor->SetMapper(aPlaneMapper);
   aPlaneMapper->Delete();
-  VISU::GetViewWindow()->AddActor(myPreviewActor);
+  VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
 }
 
 int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
@@ -349,7 +352,7 @@ void VisuGUI_CutPlanesPane::DrawTable()
 
   // Update preview
   if (myPreviewCheck->isChecked()) {
-    if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+    if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       myCutPlanes->GetPL()->Update();
       deletePlanes();
       createPlanes();
@@ -386,7 +389,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
 
     if (myPreviewCheck->isChecked()) {
       //Update Preview
-      if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+      if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
        myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
        myCutPlanes->GetPL()->Update();
        deletePlanes();
@@ -401,7 +404,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
       myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow)));
 
       if (myPreviewCheck->isChecked()) {
-       if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+       if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
          //Update Preview
          myCutPlanes->GetPL()->Update();
          deletePlanes();
@@ -417,8 +420,12 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
 void VisuGUI_CutPlanesPane::deletePlanes()
 {
   if (myPreviewActor == 0) return;
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
-    vf->RemoveActor(myPreviewActor);
+  vtkRenderer* aRend       = myPreviewActor->GetRenderer();
+  if(aRend)
+    myPreviewActor->RemoveFromRender(aRend);
+//  Bug IPAL11962: preview is still in the viewer, if viewer not active.
+//   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+//     vf->RemoveActor(myPreviewActor);
   myPreviewActor->Delete();
   myPreviewActor = 0;
 }
@@ -427,7 +434,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue)
 {
   if (myCutPlanes == NULL) return;
   if (myPreviewCheck->isChecked()) {
-    if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+    if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
       myCutPlanes->GetPL()->Update();
       deletePlanes();
@@ -439,7 +446,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue)
 
 void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
 {
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       storeToPrsObject(myCutPlanes);
       myCutPlanes->GetPL()->Update();
@@ -500,10 +507,15 @@ VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule)
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
 
+  QPushButton* buttonHelp = new QPushButton(tr("&Help"), GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
   TopLayout->addWidget(GroupButtons);
 
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
   //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
   //connect(VisuGUI::application()->desktop(),
   //        SIGNAL(windowActivated(SUIT_ViewWindow*)),
@@ -541,6 +553,22 @@ void VisuGUI_CutPlanesDlg::reject() {
   QDialog::reject();
 }
 
+void VisuGUI_CutPlanesDlg::onHelp()
+{
+  QString aHelpFileName = "/files/cut_lines_resentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 //void VisuGUI_CutPlanesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
 //{
 //  if (theWnd != myStudyWnd)
index e79e18cd9f1067eb9d02216dd01e24ea0ac70052..e1726ecce9be3d07ff47585385d8a18e5ae93a13 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -90,7 +90,7 @@ private:
     SALOME_Actor* myPreviewActor;
 
 private slots:
-    //void editScalarBar();
+//VSR: 08/06/06:     void editScalarBar();
     void orientationChanged( int );
     void DrawTable();
     void setDefault( int all = -1);
@@ -114,7 +114,8 @@ public:
 protected slots:
     void accept();
     void reject();
-    //void onWindowActivated (SUIT_ViewWindow*);
+//VSR: 08/06/06:     void onWindowActivated (SUIT_ViewWindow*);
+    void onHelp();
 
 private:
     VisuGUI_CutPlanesPane* myCutPane;
index da99973c16718890daaa60e28ef7efa0a7a0bcd9..0ab09694e83c021902388b2bf28698f85e67d743 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include "VisuGUI_DeformedShapeDlg.h"
 
+#include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
 
 #include "VISU_DeformedShape_i.hh"
 
 #include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include <qlayout.h>
 #include <qtabwidget.h>
@@ -113,6 +118,10 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule)
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
 
+  QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
   // Add Tab box and Buttons to the top layout
   TopLayout->addWidget(aTabBox);
   TopLayout->addWidget(GroupButtons);
@@ -120,6 +129,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule)
   // signals and slots connections
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
 }
 
 void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::DeformedShape_i* thePrs)
@@ -149,3 +159,19 @@ void VisuGUI_DeformedShapeDlg::reject()
   myScalarPane->deletePreview();
   QDialog::reject();
 }
+
+void VisuGUI_DeformedShapeDlg::onHelp()
+{
+  QString aHelpFileName = "/files/deformed_shape_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index 573c439a9fa76f36a41872d4e135913f78256a0d..a5e870b1866b713136228da6cae899a2e8bffefc 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -67,6 +67,7 @@ public:
 protected slots:
   void accept();
   void reject();
+  void onHelp();
 
  private:
     QtxDblSpinBox* ScalFact;
index ad3b1bd1303d66a28b7888b29d05361dc49432ce..872fd6871d906c1553d70d4671d1a842c8b16056 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File:       VisuGUI_DialogRunner.cxx
 // Created:    Thu Oct  6 10:17:39 2005
index 9f89cf7edc7c08a30540aa5a2dec61acdc9f913c..6911fe0ae69171a1cc66a64787f445e61da33fe1 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 
index 1fa6f098984eb6b1e560bf44fc517dd634a0beea..46fd092202d4a2675ad1c0bd6f2e9bfd5251cdd6 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_Displayer.cxx
 
 #include "VisuGUI_Displayer.h"
-#include "VVTK_ViewModel.h"
+
 #include "VisuGUI_Tools.h"
+#include "VISU_ViewManager_i.hh"
 #include "VISU_Actor.h"
 
+#include "VVTK_ViewModel.h"
+
 #include <SVTK_ViewModel.h>
 #include <SVTK_ViewWindow.h>
 
@@ -41,7 +44,7 @@
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
 
-#include "VISU_ViewManager_i.hh"
+#include <SUIT_MessageBox.h>
 
 VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Application* app )
 : LightApp_Displayer(),
@@ -67,7 +70,9 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V
     if( CORBA::is_nil( anObj ) )
       return 0;
 
-    SVTK_Viewer* vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
+    SVTK_Viewer* vtk_viewer = dynamic_cast<VVTK_Viewer*>( aViewFrame );
+    if (!vtk_viewer)
+      vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
     if( vtk_viewer )
     {
       SVTK_ViewWindow* wnd =
@@ -116,14 +121,22 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V
 
 void VisuGUI_Displayer::buildPrs3d( SVTK_ViewWindow* wnd, VISU::Prs3d_i* thePrs ) const
 {
-  VISU_Actor* newAct = VISU::FindActor( wnd, thePrs );
-  if( !newAct )
-  {
-    newAct = thePrs->CreateActor();
+  VISU_Actor* newAct = VISU::FindActor(wnd, thePrs);
+  if (!newAct) {
+    try {
+      newAct = thePrs->CreateActor();
+    } catch (std::runtime_error& exc) {
+      thePrs->RemoveActors();
+
+      INFOS(exc.what());
+      SUIT_MessageBox::warn1
+        (myApp->desktop(), QObject::tr("WRN_VISU"),
+         QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
+         QObject::tr("BUT_OK"));
+    }
   }
-  if( newAct )
-  {
-    wnd->AddActor( newAct );
+  if (newAct) {
+    wnd->AddActor(newAct);
     wnd->Repaint();
   }
 }
index f762ba0a9ab2c022923d8a9088e9ade83869a8f9..fdb729b5a421945551203ca217b1c5be9d48cb2c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index eed32a53721cc81c373f3585e982af23bb5df15d..b79e65d9f103e4a0c9061a482afd953f4951f2ad 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_EditContainerDlg.cxx
 //  Author : VSV
@@ -18,6 +31,9 @@
 
 #include "SalomeApp_Application.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include <qlayout.h>
 #include <qcheckbox.h>
@@ -280,10 +296,15 @@ VisuGUI_EditContainerDlg::VisuGUI_EditContainerDlg (VisuGUI* theModule, bool the
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
 
+  QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
   TopLayout->addWidget(GroupButtons);
 
   connect(buttonOk,     SIGNAL(clicked()),      this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()),      this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()),      this, SLOT(onHelp()));
 }
 
 void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer)
@@ -427,3 +448,17 @@ void VisuGUI_EditContainerDlg::onRightSelected()
   }
   myLeftBtn->setEnabled(isSelected);
 }
+
+void VisuGUI_EditContainerDlg::onHelp()
+{
+  QString aHelpFileName = "/files/creating_xy_plot.htm";
+  SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index 8493d0ffa0b35a2a52a2aeb2e0c8d9fe1b7c0fe2..ced26561e936b87bfcc5cd398fb0b089c43b47a2 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_EditContainerDlg.h
 //  Author : VSV
@@ -48,6 +61,7 @@ class VisuGUI_EditContainerDlg: public QDialog
   void onRightClicked();
   void onLeftSelected();
   void onRightSelected();
+  void onHelp();
 
  private:
   QString getSObjectName (_PTR(SObject) theSObject);
index 55cb6d5b372302dfa8aba272891461befa1ab9ad..5ef7af88bdcc9e4584347d64a6d0d71f2b332eac 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 1e788c4665a98a5c5ecdd55fd0387b3d2d4dc8a2..5bf734b291c864f8e0788bb143e17fc66fefbea0 100644 (file)
@@ -1,8 +1,21 @@
-//  SALOME SALOMEGUI : GUI of VISU module
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_FileDlg.cxx
 //  Author : 
index ec3b219f8847a7f4187dca7f5f747cf5af05233e..e1589832312be73004190312eb84baaeeee24a01 100644 (file)
@@ -1,8 +1,21 @@
-//  SALOME SALOMEGUI : GUI of VISU module
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_FileDlg.h
 //  Author : 
index 7492c7f570bf6ccec2dfaaa7dd4c49cb7fb9dcdb..a5f7df0c48d5b080ad91a31b87f8a53520aab783 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -39,7 +39,7 @@
 #include "VVTK_PrimitiveBox.h"
 #include "VVTK_SizeBox.h"
 
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 #include "SalomeApp_Module.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
@@ -314,13 +314,13 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs)
   const VISU::TNames& aCompNames = aField->myCompNames;
   const VISU::TNames& aUnitNames = aField->myUnitNames;
   for(int i = 0; i < aNbComp; i++){
-    QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace();
+    QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace();
     if(aComponent.isNull() || aComponent == "")
       aComponent = "Component " + QString::number(i+1);
     else
       aComponent = "[" + QString::number(i+1) + "] " + aComponent;
 
-    QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace();
+    QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace();
     if(anUnit.isNull() || anUnit == "")
       anUnit = "-";
     
@@ -340,7 +340,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs)
   // "Title"
   myTextDlg->setTitleText(QString(thePrs->GetTitle()));
 
-  float R, G, B;
+  vtkFloatingPointType R, G, B;
   thePrs->GetTitleColor(&R, &G, &B);
 
   myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
@@ -594,12 +594,17 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
 
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
   TopLayout->addWidget( PrsGroup );
   TopLayout->addWidget( aTabBox );
   TopLayout->addWidget( GroupButtons );
 
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 }
 
 void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs )
@@ -731,3 +736,17 @@ void VisuGUI_GaussPointsDlg::accept()
   //if( myScalarPane->check() )
   QDialog::accept();
 }
+
+void VisuGUI_GaussPointsDlg::onHelp()
+{
+  QString aHelpFileName = "types_of_gauss_points_presentations.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index 89bf6fec7869566c0a5e3c7da77476ab7e2c46c8..9617d64041866bef8cfd8e3091d38c97c0223c14 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -114,7 +114,7 @@ class VisuGUI_GaussScalarBarPane : public QVBox
 
  private slots:
   void changeDefaults( int );
-  //void changeRange( int );
+//VSR: 08/06/06:  void changeRange( int );
   void XYChanged( double );
   void onTextPref();
   void onSetDisplayGlobal();
@@ -141,6 +141,7 @@ public:
 
 protected slots:
   void    onToggleDefShape( bool );
+  void    onHelp();
 
   void    accept();
 
index 34d170b91a3ed5ac73e19d431a23fc2e11158397..4e370fb9fa68772e807cb5a959f039ddd3f3aa63 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
 
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
 #include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include <limits.h>
 
@@ -201,12 +203,16 @@ VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule)
   QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
 
   TopLayout->addWidget(GroupButtons);
 
   // signals and slots connections
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 }
 
 void VisuGUI_IsoSurfacesDlg::accept()
@@ -223,3 +229,19 @@ void VisuGUI_IsoSurfacesDlg::reject()
   myScalarPane->deletePreview();
   QDialog::reject();
 }
+
+void VisuGUI_IsoSurfacesDlg::onHelp()
+{
+  QString aHelpFileName = "/files/iso_surfaces_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index dc0547f1d6a78e24e856b22e7a2ddd18b66aa20d..5e3b1c51ad91e6d1a436282cada39f30ea06a6e1 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -86,6 +86,7 @@ class VisuGUI_IsoSurfacesDlg : public QDialog
  protected slots:
   void accept();
   void reject();
+  void onHelp();
 
  private:
   VisuGUI_IsoSurfPane*   myIsoPane;
index f496c5dcd25e2f6202f6c03e98fa634cf4f27b3e..3cab58e224a742fe5619f2fdb435a6901702865d 100644 (file)
@@ -1,4 +1,4 @@
-
+//  VISU VISUGUI : GUI of VISU component
 //
 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_VTKSelector.h"
 #include "LightApp_Preferences.h"
+#include "LightApp_Displayer.h"
+
+#include "SALOMEDSClient_ClientFactory.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
 
 #include "VVTK_ViewManager.h"
 #include "VVTK_ViewWindow.h"
@@ -55,6 +59,7 @@
 #include "VISU_Event.h"
 
 #include "VisuGUI_Prs3dTools.h"
+#include "VisuGUI_ClippingDlg.h"
 
 #include "VISU_GaussPoints_i.hh"
 #include "VISU_GaussPtsAct.h"
@@ -65,6 +70,7 @@
 #include "VISU_CutLines_i.hh"
 
 #include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
 #include "VisuGUI_Tools.h"
 #include "VisuGUI_ActionsDef.h"
 
 #include "VVTK_MainWindow.h"
 #include "VISU_View_i.hh"
 
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SVTK_ViewWindow.h>
+  #include <SVTK_ViewModel.h>
+#else
+  #include <VTKViewer_ViewWindow.h>
+#endif
+  #include <VTKViewer_ViewModel.h>
+#endif
+#ifndef DISABLE_OCCVIEWER
+  #include <OCCViewer_ViewWindow.h>
+  #include <OCCViewer_ViewPort3d.h>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SOCC_ViewModel.h>
+#else
+  #include <OCCViewer_ViewModel.h>
+#endif
+#endif
+#ifndef DISABLE_GLVIEWER
+  #include <GLViewer_ViewFrame.h>
+  #include <GLViewer_ViewPort.h>
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <Plot2d_ViewWindow.h>
+  #include <Plot2d_ViewFrame.h>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SPlot2d_ViewModel.h>
+#else
+  #include <Plot2d_ViewModel.h>
+#endif
+#endif
+
 #include <qaction.h>
 
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 #include <vtkTimerLog.h>
+#include <vtkPlane.h>
 
 #include <sstream>
 
@@ -90,6 +129,8 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
+#define SAVE_VISU_STATE          5090
+
 #define GAUSS_NEW_VIEWER         5100
 #define GAUSS_CREATE_PRS         5200
 #define GAUSS_RENAME             5210
@@ -114,87 +155,60 @@ using namespace VISU;
 
 namespace VISU
 {
-  //---------------------------------------------------------------
-  class Viewer
-  {
-    VVTK_ViewManager* myViewManager;
-    LightApp_VTKSelector* mySelector;
-  public:
-
-    Viewer(VisuGUI_Module* theModule, TViewerMap& theViewerMap)
-    {
-      SalomeApp_Application* anApp = theModule->getApp();
-      myViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
-      VVTK_Viewer* aViewer = (VVTK_Viewer*)myViewManager->getViewModel();
-      mySelector = new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
-      anApp->addViewManager( myViewManager );
-
-      theViewerMap.insert(TViewerMap::value_type(myViewManager,PViewer(this)));
-      QObject::connect( myViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
-                       theModule, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
-      
-      //aViewer->setBackgroundColor( Qt::darkGreen );
-      myViewManager->createViewWindow();
-    }
-    
-    VVTK_ViewManager* getViewManager() 
-    {
-      return myViewManager;
-    }
-
-    virtual
-    ~Viewer()
-    {
-    }
-  };
-
-
   //---------------------------------------------------------------
   typedef void (SUIT_ViewWindow::* TViewVisibility)();
   void
-  SetViewVisibility(const TViewerMap& theViewerMap, 
+  SetViewVisibility(SalomeApp_Application* app,
                    TViewVisibility theViewVisibility)
   {
-    TViewerMap::const_iterator anIter = theViewerMap.begin();
-    for(; anIter != theViewerMap.end(); anIter++){
-      if(SUIT_ViewManager* aViewManager = anIter->first){
+    ViewManagerList l;
+    app->viewManagers( VVTK_Viewer::Type(), l );
+    ViewManagerList::const_iterator anIt = l.begin(), aLast = l.end();
+    for( ; anIt!=aLast; anIt++ )
+      if( SUIT_ViewManager* aViewManager = *anIt )
+      {
        QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
        int aSize = aViews.size();
-       for(int anId = 0; anId < aSize; anId++){
-         if(SUIT_ViewWindow* aView = aViews[anId]){
+       for(int anId = 0; anId < aSize; anId++)
+       {
+         if(SUIT_ViewWindow* aView = aViews[anId])
            (aView->* theViewVisibility)();
-         }
        }
       }
-    }
   }
-
 }
 
 //---------------------------------------------------------------
-VisuGUI_Module
-::VisuGUI_Module() : 
+VisuGUI_Module::
+VisuGUI_Module() : 
   VisuGUI()
 {
 }
 
 
 //---------------------------------------------------------------
-VisuGUI_Module
-::~VisuGUI_Module()
+VisuGUI_Module::
+~VisuGUI_Module()
 {
 }
 
 
 //---------------------------------------------------------------
 void
-VisuGUI_Module
-::initialize( CAM_Application* theApp )
+VisuGUI_Module::
+initialize( CAM_Application* theApp )
 {
   VisuGUI::initialize( theApp );
 
   SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
 
+  // "Save VISU State" command is moved from SalomeApp_Applicaiton
+  createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIconSet(),
+               tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
+               0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
+  int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
+  createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 ); 
+  
   QPixmap aPixmap;
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
   createAction( GAUSS_NEW_VIEWER, 
@@ -210,7 +224,7 @@ VisuGUI_Module
   int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
   int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
   createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
-  
+
   // Add actions to menus
   createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 );
   //createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
@@ -230,7 +244,8 @@ VisuGUI_Module
   accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Key_Plus, aViewerType );
   accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Key_Minus, aViewerType );
 
-  connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
+  connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
+           this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
 
   // Prepare popup menus
   QtxPopupMgr* mgr = popupMgr();
@@ -276,6 +291,41 @@ VisuGUI_Module
                true );
   action( GAUSS_COPY_PRS )->setEnabled(false);
 
+  QStringList viewers;
+  
+#ifndef DISABLE_OCCVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+  viewers.append( SOCC_Viewer::Type() );
+#else
+  viewers.append( OCCViewer_Viewer::Type() );
+#endif
+#endif
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+  viewers.append( SVTK_Viewer::Type() );
+  viewers.append( VVTK_Viewer::Type() );
+#else
+  viewers.append( VTKViewer_Viewer::Type() );
+#endif
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+  viewers.append( SPlot2d_Viewer::Type() );
+#else
+  viewers.append( Plot2d_Viewer::Type() );
+#endif
+#endif
+
+  if( !viewers.isEmpty() )
+    {
+      QString strViewers = "{ ", temp = "'%1' ";
+      QStringList::const_iterator anIt = viewers.begin(), aLast = viewers.end();
+      for( ; anIt!=aLast; anIt++ )
+        strViewers+=temp.arg( *anIt );
+      strViewers+="}";
+      mgr->setRule( action(myEraseAll), QString( "client in %1" ).arg( strViewers ), true );
+    }
+
   aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
 
   createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_ERASE"), QIconSet(),
@@ -283,21 +333,21 @@ VisuGUI_Module
                 this, SLOT(OnErasePrs()));
   mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
   mgr->setRule( action( GAUSS_ERASE_PRS ), 
-               aRule + " and (isVisible=true)", true );
+               aRule + " and ({true} in $canBeDisplayed) and (isVisible=true)", true );
 
   createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_DISPLAY"), QIconSet(),
                 VisuGUI::tr("MEN_DISPLAY"), "", 0, this, false,
                 this, SLOT(OnDisplayPrs()));
   mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display
   mgr->setRule( action( GAUSS_DISPLAY_PRS ), 
-               aRule + " and (isVisible=false)", true );
+               aRule + " and ({true} in $canBeDisplayed) and (isVisible=false)", true );
 
   createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIconSet(),
                 VisuGUI::tr("MEN_DISPLAY_ONLY"), "", 0, this, false,
                 this, SLOT(OnDisplayOnlyPrs()));
   mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
   mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ), 
-               aRule, true );
+               aRule + " and ({true} in $canBeDisplayed)", true );
 
   createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIconSet(), 
                VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
@@ -309,7 +359,8 @@ VisuGUI_Module
                 tr("MEN_SAVE_CONFIGURATION"), "", 0, this, false,
                 this, SLOT(OnSaveConfiguration()));
   mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 );
-  mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
+  mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ),
+                "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
 
   createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIconSet(),
                 tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false,
@@ -328,12 +379,12 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 bool
-VisuGUI_Module
-::activateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+activateModule( SUIT_Study* theStudy )
 {
   VisuGUI::activateModule( theStudy );
 
-  SetViewVisibility(myViewerMap,&SUIT_ViewWindow::show);
+  SetViewVisibility(getApp(),&SUIT_ViewWindow::show);
 
   return true;
 }
@@ -341,12 +392,12 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 bool
-VisuGUI_Module
-::deactivateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+deactivateModule( SUIT_Study* theStudy )
 {
   VisuGUI::deactivateModule( theStudy );
 
-  SetViewVisibility(myViewerMap,&SUIT_ViewWindow::hide);
+  SetViewVisibility(getApp(),&SUIT_ViewWindow::hide);
 
   return true;
 }
@@ -354,27 +405,29 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 SUIT_ViewManager*
-VisuGUI_Module
-::onCreateViewManager()
+VisuGUI_Module::
+onCreateViewManager()
 {
-  Viewer* aViewer = new Viewer( this, myViewerMap );
-  return aViewer->getViewManager();
-}
-
+  SalomeApp_Application* anApp = getApp();
+  SUIT_ResourceMgr* aResourceMgr = anApp->resourceMgr();
+  VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
+  VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel();
+  aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
+  aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
+                            aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
+  new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
+  anApp->addViewManager( aViewManager );
+     
+  aViewManager->createViewWindow();
 
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::onLastViewClosed(SUIT_ViewManager* theViewManager)
-{
-  myViewerMap.erase(theViewManager);
+  return aViewer->getViewManager();
 }
 
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createPreferences()
+VisuGUI_Module::
+createPreferences()
 {
   VisuGUI::createPreferences();
 
@@ -389,15 +442,16 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createGaussPointsPreferences()
+VisuGUI_Module::
+createGaussPointsPreferences()
 {
   int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TTL" ) );
   int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), gaussTab );
   setPreferenceProperty( primitiveGr, "columns", 1 );
 
   int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
-                                        LightApp_Preferences::Selector, "VISU", "point_sprite_primitive_type" );
+                                        LightApp_Preferences::Selector, "VISU",
+                                         "point_sprite_primitive_type" );
 
   QStringList values;
   values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
@@ -422,7 +476,8 @@ VisuGUI_Module
                 LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
 
   int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
-                                         LightApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" );
+                                         LightApp_Preferences::DblSpin, "VISU",
+                                          "point_sprite_alpha_threshold" );
   setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
   setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
   setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
@@ -451,7 +506,8 @@ VisuGUI_Module
   setPreferenceProperty( maxSizePref, "max", 100 );
 
   int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
-                                        LightApp_Preferences::IntSpin, "VISU", "point_sprite_magnification" );
+                                        LightApp_Preferences::IntSpin, "VISU",
+                                         "point_sprite_magnification" );
   setPreferenceProperty( magnificationPref, "min", 10 );
   setPreferenceProperty( magnificationPref, "max", 1000 );
 
@@ -513,8 +569,8 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createInsideCursorPreferences()
+VisuGUI_Module::
+createInsideCursorPreferences()
 {
   int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) );
 
@@ -522,7 +578,8 @@ VisuGUI_Module
   setPreferenceProperty( primitiveGr, "columns", 1 );
 
   int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
-                               LightApp_Preferences::Selector, "VISU", "inside_point_sprite_primitive_type" );
+                                         LightApp_Preferences::Selector, "VISU",
+                                         "inside_point_sprite_primitive_type" );
 
   QStringList values;
   values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
@@ -547,18 +604,21 @@ VisuGUI_Module
                 LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
 
   int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
-                                         LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" );  
+                                         LightApp_Preferences::DblSpin, "VISU",
+                                          "inside_point_sprite_alpha_threshold" );  
   setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
   setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
   setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
 
   int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
-                                     LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_resolution" );
+                                     LightApp_Preferences::IntSpin, "VISU",
+                                      "inside_geom_sphere_resolution" );
   setPreferenceProperty( resolutionPref, "min", 3 );
   setPreferenceProperty( resolutionPref, "max", 100 );
 
   int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
-                                    LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_face_limit" );
+                                    LightApp_Preferences::IntSpin, "VISU",
+                                     "inside_geom_sphere_face_limit" );
   setPreferenceProperty( faceLimitPref, "min", 10 );
   setPreferenceProperty( faceLimitPref, "max", 1000000 );
 
@@ -566,12 +626,14 @@ VisuGUI_Module
   setPreferenceProperty( sizeGr, "columns", 2 );
 
   int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
-                                  LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" );
+                                  LightApp_Preferences::IntSpin, "VISU",
+                                   "inside_point_sprite_min_size" );
   setPreferenceProperty( minSizePref, "min", 1 );
   setPreferenceProperty( minSizePref, "max", 100 );
 
   int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
-                                  LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" );
+                                  LightApp_Preferences::IntSpin, "VISU",
+                                   "inside_point_sprite_max_size" );
   setPreferenceProperty( maxSizePref, "min", 1 );
   setPreferenceProperty( maxSizePref, "max", 100 );
 
@@ -579,23 +641,24 @@ VisuGUI_Module
   setPreferenceProperty( magnificationGr, "columns", 2 );
 
   int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
-                                        LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" );
+                                        LightApp_Preferences::IntSpin, "VISU",
+                                         "inside_point_sprite_magnification" );
   setPreferenceProperty( magnificationPref, "min", 10 );
   setPreferenceProperty( magnificationPref, "max", 1000 );
 
   int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr,
-                                    LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" );
+                                    LightApp_Preferences::DblSpin, "VISU",
+                                     "inside_point_sprite_increment" );
   setPreferenceProperty( incrementPref, "min", 0.01 );
   setPreferenceProperty( incrementPref, "max", 10 );
   setPreferenceProperty( incrementPref, "step", 0.1 );
-
 }
 
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createOutsideCursorPreferences()
+VisuGUI_Module::
+createOutsideCursorPreferences()
 {
   int outsideCursorTab = addPreference( tr( "VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" ) );
 
@@ -603,7 +666,8 @@ VisuGUI_Module
   setPreferenceProperty( primitiveGr, "columns", 1 );
 
   int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
-                               LightApp_Preferences::Selector, "VISU", "outside_point_sprite_primitive_type" );
+                                         LightApp_Preferences::Selector, "VISU",
+                                         "outside_point_sprite_primitive_type" );
 
   QStringList values;
   values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
@@ -628,18 +692,21 @@ VisuGUI_Module
                 LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
 
   int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
-                                         LightApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" );  
+                                         LightApp_Preferences::DblSpin, "VISU",
+                                          "outside_point_sprite_alpha_threshold" );  
   setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
   setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
   setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
 
   int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
-                                     LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_resolution" );
+                                     LightApp_Preferences::IntSpin, "VISU",
+                                      "outside_geom_sphere_resolution" );
   setPreferenceProperty( resolutionPref, "min", 3 );
   setPreferenceProperty( resolutionPref, "max", 100 );
 
   int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
-                                    LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_face_limit" );
+                                    LightApp_Preferences::IntSpin, "VISU",
+                                     "outside_geom_sphere_face_limit" );
   setPreferenceProperty( faceLimitPref, "min", 10 );
   setPreferenceProperty( faceLimitPref, "max", 1000000 );
 
@@ -663,8 +730,8 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createPickingPreferences()
+VisuGUI_Module::
+createPickingPreferences()
 {
   int pickingTab = addPreference( tr( "VISU_PICKING_PREF_TAB_TTL" ) );
 
@@ -673,7 +740,7 @@ VisuGUI_Module
   setPreferenceProperty( cursorGr, "columns", 1 );
 
   int cursorSizePref = addPreference( tr( "VISU_PICKING_PREF_CURSOR_SIZE" ), cursorGr,
-                                        LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
+                                      LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
   setPreferenceProperty( cursorSizePref, "min", 0 );
   setPreferenceProperty( cursorSizePref, "max", 1.0 );
   setPreferenceProperty( cursorSizePref, "step", 0.1 );
@@ -683,14 +750,15 @@ VisuGUI_Module
   setPreferenceProperty( pyramidHeightPref, "min", 1 );
   setPreferenceProperty( pyramidHeightPref, "max", 100 );
 
-  int selectionColorPref = addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
-                                         LightApp_Preferences::Color, "VISU", "picking_selection_color" );
+  /*int selectionColorPref = */
+  addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
+                 LightApp_Preferences::Color, "VISU", "picking_selection_color" );
 
   // Tolerance
   int toleranceGr = addPreference( tr( "VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" ), pickingTab );
 
   int pointTolerancePref = addPreference( tr( "VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" ), toleranceGr,
-                                        LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
+                                          LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
   setPreferenceProperty( pointTolerancePref, "min", 0.001 );
   setPreferenceProperty( pointTolerancePref, "max", 10 );
   setPreferenceProperty( pointTolerancePref, "step", 0.01 );
@@ -742,13 +810,14 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createSpaceMousePreferences()
+VisuGUI_Module::
+createSpaceMousePreferences()
 {
   int mouseTab = addPreference( tr( "VISU_MOUSE_PREF_TAB_TLT" ) );
 
   int mouseGr = addPreference( tr( "VISU_MOUSE_PREF_GROUP_TLT" ), mouseTab );
-  int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
+  int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr,
+                                 LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
   QStringList values;
   values.append( tr( "VISU_MOUSE_PREF_STANDARD" ) );
   values.append( tr( "VISU_MOUSE_PREF_KEYBOARD_FREE" ) );
@@ -759,16 +828,27 @@ VisuGUI_Module
   setPreferenceProperty( mousePref, "indexes", indices );
 
   int keybrdGr = addPreference( tr( "VISU_KEYBOARD_PREF_GROUP_TTL" ), mouseTab );
-  int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
+  int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr,
+                                  LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
   setPreferenceProperty( keybrdPref,  "max",  1000  );
 
   int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), mouseTab );
   setPreferenceProperty( spacemouseGr, "columns", 1 );
-  int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func1_btn" ); //decrease_speed_increment
-  int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func2_btn" ); //increase_speed_increment
-  int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
-  int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func4_btn" ); //increase_gauss_point_magnification
-  int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func5_btn" ); //dominant_combined_switch
+  int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr,
+                                       LightApp_Preferences::Selector, "VISU",
+                                       "spacemouse_func1_btn" ); //decrease_speed_increment
+  int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr,
+                                       LightApp_Preferences::Selector, "VISU",
+                                       "spacemouse_func2_btn" ); //increase_speed_increment
+  int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr,
+                                       LightApp_Preferences::Selector, "VISU",
+                                       "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
+  int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr,
+                                       LightApp_Preferences::Selector, "VISU",
+                                       "spacemouse_func4_btn" ); //increase_gauss_point_magnification
+  int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr,
+                                       LightApp_Preferences::Selector, "VISU",
+                                       "spacemouse_func5_btn" ); //dominant_combined_switch
   values.clear();
   values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) );
   values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) );
@@ -808,8 +888,8 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void 
-VisuGUI_Module
-::createRecorderPreferences()
+VisuGUI_Module::
+createRecorderPreferences()
 {
   int recorderTab = addPreference( tr( "VISU_RECORDER_PREF_TAB_TTL" ) );
 
@@ -844,27 +924,28 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void
-VisuGUI_Module
-::OnCreateGaussPoints()
+VisuGUI_Module::
+OnCreateGaussPoints()
 {
   double initialTime = vtkTimerLog::GetCPUTime();
-  CreatePrs3d<VISU::GaussPoints_i,VVTK_Viewer,VisuGUI_GaussPointsDlg,1>(this,true);
+  CreatePrs3d<VISU::GaussPoints_i, VVTK_Viewer, VisuGUI_GaussPointsDlg, 1>(this);
   INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
         vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
 }
 
 void
-VisuGUI_Module
-::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
+VisuGUI_Module::
+OnViewManagerAdded(SUIT_ViewManager* viewMgr)
 {
   QString type = viewMgr->getViewModel()->getType();
   if ( type == VVTK_Viewer::Type() ) 
-    connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
+    connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
+             this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
 }
 
 void
-VisuGUI_Module
-::OnViewCreated(SUIT_ViewWindow* view)
+VisuGUI_Module::
+OnViewCreated(SUIT_ViewWindow* view)
 {
   SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>( view );
   if ( viewWindow ) {
@@ -878,8 +959,8 @@ VisuGUI_Module
 }
 
 void
-VisuGUI_Module
-::setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
+VisuGUI_Module::
+setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
 {
   if ( !viewWindow )
     return;
@@ -914,8 +995,8 @@ VisuGUI_Module
 }
 
 void
-VisuGUI_Module
-::setProperty( SVTK_ViewManager* vm, const QString& prop )
+VisuGUI_Module::
+setProperty( SVTK_ViewManager* vm, const QString& prop )
 {
   if ( !vm )
     return;
@@ -926,8 +1007,8 @@ VisuGUI_Module
 }
 
 void
-VisuGUI_Module
-::preferencesChanged( const QString& group, const QString& pref )
+VisuGUI_Module::
+preferencesChanged( const QString& group, const QString& pref )
 {
   VisuGUI::preferencesChanged(group,pref);
 
@@ -945,14 +1026,14 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 SUIT_ViewManager*
-VisuGUI_Module
-::getViewManager(const QString& theType, 
-                const bool theIsCreate)
+VisuGUI_Module::
+getViewManager(const QString& theType, 
+               const bool theIsCreate)
 {
-  if(SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
+  if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
     return aViewManager;
 
-  if(theIsCreate && VVTK_Viewer::Type() == theType)
+  if (theIsCreate && theType == VVTK_Viewer::Type())
     return onCreateViewManager();
 
   return NULL;
@@ -960,134 +1041,19 @@ VisuGUI_Module
 
 //---------------------------------------------------------------
 void
-VisuGUI_Module
-::OnEditGaussPoints()
+VisuGUI_Module::
+OnEditGaussPoints()
 {
   Handle(SALOME_InteractiveObject) anIO;
-  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
-    EditPrs3d<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg,1>(this, aPrs3d);
-    if(SVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this,true)){
-      aViewWindow->highlight(anIO,1);
+  if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) {
+    // Create VVTK_ViewWindow, if it does not exist
+    if (VVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this)) {
+      EditPrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, anIO, aPrs3d, aViewWindow);
     }
   }
 }
 
 
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayPrs()
-{
-  if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs");
-
-  QApplication::setOverrideCursor(Qt::waitCursor);
-
-  if(LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){
-    SALOME_ListIO aSel, aList;
-    aSelectionMgr->selectedObjects(aSel);
-    extractContainers(aSel, aList);
-
-    for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
-      Handle(SALOME_InteractiveObject) anIO = it.Value();
-      CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-
-      // is it a Prs3d object ?
-      if(!CORBA::is_nil(anObject)){
-       if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in())){
-         if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Prs3d object");
-         if(aPrs3d->GetType() == VISU::TGAUSSPOINTS)
-           VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
-         else if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
-           QString aType = aViewManager->getType();
-           if(aType == SVTK_Viewer::Type())
-             VISU::UpdateViewer<SVTK_Viewer>(this,aPrs3d,false,true,true);
-           else if(aType == VVTK_Viewer::Type())
-             VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
-         }
-         continue;
-       }
-      }
-
-      // is it Curve ?
-      if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in())){
-        if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Curve object");
-        PlotCurve( this, aCurve, VISU::eDisplay );
-        continue;
-      }
-
-      // is it Container ?
-      if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in())){
-        if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Container object");
-        PlotContainer( this, aContainer, VISU::eDisplay );
-        continue;
-      }
-
-      // is it Table ?
-      if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in())){
-        if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Table object");
-        PlotTable( this, aTable, VISU::eDisplay );
-        continue;
-      }
-    }
-  }
-
-  QApplication::restoreOverrideCursor();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnEraseAll()
-{
-  if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
-    QString aType = aViewManager->getType();
-    if(aType == SVTK_Viewer::Type())
-      VISU::OnEraseAll<SVTK_Viewer>(this);
-    else if(aType == VVTK_Viewer::Type())
-      VISU::OnEraseAll<VVTK_Viewer>(this);
-    else if(aType == SPlot2d_Viewer::Type())
-      VISU::OnEraseAll<SPlot2d_Viewer>(this);
-  }
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayOnlyPrs()
-{
-  OnEraseAll();
-  OnDisplayPrs();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnErasePrs()
-{
-  QApplication::setOverrideCursor(Qt::waitCursor);
-
-  LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
-  SALOME_ListIO aSel, aList;
-  aSelectionMgr->selectedObjects(aSel);
-  extractContainers(aSel, aList);
-
-  for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
-    Handle(SALOME_InteractiveObject) anIO = it.Value();
-    CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this),anIO->getEntry());
-    if(!CORBA::is_nil(anObject)){
-      VISU::Base_var aBase = VISU::Base::_narrow(anObject);
-      if(!CORBA::is_nil(aBase)) 
-       VISU::ErasePrs(this,aBase,true);
-    }
-  }
-
-  QApplication::restoreOverrideCursor();
-}
-
-
 //---------------------------------------------------------------
 namespace
 {
@@ -1096,40 +1062,40 @@ namespace
                const char* theSuffix,
                std::ostringstream& theStr)
   {
-    float aColor[3];
+    vtkFloatingPointType aColor[3];
     vtkRenderer* aRenderer = theViewWindow->getRenderer();
     aRenderer->GetBackground(aColor);
-    Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".R",aColor[0]);
-    Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".G",aColor[1]);
-    Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".B",aColor[2]);
+    Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]);
+    Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".G").c_str(),aColor[1]);
+    Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".B").c_str(),aColor[2]);
       
     double aPosition[3];
     vtkCamera* aCamera = aRenderer->GetActiveCamera();
     aCamera->GetPosition(aPosition);
-    Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[0]",aPosition[0]);
-    Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[1]",aPosition[1]);
-    Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[2]",aPosition[2]);
+    Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[0]").c_str(),aPosition[0]);
+    Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[1]").c_str(),aPosition[1]);
+    Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[2]").c_str(),aPosition[2]);
 
     double aFocalPnt[3];
     aCamera->GetFocalPoint(aFocalPnt);
-    Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[0]",aFocalPnt[0]);
-    Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[1]",aFocalPnt[1]);
-    Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[2]",aFocalPnt[2]);
+    Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[0]").c_str(),aFocalPnt[0]);
+    Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[1]").c_str(),aFocalPnt[1]);
+    Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[2]").c_str(),aFocalPnt[2]);
       
     double aViewUp[3];
     aCamera->GetViewUp(aViewUp);
-    Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[0]",aViewUp[0]);
-    Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[1]",aViewUp[1]);
-    Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[2]",aViewUp[2]);
+    Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[0]").c_str(),aViewUp[0]);
+    Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]);
+    Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]);
       
-    float aParallelScale = aCamera->GetParallelScale();
-    Storable::DataToStream(theStr,std::string("myParallelScale") + theSuffix,aParallelScale);
+    vtkFloatingPointType aParallelScale = aCamera->GetParallelScale();
+    Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale);
       
     double aScaleFactor[3];
     theViewWindow->GetScale(aScaleFactor);
-    Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[0]",aScaleFactor[0]);
-    Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[1]",aScaleFactor[1]);
-    Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[2]",aScaleFactor[2]);
+    Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[0]").c_str(),aScaleFactor[0]);
+    Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[1]").c_str(),aScaleFactor[1]);
+    Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[2]").c_str(),aScaleFactor[2]);
   }
 
   //---------------------------------------------------------------
@@ -1138,7 +1104,7 @@ namespace
                const char* theSuffix,
                const Storable::TRestoringMap& theMap)
   {
-    float aColor[3];
+    vtkFloatingPointType aColor[3];
     aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
     aColor[1] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".G").toDouble();
     aColor[2] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".B").toDouble();
@@ -1164,7 +1130,7 @@ namespace
     aViewUp[2] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[2]").toDouble();
     aCamera->SetViewUp(aViewUp);
 
-    float aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
+    vtkFloatingPointType aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
     aCamera->SetParallelScale(aParallelScale);
       
     double aScaleFactor[3];
@@ -1186,37 +1152,37 @@ namespace
       std::string aSegmentationMode;
       if(aWidgetCtrl->IsPlanesActive()){
        VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
-       float anOrigin[3];
+       vtkFloatingPointType anOrigin[3];
        aPlanesWidget->GetOrigin(anOrigin);
        Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
        Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
        Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
        
-       float aNormal[3];
+       vtkFloatingPointType aNormal[3];
        aPlanesWidget->GetNormal(aNormal);
        Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
        Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
        Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
        
-       float aDepth = aPlanesWidget->Distance();
+       vtkFloatingPointType aDepth = aPlanesWidget->Distance();
        Storable::DataToStream(theStr,"myCursorDepth",aDepth);
        
        aSegmentationMode = "Planes";
       }else if(aWidgetCtrl->IsSphereActive()){
        VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
-       float aCenter[3];
+       vtkFloatingPointType aCenter[3];
        aSphereWidget->GetCenter(aCenter);
        Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
        Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
        Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
        
-       float aRadius = aSphereWidget->GetRadius();
+       vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
        Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
        
        aSegmentationMode = "Sphere";
       }
       
-      Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode);
+      Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
     }
   }
 
@@ -1375,7 +1341,7 @@ namespace
        PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
        if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
          // To set visiblity
-         VISU::UpdateViewer<VVTK_Viewer>(theModule,aPrs3d,anIsFirst,false,false);
+         VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false);
          anIsFirst = false;
          
          // To update selection
@@ -1578,31 +1544,31 @@ OnRestoreConfiguration()
        
        if(aSegmentationMode == "Planes"){
          VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
-         float anOrigin[3];
+         vtkFloatingPointType anOrigin[3];
          anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
          anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
          anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
          aPlanesWidget->SetOrigin(anOrigin);
          
-         float aNormal[3];
+         vtkFloatingPointType aNormal[3];
          aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
          aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
          aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
          aPlanesWidget->SetNormal(aNormal);
          
-         float aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
+         vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
          aPlanesWidget->SetDistance(aDepth);
          
          aMainWindow->SetPlanesSegementation(true);
        }else if(aSegmentationMode == "Sphere"){
          VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
-         float aCenter[3];
+         vtkFloatingPointType aCenter[3];
          aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
          aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
          aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
          aSphereWidget->SetCenter(aCenter);
          
-         float aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
+         vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
          aSphereWidget->SetRadius(aRadius);
          
          aMainWindow->SetSphereSegementation(true);
@@ -1661,3 +1627,447 @@ eventFilter( QObject * theWatched, QEvent * theEvent )
   }
   return aRet;
 }
+
+
+const char gSeparator = '_'; // character used to separate parameter names
+const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b)
+/*!
+ * \brief Virtual public
+ *
+ * This method is called just before the study document is saved, so the module has a possibility
+ * to store visual parameters in AttributeParameter attribue(s)
+ */
+void VisuGUI_Module::storeVisualParameters(int savePoint)
+{
+  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  if( !study || !study->studyDS() )
+    return;
+  _PTR(Study) studyDS = study->studyDS();
+  _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+  _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+
+  // viewers counters are used for storing view_numbers in IParameters
+  int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 );
+
+  // componentName is used for encoding of entries when storing them in IParameters
+  _PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS );
+  std::string componentName = visuEng->ComponentDataType();
+
+  QPtrList<SUIT_ViewManager> lst;
+
+  // saving VVTK viewer parameters.  VVTK (Gauss Viewers) are NOT created by SalomeApp since
+  // VVTK is declared in VISU, so here we store VVTK view window parameters.
+  // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters.
+  ip->setProperty( "ActiveGaussViewer", "-1" ); 
+  getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+  for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+    SUIT_ViewManager* vman = it.current();
+    if ( SUIT_ViewWindow* vwin = vman->getActiveView() ) { 
+      // using predefined string "GaussViewer" as "entry"..  it's a hardcoded "workaround".  
+      // gauss viewer parameters are retrieved using this "entry" string.
+      // name of parameter  = caption of gauss ViewWindow 
+      // value of parameter = ViewWindow's visual parameters
+      ip->setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() );
+
+      if ( application()->desktop()->activeWindow() == vwin )
+       ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() );
+      vvtkViewers++;
+    }
+  }
+
+  // VISU module opens one SVTK viewer in activateModule().  This causes a bug in save-restore visual
+  // parameters: it no SVTK view was saved, we need NOT any SVTK on restore.  Here we store if any is open..
+  /*
+  lst.clear();
+  getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+  ip->setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() );
+  */
+
+  // main cycle to store parameters of displayed objects
+  lst.clear();
+  getApp()->viewManagers( lst );
+  vvtkViewers = svtkViewers = plotViewers = 0;
+  for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+    SUIT_ViewManager* vman = it.current();
+    QString vType = vman->getType();
+    int* viewsCounter = vType == SVTK_Viewer::Type()    ? &svtkViewers :
+                        vType == VVTK_Viewer::Type()    ? &vvtkViewers :
+                        vType == SPlot2d_Viewer::Type() ? &plotViewers : 0;
+
+    // saving VTK actors' properties
+    if ( vType == SVTK_Viewer::Type() ||  // processing SVTK and VVTK viewers in the same
+        vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)       
+
+      QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+      for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+       if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+         vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+         allActors->InitTraversal();
+         while ( vtkActor* actor = allActors->GetNextActor() ) {
+           if ( actor->GetVisibility() ) { // store only visible actors
+             if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+               if ( vActor->hasIO() ) { // actor corresponds to existing obj
+                 
+                 Handle(SALOME_InteractiveObject) io = vActor->getIO();
+                 // entry is "ecoded" = it does NOT contain component adress, since it is a 
+                 // subject to change on next component loading
+                 std::string entry = ip->encodeEntry( io->getEntry(), componentName ); 
+
+                 std::string param, vtkParam = vType.latin1(); vtkParam += gSeparator; 
+                 vtkParam += QString::number( *viewsCounter ).latin1();       vtkParam += gSeparator; 
+
+                 param = vtkParam + "Visibility";     
+                 ip->setParameter( entry, param, "On" );
+                 param = vtkParam + "Name";
+                 ip->setParameter( entry, param, vActor->getName() );
+                 param = vtkParam + "RepresentationMode";
+                 ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() );
+                 param = vtkParam + "Opacity";  
+                 ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() );
+                 vtkFloatingPointType r, g, b;
+                 vActor->GetColor(r, g, b);
+                 QString colorStr  = QString::number( r ); colorStr += gDigitsSep;
+                         colorStr += QString::number( g ); colorStr += gDigitsSep; 
+                          colorStr += QString::number( b ); 
+                 param = vtkParam + "Color"; 
+                 ip->setParameter( entry, param, colorStr.latin1() );
+                 param = vtkParam + "LineWidth";
+                 ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() );
+                 if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+                   param = vtkParam + "ShrinkMode";
+                   ip->setParameter( entry, param, "On" );
+                   param = vtkParam + "ShrinkFactor";
+                   ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() );
+                 }
+                 VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
+                 if ( scalarMapActor && scalarMapActor->IsShading() ) {
+                   param = vtkParam + "Shading";
+                   ip->setParameter( entry, param, "On" );
+                 }
+                 if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
+                   param = vtkParam + "ClippingPlane";
+                   int nPlanes = vPrs->GetNumberOfClippingPlanes();
+                   if ( !nPlanes )
+                     ip->setParameter( entry, param, "Off" );
+                   for ( int p = 0; p < nPlanes; p++ ) {
+                     vtkPlane* plane = vPrs->GetClippingPlane( p );
+                     vtkFloatingPointType normal[3], origin[3];
+                     plane->GetNormal( normal );
+                     plane->GetOrigin( origin );
+                     std::string planeValue  = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep;
+                                 planeValue += QString::number( normal[1] ).latin1(); planeValue += gDigitsSep;
+                                 planeValue += QString::number( normal[2] ).latin1(); planeValue += gDigitsSep;
+                                 planeValue += QString::number( origin[0] ).latin1(); planeValue += gDigitsSep;
+                                 planeValue += QString::number( origin[1] ).latin1(); planeValue += gDigitsSep;
+                                 planeValue += QString::number( origin[2] ).latin1(); 
+                     param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).latin1();
+                     ip->setParameter( entry, param, planeValue );
+                   }
+                 }
+
+               } // hasIO
+             } // salome_actor successfull downcast
+           } // isVisible
+         } // end of ..while.. actors traversal
+       } // if ( vtkView )
+      } // for ( views ) 
+      (*viewsCounter)++;   
+    } // if ( SVTK view model )
+    else if ( vType == SPlot2d_Viewer::Type() ) {  // processing Plot2d viewers
+      QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+      for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+       if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+         Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+         QPtrList<Plot2d_Curve> curves;
+         plotVF->getCurves( curves );
+         
+         Plot2d_Curve* curve;
+         for ( curve = curves.first(); curve; curve = curves.next() ) {
+           if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( curve ) ) {
+             if ( sCurve->hasIO() ) {
+               
+               Handle(SALOME_InteractiveObject) io = sCurve->getIO();
+               // entry is "ecoded" = it does NOT contain component adress, since it is a 
+               // subject to change on next component loading
+               std::string entry = ip->encodeEntry( io->getEntry(), componentName ); 
+
+               std::string param, plotParam = vType.latin1(); plotParam += gSeparator; 
+               plotParam += QString::number( *viewsCounter ).latin1();      plotParam += gSeparator; 
+
+               param = plotParam + "Visibility";     
+               ip->setParameter( entry, param, "On" );
+             }
+           }
+         } // for curves
+       } // if ( plotView )
+      } // for ( views ) 
+      (*viewsCounter)++;
+    } // if ( SPlot2d view model )
+  }
+}
+
+// returns VISU_Actor with IO with given entry
+VISU_Actor* getActor( const QString& entry, SVTK_ViewWindow* vtkView )
+{
+  if ( vtkView && !entry.isEmpty() ) {
+    vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+    allActors->InitTraversal();
+    while ( vtkActor* actor = allActors->GetNextActor() ) {
+      if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+       if ( vActor->hasIO() ) { // actor corresponds to existing obj
+         Handle(SALOME_InteractiveObject) io = vActor->getIO();
+         if ( entry == io->getEntry() )
+           return vActor;
+       }
+      }
+    }
+  }
+  return 0;
+}
+
+const int ViewerType = 0;
+const int ViewIndex = 1;
+const int ParamName = 2;
+// visual parameters are stored in strings as follows:
+// ViewerType_ViewNumber_ParamName.  '_' is used as separator and should not be used in
+// viewer type or parameter names
+
+// return viewer type substring from parameter name
+std::string getParam( const std::string& paramName, const int index )
+{
+  QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) );
+  if ( !lst.isEmpty() && index < lst.size() )
+    return lst[index].latin1();
+  return "";
+}
+
+
+/*!
+ * \brief Virtual public
+ *
+ * This method is called after the study document is opened, so the module has a possibility to restore
+ * visual parameters
+ */
+void VisuGUI_Module::restoreVisualParameters(int savePoint)
+{
+  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  if( !study || !study->studyDS() )
+    return;
+  _PTR(Study) studyDS = study->studyDS();
+  _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+  _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+
+  // actors are stored in a map after displaying of them for quicker access in future  
+  QMap<QString, QMap<QString, VISU_Actor*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
+
+  std::vector<std::string> entries = ip->getEntries();
+
+  for ( std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt ) {
+    
+    std::vector<std::string> paramNames = ip->getAllParameterNames( *entIt );
+    std::vector<std::string> paramValues = ip->getAllParameterValues( *entIt );
+    std::vector<std::string>::iterator namesIt = paramNames.begin();
+    std::vector<std::string>::iterator valuesIt = paramValues.begin();
+    
+    if ( *entIt == "GaussViewer" ) {
+      // parameter names are view window's captions, values - visual parameters.
+      for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+       SUIT_ViewManager* vman = onCreateViewManager();
+       SUIT_ViewWindow* vwin = vman->getActiveView(); 
+       vwin->setCaption( (*namesIt).c_str() );
+
+       // wait untill the window is really shown.  This step fixes MANY bugs..
+       while ( !vwin->isVisible() )
+         qApp->processEvents();
+
+       vwin->setVisualParameters( (*valuesIt).c_str() );
+      }
+      continue; // skip to next entry
+    }
+    
+    // entry is a normal entry - it should be "decoded" (setting base adress of component) 
+    QString entry( ip->decodeEntry( *entIt ).c_str() );
+
+    //SRN: Added a check that the entry corresponds to Standard_Real object in the Study
+    //     as the object may be deleted or modified after the visual state is saved.
+    _PTR(SObject) so = studyDS->FindObjectID(entry.latin1());
+    if(!so) continue;  //Skip the not existent entry
+
+    for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+      std::string viewerType = ::getParam( *namesIt, ViewerType );
+
+      std::string paramName = ::getParam( *namesIt, ParamName );
+      bool ok;
+      std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
+      int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
+      if ( !ok ) // bad conversion of view index to integer
+       continue;       
+
+      //      cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
+
+      if ( viewerType == SVTK_Viewer::Type().latin1() ||
+          viewerType == VVTK_Viewer::Type().latin1() ) {
+
+       // used as inner map key for locating the actor.
+       QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
+
+       if ( paramName == "Visibility" && displayer() ) {
+         // if VVTK, then we must create viewer first, because 
+
+         QPtrList<SUIT_ViewManager> lst;
+         getApp()->viewManagers( viewerType.c_str(), lst );
+
+         // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager
+         if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+           SUIT_ViewManager* vman = lst.at( viewIndex );
+           SUIT_ViewModel* vmodel = vman->getViewModel();
+           // both SVTK and VVTK view models can be casted to SALOME_View
+           displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+
+           // store displayed actor in a temporary map for quicker access later when restoring other parameters
+           SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+           QMap<QString, VISU_Actor*> viewActorMap;
+           if ( vtkActors.contains( entry ) )
+             viewActorMap = vtkActors[ entry ];
+           viewActorMap[ viewerTypeIndex ] = getActor( entry, vtkView );
+           vtkActors[ entry ] = viewActorMap;
+         }
+       }
+       else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+         VISU_Actor* vActor = 0;
+         if ( vtkActors.contains( entry ) ) {
+           QMap<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
+           if ( viewActorMap.contains( viewerTypeIndex ) )
+             vActor = viewActorMap[ viewerTypeIndex ];
+         }
+         if ( !vActor )
+           continue;
+
+         QString val( (*valuesIt).c_str() );
+         
+         if ( paramName == "Name" )
+           vActor->setName( val.latin1() );
+
+         else if ( paramName == "RepresentationMode" ) 
+           vActor->SetRepresentation( val.toInt() );
+
+         else if ( paramName == "Opacity" )
+           vActor->SetOpacity( val.toFloat() );
+
+         else if ( paramName == "Color" ) {
+           QStringList colors = QStringList::split( gDigitsSep, val );
+           if ( colors.count() == 3 )
+             vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+         }
+
+         else if ( paramName == "LineWidth" )
+           vActor->SetLineWidth( val.toFloat() );
+
+         else if ( paramName == "ShrinkMode" ) {
+           vActor->SetShrinkable( true );
+           vActor->SetShrink();
+         }
+
+         else if ( paramName == "ShrunkFactor" )
+           vActor->SetShrinkFactor( val.toFloat() );
+
+         else if ( paramName == "Shading" ) {
+           if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+             scalarMapActor->SetShading();
+         }
+
+         else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+           VISU::Prs3d_i* prs = vActor->GetPrs3d();
+           if ( !prs )
+             continue;
+
+           prs->RemoveAllClippingPlanes();
+           if ( val != "Off" ) {
+             QStringList vals = QStringList::split( gDigitsSep, val );
+             if ( vals.count() == 6 ) { // format check: 6 float values
+               vtkFloatingPointType normal[3], origin[3];
+               for (int x = 0; x < 3; x++ ) {
+                 normal[x] = vals[x].toFloat();
+                 origin[x] = vals[x+3].toFloat();
+               }
+               OrientedPlane* plane = OrientedPlane::New();
+               plane->SetNormal( normal );
+               plane->SetOrigin( origin );
+               prs->AddClippingPlane( plane );
+               plane->Delete();
+             }
+           }
+         }
+       } // else ..
+      } // if SVTK
+
+      else if ( viewerType == SPlot2d_Viewer::Type().latin1() ) {
+
+       if ( paramName == "Visibility" && displayer() ) {
+         QPtrList<SUIT_ViewManager> lst;
+         getApp()->viewManagers( viewerType.c_str(), lst );
+
+         if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+           SUIT_ViewManager* vman = lst.at( viewIndex );
+           SUIT_ViewModel* vmodel = vman->getViewModel();
+           // SVTK and VVTK view models can be casted to SALOME_View
+           displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) ); 
+         }
+       }
+
+      } // if SPlot2d
+
+    } // for names/parameters iterator
+  } // for entries iterator
+
+  // [ update all SVTK/VVTK/Plot2D views
+  QPtrList<SUIT_ViewManager> lst;
+  getApp()->viewManagers( lst );
+  for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+    SUIT_ViewManager* vman = it.current();
+    SUIT_ViewModel* vmodel = vman->getViewModel();
+    if ( !vmodel )
+      continue;
+    if ( vmodel->getType() == SVTK_Viewer::Type() ||  // processing SVTK and VVTK viewers
+        vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way 
+      SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+      vtkView->getRenderer()->ResetCameraClippingRange();
+      vtkView->Repaint();
+    }
+    else if ( vmodel->getType() == SPlot2d_Viewer::Type().latin1() ) {
+      Plot2d_ViewWindow* plotView = (Plot2d_ViewWindow*) vman->getActiveView();
+      plotView->getViewFrame()->Repaint();
+    }
+  } // ] end of update views
+
+  // VISU module opens one SVTK viewer in activateModule().  This causes a bug in save-restore visual
+  // parameters: it no SVTK view was saved, we need NOT any SVTK on restore.  Here we close one
+  // default SVTK if needed.
+  /*
+  QString openedSvtkViewerStr = ip->getProperty( "VtkViewersCount" ).c_str();
+  int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok );
+  if ( ok && openedSvtkViewer == 0 ) {
+    lst.clear();
+    getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+    if ( lst.count() )
+      lst.at( 0 )->closeAllViews();
+  }
+  */
+
+  // if active Gauss Viewer is set ( != -1) then raise the gauss view window.
+  bool ok;
+  QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str();
+  int activeGaussViewer = activeGaussViewerStr.toInt( &ok );
+  if ( ok && activeGaussViewer != -1 ) {
+    lst.clear();
+    getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+    if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
+      SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
+      if ( activeView ) {
+       activeView->setActiveWindow();
+       activeView->setFocus();
+      }          
+    }
+  }
+}
+
index c13c8235d997885cca1298ba144abd19b50da748..02abf76e08c74e5d7465f7466a0245f6a23b9ce7 100644 (file)
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  File   : VisuGUI_Module.h
 //  Author : 
 //  Module : VISU
-//  $Header$
 
 #ifndef VisuGUI_Module_HeaderFile
 #define VisuGUI_Module_HeaderFile
@@ -39,22 +38,12 @@ class SVTK_ViewWindow;
 
 #include "MED_SharedPtr.hxx"
 
-namespace VISU
-{
-  class Viewer;
-  typedef MED::SharedPtr<Viewer> PViewer;
-  
-  typedef std::map<SUIT_ViewManager*,PViewer> TViewerMap;
-}
-
 //! This class inherits base VisuGUI.
 /*! Used to display, erase end edit presentations in the VVTK viewer. */
 class VisuGUI_Module: public VisuGUI
 {
   Q_OBJECT;
 
-  friend class VISU::Viewer;
-
 public:
   VisuGUI_Module();
 
@@ -84,6 +73,14 @@ public:
   getViewManager(const QString& theType, 
                 const bool theIsCreate);
 
+  virtual 
+  void
+  storeVisualParameters(int savePoint);
+  
+  virtual
+  void
+  restoreVisualParameters(int savePoint);
+
 public slots:
   //! Reimplemented method of the module deactivation.
   virtual 
@@ -129,9 +126,6 @@ protected slots:
   SUIT_ViewManager*
   onCreateViewManager();
 
-  void
-  onLastViewClosed(SUIT_ViewManager*);
-
   void
   OnCreateGaussPoints();
 
@@ -146,26 +140,6 @@ protected slots:
   void
   OnEditGaussPoints();
 
-  //! Reimplemented method of the Gauss Points displaying.
-  virtual 
-  void
-  OnDisplayPrs();
-
-  //! Reimplemented method of the Gauss Points displaying only.
-  virtual 
-  void
-  OnDisplayOnlyPrs();
-
-  //! Reimplemented method of the Gauss Points full erasing.
-  virtual
-  void
-  OnEraseAll();
-
-  //! Reimplemented method of the Gauss Points erasing.
-  virtual
-  void
-  OnErasePrs();
-
   //! Virtual method of saving configuration.
   virtual
   void
@@ -182,7 +156,6 @@ protected slots:
   OnRestoreConfiguration();
 
 protected:
-  VISU::TViewerMap myViewerMap;
   _PTR(SObject) myConfigSObject;
 
   void setProperty( SVTK_ViewWindow*, const QString& );  // set a property (speed_increment, etc ) for SVTK ViewWindow
index c847861fbb1076e9e11a246eb9d7437b7f38c325..b4a479ffa402959a8ea02608364effa828ff9338 100644 (file)
@@ -1,8 +1,21 @@
-//  SALOME VisuGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_NameDlg.cxx
 //  Author : Vadim SANDLER
 //  $Header$
 
 #include "VisuGUI_NameDlg.h"
+#include "VisuGUI.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_Application.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_Tools.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <LightApp_Application.h>
 
 #include <qgroupbox.h>
 #include <qlabel.h>
@@ -73,6 +91,11 @@ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent )
   myButtonCancel->setText( tr( "BUT_CANCEL"  ) );
   myButtonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( myButtonCancel );
+
+  myButtonHelp = new QPushButton( GroupButtons, "buttonHelp" );
+  myButtonHelp->setText( tr( "BUT_HELP"  ) );
+  myButtonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( myButtonHelp );
   /***************************************************************/
   
   topLayout->addWidget( GroupC1 );
@@ -81,6 +104,7 @@ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent )
   // signals and slots connections
   connect( myButtonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( myButtonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
   
   /* Move widget on the botton right corner of main widget */
   SUIT_Tools::centerWidget( this, parent );
@@ -118,6 +142,22 @@ void VisuGUI_NameDlg::accept()
   QDialog::accept();
 }
 
+void VisuGUI_NameDlg::onHelp()
+{
+  QString aHelpFileName = "/files/renaming_presentations.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 /*!
   Creates modal <Rename> dialog and returns name entered [ static ]
 */
index 56a9819b0675716491eba2c66726a03655ad63b3..c95057992151c42c8f5592e33db2dd7a3033635f 100644 (file)
@@ -1,13 +1,25 @@
-//  SALOME VisuGUI : implementation of desktop and GUI kernel
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_NameDlg.h
 //  Author : Vadim SANDLER
 //  Module : SALOME
-//  $Header$
 
 #ifndef VisuGUI_NAMEDLG_H
 #define VisuGUI_NAMEDLG_H
@@ -36,10 +48,12 @@ public:
     
 protected slots:
   void accept();
+  void onHelp(); 
   
 private:
   QPushButton*    myButtonOk;
   QPushButton*    myButtonCancel;
+  QPushButton*    myButtonHelp;
   QLineEdit*      myLineEdit;
 };
 
index 3fca41a1d23db6973f7ec8d02551a5601f94ac12..759c9948cda2971b8044c6e16174dd6883dc46e3 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "VisuGUI_OffsetDlg.h"
 #include "VISU_ViewManager_i.hh"
 #include "VISU_Actor.h"
 
+#include "LightApp_Application.h"
 #include "SalomeApp_Application.h"
 #include "SVTK_ViewWindow.h"
 #include "SVTK_ViewModel.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include "QtxDblSpinBox.h"
 
@@ -63,25 +67,25 @@ myModule(theModule)
   TopLayout->setSpacing(6);
   TopLayout->setMargin(11);
 
-  QHBox* aOffsetsPane = new QHBox (this);
-  aOffsetsPane->setSpacing(6);
+  QHBox* anOffsetsPane = new QHBox (this);
+  anOffsetsPane->setSpacing(6);
 
-  new QLabel ("dX:", aOffsetsPane);
-  myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt");
+  new QLabel ("dX:", anOffsetsPane);
+  myDxEdt = new QtxDblSpinBox (anOffsetsPane, "myDxEdt");
   myDxEdt->setRange(-MAXVAL, MAXVAL);
 
-  new QLabel("dY:", aOffsetsPane);
-  myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt");
+  new QLabel("dY:", anOffsetsPane);
+  myDyEdt = new QtxDblSpinBox (anOffsetsPane, "myDyEdt");
   myDyEdt->setRange(-MAXVAL, MAXVAL);
 
-  new QLabel("dZ:", aOffsetsPane);
-  myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt");
+  new QLabel("dZ:", anOffsetsPane);
+  myDzEdt = new QtxDblSpinBox (anOffsetsPane, "myDzEdt");
   myDzEdt->setRange(-MAXVAL, MAXVAL);
 
-  QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane);
+  QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane);
   connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset()));
 
-  TopLayout->addWidget(aOffsetsPane);
+  TopLayout->addWidget(anOffsetsPane);
 
   if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) {
     mySaveChk = new QCheckBox ("Save to presentation", this);
@@ -115,37 +119,43 @@ myModule(theModule)
   QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel");
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 4);
+  GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 5);  
+
+  QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 6);
 
   TopLayout->addWidget(GroupButtons);
 
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(onApply()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
 }
 
 void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
 {
   myPrsList.append(thePrs);
-  OffsetStruct aOffs;
-  thePrs->GetOffset(aOffs.myOffset);
-  myOldOffsets.append(aOffs);
+  CORBA::Float anOffset[3];
+  thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+  OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]);
+  myOldOffsets.append(anOffs);
   if (myPrsList.count() == 1) {
-    setOffset(aOffs.myOffset);
+    setOffset(anOffs.myOffset);
   } else if (myPrsList.count() == 2) {
-    float aOffset[3];
-    aOffset[0] = aOffset[1] = aOffset[2] = 0;
-    setOffset(aOffset);
+    OffsetStruct anOffs;
+    setOffset(anOffs.myOffset);
   }
 }
 
-void VisuGUI_OffsetDlg::setOffset (const float* theOffset)
+void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
 {
   myDxEdt->setValue(theOffset[0]);
   myDyEdt->setValue(theOffset[1]);
   myDzEdt->setValue(theOffset[2]);
 }
 
-void VisuGUI_OffsetDlg::getOffset (float* theOffset) const
+void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const
 {
   theOffset[0] = myDxEdt->value();
   theOffset[1] = myDyEdt->value();
@@ -167,11 +177,11 @@ bool VisuGUI_OffsetDlg::isToSave() const
     return false;
 }
 
-void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset)
+void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset)
 {
   if (myPrsList.count() == 0) return;
 
-  if (isToSave()) thePrs->SetOffset(theOffset);
+  if (isToSave()) thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
 
   ViewManagerList aViewManagerList;
   SalomeApp_Application* anApp = myModule->getApp();
@@ -203,10 +213,10 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset)
 
 void VisuGUI_OffsetDlg::accept()
 {
-  float aOffset[3];
-  getOffset(aOffset);
+  vtkFloatingPointType anOffset[3];
+  getOffset(anOffset);
   for (int i = 0; i < myPrsList.count(); i++) {
-    updateOffset(myPrsList.at(i), aOffset);
+    updateOffset(myPrsList.at(i), anOffset);
   }
   QDialog::accept();
 }
@@ -221,9 +231,23 @@ void VisuGUI_OffsetDlg::reject()
 
 void VisuGUI_OffsetDlg::onApply()
 {
-  float aOffset[3];
-  getOffset(aOffset);
+  vtkFloatingPointType anOffset[3];
+  getOffset(anOffset);
   for (int i = 0; i < myPrsList.count(); i++) {
-    updateOffset(myPrsList.at(i), aOffset);
+    updateOffset(myPrsList.at(i), anOffset);
+  }
+}
+
+void VisuGUI_OffsetDlg::onHelp()
+{
+  QString aHelpFileName = "/files/scaling_presentations.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
   }
 }
index b06092f9578db3cef7fed3a06fd09631c7666f7f..80a3f114060a75459c6c03d30f1e89b640e22f20 100644 (file)
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef DIALOGBOX_OFFSET_H
 #define DIALOGBOX_OFFSET_H
 
+#include "VTKViewer.h"
 #include "VISU_Prs3d_i.hh"
 
 // QT Includes
@@ -31,8 +32,23 @@ class QCheckBox;
 class QtxDblSpinBox;
 class VisuGUI;
 
-struct OffsetStruct {
-  float myOffset[3];
+struct OffsetStruct
+{
+  vtkFloatingPointType myOffset[3];
+
+  OffsetStruct()
+  {
+    myOffset[0] = myOffset[1] = myOffset[2] = 0;
+  }
+
+  OffsetStruct(vtkFloatingPointType theX,
+              vtkFloatingPointType theY,
+              vtkFloatingPointType theZ)
+  {
+    myOffset[0] = theX;
+    myOffset[1] = theY;
+    myOffset[2] = theZ;
+  }
 };
 
 class VisuGUI_OffsetDlg: public QDialog
@@ -45,8 +61,8 @@ class VisuGUI_OffsetDlg: public QDialog
   void addPresentation (VISU::Prs3d_i* thePrs);
   int getPrsCount() const { return myPrsList.count(); }
 
-  void setOffset (const float* theOffset);
-  void getOffset (float* theOffset) const;
+  void setOffset (const vtkFloatingPointType* theOffset);
+  void getOffset (vtkFloatingPointType* theOffset) const;
   bool isToSave() const;
 
  public slots:
@@ -56,9 +72,10 @@ class VisuGUI_OffsetDlg: public QDialog
   virtual void accept();
   virtual void reject();
   void onApply();
+  void onHelp();
 
  private:
-  void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset);
+  void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset);
 
   VisuGUI * myModule;
 
index a79356329eca42f54ff6e809e4cb6baa31ee5da2..04d78a4e3bd765b2a3778f760129c5b36055303c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_ViewManager_i.hh"
 #include "VISU_Plot3DPL.hxx"
 
-#include "SALOME_Actor.h"
 #include "SVTK_ViewWindow.h"
+
+#include "SALOME_Actor.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "LightApp_Application.h"
 
 #include <qlayout.h>
 #include <qvalidator.h>
@@ -72,20 +78,20 @@ static void renderViewFrame (SVTK_ViewWindow* vw)
 //=======================================================================
 class TPlane : public SALOME_Actor
 {
-  float                mySize;
+  vtkFloatingPointType mySize;
   vtkDataSetMapper*    myMapper;
   vtkPlaneSource*      myPlaneSource;
 
  public:
   // constructor
-  TPlane(float planeSize): mySize(planeSize)
+  TPlane(vtkFloatingPointType planeSize): mySize(planeSize)
   {
     Init();
   }
   // set plane parameters
-  void Set(float origin[3], float normal[3])
+  void Set(vtkFloatingPointType origin[3], vtkFloatingPointType normal[3])
   {
-    float point2[3], point1[3];
+    vtkFloatingPointType point2[3], point1[3];
     vtkMath::Perpendiculars(normal, point1, point2, 0.);
     for (int i = 0; i < 3; ++i) {
       point1[ i ] = point1[ i ] * mySize + origin[ i ];
@@ -127,7 +133,7 @@ class TPlane : public SALOME_Actor
 //=======================================================================
 VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent)
      : QVBox(parent), myInitFromPrs(false), myPreviewActor(NULL),
-       myViewWindow(VISU::GetViewWindow()), myPrs(NULL), myPipeCopy(NULL)
+       myViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>()), myPrs(NULL), myPipeCopy(NULL)
 {
   layout()->setAlignment(Qt::AlignTop);
   setSpacing(6);
@@ -279,7 +285,7 @@ void VisuGUI_Plot3DPane::restorePrsParams()
 void VisuGUI_Plot3DPane::onPositionSpn()
 {
   if (myPrs && !RelativeChkB->isChecked()) {
-    float minPos, maxPos;
+    vtkFloatingPointType minPos, maxPos;
     storePrsParams();
     myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
     restorePrsParams();
@@ -317,7 +323,7 @@ void VisuGUI_Plot3DPane::orientationChanged(int Id)
 //=======================================================================
 void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos)
 {
-  float minPos = 0., maxPos = 1., pos = PositionSpn->value();
+  vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value();
   if (myPrs) {
     storePrsParams();
     myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
@@ -370,7 +376,7 @@ void VisuGUI_Plot3DPane::updatePreview()
     }
     // set plane parameters corresponding to control values
     storePrsParams();
-    float normal[3], origin[3];
+    vtkFloatingPointType normal[3], origin[3];
     myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true);
     planePreview->Set(origin, normal);
     restorePrsParams();
@@ -494,6 +500,35 @@ bool VisuGUI_Plot3DPane::check()
   return true;
 }
 
+void VisuGUI_Plot3DPane::setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos)
+{
+  // Set plane
+  int id;
+  switch (theOrientation) {
+  case VISU::Plot3D::XY: id = 0; break;
+  case VISU::Plot3D::YZ: id = 1; break;
+  default: id = 2;
+  }
+  GBOrientation->setButton(id);
+  orientationChanged(id);
+  GBOrientation->setEnabled(false);
+
+
+  // Set rotation
+  Rot1->setValue(theXRotation * 180./PI);
+  Rot1->setEnabled(false);
+  Rot2->setValue(theYRotation * 180./PI);
+  Rot2->setEnabled(false);
+
+  // Set position
+  RelativeChkB->setChecked(false);
+  onRelativePos(false); // update range
+  PositionSpn->setValue(thePlanePos);
+  RelativeChkB->setEnabled(false);
+  PositionSpn->setEnabled(false);
+}
+
+
 //=======================================================================
 //function : Constructor
 //purpose  :
@@ -537,12 +572,16 @@ VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule)
   QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+  QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
 
   TopLayout->addWidget(GroupButtons);
 
   // signals and slots connections
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
 }
 
 //=======================================================================
@@ -569,3 +608,32 @@ void VisuGUI_Plot3DDlg::reject()
   
   QDialog::reject();
 }
+
+//=======================================================================
+//function : onHelp
+//purpose  :
+//=======================================================================
+void VisuGUI_Plot3DDlg::onHelp()
+{
+  QString aHelpFileName = "plot_3d_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
+//=======================================================================
+//function : setPlane
+//purpose  :
+//=======================================================================
+void VisuGUI_Plot3DDlg::setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos)
+{
+  myIsoPane->setPlane(theOrientation, theXRotation, theYRotation, thePlanePos);
+}
index a1e59f90c2fb1f1229fb33097c688871c910b35b..e6e227519944595a134a090497e677fee17e9334 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -61,6 +61,8 @@ class VisuGUI_Plot3DPane : public QVBox
 
   VISU::Plot3D_i* GetPrs() { return myPrs; }
 
+  void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
+
  private:
   bool                 myInitFromPrs;
   SALOME_Actor*        myPreviewActor;
@@ -107,9 +109,12 @@ class VisuGUI_Plot3DDlg : public QDialog
   int storeToPrsObject (VISU::Plot3D_i* thePrs)
     { return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs); }
 
+  void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
+
  protected slots:
   void accept();
   void reject();
+  void onHelp();
 
  private:
   VisuGUI_Plot3DPane*    myIsoPane;
index b4ca7c2079eda64b23b1b2c1fd0852084e1bacec..45d034d939acaee43cca21f06586e49fa9324069 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  Module : VISU
 
 #include "VisuGUI_PopupTools.h"
+
 #include "VisuGUI_ViewTools.h"
 #include "VisuGUI_Tools.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_Study.h"
+
+#include "VISU_Result_i.hh"
+#include "VISU_Gen_i.hh"
 
 #include "VISU_Actor.h"
 #include "VISU_ScalarMapAct.h"
-#include "VISU_Result_i.hh"
+
 #include "SalomeApp_Study.h"
+#include "LightApp_Study.h"
 
 using namespace VISU;
 
@@ -59,6 +62,7 @@ QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const
     else if ( p == "hasActor"       ) val = QtxValue( hasActor( ind ) );
     else if ( p == "isShading"      ) val = QtxValue( isShading( ind ) );
     else if ( p == "isScalarMapAct" ) val = QtxValue( isScalarMapAct( ind ) );
+    else if ( p == "isVisuComponent") val = QtxValue( isVisuComponent( ind ) );
   }
 
   return val;
@@ -170,7 +174,7 @@ QString VisuGUI_Selection::medEntity( const int ind ) const
 QString VisuGUI_Selection::medSource( const int ind ) const
 {
   _PTR(Study) aStudyDS = GetStudy()->studyDS();
-  if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind))){
+  if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind).latin1())){
     VISU::Result_var aRes;
     if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){
       using namespace VISU;
@@ -211,10 +215,10 @@ QString VisuGUI_Selection::representation( const int ind ) const
 {
   QString aResStr;
 
-  if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ){
-    if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ){
+  if (SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
+    if (VISU_Actor* anVISUActor = FindActor(aView, entry(ind).latin1())) {
       int aRepresent = anVISUActor->GetRepresentation();
-      switch ( aRepresent ){
+      switch (aRepresent) {
        ENUM2STRING( aResStr, VISU::POINT );
        ENUM2STRING( aResStr, VISU::WIREFRAME );
        ENUM2STRING( aResStr, VISU::SHADED );
@@ -278,8 +282,8 @@ namespace
        const QString& theEntry)
     {
       typedef typename TViewer::TViewWindow TViewWindow;
-      if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule))
-       if(VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1()))
+      if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule))
+       if (VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1()))
          return anActor->GetVisibility() ? "true" : "false";
 
       return QString();
@@ -315,7 +319,7 @@ QString VisuGUI_Selection::isShrunk( const int ind ) const
 {
   QString aResStr;
 
-  if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+  if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
     if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
       if ( anVISUActor->IsShrunkable() )
        aResStr = anVISUActor->IsShrunk() ? "1" : "0";
@@ -332,7 +336,7 @@ QString VisuGUI_Selection::isShading( const int ind ) const
 {
   QString aResStr;
   
-  if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+  if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
     if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
       if ( VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor) )
        aResStr = anActor->IsShading() ? "1" : "0";
@@ -344,12 +348,28 @@ QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
 {
   QString aResStr;
 
-  if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+  if ( SVTK_ViewWindow* aView = GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
     if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
-      {
-       VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
-       aResStr = anActor ? "1" : "0";
-      }
-  
+    {
+      VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
+      aResStr = anActor ? "1" : "0";
+    }
+
   return aResStr;
 }
+
+bool VisuGUI_Selection::isVisuComponent( const int ind ) const
+{
+  SalomeApp_Study* study = GetStudy();
+  if ( !study )
+    return false;
+  
+  _PTR(SObject) obj = study->studyDS()->FindObjectID( entry( ind ).latin1() );
+  if ( !obj )
+    return false;
+  CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
+  if( CORBA::is_nil( anObj ) )
+    return false;
+
+  return dynamic_cast<VISU::VISU_Gen_i*>( VISU::GetServant( anObj ).in() );
+}
index 1a7ae957869474101fb55e231f90a828d97cd736..536ef59a94745cea92a066fa2a127a69e49b992a 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -59,6 +59,7 @@ private:
   QString          hasActor( const int ) const;
   QString          isShading( const int ) const;
   QString          isScalarMapAct( const int ) const;
+  bool             isVisuComponent( const int ) const;
 
 private:
   int              nbChild( const int, const bool ) const;
index 7984a698872fe2e76323cec325b3bfd8c56adbb7..9050d5fdec95d8b4f42c47b41b125c283dbcbdba 100644 (file)
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  File   : VisuGUI_Module.h
 //  Author : 
 //  Module : VISU
-//  $Header$
 
 #ifndef VisuGUI_Prs3dTools_HeaderFile
 #define VisuGUI_Prs3dTools_HeaderFile
@@ -52,9 +51,10 @@ namespace VISU
   template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
   void
   EditPrs3d(VisuGUI* theModule, 
-           VISU::Prs3d_i* thePrs3d)
+           VISU::Prs3d_i* thePrs3d,
+           SVTK_ViewWindow* theViewWindow)
   {
-    if(TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)){
+    if (TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)) {
       TDlg* aDlg = new TDlg (theModule);
       aDlg->initFromPrsObject(aPrs3d);
       if (runAndWait(aDlg,TIsDlgModal)) {
@@ -65,18 +65,17 @@ namespace VISU
        try {
          aPrs3d->UpdateActors();
        } catch (std::runtime_error& exc) {
+         aPrs3d->RemoveActors();
+
          INFOS(exc.what());
          SUIT_MessageBox::warn1
            (GetDesktop(theModule), QObject::tr("WRN_VISU"),
             QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
             QObject::tr("BUT_OK"));
-
-         aPrs3d->RemoveActors();
        }
-       typedef typename TViewer::TViewWindow TViewWindow;
-       if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
-         aViewWindow->getRenderer()->ResetCameraClippingRange();
-         aViewWindow->Repaint();
+       if (theViewWindow) {
+         theViewWindow->getRenderer()->ResetCameraClippingRange();
+         theViewWindow->Repaint();
        }
        // Optionally, create table and curves for cut lines
        QApplication::setOverrideCursor(Qt::waitCursor);
@@ -93,10 +92,19 @@ namespace VISU
   template<class TPrs3d_i, class TDlg, int TIsDlgModal>
   inline
   void
-  EditPrs3d(VisuGUI* theModule, 
-           VISU::Prs3d_i* thePrs3d)
+  EditPrs3d(VisuGUI* theModule,
+           Handle(SALOME_InteractiveObject)& theIO,
+           VISU::Prs3d_i* thePrs3d,
+           SVTK_ViewWindow* theViewWindow = NULL)
   {
-    EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg,TIsDlgModal>(theModule,thePrs3d);
+    SVTK_ViewWindow* aViewWindow = theViewWindow;
+    if (!aViewWindow)
+      // Create SVTK_ViewWindow, if it does not exist
+      aViewWindow = GetViewWindow<SVTK_Viewer>(theModule);
+    if (aViewWindow) {
+      EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg,TIsDlgModal>(theModule, thePrs3d, aViewWindow);
+      aViewWindow->highlight(theIO, 1);
+    }
   }
 
   //---------------------------------------------------------------
@@ -134,26 +142,30 @@ namespace VISU
   bool
   CreatePrs3d(VisuGUI* theModule,
              _PTR(SObject) theTimeStamp,
-             const Handle(SALOME_InteractiveObject)& theIO,
-             const bool theIsCreateView = false)
+             const Handle(SALOME_InteractiveObject)& theIO)
   {
     Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
 
     bool isExist;
     QString aType = Storable::FindValue(aMap,"myType",&isExist);
-    if(!isExist || aType.toInt() != TTIMESTAMP )
+    if (!isExist || aType.toInt() != TTIMESTAMP )
       return false;
 
     QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
     QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
     QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
     QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
-    //
-    int aPos = GetFreePositionOfDefaultScalarBar(theModule);
-    GetResourceMgr()->setValue("VISU","scalar_bar_position_num",aPos);
-    //
+
+    // Create new TViewWindow instance, if it does not exist.
+    typedef typename TViewer::TViewWindow TViewWindow;
+    TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule);
+
+    // Define free position for scalar bar.
+    int aPos = GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
+    GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
+
     QApplication::setOverrideCursor(Qt::waitCursor);
-    
+
     TPrs3d_i* aPrs3d =
       CreatePrs3d<TPrs3d_i>(theModule,
                            theTimeStamp,
@@ -161,16 +173,16 @@ namespace VISU
                            (Entity)anEntity.toInt(),
                            aFieldName.latin1(),
                            aTimeStampId.toInt());
-    
+
     QApplication::restoreOverrideCursor();
-    if(aPrs3d){
+    if (aPrs3d) {
       SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
       int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
-      if(!aValue){
-       if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode
+      if (!aValue) {
+       if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
          aDlg->initFromPrsObject(aPrs3d);
 
-           if(runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
+           if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
              // Optionally, create table and curves for cut lines
              QApplication::setOverrideCursor(Qt::waitCursor);
              CreateCurves( theModule,
@@ -187,57 +199,58 @@ namespace VISU
            }
        }
       }
-      PublishInView<TViewer>(theModule,aPrs3d,true,theIsCreateView);
 
-      AddScalarBarPosition(theModule,aPrs3d,aPos);
+      // Display created presentation.
+      if (aViewWindow) {
+       PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
+       aViewWindow->onFitAll();
+
+       AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+      }
 
       return true;
     }
 
     return false;
   }
-  
+
 
   //---------------------------------------------------------------
   template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
   inline
   void
-  CreatePrs3d(VisuGUI* theModule,
-             const bool theIsCreateView = true)
+  CreatePrs3d(VisuGUI* theModule)
   {
     if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
       return;
-    
+
     _PTR(SObject) aTimeStampSObj;
     Handle(SALOME_InteractiveObject) anIO;
-    if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+    if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
+      return;
+
+    // Create new TViewWindow instance, if it does not exist.
+    typedef typename TViewer::TViewWindow TViewWindow;
+    if (!GetViewWindow<TViewer>(theModule))
       return;
-    
-    if(!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO,theIsCreateView))
+
+    if (!CreatePrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
       return;
-    
+
     theModule->application()->putInfo(QObject::tr("INF_DONE"));
-    
-    typedef typename TViewer::TViewWindow TView;
-    if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView))
-      aView->onFitAll();
   }
 
   template<class TPrs3d_i, class TDlg, int IsDlgModal>
   inline
   void
-  CreatePrs3d(VisuGUI* theModule,
-             const bool theIsCreateView = true)
+  CreatePrs3d(VisuGUI* theModule)
   {
-    if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
-      QString aType = aViewManager->getType();
-      if(aType == SVTK_Viewer::Type())
-       CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
-      else if(aType == VVTK_Viewer::Type())
-       CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
-    }
-  }
+    if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager())
+      if (aViewManager->getType() == VVTK_Viewer::Type()) 
+       return CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule);
 
+    CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule);
+  }
 }
 
 #endif
index ddc63e88388ffe4a59dbeade3d49a339ce14b6d7..affe39ed92ff9756f25b928cd25dddaf8f6c52e2 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
-
-#include "SVTK_FontWidget.h"
-
-#include "SVTK_ViewWindow.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "SVTK_ViewWindow.h"
+#include "SVTK_FontWidget.h"
 
 #include "VISUConfig.hh"
 #include "VISU_Convertor.hxx"
@@ -44,8 +42,9 @@
 #include "VISU_ScalarMap_i.hh"
 #include "VISU_ScalarMapAct.h"
 
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 
+#include "SUIT_Session.h"
 #include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 
@@ -62,8 +61,20 @@ using namespace std;
 VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref):
   QVBox(parent), myPreviewActor(0)
 {
-  myVerX = 0.01;  myVerY = 0.10;  myVerW = 0.10;  myVerH = 0.80;
-  myHorX = 0.20;  myHorY = 0.01;  myHorW = 0.60;  myHorH = 0.12;
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  QString propertyName;
+  propertyName = QString("scalar_bar_vertical_");
+  myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
+  myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
+  myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
+  myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
+  
+  propertyName = QString("scalar_bar_horizontal_");
+  myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.);
+  myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
+  myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
+  myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
+  
   Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0;
   myRangeMode = -1;
 
@@ -538,6 +549,7 @@ void VisuGUI_ScalarBarPane::storeToResources() {
 void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
   initFromResources();
   myScalarMap = thePrs;
+  myTitle = thePrs->GetTitle();
   setPosAndSize( thePrs->GetPosX(),
                 thePrs->GetPosY(),
                 thePrs->GetWidth(),
@@ -550,7 +562,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
   default:
     setLogarithmic(false);
   }
-  float aRange[2];
+  vtkFloatingPointType aRange[2];
   thePrs->GetScalarMapPL()->GetSourceRange(aRange);
   Rmin = aRange[0]; Rmax = aRange[1];
   setRange( thePrs->GetMin(), thePrs->GetMax(),
@@ -566,13 +578,13 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
   const VISU::TNames& aCompNames = aField->myCompNames;
   const VISU::TNames& aUnitNames = aField->myUnitNames;
   for(int i = 0; i < aNbComp; i++){
-    QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace();
+    QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace();
     if(aComponent.isNull() || aComponent == "")
       aComponent = "Component " + QString::number(i+1);
     else
       aComponent = "[" + QString::number(i+1) + "] " + aComponent;
 
-    QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace();
+    QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace();
     if(anUnit.isNull() || anUnit == "")
       anUnit = "-";
     
@@ -592,7 +604,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
   // "Title"
   myTextDlg->setTitleText(QString(thePrs->GetTitle()));
 
-  float R, G, B;
+  vtkFloatingPointType R, G, B;
   thePrs->GetTitleColor(&R, &G, &B);
 
   myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
@@ -622,7 +634,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) {
 void VisuGUI_ScalarBarPane::updatePreview()
 {
   if (myPreviewCheck->isChecked()) {
-    if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+    if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       deleteScalarBar();
       createScalarBar();
       vf->Repaint();
@@ -634,12 +646,15 @@ void VisuGUI_ScalarBarPane::updatePreview()
  */
 void VisuGUI_ScalarBarPane::createScalarBar()
 {
-  if (VISU::GetViewWindow() == NULL) return;
+  if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
   if (myPreviewActor != 0) return;
   if (myScalarMap == NULL) return;
 
-  if(!check()) return;
-
+  if (!check()) return;
+  myScalarMapPL = VISU_ScalarMapPL::New();
+  if(myScalarMap->GetScalarMapPL())
+    myScalarMapPL->ShallowCopy(myScalarMap->GetScalarMapPL());
+  
   if ( myBusy ) return;
 
   myBusy = true;
@@ -656,31 +671,25 @@ void VisuGUI_ScalarBarPane::createScalarBar()
   myPreviewActor->GetScalarBar()->VisibilityOn();
   myPreviewActor->PickableOff();
   
-  myScalarMap->SetScalarMode(myModeCombo->currentItem());
-  myScalarMap->SetPosition(getX(),getY());
-  myScalarMap->SetSize(getWidth(),getHeight());
-  myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL);
+  myScalarMapPL->SetScalarMode(myModeCombo->currentItem());
   if(isLogarithmic())
-    myScalarMap->SetScaling(VISU::LOGARITHMIC);
+    myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
   else
-    myScalarMap->SetScaling(VISU::LINEAR);
-  if (RBFrange->isChecked()) {
-    myScalarMap->SetSourceRange();
-  } else {
-    myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
-  }
-  myScalarMap->SetNbColors(sbCol);
-  myScalarMap->SetLabels(sbLab); 
+    myScalarMapPL->SetScaling(VISU::LINEAR);
+  vtkFloatingPointType theRange[2];
+  theRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
+  theRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
+  myScalarMapPL->SetScalarRange(theRange);
+  myScalarMapPL->SetNbColors(sbCol);
   
-  myScalarMap->GetScalarMapPL()->SetNbColors(sbCol);
-  myScalarMap->GetScalarMapPL()->Update();
-    
-  aScalarBarActor->SetLookupTable(myScalarMap->GetScalarMapPL()->GetBarTable());
+  myScalarMapPL->Update();
+  
+  aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
   
   if (myTextDlg->getTitleText().latin1() != "") 
     aScalarBarActor->SetTitle(myTextDlg->getTitleText().latin1());
   else
-    aScalarBarActor->SetTitle(myScalarMap->GetTitle());
+    aScalarBarActor->SetTitle(myTitle.c_str());
   aScalarBarActor->SetOrientation(getOrientation());
   aScalarBarActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
   aScalarBarActor->GetPositionCoordinate()->SetValue(getX(),getY());
@@ -699,9 +708,9 @@ void VisuGUI_ScalarBarPane::createScalarBar()
                                  isTitleBold,isTitleItalic,isTitleShadow);
   vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
   aTitleProp->SetFontFamily(aTitleFontFamily);
-  aTitleProp->SetColor(float(aTitleColor.red())/255.,
-                      float(aTitleColor.green())/255.,
-                      float(aTitleColor.blue())/255.);
+  aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
+                      vtkFloatingPointType(aTitleColor.green())/255.,
+                      vtkFloatingPointType(aTitleColor.blue())/255.);
   (isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
   (isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
   (isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
@@ -716,16 +725,16 @@ void VisuGUI_ScalarBarPane::createScalarBar()
                                  isLabelBold, isLabelItalic, isLabelShadow);
   vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
   aLabelProp->SetFontFamily(aLabelFontFamily);
-  aLabelProp->SetColor(float(aLabelColor.red())/255.,
-                      float(aLabelColor.green())/255.,
-                      float(aLabelColor.blue())/255.);
+  aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
+                      vtkFloatingPointType(aLabelColor.green())/255.,
+                      vtkFloatingPointType(aLabelColor.blue())/255.);
   (isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
   (isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
   (isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
 
   aScalarBarActor->Modified();
 
-  VISU::GetViewWindow()->AddActor(myPreviewActor);
+  VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
 
   myBusy = false;
 }
@@ -736,18 +745,25 @@ void VisuGUI_ScalarBarPane::deleteScalarBar()
   if ( myBusy ) return;
   
   if (myPreviewActor == 0) return;
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow()){
-    vf->RemoveActor(myPreviewActor);
-    myPreviewActor->GetScalarBar()->VisibilityOff();
-  }
+  vtkRenderer* aRend       = myPreviewActor->GetRenderer();
+  if(aRend)
+    myPreviewActor->RemoveFromRender(aRend);
+  myPreviewActor->GetScalarBar()->VisibilityOff();
   myPreviewActor->Delete();
   myPreviewActor = 0;
+
+  if (myScalarMapPL){
+    myScalarMapPL->Delete();
+    myScalarMapPL = 0;
+  }
 }
 /*! public: Deleting preview scalar bar
  */
 void VisuGUI_ScalarBarPane::deletePreview()
 {
   deleteScalarBar();
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+    vf->Repaint();
 }
 /**
  * Store values to presentation object
@@ -810,6 +826,7 @@ int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ScalarMap_i* thePrs) {
     thePrs->SetLabelColor(aLblColor.red()/255.,
                          aLblColor.green()/255.,
                          aLblColor.blue()/255.);
+    myIsStoreTextProp = false;
   }
 
   return 1;
@@ -895,13 +912,16 @@ void VisuGUI_ScalarBarPane::changeScalarMode( int theMode )
 {
   if ( myScalarMap ) {
     if ( RBFrange->isChecked() ) {
-      float aRange[2];
+      vtkFloatingPointType aRange[2];
+      int aMode = myScalarMap->GetScalarMode();
       myScalarMap->SetScalarMode(theMode);
       myScalarMap->GetScalarMapPL()->GetSourceRange(aRange);
       MinEdit->setText( QString::number( aRange[0] ) );
       MaxEdit->setText( QString::number( aRange[1] ) );
+      myScalarMap->SetScalarMode(aMode);
     }
   }
+  updatePreview();
 }
 
 /*!
@@ -1027,13 +1047,14 @@ bool VisuGUI_ScalarBarPane::check()
 
 void VisuGUI_ScalarBarPane::onTextPref()
 {
-  myIsStoreTextProp = myTextDlg->exec();
+  myTextDlg->storeBeginValues();
+  myIsStoreTextProp = myTextDlg->exec() || myIsStoreTextProp;
   updatePreview();
 }
 
 void VisuGUI_ScalarBarPane::onPreviewCheck (bool thePreview)
 {
-  if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+  if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       createScalarBar();
     } else {
@@ -1083,10 +1104,15 @@ VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool Se
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
 
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
   TopLayout->addWidget( GroupButtons );
 
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 }
 
 /*!
@@ -1110,6 +1136,25 @@ void VisuGUI_ScalarBarDlg::reject()
   QDialog::reject();
 }
 
+/*!
+  Called when <Help> button is clicked, shows the corresponding help page in defined browser
+*/
+void VisuGUI_ScalarBarDlg::onHelp()
+{
+  QString aHelpFileName = "/files/scalar_map_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 
 //#######################################################################################
 VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent)
@@ -1166,8 +1211,57 @@ VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent)
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
 
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
   TopLayout->addWidget( GroupButtons );
 
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
+}
+
+void VisuGUI_TextPrefDlg::onHelp()
+{
+  QString aHelpFileName = "/files/scalar_map_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
+void VisuGUI_TextPrefDlg::storeBeginValues()
+{
+  myTitle = myTitleEdt->text();
+  myTitleFont->GetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]);
+  myLabelFont->GetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
+}
+
+/*!
+  Called when <Cancel> button is clicked, restore begin values
+*/
+void VisuGUI_TextPrefDlg::reject()
+{
+  myTitleEdt->setText(myTitle);
+  myTitleFont->SetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]);
+  myLabelFont->SetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
+
+  QDialog::reject();
+}
+/*!
+  Called when <Ok> button is clicked, store begin values
+*/
+void VisuGUI_TextPrefDlg::accept()
+{
+  storeBeginValues();
+
+  QDialog::accept();
 }
index 4f53a39bdc4e221c2cb076d7ff432af730d5795b..5ef53b8d8b91f3a011badc51d5a8301e531ad831 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -77,12 +77,23 @@ class VisuGUI_TextPrefDlg: public QDialog
   void setTitleVisible (bool isVisible)
     { (isVisible)? myTitleEdt->show() : myTitleEdt->hide(); }
 
+  void storeBeginValues();
+
  public:
   SVTK_FontWidget* myTitleFont;
   SVTK_FontWidget* myLabelFont;
 
+ protected slots:
+  void accept();
+  void reject();
+  void onHelp();
+
  private:
   QLineEdit* myTitleEdt;
+  QString    myTitle;
+  QColor     myColors[2];
+  int        myComboVals[2];
+  bool       myCheckVals[6];
 };
 
 
@@ -169,6 +180,8 @@ class VisuGUI_ScalarBarPane : public QVBox
   QCheckBox* myPreviewCheck;
   VISU_ScalarMapAct* myPreviewActor;
   VISU::ScalarMap_i* myScalarMap;
+  VISU_ScalarMapPL* myScalarMapPL;
+  std::string       myTitle;
 
   bool myBusy;
 };
@@ -193,6 +206,7 @@ class VisuGUI_ScalarBarDlg : public QDialog
  protected slots:
   void accept();
   void reject();
+  void onHelp();
 
  protected:
   VisuGUI_ScalarBarPane* myScalarPane;
index ccb1c5737824a1ab136e4e6811ed7e57ab10e5f0..2ab7dcca97d760514e7c246fb758053791a504fb 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  Module : VISU
 
 #include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+
 #include "VisuGUI_Tools.h"
+
 #include "VISU_Result_i.hh"
 #include "VISU_ScalarMapOnDeformedShape_i.hh"
+
+#include "VISU_ScalarMapPL.hxx"
 #include "VISU_ScalarMapOnDeformedShapePL.hxx"
+
+#include "VISU_Convertor.hxx"
+
 #include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 #include "SUIT_Desktop.h"
-#include "VISU_ScalarMapPL.hxx"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
 
 #include "SALOME_ListIO.hxx"
 
-#include "VISU_Convertor.hxx"
-
 #include "SALOMEDSClient_AttributeComment.hxx"
 #include "SALOMEDSClient_AttributeName.hxx"
 
@@ -55,6 +63,7 @@ using namespace std;
 VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
     : QDialog(VISU::GetDesktop(theModule), "VisuGUI_ScalarMapOnDeformedShapeDlg", false,
               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+      myIsAnimation(false),
       myVisuGUI(theModule)
 {
   myPrs = NULL;
@@ -94,14 +103,14 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome
 
   TopGroupLayout->addWidget(FieldLabel, 1, 0);
   TopGroupLayout->addWidget(myFieldsCombo,1,1);
-  
+
   // TimeStamps combo box
   QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
   myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
 
   TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
   TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
-  
+
   //
   aTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
 
@@ -134,6 +143,10 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome
   buttonCancel->setAutoDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
 
+  QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
   // Add Tab box and Buttons to the top layout
   TopLayout->addWidget(aTabBox);
   TopLayout->addWidget(GroupButtons);
@@ -141,25 +154,27 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome
   // signals and slots connections
   connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
   connect(myFieldsCombo,     SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
   connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
-  
 }
 
-void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim)
+void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject
+             (VISU::ScalarMapOnDeformedShape_i* thePrs, bool isAnim)
 {
+  myIsAnimation = isAnim;
   myPrs = thePrs;
 
-  setFactor(thePrs->GetScale());
+  setFactor(myPrs->GetScale());
   myTimeStampsCombo->setDisabled(isAnim);
-  
-  QString aFieldName(thePrs->GetScalarFieldName());
-  float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetMeshName().c_str(),
-                                             thePrs->GetScalarFieldName().c_str(),
-                                             thePrs->GetScalarIteration(),
-                                             thePrs->GetScalarEntity());
+
+  QString aFieldName(myPrs->GetScalarFieldName().c_str());
+  float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+                                             myPrs->GetScalarFieldName().c_str(),
+                                             myPrs->GetScalarIteration(),
+                                             myPrs->GetScalarEntity());
   QString aIteration(QString("%1").arg(aIterFloat));
-  
+
   if (myMeshFieldsTimes.size() == 0)
   {
     // find all fields and time stamps on it
@@ -171,67 +186,109 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDe
       Handle(SALOME_InteractiveObject) aIO = selected.First();
       if (aIO->hasEntry()) {
        _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+       _PTR(GenericAttribute) anTmpAttr;
+       if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+         _PTR(AttributeComment) aTmpComment (anTmpAttr);
+         string aTmpComm = aTmpComment->Value();
+         QString aTmpstrIn (aTmpComm.c_str());
+         VISU::Storable::TRestoringMap aTmpaMap;
+         VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+         bool aTmpisExist;
+         VISU::VISUType aTmpType =
+            (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+         switch(aTmpType){
+         case VISU::TTIMESTAMP:
+           {
+             aSObject = aSObject->GetFather();
+             aSObject = aSObject->GetFather();
+             break;
+           }
+         case VISU::TFIELD:
+           {
+             _PTR(SObject) newSObject;
+             if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+             aSObject = aSObject->GetFather();
+             break;
+           }
+         case VISU::TANIMATION:
+           {
+             _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+             for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+               _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+               _PTR(SObject) newSObject;
+               if(aTmpChildSObj->ReferencedObject(newSObject)){
+                 aSObject = newSObject;
+                 aSObject->GetFather();
+                 break;
+               }
+             }
+             break;
+           }
+         }
+       }
+
        aSObject = aSObject->GetFather();
        aSObject = aSObject->GetFather();
-       aSObject = aSObject->GetFather();
-       aSObject = aSObject->GetFather();
+
        mySelectionObj = aSObject;
        CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
-       VISU::Result_var aResult;
        if (CORBA::is_nil(anObject)) {
          mySelectionObj = mySelectionObj->GetFather();
        }
-       _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-       
-       for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
-         _PTR(SObject) aChildSObj = aIter->Value();
-         CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-         
-         _PTR(GenericAttribute) anAttr;
-         if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
-           _PTR(AttributeComment) aComment (anAttr);
-           string aComm = aComment->Value();
-           QString strIn (aComm.c_str());
-           VISU::Storable::TRestoringMap aMap;
-           VISU::Storable::StrToMap(strIn,aMap);
-           bool isExist;
-           VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
-           if (isExist) {
-             if ((aType == VISU::TTIMESTAMP)) {
-               _PTR(GenericAttribute) aNameAttr;
-               if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
-                 _PTR(AttributeName) aName (aNameAttr);
-                 VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
-                 QString aMeshName  = VISU::getValue(aChildSObj,"myMeshName");
-                 if(QString(thePrs->GetMeshName().c_str()) != aMeshName) continue;
-                 myCurrMeshName = aMeshName;
-                 QString aFieldName = VISU::getValue(aChildSObj,"myFieldName");
-                 QString aTimeIter  = VISU::getValue(aChildSObj,"myTimeStampId");
-                 QString aEntity    = VISU::getValue(aChildSObj,"myEntityId");
-                 VISU::TEntity anEntity;
-                 switch(aEntity.toInt()){
-                 case 0: anEntity = VISU::NODE_ENTITY; break;
-                 case 1: anEntity = VISU::EDGE_ENTITY; break;
-                 case 2: anEntity = VISU::FACE_ENTITY; break;
-                 case 3: anEntity = VISU::CELL_ENTITY; break;
-                 }
-                 TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
-                 TFE aKey(aFieldName.latin1(),anEntity);
-                 aFieldsMap[aKey][aTimeIter.toInt()] = 
-                   GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
-                                            aFieldName.latin1(),
-                                            aTimeIter.toInt(),
-                                            anEntity);
-               }
-             }
-           }
-         }
-       }
       }
     }
-    
-    AddAllFieldNames();
 
+    if (mySelectionObj) {
+      _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+      for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+        _PTR(SObject) aChildSObj = aIter->Value();
+        CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+        _PTR(GenericAttribute) anAttr;
+        if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+          _PTR(AttributeComment) aComment (anAttr);
+          string aComm = aComment->Value();
+          QString strIn (aComm.c_str());
+          VISU::Storable::TRestoringMap aMap;
+          VISU::Storable::StrToMap(strIn,aMap);
+          bool isExist;
+          VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+          if (isExist) {
+            if ((aType == VISU::TTIMESTAMP)) {
+              _PTR(GenericAttribute) aNameAttr;
+              if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+                _PTR(AttributeName) aName (aNameAttr);
+                VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+                QString aMeshName = VISU::getValue(aChildSObj, "myMeshName");
+                if (QString(myPrs->GetMeshName().c_str()) != aMeshName) continue;
+                myCurrMeshName = aMeshName;
+                QString aFieldName = VISU::getValue(aChildSObj, "myFieldName");
+                QString aTimeIter  = VISU::getValue(aChildSObj, "myTimeStampId");
+                QString aEntity    = VISU::getValue(aChildSObj, "myEntityId");
+                VISU::TEntity anEntity;
+                switch (aEntity.toInt()) {
+                case 0: anEntity = VISU::NODE_ENTITY; break;
+                case 1: anEntity = VISU::EDGE_ENTITY; break;
+                case 2: anEntity = VISU::FACE_ENTITY; break;
+                case 3: anEntity = VISU::CELL_ENTITY; break;
+                }
+                TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
+                TFE aKey (aFieldName.latin1(), anEntity);
+                aFieldsMap[aKey][aTimeIter.toInt()] = 
+                  GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+                                           aFieldName.latin1(),
+                                           aTimeIter.toInt(),
+                                           anEntity);
+              }
+            }
+          }
+        }
+      }
+    }
+
+    AddAllFieldNames();
   }
   myFieldsCombo->setCurrentText(aFieldName);
   AddAllTimes(myFieldsCombo->currentText());
@@ -241,21 +298,28 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDe
   myScalarPane->initFromPrsObject(myPrs);
 }
 
-int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalar) {
-
+int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject
+            (VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalars, int theIter)
+{
   thePrs->SetScale(getFactor());
-  
-  thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
-                        myPrs->GetScalarFieldName().c_str(),
-                        myPrs->GetScalarIteration(),
-                        myPrs->GetScalarEntity());
 
-  if (theUpdateScalar) SetScalarField();
+  if (myIsAnimation)
+    thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+                          getCurrentScalarFieldName().latin1(),
+                          theIter,
+                          myPrs->GetScalarEntity());
+  else
+    thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
+                          getCurrentScalarFieldName().latin1(),
+                          myTimeStampsCombo->currentItem() + 1,
+                          myPrs->GetScalarEntity());
+
+  if (theUpdateScalars) SetScalarField();
 
   thePrs->ShowColored(true);
 
   myScalarPane->storeToPrsObject(thePrs);
-  
+
   myPrs = thePrs;
 
   return 1;
@@ -304,7 +368,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString the
                        aFieldName.latin1(),
                        theIter,
                        anEntity);
-  
+
   myScalarPane->storeToPrsObject(myPrs);
   
   UpdateScalarField();
@@ -324,6 +388,20 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::reject()
   QDialog::reject();
 }
 
+void VisuGUI_ScalarMapOnDeformedShapeDlg::onHelp()
+{
+  QString aHelpFileName = "scalar_map_on_deformed_shape_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
   TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin();
   for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){
@@ -366,7 +444,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){
 
 void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
   myPrs->SetScale(getFactor());
-  float aRange[2];
+  vtkFloatingPointType aRange[2];
   myPrs->GetScalarMapOnDeformedShapePL()->Build();
   myPrs->GetScalarMapOnDeformedShapePL()->Update();
   myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange);
index bf588c9e429e2f62e9f3c7e40261a65ae30ffdb5..7fb24fac15cf1f5289edd97a1e0c906217b5d4f1 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -63,7 +63,7 @@ public:
     
 
     void initFromPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim=false);
-    int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalar=true);
+    int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalars=true,int theIter=1);
 
     int getCurrentScalarFieldNamePos();
     QString getCurrentScalarFieldName();
@@ -74,6 +74,7 @@ public:
 protected slots:
   void accept();
   void reject();
+  void onHelp();
 
 private slots:
   void onFieldChanged(int i=0);
@@ -92,6 +93,8 @@ private:
  
  TMF myMeshFieldsTimes;
  QString myCurrMeshName;
+ int myCurrScalarIter;
+ bool myIsAnimation;
  
  _PTR(SObject) mySelectionObj;
  VISU::ScalarMapOnDeformedShape_i* myPrs;
index 5bcf465face56786563e21be085f1cefb845ce6a..0f57d69ee20a9bc13af1dabddcbd43c7b7cae9d4 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -30,6 +30,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Actor.h"
 #include "VISU_PrsObject_i.hh"
 
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_VTKSelector.h"
 
 #include "SUIT_MessageBox.h"
 #include "SUIT_ViewWindow.h"
 #include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
 
 #include "SALOME_ListIO.hxx"
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
 #include "SVTK_Selector.h"
 
 #include "utilities.h"
@@ -250,6 +252,9 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
   QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox);
   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
 
+  QPushButton* aHelpBtn = new QPushButton (tr("BUT_HELP"), aBtnBox);
+  connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+
   TopLayout->addWidget(aBtnBox, 3, 0);
 
   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
@@ -263,7 +268,7 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
 
   // Activate Points pane
   myWidgetStack->raiseWidget(myPointsPane);
-  if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule))
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
     aViewWindow->SetSelectionMode(NodeSelection);
   onSelectionEvent();
 
@@ -276,7 +281,7 @@ VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
 
 void VisuGUI_SelectionDlg::onSelectionChange (int theId)
 {
-  SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
   if (!aViewWindow) return;
 
   switch (theId) {
@@ -300,11 +305,10 @@ void VisuGUI_SelectionDlg::onSelectionChange (int theId)
 
 void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
 {
-  if( mySelectionDlg )
-  {
+  if (mySelectionDlg) {
     mySelectionDlg = NULL;
     disconnect(mySelectionMgr,0,0,0);
-    if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule)){
+    if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
       switch(aViewWindow->SelectionMode()){
       case NodeSelection:
       case CellSelection:
@@ -318,7 +322,7 @@ void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
 
 template<class TData> QString getValue(TData* theData, int theId){
   if (vtkDataArray *aScalar = theData->GetScalars()){
-    float aVal = aScalar->GetTuple1(theId);
+    vtkFloatingPointType aVal = aScalar->GetTuple1(theId);
     return QString::number(aVal);
   } else {
     return QString("No data");
@@ -327,7 +331,7 @@ template<class TData> QString getValue(TData* theData, int theId){
 
 template<class TData> QString getVector(TData* theData, int theId){
   if (vtkDataArray *aVector = theData->GetVectors()) {
-    float *aVal = aVector->GetTuple3(theId);
+    vtkFloatingPointType *aVal = aVector->GetTuple3(theId);
     return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]);
   } else {
     return QString("No data");
@@ -337,10 +341,10 @@ template<class TData> QString getVector(TData* theData, int theId){
 #define ABS(a) (a>=0)?a:-a
 
 void VisuGUI_SelectionDlg::onSelectionEvent() {
-  SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
   if (!aViewWindow) return;
 
-  switch(aViewWindow->SelectionMode()){
+  switch (aViewWindow->SelectionMode()) {
   case NodeSelection:
   case CellSelection:
   case ActorSelection:
@@ -413,7 +417,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
     VISU_Actor* anVISUActor =
       VISU::FindActor(aViewWindow, aSObject->GetID().c_str());
     if (anVISUActor) {
-      float aCoord[6];
+      vtkFloatingPointType aCoord[6];
       anVISUActor->GetBounds(aCoord);
       myXPosLbl->setText(QString::number( aCoord[0] ));
       myYPosLbl->setText(QString::number( aCoord[2] ));
@@ -424,7 +428,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
       myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
 
       TColStd_IndexedMapOfInteger aMapIndex;
-      typedef map<int,float*> PointsMap;
+      typedef map<int,vtkFloatingPointType*> PointsMap;
       PointsMap aPointsMap;
 
       aSelector->GetIndex(anIO, aMapIndex);
@@ -438,7 +442,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
         switch (aType) {
         case 0:
           {
-            float* aCoord = anVISUActor->GetNodeCoord(anID);
+            vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID);
            int aVTKID = anVISUActor->GetNodeVTKID(anID);
             myXValLbl->setText( QString::number( aCoord[0] ) );
             myYValLbl->setText( QString::number( aCoord[1] ) );
@@ -462,7 +466,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
                 myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
                 myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
 
-                float* aCoord;
+                vtkFloatingPointType* aCoord;
                 vtkIdList *aPointList = aCell->GetPointIds();
 
                 for (int i = 0; i < aNbOfPoints; i++) {
@@ -483,7 +487,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
         myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
         int id = It->first;
         myListPoints->setText(i, 0, QString::number( id ));
-        float* aCoord = It->second;
+        vtkFloatingPointType* aCoord = It->second;
         myListPoints->setText(i, 1, QString::number( aCoord[0] ));
         myListPoints->setText(i, 2, QString::number( aCoord[1] ));
         myListPoints->setText(i, 3, QString::number( aCoord[2] ));
@@ -538,7 +542,7 @@ bool onIdEdit (const QString& theText,
                QLabel* theFieldName)
 {
   SalomeApp_Application* anApp = theModule->getApp();
-  SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theModule);
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
   if (!aViewWindow) return false;
   SVTK_Selector* aSelector = aViewWindow->GetSelector();
 
@@ -618,3 +622,17 @@ void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText)
   else
     clearFields();
 }
+
+void VisuGUI_SelectionDlg::onHelp()
+{
+  QString aHelpFileName = "/files/getting_elements_attributes.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index 467e9c182d810b2d6e45589fd95ced5cfa034824..40da2d6cb053c37c60f245d4e53f36490c7a0f8c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -55,6 +55,7 @@ private slots:
   void onSelectionEvent ();
   void onPointIdEdit (const QString& theText);
   void onCellIdEdit (const QString& theText);
+  void onHelp();
 
  private:
   void clearFields ();
index 120785fa09892ef8966a928289aab865ab64a675..f0e11c12613bab4310a4dc009034bb7602ef50bb 100644 (file)
@@ -1,6 +1,21 @@
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_SetupPlot2dDlg.cxx
 //  Author : Vadim SANDLER
 //  $Header$
 
 #include "VisuGUI_SetupPlot2dDlg.h"
+#include "VisuGUI.h"
 #include "SPlot2d_Curve.h"
 
 #include "SUIT_Tools.h"
 #include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "LightApp_Application.h"
 
 #include <SALOMEDSClient_AttributeTableOfInteger.hxx>
 #include <SALOMEDSClient_AttributeTableOfReal.hxx>
@@ -183,20 +203,24 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p
   
   myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 );
 
-  /* OK/Cancel buttons */
+  /* OK/Cancel/Help buttons */
   myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
   myOkBtn->setAutoDefault( TRUE );
   myOkBtn->setDefault( TRUE );
   myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" );
   myCancelBtn->setAutoDefault( TRUE );
+  myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this, "buttonHelp" );
+  myHelpBtn->setAutoDefault( TRUE );
 
-  topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 );
+  topLayout->addMultiCellWidget( myView, 0, 0, 0, 3 );
   topLayout->addWidget( myOkBtn, 1, 0 );
   topLayout->setColStretch( 1, 5 );
   topLayout->addWidget( myCancelBtn, 1, 2 );
+  topLayout->addWidget( myHelpBtn, 1, 3 );
 
   connect( myOkBtn,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( myHelpBtn,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 
   enableControls();
 
@@ -426,6 +450,24 @@ void VisuGUI_SetupPlot2dDlg::onVBtnToggled( bool on )
   }
   enableControls();
 }
+/*!
+  Slot, called when <Help> button is clicked
+*/
+void VisuGUI_SetupPlot2dDlg::onHelp()
+{
+  QString aHelpFileName = "/files/creating_curves.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
 /*!
   Enables/disables buttons 
 */
index 1ce1e2aaa449d499b1ae75b50f01c3de0ad53811..4332f048750b1ed835ce784e6da94fb9e0093870 100644 (file)
@@ -1,11 +1,25 @@
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_SetupPlot2dDlg.h
 //  Author : Vadim SANDLER
 //  Module : SALOME
-//  $Header$
 
 #ifndef VISUGUI_SetupPlot2dDlg_H
 #define VISUGUI_SetupPlot2dDlg_H
@@ -46,12 +60,14 @@ public:
 private slots:
   void onHBtnToggled( bool );
   void onVBtnToggled( bool );
+  void onHelp();
   void enableControls();
 
 private:
   QScrollView*                myView;
   QPushButton*                myOkBtn;
   QPushButton*                myCancelBtn;
+  QPushButton*                myHelpBtn;
   QPtrList<VisuGUI_ItemContainer> myItems;
 
   _PTR(SObject)               myObject;
index aba09d667d20c0cb77489cba94b000fbfb2171f3..d1615223a6eb751694f069b7e53d7fab803af548 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_StreamLinesDlg.cxx
 //  Author : Vitaly SMETANNIKOV
 #include "VISU_Actor.h"
 
 #include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 
 #include "SVTK_ViewWindow.h"
 
 #include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_MessageBox.h"
 
@@ -82,8 +97,7 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
 
   connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int)));
 
-  // Find All prs obj
-  //SUIT_Study* aActiveStudy = VISU::(myVisuGUI);
+  // Find all fields and time stamps on it
   _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
   LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
   SALOME_ListIO selected;
@@ -92,71 +106,114 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
     Handle(SALOME_InteractiveObject) aIO = selected.First();
     if (aIO->hasEntry()) {
       _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+      _PTR(GenericAttribute) anTmpAttr;
+      if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+        _PTR(AttributeComment) aTmpComment (anTmpAttr);
+        string aTmpComm = aTmpComment->Value();
+        QString aTmpstrIn (aTmpComm.c_str());
+        VISU::Storable::TRestoringMap aTmpaMap;
+        VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+        bool aTmpisExist;
+        VISU::VISUType aTmpType =
+          (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+        switch (aTmpType) {
+        case VISU::TTIMESTAMP:
+          {
+            aSObject = aSObject->GetFather();
+            aSObject = aSObject->GetFather();
+            break;
+          }
+        case VISU::TFIELD:
+          {
+            _PTR(SObject) newSObject;
+            if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+            aSObject = aSObject->GetFather();
+            break;
+          }
+        case VISU::TANIMATION:
+          {
+            _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+            for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+              _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+              _PTR(SObject) newSObject;
+              if(aTmpChildSObj->ReferencedObject(newSObject)){
+                aSObject = newSObject;
+                aSObject->GetFather();
+                break;
+              }
+            }
+            break;
+          }
+        }
+      }
+
       aSObject = aSObject->GetFather();
       aSObject = aSObject->GetFather();
-      aSObject = aSObject->GetFather();
-      aSObject = aSObject->GetFather();
+
       mySelectionObj = aSObject;
       CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
-      VISU::Result_var aResult;
       if (CORBA::is_nil(anObject)) {
        mySelectionObj = mySelectionObj->GetFather();
       }
-      _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
-      for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
-       _PTR(SObject) aChildSObj = aIter->Value();
-       CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-
-       if (!CORBA::is_nil(aChildObject)) {
-         VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
-         if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
-           if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
-               (aPrsObj->GetType() != VISU::TMESH)) {
-             _PTR(GenericAttribute) anAttr;
-             if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
-               _PTR(AttributeName) aName (anAttr);
-               myPrsLst += QString(aName->Value().c_str());
-               myPrsList.append(aPrsObj);
-               continue;
-             }
-           }
-         }
-       }
-       // else { // This is not a Prs object
-       _PTR(GenericAttribute) anAttr;
-       if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
-         _PTR(AttributeComment) aComment (anAttr);
-         string aComm = aComment->Value();
-         QString strIn (aComm.c_str());
-         VISU::Storable::TRestoringMap aMap;
-         VISU::Storable::StrToMap(strIn,aMap);
-         bool isExist;
-         VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
-         if (isExist) {
-           if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
-             _PTR(GenericAttribute) aNameAttr;
-             if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
-               _PTR(AttributeName) aName (aNameAttr);
-               VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
-               switch (aType) {
-               case VISU::TFAMILY:
-                 myFamilisLst += QString(aName->Value().c_str());
-                 myFamilyList.append(aPrsObj);
-                 break;
-               case VISU::TGROUP:
-                 myGroupsLst += QString(aName->Value().c_str());
-                 myGroupList.append(aPrsObj);
-                 break;
-               case VISU::TENTITY:
-                 myEntitiesLst += QString(aName->Value().c_str());
-                 myEntityList.append(aPrsObj);
-                 break;
-               }
-             }
-           }
-         }
-       }
+    }
+  }
+
+  if (mySelectionObj) {
+    _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+    for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+      _PTR(SObject) aChildSObj = aIter->Value();
+      CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+      if (!CORBA::is_nil(aChildObject)) {
+        VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+        if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
+          if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
+              (aPrsObj->GetType() != VISU::TMESH)) {
+            _PTR(GenericAttribute) anAttr;
+            if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
+              _PTR(AttributeName) aName (anAttr);
+              myPrsLst += QString(aName->Value().c_str());
+              myPrsList.append(aPrsObj);
+              continue;
+            }
+          }
+        }
+      }
+
+      _PTR(GenericAttribute) anAttr;
+      if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+        _PTR(AttributeComment) aComment (anAttr);
+        string aComm = aComment->Value();
+        QString strIn (aComm.c_str());
+        VISU::Storable::TRestoringMap aMap;
+        VISU::Storable::StrToMap(strIn,aMap);
+        bool isExist;
+        VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+        if (isExist) {
+          if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
+            _PTR(GenericAttribute) aNameAttr;
+            if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+              _PTR(AttributeName) aName (aNameAttr);
+              VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+              switch (aType) {
+              case VISU::TFAMILY:
+                myFamilisLst += QString(aName->Value().c_str());
+                myFamilyList.append(aPrsObj);
+                break;
+              case VISU::TGROUP:
+                myGroupsLst += QString(aName->Value().c_str());
+                myGroupList.append(aPrsObj);
+                break;
+              case VISU::TENTITY:
+                myEntitiesLst += QString(aName->Value().c_str());
+                myEntityList.append(aPrsObj);
+                break;
+              }
+            }
+          }
+        }
       }
     }
   }
@@ -235,8 +292,14 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
   QPushButton* aCancelBtn = new QPushButton( tr( "&Cancel" ) , aGroupButtons, "buttonCancel" );
   aCancelBtn->setAutoDefault( TRUE );
   aGroupButtonsLayout->addWidget( aCancelBtn, 0, 2 );
+
+  QPushButton* aHelpBtn = new QPushButton( tr( "&Help" ) , aGroupButtons, "buttonHelp" );
+  aHelpBtn->setAutoDefault( TRUE );
+  aGroupButtonsLayout->addWidget( aHelpBtn, 0, 3 );
+
   connect( aOkBtn,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( aHelpBtn,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 
   aBoxLayout->addWidget(aGroupButtons);
 
@@ -244,7 +307,6 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
 }
 
 
-
 void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs)
 {
   myScalarPane->initFromPrsObject(thePrs);
@@ -552,3 +614,17 @@ void VisuGUI_StreamLinesDlg::reject()
   myScalarPane->deletePreview();
   QDialog::reject();
 }
+
+void VisuGUI_StreamLinesDlg::onHelp()
+{
+  QString aHelpFileName = "/files/stream_lines_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index a4485ff83627ff22be504346aa3d6af4c093e30e..b1e33ac3071a27bdf40a870a61d202cf84bce62e 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_StreamLinesDlg.h
 //  Author : Vitaly SMETANNIKOV
@@ -40,9 +53,10 @@ public:
 protected slots:
   void accept();
   void reject();
+  void onHelp();
 
 private slots:
-  //void onSelectionActive(bool theActive);
+//VSR: 08/06/06:  void onSelectionActive(bool theActive);
   void StepLengthChanged(double theValue);
   void IntegrationStepChanged(double theValue);
   void PropagationTimeChanged(double theValue);
index 476721a51807548745b242d04ec3a156a46d5e19..ce4110d9992f183d14e5542dd19a44571f4d2fc4 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_TimeAnimation.cxx
 //  Author : Vitaly SMETANNIKOV
@@ -12,6 +25,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 #include "VisuGUI_DeformedShapeDlg.h"
 #include "VisuGUI_CutPlanesDlg.h"
 #include "VisuGUI_CutLinesDlg.h"
 #include "VISU_Actor.h"
 
 #include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
+#include "LightApp_Application.h"
 
 #include "SVTK_ViewWindow.h"
 
 #include "SUIT_OverrideCursor.h"
 #include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_FileDlg.h"
 
 #define  MAXVAL 1e10
 
 ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator)
-  : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
-    myAnimator(theAnimator), myViewWindow(theAnimator->getViewer())
+  : QDialog(theParent, "ArrangeDlg", true,
+            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+    myAnimator(theAnimator),
+    myViewWindow(theAnimator->getViewer())
 {
   myCurrent = 0;
   init();
   QStringList aFieldNames;
   // Find names of fields
-  for (int i = 0; i < theAnimator->getNbFields(); i++) {
-    aFieldNames.append(VISU::getValue(theAnimator->getFieldData(i).myField, "myName"));
+  for (int i = 0; i < myAnimator->getNbFields(); i++) {
+    aFieldNames.append(VISU::getValue(myAnimator->getFieldData(i).myField, "myName"));
     Offset aOffs;
     aOffs.myOffset[0] = myAnimator->getFieldData(i).myOffset[0];
     aOffs.myOffset[1] = myAnimator->getFieldData(i).myOffset[1];
@@ -90,7 +108,7 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator)
 ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow)
   : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize |
             WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
-    myAnimator(0), myViewWindow(theViewWindow)
+    myAnimator(NULL), myViewWindow(theViewWindow)
 {
   myCurrent = 0;
   init();
@@ -242,7 +260,7 @@ void ArrangeDlg::init()
 
 void ArrangeDlg::accept()
 {
-  if (myAnimator) {
+  if (myAnimator != NULL) {
     acceptAnimation();
   } else {
     acceptViewWindow();
@@ -282,14 +300,12 @@ void ArrangeDlg::acceptAnimation()
     }
   } else {
     QApplication::setOverrideCursor( Qt::waitCursor );
-    FieldData& aData = myAnimator->getFieldData(0);
+    FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
     if (aData.myPrs.empty())
-      myAnimator->generatePresentations(0);
-    VISU_Actor* aActor = aData.myPrs[0]->CreateActor();
-    float aBounds[6];
-    aActor->GetBounds(aBounds);
-    aActor->Delete();
-    float aDist = 0;
+      myAnimator->generatePresentations(myFieldLst->currentItem());
+    vtkFloatingPointType aBounds[6];
+    aData.myPrs[0]->GetBounds(aBounds);
+    vtkFloatingPointType aDist = 0;
     int aAxis = getAxis();
     switch (aAxis) {
     case XAxis:
@@ -302,10 +318,10 @@ void ArrangeDlg::acceptAnimation()
       aDist = fabs(aBounds[5] - aBounds[4]);
     }
 
-    float dx = fabs(aBounds[1] - aBounds[0]);
-    float dy = fabs(aBounds[3] - aBounds[2]);
-    float dz = fabs(aBounds[5] - aBounds[4]);
-    float max = (dx > dy) ? dx : dy;
+    vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+    vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+    vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+    vtkFloatingPointType max = (dx > dy) ? dx : dy;
     max = (dz > max) ? dz : max;
     max /= 100.0;
 
@@ -348,13 +364,13 @@ void ArrangeDlg::acceptViewWindow()
         anActor->SetPosition(aOffs.myOffset);
       if (mySaveChk)
        if (mySaveChk->isChecked())
-         aPrs->SetOffset(aOffs.myOffset);
+         aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
     }
   } else {
-    float aDist = 0;
-    float aShift = 0;
-    float aPrevDist = 0;
-    float aPrevShift = 0;
+    vtkFloatingPointType aDist = 0;
+    vtkFloatingPointType aShift = 0;
+    vtkFloatingPointType aPrevDist = 0;
+    vtkFloatingPointType aPrevShift = 0;
     int i;
     QMap<VISU::Prs3d_i*, int>::Iterator it;
     for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) {
@@ -362,12 +378,12 @@ void ArrangeDlg::acceptViewWindow()
       if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) {
        int aAxis = getAxis();
 
-       float aZeroOffset[3];
+       vtkFloatingPointType aZeroOffset[3];
         aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
        aActor->SetPosition(aZeroOffset);
         aActor->GetMapper()->Update();
 
-       float aBounds[6];
+       vtkFloatingPointType aBounds[6];
        aActor->GetBounds(aBounds);
        switch (aAxis) {
        case XAxis:
@@ -379,18 +395,18 @@ void ArrangeDlg::acceptViewWindow()
        case ZAxis:
          aDist = fabs(aBounds[5] - aBounds[4]);
        }
-       float aOffset[3];
+       vtkFloatingPointType aOffset[3];
         aOffset[0] = aOffset[1] = aOffset[2] = 0;
         aOffset[aAxis] =
           (aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
 
         if (i > 0) {
-          float aCCDist = (aDist + aPrevDist) / 2.0;
+          vtkFloatingPointType aCCDist = (aDist + aPrevDist) / 2.0;
 
-          float dx = fabs(aBounds[1] - aBounds[0]);
-          float dy = fabs(aBounds[3] - aBounds[2]);
-          float dz = fabs(aBounds[5] - aBounds[4]);
-          float max = (dx > dy) ? dx : dy;
+          vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+          vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+          vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+          vtkFloatingPointType max = (dx > dy) ? dx : dy;
           max = (dz > max) ? dz : max;
           max /= 100.0;
 
@@ -425,7 +441,7 @@ void ArrangeDlg::acceptViewWindow()
        aActor->SetPosition(aOffset);
        if (mySaveChk)
          if (mySaveChk->isChecked())
-           aPrs->SetOffset(aOffset);
+           aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
 
        aPrevDist = aDist;
        aPrevShift = aShift;
@@ -456,6 +472,7 @@ SetupDlg::SetupDlg (QWidget* theParent,
   QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6);
   aMainLayout->setSpacing(5);
 
+  // Range of time stamps
   QFrame* aRangeGrp = new QFrame(this);
   QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp );
   aRangeLayout->setSpacing( 6 );
@@ -466,16 +483,19 @@ SetupDlg::SetupDlg (QWidget* theParent,
   aRangeLayout->addMultiCellWidget(myUseRangeChk, 0, 0, 0, 3);
   myUseRangeChk->setChecked(myAnimator->isRangeDefined());
 
+  double aMaxTime = myAnimator->getMaxTime();
+  double aMinTime = myAnimator->getMinTime();
+  double aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+
   QLabel* aMinLbl = new QLabel("From", aRangeGrp);
   aMinLbl->setEnabled(myUseRangeChk->isChecked());
   aRangeLayout->addWidget(aMinLbl, 1, 0);
-  double aStep = (myAnimator->getMaxTime() - myAnimator->getMinTime())/(theAnimator->getFieldData(0).myNbTimes - 1);
-  myMinVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+  myMinVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
   myMinVal->setEnabled(myUseRangeChk->isChecked());
   if (myUseRangeChk->isChecked())
     myMinVal->setValue( myAnimator->getMinRange() );
   else
-    myMinVal->setValue( myAnimator->getMinTime() );
+    myMinVal->setValue( aMinTime );
 
   connect(myMinVal, SIGNAL( valueChanged(double)),
          this, SLOT( onMinValue(double) ));
@@ -484,12 +504,12 @@ SetupDlg::SetupDlg (QWidget* theParent,
   QLabel* aMaxLbl = new QLabel("To", aRangeGrp);
   aMaxLbl->setEnabled(myUseRangeChk->isChecked());
   aRangeLayout->addWidget(aMaxLbl, 1, 2);
-  myMaxVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+  myMaxVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
   myMaxVal->setEnabled(myUseRangeChk->isChecked());
   if (myUseRangeChk->isChecked())
     myMaxVal->setValue( myAnimator->getMaxRange() );
   else
-    myMaxVal->setValue( myAnimator->getMaxTime() );
+    myMaxVal->setValue( aMaxTime );
 
   connect(myMaxVal, SIGNAL( valueChanged(double)),
          this, SLOT( onMaxValue(double) ));
@@ -505,6 +525,7 @@ SetupDlg::SetupDlg (QWidget* theParent,
   aMainLayout->addWidget(aRangeGrp);
 
 
+  // Fields and Properties
   QHBox* aPropFrame = new QHBox(this);
   aPropFrame->setSpacing(5);
 
@@ -512,8 +533,8 @@ SetupDlg::SetupDlg (QWidget* theParent,
   myFieldLst = new QListBox(aNamesBox);
   QStringList aFieldNames;
   // Find names of fields
-  for (int i = 0; i < theAnimator->getNbFields(); i++) {
-    _PTR(SObject) aSO = theAnimator->getFieldData(i).myField;
+  for (int i = 0; i < myAnimator->getNbFields(); i++) {
+    _PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
     aFieldNames.append(VISU::getValue(aSO, "myName"));
   }
   myFieldLst->insertStringList(aFieldNames);
@@ -536,7 +557,7 @@ SetupDlg::SetupDlg (QWidget* theParent,
   //      this, SLOT( onScalarBarDlg() ) );
 
   myPropBtn = new QPushButton("Properties...", aPropBox);
-  //  myPropBtn->setEnabled(theAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
+  //  myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
   connect( myPropBtn, SIGNAL( clicked() ),
           this, SLOT( onPreferencesDlg() ) );
 
@@ -647,7 +668,7 @@ void SetupDlg::onFieldChange (int theIndex)
     myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
-    myTypeCombo->setCurrentItem(TSCALARMAPONDEFORMEDSHAPE_ITEM);
+    myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]);
     break;
   case VISU::TVECTORS: //Vectors
     myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
@@ -730,6 +751,15 @@ void SetupDlg::onPreferencesDlg()
   if (aData.myPrs.empty())
     myAnimator->generatePresentations(myFieldLst->currentItem());
 
+  if(!aData.myNbFrames || !aData.myPrs[0]){
+    QApplication::restoreOverrideCursor();
+    SUIT_MessageBox::warn1(this,
+                           tr("ERROR"),
+                           VisuGUI_TimeAnimationDlg::tr("MSG_NO_ANIMATIONDATA"),
+                           tr("&OK"));
+    return;
+  }
+
   int aType = myComboId2TypeId[myTypeCombo->currentItem()];
   switch (aType) {
   case TSCALARMAP_ITEM: //Scalar Map
@@ -766,13 +796,13 @@ void SetupDlg::onPreferencesDlg()
       if (aDlg->exec())
         { 
          int anbFrames=aDlg->getCurrentScalarNbIterations();
+         int aIter = 0;
          for (int i = 0; i < aData.myNbFrames; i++){
            TYPE* aCurrPrs_i = dynamic_cast<TYPE*>(aData.myPrs[i]);
+           aIter = i+1;
            if(i+1 > anbFrames)
-             aDlg->SetScalarField(anbFrames);
-           else
-             aDlg->SetScalarField(i+1);
-           aDlg->storeToPrsObject(aCurrPrs_i,false);
+             aIter=anbFrames;
+           aDlg->storeToPrsObject(aCurrPrs_i,false,aIter);
          }
        }
       delete aDlg;
@@ -970,7 +1000,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
 
   myAnimator = new VISU_TimeAnimation (theStudy);
   myAnimator->setSpeed(1);
-  myAnimator->setViewer(VISU::GetViewWindow(theModule));
+  myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
   connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
   connect(myAnimator, SIGNAL(stopped()),                 this, SLOT(onStop()));
 
@@ -1076,6 +1106,8 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   aSaveLay->setMargin( 5 );
 
   mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox);
+  connect(mySaveCheck, SIGNAL( toggled(bool)),
+          this, SLOT( onCheckDump(bool) ));
   aSaveLay->addMultiCellWidget(mySaveCheck, 0, 0, 0, 2);
 
   QLabel* aFormatLbl = new QLabel("Saving format:", aSaveBox);
@@ -1097,6 +1129,8 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   aSaveLay->addWidget(myPicsFormat, 1, 2);
   connect(mySaveCheck, SIGNAL( toggled(bool)),
           myPicsFormat, SLOT( setEnabled(bool) ));
+  connect(myPicsFormat, SIGNAL(  activated (int)),
+         this, SLOT( onPicsFormatChanged()));
 
   QLabel* aPathLbl = new QLabel("Path:", aSaveBox);
   aPathLbl->setEnabled(false);
@@ -1120,6 +1154,35 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   mySaveCheck->setChecked(false);
   aSaveLay->addWidget(aBrowseBtn, 2, 2);
 
+  mySaveAVICheck = new QCheckBox("Save animation to AVI file", aSaveBox);
+  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+          this, SLOT( onCheckDump(bool) ));
+  aSaveLay->addMultiCellWidget(mySaveAVICheck, 3, 3, 0, 2);
+
+  QLabel* aPathAVILbl = new QLabel("Path:", aSaveBox);
+  aPathAVILbl->setEnabled(false);
+  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+          aPathAVILbl, SLOT( setEnabled(bool) ));
+  aSaveLay->addWidget(aPathAVILbl, 4, 0);
+
+  myPathAVIEdit = new QLineEdit(aSaveBox);
+  myPathAVIEdit->setReadOnly(true);
+  myPathAVIEdit->setEnabled(false);
+  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+          myPathAVIEdit, SLOT( setEnabled(bool) ));
+  aSaveLay->addWidget(myPathAVIEdit, 4, 1);
+
+  QPushButton* aBrowseAVIBtn = new QPushButton("Browse...", aSaveBox);
+  aBrowseAVIBtn->setEnabled(false);
+  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+         aBrowseAVIBtn, SLOT( setEnabled(bool) ));
+  connect(aBrowseAVIBtn, SIGNAL( clicked()),
+         this, SLOT( onBrowseAVI() ));
+  aSaveLay->addWidget(aBrowseAVIBtn, 4, 2);
+
+  mySaveAVICheck->setChecked(false);
+  mySaveAVICheck->setEnabled(myAnimator->checkAVIMaker());
+
   TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3);
 
   aMainLayout->addWidget(myPlayFrame);
@@ -1145,9 +1208,15 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
 
+  QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
+  connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+
   SUIT_Study* aStudy = VISU::GetAppStudy(myModule);
   connect(aStudy, SIGNAL(destroyed()), this, SLOT(close()));
 
+  connect(myAnimator->getViewer(), SIGNAL(destroyed()), this, SLOT(close()));
+  connect(myAnimator->getViewer(), SIGNAL(closing(SUIT_ViewWindow*)), this, SLOT(close()));
+
   aMainLayout->addWidget(aBtnBox);
 
   myPlayFrame->setEnabled(false);
@@ -1156,7 +1225,11 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
 //------------------------------------------------------------------------
 VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg()
 {
-  delete myAnimator;
+  if(myAnimator != NULL){
+    delete myAnimator;
+    myAnimator = NULL;
+    VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)->Repaint();
+  }
 }
 
 //------------------------------------------------------------------------
@@ -1215,9 +1288,12 @@ void VisuGUI_TimeAnimationDlg::onPlayPressed()
   if (myPlayBtn->isOn() && (!myAnimator->running())) {
     myPlayBtn->setIconSet(MYpausePixmap);
     if (mySaveCheck->isChecked()) {
-      QStrList aDumpFormats = QImageIO::outputFormats();
-      myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem()));
-      myAnimator->dumpTo(myPathEdit->text());
+      onPicsFormatChanged();
+      onPathChanged();
+      
+    } else if (mySaveAVICheck->isChecked()) {
+      myAnimator->setDumpFormat("AVI");
+      myAnimator->dumpTo(myPathAVIEdit->text());
     } else {
       myAnimator->dumpTo("");
     }
@@ -1269,14 +1345,32 @@ void VisuGUI_TimeAnimationDlg::showEvent(QShowEvent* theEvent)
   mySetupDlg = new SetupDlg(this,myModule, myAnimator);
 }
 
+void VisuGUI_TimeAnimationDlg::reject()
+{
+  close();
+  QDialog::reject();
+}
+
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
 {
-  myAnimator->stopAnimation();
-  myAnimator->wait(500);
-  if (myAnimator->running() && (! myAnimator->finished())) {
-    isClosing = true;
-    myEvent = theEvent;
+  if(myAnimator != NULL){
+    myAnimator->stopAnimation();
+    myAnimator->wait(500);
+    if (myAnimator->running() && (! myAnimator->finished())) {
+      isClosing = true;
+      myEvent = theEvent;
+      //        * Destroing data in myAnimator before study closed.
+      //        * It needed for correcting destroing of myAnimator, which 
+      //        * depend from SVTK_RenderWindowInteractor() e.t.c.
+      if(theEvent->type() == QEvent::Close){
+       for (int i = 0; i < myAnimator->getNbFields(); i++)
+         myAnimator->clearData(myAnimator->getFieldData(i));
+       myAnimator->clearFieldData();
+      }
+    } else {
+      QDialog::closeEvent(theEvent);
+    }
   } else {
     QDialog::closeEvent(theEvent);
   }
@@ -1324,9 +1418,59 @@ void VisuGUI_TimeAnimationDlg::onSetupDlg()
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onBrowse()
 {
-  QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path");
+  //  QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path");
+  QString aDir;
+  if (myPathEdit->text().isEmpty())
+    aDir = getenv("HOME");
+  else 
+    aDir = myPathEdit->text();
+  QString aPath = SUIT_FileDlg::getExistingDirectory(this, aDir, "Select path");
   if (!aPath.isEmpty())
     myPathEdit->setText(Qtx::addSlash(aPath));
+  onPathChanged();
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onBrowseAVI()
+{
+  QStringList aFilter;
+  aFilter.append( "AVI Files (*.avi)" );
+  aFilter.append( "All Files (*.*)" );
+
+  QString aDir;
+  if (myPathAVIEdit->text().isEmpty())
+    aDir = getenv("HOME");
+  else {
+    QFileInfo aFile(myPathAVIEdit->text());
+    aDir = aFile.dirPath(true);
+  }
+  QString aPath = SUIT_FileDlg::getFileName(this, aDir, aFilter, "Select file", false);
+  if (!aPath.isEmpty())
+    myPathAVIEdit->setText(aPath);
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onCheckDump(bool)
+{
+  const QObject* source = sender();
+  if (source == mySaveCheck) {
+    if (mySaveCheck->isChecked()) {
+      onPicsFormatChanged();
+      onPathChanged();
+      if (mySaveAVICheck->isChecked())
+       mySaveAVICheck->setChecked(false);
+    } else {
+      myAnimator->dumpTo("");
+    }
+    mySaveAVICheck->setEnabled(!mySaveCheck->isChecked() && myAnimator->checkAVIMaker());
+  }
+  else if (source == mySaveAVICheck) {
+    if (mySaveAVICheck->isChecked()) {
+      if (mySaveCheck->isChecked())
+       mySaveCheck->setChecked(false);
+    }
+    mySaveCheck->setEnabled(!mySaveAVICheck->isChecked());
+  }
 }
 
 //------------------------------------------------------------------------
@@ -1342,6 +1486,21 @@ void VisuGUI_TimeAnimationDlg::onStop()
   }
 }
 
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onHelp()
+{
+  QString aHelpFileName = "/files/animating_presentations.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::saveToStudy()
 {
@@ -1363,3 +1522,16 @@ void VisuGUI_TimeAnimationDlg::restoreFromStudy(_PTR(SObject) theAnimation)
   myAnimator->restoreFromStudy(theAnimation);
   mySaveBtn->setEnabled(myAnimator->isSavedInStudy());
 }
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onPicsFormatChanged()
+{
+  QStrList aDumpFormats = QImageIO::outputFormats();
+  myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem()));
+}
+
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::onPathChanged()
+{
+  myAnimator->dumpTo(myPathEdit->text());
+}
index 53191604996c1c1bcef7932a7b47877367954435..3d59282694c7d20cdc1be56bfab3e66fc27d7a48 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VisuGUI_TimeAnimation.h
 //  Author : Vitaly SMETANNIKOV
 #define VISUGUI_TIMEANIMATION_H
 
 #include "QtxDblSpinBox.h"
-
 #include "SALOMEDSClient_Study.hxx"
 
+#include "VTKViewer.h"
+
 #include <qdialog.h>
 #include <qbuttongroup.h>
 #include <qwidgetstack.h>
 
+#include <vector>
+#include <map>
+
 class VisuGUI;
 class VISU_TimeAnimation;
 
@@ -61,7 +78,7 @@ class ArrangeDlg: public QDialog
 
  private:
   struct Offset {
-    float myOffset[3];
+    vtkFloatingPointType myOffset[3];
   };
 
 
@@ -137,6 +154,7 @@ class VisuGUI_TimeAnimationDlg: public QDialog
  protected:
     virtual void closeEvent(QCloseEvent* theEvent);
     virtual void showEvent(QShowEvent* theEvent);
+    virtual void reject();
     void stopAnimation();
 
  private slots:
@@ -152,9 +170,16 @@ class VisuGUI_TimeAnimationDlg: public QDialog
    void onSpeedChange(double theSpeed);
    void onExecution(long theNewFrame, double theTime);
    void onBrowse();
+   void onBrowseAVI();
+   void onCheckDump(bool);
    void onStop();
+   void onHelp();
    void saveToStudy();
    void publishToStudy();
+   /*!Sets dump format for myAnimator (setDumpFormat(...)), from myPicsFormat.*/
+   void onPicsFormatChanged();
+   /*!Sets path for myAnimator (dumpTo(...)), from myPathEdit.*/
+   void onPathChanged();
 
  private:
     QSlider* mySlider;
@@ -177,6 +202,9 @@ class VisuGUI_TimeAnimationDlg: public QDialog
     bool isClosing;
     QCloseEvent* myEvent;
 
+    QCheckBox* mySaveAVICheck;
+    QLineEdit* myPathAVIEdit;
+
     QPushButton* myPublishBtn;
     QPushButton* mySaveBtn;
 };
index ca1eea96bdb3c617901aab3b59bcb64bf7118961..61a268167d061ce84eaf2b1309aca9654be6f75b 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index bbfb7e574e31da8edbef1ca9648940b66bce246a..b49b5f823a9127190ac7b738faec5e81fd4c6d26 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 9e9f523d015eed52a82e71be641da3c38449e7ce..ffefafb9ad3827408b9e3652a9882e56da6f1b33 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -28,6 +28,9 @@
 
 #include "VisuGUI_Tools.h"
 
+#include "VisuGUI.h"
+#include "VisuGUI_ViewTools.h"
+
 #include "VISU_Gen_i.hh"
 #include "VISU_Prs3d_i.hh"
 #include "VISU_Result_i.hh"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
 
-#include "OB_Browser.h"
 #include "LightApp_DataObject.h"
 #include "LightApp_SelectionMgr.h"
 
+#include "OB_Browser.h"
+
 #include "SALOME_ListIO.hxx"
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
 #include "SVTK_Functor.h"
 
 #include "VTKViewer_Algorithm.h"
 
 #include "SPlot2d_ViewModel.h"
 #include "Plot2d_ViewFrame.h"
+#include "Plot2d_ViewManager.h"
 
 #include "SUIT_Session.h"
 #include "SUIT_MessageBox.h"
 
-#include "VisuGUI.h"
-
 #include <vtkRenderer.h>
 #include <vtkActorCollection.h>
 
@@ -366,6 +368,11 @@ namespace VISU
     for (; anIter.More(); anIter.Next()) {
       Handle(SALOME_InteractiveObject) anIO = anIter.Value();
       if (anIO->hasEntry()) {
+
+       // asv : if selected object is a Save Point object selected in object browser - return false
+       if ( QString( anIO->getEntry() ).startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) )
+         return false;
+
         _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
         VISU::Storable::TRestoringMap pMap;
         if (aSObject) {
@@ -421,49 +428,6 @@ namespace VISU
     return true;
   }
 
-  // Display/Erase
-
-  void
-  ErasePrs (const SalomeApp_Module* theModule,
-            CORBA::Object_ptr theObject, bool theUpdate)
-  {
-    if (!CORBA::is_nil(theObject)) {
-      VISU::Base_var aBase = VISU::Base::_narrow(theObject);
-      if (CORBA::is_nil(aBase)) return;
-      VISU::VISUType aType = aBase->GetType();
-      switch (aType) {
-      case VISU::TCURVE:
-        {
-          if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
-            PlotCurve(theModule, aCurve, VISU::eErase );
-          break;
-        }
-      case VISU::TCONTAINER:
-        {
-          if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
-            PlotContainer(theModule, aContainer, VISU::eErase );
-          break;
-        }
-      case VISU::TTABLE:
-        {
-          if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
-            PlotTable(theModule, aTable, VISU::eErase );
-          break;
-        }
-      default:
-        {
-          if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
-            ErasePrs3d(theModule, aPrsObject);
-            if (theUpdate) {
-              if (SVTK_ViewWindow* vw = GetViewWindow(theModule))
-                vw->Repaint();
-            }
-          }
-        }
-      } // switch (aType)
-    }
-  }
-
   void
   DeleteSObject(VisuGUI* theModule,
                _PTR(Study) theStudy,
@@ -472,16 +436,13 @@ namespace VISU
     _PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
     for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
       _PTR(SObject) aChildSObject = aChildIter->Value();
-      
       CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
-      RemoveScalarBarPosition(theModule,aChildObj);
-      ErasePrs(theModule, aChildObj);
+      ErasePrs(theModule, aChildObj, /*repaint_view_window = */false);
     }
 
     CORBA::Object_var anObj = VISU::ClientSObjectToObject(theSObject);
     if (!CORBA::is_nil(anObj)) {
-      RemoveScalarBarPosition(theModule,anObj);
-      ErasePrs(theModule, anObj);
+      ErasePrs(theModule, anObj, /*repaint_view_window = */true);
 
       VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj);
       if (!CORBA::is_nil(aRemovableObject)) {
@@ -506,19 +467,10 @@ namespace VISU
     if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
       return;
 
-    RemoveScalarBarPosition(theModule,thePrs);
-    thePrs->RemoveFromStudy();
-  }
+    SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+    RemoveScalarBarPosition(theModule, vw, thePrs);
 
-  void
-  ErasePrs3d(const SalomeApp_Module* theModule,
-             VISU::Prs3d_i* thePrs)
-  {
-    if ( SVTK_ViewWindow* vw = GetViewWindow( theModule ) ){
-      if (VISU_Actor* anVISUActor = FindActor( vw, thePrs )) {
-        anVISUActor->VisibilityOff();
-      }
-    }
+    thePrs->RemoveFromStudy();
   }
 
   // Presentation management
@@ -527,8 +479,8 @@ namespace VISU
   ChangeRepresentation (const SalomeApp_Module* theModule,
                         VISU::PresentationType  theType)
   {
-    SVTK_ViewWindow* vw  = GetViewWindow( theModule, false );
-    if( !vw )
+    SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+    if (!vw)
       return;
 
     Handle(SALOME_InteractiveObject) anIO;
@@ -563,17 +515,15 @@ namespace VISU
       }
     }
   }
-  
+
   void
   SetShading ( const SalomeApp_Module* theModule,
              bool theOn )
   {
-    SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type());
-    if (!aView) return;
-    SVTK_ViewWindow* vw  = dynamic_cast<SVTK_ViewWindow*>( aView );
-    if( !vw )
+    SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+    if (!vw)
       return;
-    
+
     Handle(SALOME_InteractiveObject) anIO;
     CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
     if (CORBA::is_nil(anObject)) return;
@@ -654,167 +604,30 @@ namespace VISU
     return dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
   }
 
-  // Views
-
-  SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, QString theType)
-  {
-    if(SalomeApp_Application* anApp = theModule->getApp()){
-      if(SUIT_ViewManager* aViewManager = anApp->activeViewManager()){
-        if (!theType.isNull()) {
-          if (aViewManager->getType() != theType)
-            return 0;
-        }
-        return aViewManager->getActiveView();
-      }
-    }
-    return 0;
-  }
-
   // VTK View
 
-  TViewWindows
-  GetViews(const SalomeApp_Module* theModule)
-  {
-    TViewWindows aViewWindows;
-    if(SalomeApp_Application* anApp = theModule->getApp()){
-      ViewManagerList aViewManagerList;
-      anApp->viewManagers(SVTK_Viewer::Type(),aViewManagerList);
-      QPtrListIterator<SUIT_ViewManager> anIter(aViewManagerList);
-      while(SUIT_ViewManager* aViewManager = anIter.current()){
-        QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
-        for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-          if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
-            if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
-              aViewWindows.push_back(aView);
-        }
-        ++anIter;
-      }
-    }
-    return aViewWindows;
-  }
-
-  SVTK_ViewWindow*
-  GetViewWindow( const SalomeApp_Module* theModule, const bool theCreate )
-  {
-    if (SalomeApp_Application* anApp = theModule->getApp())
-    {
-      SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
-      if( wnd )
-       return wnd;
-      else
-      {
-       SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate );
-       return aViewManager ? dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() ) : 0;
-      }
-    }
-    return NULL;
-  }
-
-  /*SVTK_ViewWindow*
-  GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate )
-  {
-    if (SalomeApp_Application* anApp = theModule->getApp())
-    {
-      SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
-      if( wnd )
-       return wnd;
-      else
-      {
-       if(SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate ))
-         return dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() );
-      }
-    }
-    return NULL;
-  }*/
-
-
-  SVTK_ViewWindow*
-  GetViewWindow()
-  {
-    SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
-      (SUIT_Session::session()->activeApplication());
-    if (anApp) {
-      if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) {
-        if (aViewManager->getType() == SVTK_Viewer::Type()) {
-          if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
-            return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
-          }
-        }
-      }
-    }
-    return NULL;
-  }
-
   VISU_Actor*
-  PublishInView(const SalomeApp_Module* theModule,
-                VISU::Prs3d_i* thePrs)
+  PublishMeshInView(const SalomeApp_Module* theModule,
+                    VISU::Prs3d_i* thePrs,
+                    SVTK_ViewWindow* theViewWindow)
   {
     VISU_Actor* aActor = NULL;
-    if(!thePrs)
+    if (!thePrs || !theViewWindow)
       return aActor;
-    if(SVTK_ViewWindow* aView = GetViewWindow(theModule)){
-      QApplication::setOverrideCursor( Qt::waitCursor );
-      try{
-       if(aActor = thePrs->CreateActor())
-         aView->AddActor(aActor);
-      }catch(std::exception& exc){
-       SUIT_MessageBox::warn1
-          (GetDesktop(theModule), QObject::tr("WRN_VISU"),
-           QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
-           QObject::tr("BUT_OK"));
-      }
-      QApplication::restoreOverrideCursor();
-    }
-    return aActor;
-  }
 
-  VISU_Actor*
-  UpdateViewer(const SalomeApp_Module* theModule,
-               VISU::Prs3d_i* thePrs,
-               bool theDispOnly)
-  {
-    SVTK_ViewWindow* vw = GetViewWindow( theModule );
-    if (!vw) return NULL;
-
-    vtkRenderer *aRen = vw->getRenderer();
-    vtkActorCollection *anActColl = aRen->GetActors();
-    anActColl->InitTraversal();
-
-    vtkActor *anActor;
-    VISU_Actor* anVISUActor = NULL;
-    VISU_Actor* aResActor = NULL;
-    while(vtkActor *anActor = anActColl->GetNextActor()){
-      anVISUActor = VISU_Actor::SafeDownCast(anActor);
-      if(anVISUActor){
-        VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
-        if(aPrs == NULL) continue;
-        if (thePrs == aPrs) {
-          try {
-           aResActor = anVISUActor;
-            thePrs->UpdateActor(aResActor);
-            aResActor->VisibilityOn();
-          } catch (std::runtime_error& exc) {
-            aResActor->VisibilityOff();
-            INFOS(exc.what());
-            SUIT_MessageBox::warn1
-              (GetDesktop(theModule), QObject::tr("WRN_VISU"),
-               QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
-               QObject::tr("BUT_OK"));
-          }
-        } else if (theDispOnly) {
-          anVISUActor->VisibilityOff();
-        } else {
-        }
-      } else if (theDispOnly && anActor->GetVisibility()) {
-        anActor->VisibilityOff();
-      } else {
-      }
+    QApplication::setOverrideCursor( Qt::waitCursor );
+    try {
+      if ((aActor = thePrs->CreateActor()))
+        theViewWindow->AddActor(aActor);
+    } catch(std::exception& exc) {
+      SUIT_MessageBox::warn1
+        (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+         QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
+         QObject::tr("BUT_OK"));
     }
-    if (aResActor)
-      return aResActor;
+    QApplication::restoreOverrideCursor();
 
-    //anVISUActor = PublishInView( theModule, thePrs );
-    return anVISUActor;
+    return aActor;
   }
 
   void
@@ -893,15 +706,17 @@ namespace VISU
     QApplication::restoreOverrideCursor();
   }
 
-  static bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
-                                      float             allBounds[6], 
-                                      const char*       theActorClassName = "VISU_Actor")
+  static 
+  bool
+  ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
+                          vtkFloatingPointType allBounds[6], 
+                          const char* theActorClassName = "VISU_Actor")
   {
     vtkRenderer *aRen = theViewWindow->getRenderer();
     vtkActorCollection *anActColl = aRen->GetActors(); 
     vtkProp *prop;
-    float   *bounds;
-    int     somethingVisible = false;
+    vtkFloatingPointType *bounds;
+    int somethingVisible = false;
 
     allBounds[0] = allBounds[2] = allBounds[4] = VTK_LARGE_FLOAT;
     allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT;
@@ -931,14 +746,14 @@ namespace VISU
 
   void SetFitAll(SVTK_ViewWindow* theViewWindow)
   {
-    static float PRECISION = 0.000001;
-    static float DEVIATION = 600;
-    float XYZ_Bnd[6];
+    static vtkFloatingPointType PRECISION = 0.000001;
+    static vtkFloatingPointType DEVIATION = 600;
+    vtkFloatingPointType XYZ_Bnd[6];
     if (!ComputeVisiblePropBounds(theViewWindow, XYZ_Bnd)) return;
 
-    float absX = XYZ_Bnd[1] - XYZ_Bnd[0];
-    float absY = XYZ_Bnd[3] - XYZ_Bnd[2];
-    float absZ = XYZ_Bnd[5] - XYZ_Bnd[4];
+    vtkFloatingPointType absX = XYZ_Bnd[1] - XYZ_Bnd[0];
+    vtkFloatingPointType absY = XYZ_Bnd[3] - XYZ_Bnd[2];
+    vtkFloatingPointType absZ = XYZ_Bnd[5] - XYZ_Bnd[4];
 
     enum CameraOrient {e3D, eFront, eLeft, eTop};
     CameraOrient aCameraOrient = e3D;
@@ -949,9 +764,9 @@ namespace VISU
         if (absZ <= PRECISION) aCameraOrient = eTop;
         else {
           // all the three dimensions exceeds precision
-          float dev_abs_XY = absX / absY;
-          float dev_abs_YZ = absY / absZ;
-          float dev_abs_XZ = absX / absZ;
+          vtkFloatingPointType dev_abs_XY = absX / absY;
+          vtkFloatingPointType dev_abs_YZ = absY / absZ;
+          vtkFloatingPointType dev_abs_XZ = absX / absZ;
           if (dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION)
             aCameraOrient = eLeft;
           else {
@@ -1124,6 +939,33 @@ namespace VISU
     aPlot->Repaint();
   }
 
+  void
+  PlotRemoveCurve(const SalomeApp_Module* theModule,
+                 VISU::Curve_i* pCrv)
+  {
+    QString anEntry = pCrv->GetEntry();
+    ViewManagerList pvm_list;
+    theModule->getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
+    for( SUIT_ViewManager* mgr = pvm_list.first(); mgr; mgr = pvm_list.next() ){
+      Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( mgr );
+      if( pvm ){
+       SPlot2d_Viewer* aSPlot2d = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
+       if( aSPlot2d ){
+         Plot2d_ViewFrame* aPlot = aSPlot2d->getActiveViewFrame();
+         if(aPlot){
+           QList<Plot2d_Curve> clist;
+           aPlot->getCurves( clist );
+           for (int i = 0; i < clist.count(); i++) {
+             if(SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i)))
+               if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry))
+                 aPlot->eraseCurve(clist.at(i));
+           }
+         }
+       }
+      }
+    }
+  }
+  
   void
   PlotContainer(const SalomeApp_Module* theModule,
                 VISU::Container_i* container,
@@ -1196,7 +1038,8 @@ namespace VISU
   // Others
 
   void CreateMesh (const SalomeApp_Module* theModule,
-                    const Handle(SALOME_InteractiveObject)& theIO)
+                   const Handle(SALOME_InteractiveObject)& theIO,
+                   SVTK_ViewWindow* theViewWindow)
   {
     _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
     //if (CheckLock(aStudy))
@@ -1243,7 +1086,7 @@ namespace VISU
     timer.Show();
 #endif
 
-    QApplication::restoreOverrideCursor();
+    //QApplication::restoreOverrideCursor();
     VISU::Mesh_i* pPresent = NULL;
     if (!CORBA::is_nil(aMesh))
       pPresent = dynamic_cast<VISU::Mesh_i*>(VISU::GetServant(aMesh).in());
@@ -1255,23 +1098,19 @@ namespace VISU
       return;
     }
 
-    if (SVTK_ViewWindow* aView = GetViewWindow(theModule)) {
+    if (theViewWindow) {
       try {
 #ifdef CHECKTIME
         Utils_Timer timer;
         timer.Start();
 #endif
-        PublishInView(theModule, pPresent);
-        //aView->onFitAll();
-        SetFitAll(aView);
+        PublishMeshInView(theModule, pPresent, theViewWindow);
+        SetFitAll(theViewWindow);
 #ifdef CHECKTIME
         timer.Stop();
         MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
         timer.Show();
 #endif
-        theModule->application()->putInfo(QObject::tr("INF_DONE"));
-        // Make "Save" button active
-        theModule->getApp()->updateActions();
       } catch (std::runtime_error& exc) {
         INFOS(exc.what());
         SUIT_MessageBox::warn1
@@ -1280,6 +1119,10 @@ namespace VISU
            QObject::tr("BUT_OK"));
       }
     }
+
+    theModule->application()->putInfo(QObject::tr("INF_DONE"));
+    // Make "Save" button active
+    theModule->getApp()->updateActions();
   }
 
   // ========================================================================================
@@ -1411,58 +1254,45 @@ namespace VISU
     }
     return aList;
   }
-  
-  int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule){
+
+  int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow)
+  {
     int minIndx = 1;
     std::set<int> aIndexes;
-    SVTK_ViewWindow* vw = GetViewWindow(theModule);
     TViewToPrs3d aMap = theModule->getScalarBarsMap();
-    TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(vw);
-    if (aViewToPrsIter != aMap.end()){
+    TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(theViewWindow);
+    if (aViewToPrsIter != aMap.end()) {
       TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin();
-      for(;aPrsIter!=(aViewToPrsIter->second).end();aPrsIter++){
+      for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) {
        aIndexes.insert((*aPrsIter).second);
       }
     }
     std::set<int>::const_iterator aIter = aIndexes.begin();
-    for (int i=1,length=aIndexes.size(); i <= length; i++){
+    for (int i = 1,length = aIndexes.size(); i <= length; i++) {
       std::set<int>::const_iterator aIter = aIndexes.find(i);
-      if(aIter==aIndexes.end()){minIndx = i;break;
+      if (aIter == aIndexes.end()) { minIndx = i; break; 
       else minIndx = i + 1;
-      
     }
     return minIndx;
   }
-  
-  void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos){
-    SVTK_ViewWindow* vw = GetViewWindow(theModule);
+
+  void AddScalarBarPosition (VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+                             VISU::Prs3d_i* thePrs3d, int pos)
+  {
     TViewToPrs3d& aMap = theModule->myScalarBarsMap;
-    TPrs3dToInd aPair; aPair.first=thePrs3d; aPair.second=pos;
-    aMap[vw].insert(aPair);
+    TPrs3dToInd aPair; aPair.first = thePrs3d; aPair.second = pos;
+    aMap[theViewWindow].insert(aPair);
   }
-  
-  void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d){
+
+  void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+                               VISU::Prs3d_i* thePrs3d)
+  {
     TViewToPrs3d& aMap = theModule->myScalarBarsMap;
-    TSetPrs3d::iterator aIter = aMap[vw].begin();
-    for(;aIter!=aMap[vw].end();aIter++)
-      if((*aIter).first == thePrs3d){
-       aMap[vw].erase(*aIter);
+    TSetPrs3d::iterator aIter = aMap[theViewWindow].begin();
+    for (; aIter != aMap[theViewWindow].end(); aIter++)
+      if ((*aIter).first == thePrs3d) {
+       aMap[theViewWindow].erase(*aIter);
        return;
       }
   }
-
-  void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d){
-    SVTK_ViewWindow* vw = GetViewWindow(theModule);
-    RemoveScalarBarPosition(theModule,vw,thePrs3d);
-  }
-  
-  void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject){
-    if (!CORBA::is_nil(theObject)) {
-      Base_var aBase = Base::_narrow(theObject);
-      if (CORBA::is_nil(aBase)) return;
-      if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
-       RemoveScalarBarPosition(theModule,aPrsObject);
-      }
-    }
-  }
 }
index d514b4b3a223fe691bcfc90bbf20f8767653b46c..0e4258a0dae942263bf0c9ad3a5f1729593a3d7e 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -98,18 +98,12 @@ namespace VISU {
 
   bool                                 IsRemovableSelected(const SalomeApp_Module* theModule);
 
-  // Display/Erase
-  void                                 ErasePrs(const SalomeApp_Module* theModule,
-                                               CORBA::Object_ptr theObject,
-                                               bool theUpdate = true);
   void                                 DeleteSObject(VisuGUI* theModule,
                                                     _PTR(Study)       theStudy,
                                                     _PTR(SObject)     theSObject);
   void                                 DeletePrs3d(VisuGUI* theModule,
                                                   VISU::Prs3d_i* thePrs,
                                                   const Handle(SALOME_InteractiveObject)& theIO);
-  void                                 ErasePrs3d(const SalomeApp_Module* theModule,
-                                                 VISU::Prs3d_i* thePrs);
 
   // Presentation management
   void ChangeRepresentation (const SalomeApp_Module* theModule,
@@ -126,21 +120,11 @@ namespace VISU {
                                                   VISU::Result_var& theResult);
   bool                                 IsSObjectTable(_PTR(SObject) theSObject);
 
-  // Views
-  SUIT_ViewWindow*                     GetActiveView(const SalomeApp_Module* theModule,
-                                                    QString theType = QString::null);
-
-  // VTK View
-  TViewWindows                         GetViews(const SalomeApp_Module* theModule);
-  SVTK_ViewWindow*                     GetViewWindow(const SalomeApp_Module* theModule,
-                                                    const bool theCreate = false );
-  SVTK_ViewWindow*                     GetViewWindow();
-
-  VISU_Actor*                          PublishInView(const SalomeApp_Module* theModule,
-                                                    VISU::Prs3d_i* thePrs);
-  VISU_Actor*                          UpdateViewer(const SalomeApp_Module* theModule,
-                                                   VISU::Prs3d_i* thePrs,
-                                                   bool theDispOnly = false);
+  /*! Display mesh presentation in given VTK view window
+   */
+  VISU_Actor*                          PublishMeshInView(const SalomeApp_Module* theModule,
+                                                        VISU::Prs3d_i* thePrs,
+                                                        SVTK_ViewWindow* theViewWindow);
 
   /*!
    * \brief Repaint all SVTK view windows, where the given object is displayed.
@@ -177,32 +161,40 @@ namespace VISU {
   void                                 PlotCurve( const SalomeApp_Module* theModule,
                                                  VISU::Curve_i* curve,
                                                  int theDisplaying );
+  void                                 PlotRemoveCurve(const SalomeApp_Module* theModule,
+                                                      VISU::Curve_i* curve);
   void                                 PlotContainer( const SalomeApp_Module* theModule,
                                                      VISU::Container_i* container,
                                                      int theDisplaying );
   void                                 CreatePlot( SalomeApp_Module* theModule,
                                                   _PTR(SObject) theSobj );
 
+  /*! Display/Erase/Update a curve presentation.
+   *  Parameter \a frame may be NULL, in this case there is only update without display/erase
+   */
   void                                 UpdateCurve( VISU::Curve_i*,
                                                    Plot2d_ViewFrame* frame,
                                                    SPlot2d_Curve*,
                                                    int theDisplaying );
-  //parameter frame may be 0, in this case there is only update without display/erase 
 
-  // Others
+  /*! Create mesh presentation and display it in \a theViewWindow.
+   *  If \a theViewWindow is NULL, no displaying will be done.
+   */
   void CreateMesh (const SalomeApp_Module* theModule,
-                  const Handle(SALOME_InteractiveObject)& theIO);
+                  const Handle(SALOME_InteractiveObject)& theIO,
+                  SVTK_ViewWindow* theViewWindow = NULL);
 
+  // Others
   std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
                                            const Handle(SALOME_InteractiveObject)& theIO);
   std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
                                            _PTR(SObject) theObject);
   
-  int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule);
-  void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos);
-  void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d);
-  void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d);
-  void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject);
+  int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow);
+  void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+                           VISU::Prs3d_i* thePrs3d, int pos);
+  void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
+                              VISU::Prs3d_i* thePrs3d);
 }
 
 #endif
index bf893f5045fb1cc1b37c1b7e777bc6c3d1161858..bb5eff323f737a20e3f1861d9b91c1937606b700 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -35,6 +35,9 @@
 
 #include "SUIT_Desktop.h"
 #include "SUIT_OverrideCursor.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
 
 #include "SALOME_ListIO.hxx"
 #include "SALOME_ListIteratorOfListIO.hxx"
@@ -42,6 +45,7 @@
 
 #include "LightApp_Study.h"
 #include "LightApp_SelectionMgr.h"
+#include "LightApp_Application.h"
 
 #include "SVTK_ViewWindow.h"
 
@@ -66,7 +70,7 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
      : QDialog( VISU::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
      mySelectionMgr( VISU::GetSelectionMgr( theModule ) ),
-     myViewWindow( VISU::GetViewWindow( theModule ) )
+     myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule) )
 {
   if (!name)
     setName("VisuGUI_TransparencyDlg");
@@ -128,9 +132,14 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
   buttonOk->setText(tr("BUT_CLOSE"));
   buttonOk->setAutoDefault(TRUE);
   buttonOk->setDefault(TRUE);
-  GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0);
-  GroupButtonsLayout->addWidget(buttonOk, 0, 1);
-  GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
+
+  buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+  buttonHelp->setText(tr("BUT_HELP"));
+  buttonHelp->setAutoDefault(TRUE);
+
+  GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+  GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 2);
 
   VisuGUI_TransparencyDlgLayout->addWidget(GroupC1,      0, 0);
   VisuGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
@@ -140,6 +149,7 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule,
 
   // signals and slots connections : after ValueHasChanged()
   connect(buttonOk, SIGNAL(clicked()),         this, SLOT(ClickOnOk()));
+  connect(buttonHelp, SIGNAL(clicked()),       this, SLOT(ClickOnHelp()));
   connect(Slider1,  SIGNAL(valueChanged(int)), this, SLOT(SetTransparency()));
   connect(Slider1,  SIGNAL(sliderMoved(int)),  this, SLOT(ValueHasChanged()));
   connect(mySelectionMgr,  SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
@@ -163,6 +173,26 @@ void VisuGUI_TransparencyDlg::ClickOnOk()
   close();
 }
 
+//=======================================================================
+// function : ClickOnHelp()
+// purpose  :
+//=======================================================================
+void VisuGUI_TransparencyDlg::ClickOnHelp()
+{
+  QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Changing3";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 //=================================================================================
 // function : SetTransparency()
 // purpose  : Called when value of slider change
index 6dbc9437e2068fa404b8838a19d396d9411fe6ff..9a67b25b85990ed3623a2cb8c9b5946949c0c422 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -61,6 +61,7 @@ private :
   SVTK_ViewWindow*        myViewWindow;
 
   QPushButton*            buttonOk;
+  QPushButton*            buttonHelp;
   QLabel*                 TextLabelOpaque;
   QLabel*                 ValueLab;
   QLabel*                 TextLabelTransparent;
@@ -68,6 +69,7 @@ private :
 
 public slots:
   void ClickOnOk();
+  void ClickOnHelp(); 
   void ValueHasChanged();
   void SetTransparency();
   void onSelectionChanged();
index a5e2f2c590ea8845052d11f462a26f65b4c0c067..2dd8f7192d5c46453c29d844c07cc3c6ec85082d 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 #include "VisuGUI_Tools.h"
 
 #include "VISU_Vectors_i.hh"
-
+#include "LightApp_Application.h"
 #include "SalomeApp_Module.h"
+
 #include "SUIT_Desktop.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
 
 #include <qlayout.h>
 #include <qcolordialog.h>
@@ -162,6 +166,9 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule)
   buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+  buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
 
   // top layout
   aTabBox->addTab(aBox, "Vectors");
@@ -178,6 +185,7 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule)
   connect( UseMagn,      SIGNAL( clicked() ), this, SLOT( enableSetColor() ) );
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
   
   // default values
   UseMagn->setChecked( TRUE );
@@ -420,3 +428,19 @@ void VisuGUI_VectorsDlg::reject()
   myScalarPane->deletePreview();
   QDialog::reject();
 }
+
+void VisuGUI_VectorsDlg::onHelp()
+{
+  QString aHelpFileName = "/files/vectors_presentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
index 2abdf591ce65c109d998ba92b315a03f710298bc..857887ce8bf31ae4c050d1d3103eac9d7d1320e9 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -82,6 +82,7 @@ public:
 protected slots:
   void accept();
   void reject();
+  void onHelp();
 
 private:
     QGroupBox*      TopGroup;
@@ -104,6 +105,7 @@ private:
     QGroupBox*      GroupButtons;
     QPushButton*    buttonOk;
     QPushButton*    buttonCancel;
+    QPushButton*    buttonHelp;
 
     QColor          myColor;
     VisuGUI_ScalarBarPane* myScalarPane;
index 868ab60672be4f118a6fed72a194313930c5df25..047603e99ff765a5ef3ace35f36eb8543f9eeeb3 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -37,37 +37,35 @@ namespace VISU
 {
   void
   ErasePrs(VisuGUI* theModule,
-          VISU::Base_ptr theBase
-          bool thIsUpdate)
+          CORBA::Object_ptr theObject
+          bool theDoRepaintVW)
   {
-    VISU::VISUType aType = theBase->GetType();
+    if (CORBA::is_nil(theObject)) return;
+    VISU::Base_var aBase = VISU::Base::_narrow(theObject);
+    if (CORBA::is_nil(aBase)) return;
+
+    VISU::VISUType aType = aBase->GetType();
     switch (aType) {
     case VISU::TCURVE: {
-      if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(theBase).in()))
+      if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
        PlotCurve(theModule, aCurve, VISU::eErase );
       break;
     }
     case VISU::TCONTAINER: {
-      if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(theBase).in()))
+      if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
        PlotContainer(theModule, aContainer, VISU::eErase );
       break;
     }
     case VISU::TTABLE: {
-      if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(theBase).in()))
+      if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
        PlotTable(theModule, aTable, VISU::eErase );
       break;
     }
     default: {
-      if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(theBase).in())){
-       if(aType == VISU::TGAUSSPOINTS)
-         ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
-       else if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
-         QString aType = aViewManager->getType();
-         if(aType == SVTK_Viewer::Type())
-           ErasePrs3d<SVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
-         else if(aType == VVTK_Viewer::Type())
-           ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
-       }
+      if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
+        SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+       RemoveScalarBarPosition(theModule, vw, aPrsObject);
+        ErasePrs3d(theModule, aPrsObject, theDoRepaintVW);
       }
     }} // switch (aType)
   }
index f10bf63e9a5ee9e442e82c94967aa191dd359286..1e7c3d0ee5508a89220b6acd2b155b5488af1326 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include "VisuGUI.h"
 
-#include "SUIT_MessageBox.h"
-#include "SUIT_ViewManager.h"
-#include "SUIT_ViewWindow.h"
+#include "VisuGUI_Tools.h"
+
+#include "VISU_Prs3d_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_ViewManager_i.hh"
+
+#include "VISU_Actor.h"
 
 #include "SalomeApp_Module.h"
 #include "SalomeApp_Application.h"
 
-#include "VISU_Prs3d_i.hh"
-
 #include "VVTK_ViewModel.h"
 #include "VVTK_ViewWindow.h"
 
+#include "SVTK_Functor.h"
 #include "SVTK_ViewModel.h"
 #include "SVTK_ViewWindow.h"
 
-#include "VisuGUI_Tools.h"
+#include "SPlot2d_ViewModel.h"
+
 #include "VTKViewer_Algorithm.h"
-#include "SVTK_Functor.h"
 
-#include "VISU_Table_i.hh"
-#include "VISU_ViewManager_i.hh"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ViewManager.h"
+#include "SUIT_ViewWindow.h"
+
 #include "SALOME_ListIO.hxx"
 #include "SALOME_ListIteratorOfListIO.hxx"
 
-#include "SPlot2d_ViewModel.h"
-
-#include "VISU_Actor.h"
-
 #include <vtkActorCollection.h>
 #include <vtkRenderer.h>
 
@@ -65,17 +67,26 @@ class VVTK_Viewer;
 
 namespace VISU 
 {
-  //---------------------------------------------------------------
+  /*! Return active view window, if it instantiates TViewer::TViewWindow class,
+   *  overwise find or create corresponding view window, make it active and return it.
+   *  \note Active VVTK_ViewWindow can be returned by request GetViewWindow<SVTK_Viewer>(),
+   *        because VVTK_ViewWindow inherits SVTK_ViewWindow.
+   */
   template<class TViewer>
   inline
   typename TViewer::TViewWindow*
-  GetViewWindow(VisuGUI* theModule, 
-               const bool theIsViewCreate = false)
+  GetViewWindow(VisuGUI* theModule)
   {
-    typedef typename TViewer::TViewWindow TView;
-    if(SUIT_ViewManager* aViewManager = theModule->getViewManager(TViewer::Type(),theIsViewCreate)){
-      if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){
-       if(TView* aView = dynamic_cast<TView*>(aViewWindow)){
+    typedef typename TViewer::TViewWindow TViewWindow;
+    if (SalomeApp_Application* anApp = theModule->getApp()) {
+      if (TViewWindow* aView = dynamic_cast<TViewWindow*>(anApp->desktop()->activeWindow()))
+       return aView;
+    }
+    SUIT_ViewManager* aViewManager =
+      theModule->getViewManager(TViewer::Type(), /*create = */true);
+    if (aViewManager) {
+      if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
+       if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
          aViewWindow->raise();
          aViewWindow->setFocus();
          return aView;
@@ -85,30 +96,54 @@ namespace VISU
     return NULL;
   }
 
+  /*! Return active view window, if it instantiates TViewWindow class, overwise return NULL.
+   *  \note Active VVTK_ViewWindow can be returned by request GetActiveViewWindow<SVTK_ViewWindow>(),
+   *        because VVTK_ViewWindow inherits SVTK_ViewWindow.
+   */
+  template<class TViewWindow>
+  inline
+  TViewWindow*
+  GetActiveViewWindow(const SalomeApp_Module* theModule = NULL)
+  {
+    SalomeApp_Application* anApp = NULL;
+    if (theModule)
+      anApp = theModule->getApp();
+    else
+      anApp = dynamic_cast<SalomeApp_Application*>
+       (SUIT_Session::session()->activeApplication());
+
+    if (anApp)
+      if (SUIT_ViewManager* aViewManager = anApp->activeViewManager())
+       if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
+         return dynamic_cast<TViewWindow*>(aViewWindow);
+
+    return NULL;
+  }
+
 
   //---------------------------------------------------------------
-  template<class TViewer>
   inline
   VISU_Actor*
   PublishInView(VisuGUI* theModule,
                 Prs3d_i* thePrs,
-               const bool theIsHighlight = false,
-               const bool theIsCreateView = false)
+               SVTK_ViewWindow* theViewWindow,
+               const bool theIsHighlight = false)
   {
-    typedef typename TViewer::TViewWindow TView;
-    if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView)){
+    if (theViewWindow) {
       QApplication::setOverrideCursor( Qt::waitCursor );
       try {
-       if(VISU_Actor* anActor = thePrs->CreateActor()){
-         aView->AddActor(anActor);
-         if(theIsHighlight)
-           aView->highlight(anActor->getIO(),true);
-         aView->getRenderer()->ResetCameraClippingRange();
-         aView->Repaint();
+       if (VISU_Actor* anActor = thePrs->CreateActor()) {
+         theViewWindow->AddActor(anActor);
+         if (theIsHighlight)
+           theViewWindow->highlight(anActor->getIO(),true);
+         theViewWindow->getRenderer()->ResetCameraClippingRange();
+         theViewWindow->Repaint();
          QApplication::restoreOverrideCursor();
          return anActor;
        }
       } catch(std::exception& exc) {
+       thePrs->RemoveActors();
+
        QApplication::restoreOverrideCursor();
        INFOS(exc.what());
        SUIT_MessageBox::warn1
@@ -122,56 +157,53 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  template<class TViewer>
   inline
   VISU_Actor*
   UpdateViewer(VisuGUI* theModule,
                VISU::Prs3d_i* thePrs,
                bool theDispOnly = false,
-              const bool theIsHighlight = false,
-              const bool theIsViewCreate = false)
+              const bool theIsHighlight = false)
   {
-    typedef typename TViewer::TViewWindow TView;
-    if(TView* aView = GetViewWindow<TViewer>(theModule,theIsViewCreate)){
-      vtkRenderer *aRen = aView->getRenderer();
+    if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+      vtkRenderer *aRen = aViewWindow->getRenderer();
       vtkActorCollection *anActColl = aRen->GetActors();
       anActColl->InitTraversal();
       VISU_Actor* aResActor = NULL;
-      while(vtkActor *anAct = anActColl->GetNextActor()){
-       if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
-         if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){
-           if(thePrs == aPrs3d){
+      bool isOk = true;
+      while (vtkActor *anAct = anActColl->GetNextActor()) {
+       if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
+         if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) {
+           if (thePrs == aPrs3d) {
              try {
+               aResActor = anActor;
                thePrs->UpdateActors();
+               aResActor->VisibilityOn();
              } catch (std::runtime_error& exc) {
+               thePrs->RemoveActors();
+               isOk = false;
+
                INFOS(exc.what());
-               QApplication::restoreOverrideCursor();
                SUIT_MessageBox::warn1
                  (GetDesktop(theModule), QObject::tr("WRN_VISU"),
                   QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()),
                   QObject::tr("BUT_OK"));
-
-               thePrs->RemoveActors();
-               return NULL;
              }
-             aResActor = anActor;
-             aResActor->VisibilityOn();
-           }else if(theDispOnly){
+           } else if (theDispOnly) {
              anActor->VisibilityOff();
            }
-         }else if(theDispOnly && anActor->GetVisibility()){
+         } else if (theDispOnly && anActor->GetVisibility()) {
            anActor->VisibilityOff();
          }
        }
       }
-      if(aResActor){
-       if(theIsHighlight)
-         aView->highlight(aResActor->getIO(),true);
-       aView->getRenderer()->ResetCameraClippingRange();
-       aView->Repaint();
+      if (aResActor) {
+       if (theIsHighlight && isOk)
+         aViewWindow->highlight(aResActor->getIO(), true);
+       aViewWindow->getRenderer()->ResetCameraClippingRange();
+       aViewWindow->Repaint();
        return aResActor;
       }
-      return PublishInView<TViewer>(theModule,thePrs,theIsHighlight,theIsViewCreate);
+      return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight);
     }
     return NULL;
   }
@@ -184,14 +216,14 @@ namespace VISU
   OnEraseAll(VisuGUI* theModule)
   {
     typedef typename TViewer::TViewWindow TViewWindow;
-    if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
+    if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule)) {
       aViewWindow->unHighlightAll();
-      if(vtkRenderer *aRen = aViewWindow->getRenderer()){
+      if (vtkRenderer *aRen = aViewWindow->getRenderer()) {
        vtkActorCollection *aCollection = aRen->GetActors();
        aCollection->InitTraversal();
-       while(vtkActor *anAct = aCollection->GetNextActor()){
-         if(anAct->GetVisibility() > 0)
-           if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
+       while (vtkActor *anAct = aCollection->GetNextActor()) {
+         if (anAct->GetVisibility() > 0)
+           if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)) {
              anActor->VisibilityOff();
            }
        }
@@ -199,57 +231,37 @@ namespace VISU
       }
     }
   }
-  
+
   template<>
   inline
   void
   OnEraseAll<SPlot2d_Viewer>(VisuGUI* theModule)
   {
-    if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule,false))
+    if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false))
       aPlot2d->EraseAll();
   }
 
 
   //---------------------------------------------------------------
-  template<class TVieweWindow>
-  inline
-  VISU_Actor*
-  FindActor(TVieweWindow* theViewWindow,
-            const char* theEntry)
-  {
-    using namespace SVTK;
-    if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
-      if(vtkActorCollection* aCollection = aRenderer->GetActors()){
-        if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
-          return anActor;
-        }
-      }
-    }
-    return NULL;
-  }
-
-  template<class TViewer>
   inline
   void
   ErasePrs3d(VisuGUI* theModule,
              VISU::Prs3d_i* thePrs,
-            const bool thIsUpdate = true)
+            const bool theDoRepaintVW = true)
   {
-    typedef typename TViewer::TViewWindow TViewWindow;
-    if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
-      if(VISU_Actor* anActor = FindActor(aViewWindow,thePrs)){
+    if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+      if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs)) {
         anActor->VisibilityOff();
-       if(thIsUpdate)
+       if (theDoRepaintVW)
          aViewWindow->Repaint();
       }
     }
   }
 
-
   void
   ErasePrs(VisuGUI* theModule,
-          VISU::Base_ptr theBase
-          bool thIsUpdate);
+          CORBA::Object_ptr theObject
+          bool theDoRepaintVW);
 }
 
 #endif
index 20168853268cdef702d610b0e2568678e7e00894..41b9c67e5df289959da881e30d2926f6ce2b67d0 100644 (file)
@@ -1,17 +1,31 @@
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : Makefile.in
 #  Author : Alexey Petrov
 #  Module : VISU
-#  $Header:
 
 top_srcdir=@top_srcdir@
 top_builddir=../..
 srcdir=@srcdir@
 VPATH=.:@srcdir@:@top_srcdir@/idl
-
+BOOST_LIBSUFFIX=@BOOST_LIBSUFFIX@
 
 @COMMENCE@
 
@@ -98,9 +112,9 @@ CPPFLAGS += \
        $(HDF5_INCLUDES) \
        $(QWT_INCLUDES) \
        $(BOOST_CPPFLAGS)\
-       -I${KERNEL_ROOT_DIR}/include/salome \
-       -I${MED_ROOT_DIR}/include/salome \
-       -I${GUI_ROOT_DIR}/include/salome
+       $(KERNEL_CXXFLAGS) \
+       $(MED_CXXFLAGS) \
+       $(GUI_CXXFLAGS)
 
 LDFLAGS  += \
        $(PYTHON_LIBS) \
@@ -108,11 +122,11 @@ LDFLAGS  += \
        $(VTK_LIBS) \
        $(QWT_LIBS) \
        $(BOOST_LIBS) \
-       -L${KERNEL_ROOT_DIR}/lib/salome \
-       -L${GUI_ROOT_DIR}/lib/salome \
-       -L${MED_ROOT_DIR}/lib/salome 
+       $(KERNEL_LDFLAGS) \
+       $(GUI_LDFLAGS) \
+       $(MED_LDFLAGS) 
 
-LIBS+=  -lboost_signals-mt \
+LIBS+=  -lboost_signals${BOOST_LIBSUFFIX} \
        -lSalomeHDFPersist \
        -lSalomeGenericObj \
        -lSalomeContainer \
@@ -120,7 +134,6 @@ LIBS+=  -lboost_signals-mt \
        -lTOOLSDS \
        -lOpUtil \
        -lEvent \
-       -lCASCatch \
        -lSalomeApp \
        -lSalomeSession \
        -lVTKViewer \
@@ -129,10 +142,11 @@ LIBS+=  -lboost_signals-mt \
        -lVisuConvertor \
        -lVisuPipeLine \
        -lVisuObject \
+       -lVVTK \
        -lVISUGUITOOLS
 
 LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \
-       -L${KERNEL_ROOT_DIR}/lib/salome \
+       $(KERNEL_LDFLAGS) \
        -lSALOMEBasics \
        -lSalomeCatalog \
        -lwith_loggerTraceCollector \
@@ -141,8 +155,7 @@ LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \
        -lSalomeNotification \
        -lSALOMELocalTrace \
        -lSalomeResourcesManager \
-       -lSalomeDS \
-       -lSalomeDSImpl \
+       -lSalomeDSClient \
        -lSalomeObject \
        -lqtx \
        -lsuit \
index ee879b6a407126e423413b4bc43c2c8cfa4ac77c..72c1635d2a0c258571691ad3760371256e4f4b93 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISUConfig.cc
@@ -194,6 +194,16 @@ namespace VISU{
   }
 
 
+  QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, const QString& theDefaultValue)
+  {
+    bool anIsFound = false;
+    QString aValue = FindValue(theMap,theArg,&anIsFound);
+    if(anIsFound)
+      return aValue;
+    return theDefaultValue;
+  }
+
+
   //===========================================================================
   PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){
     if(CORBA::is_nil(theObject))  return NULL;
index 9651c9c680fb02ccb38227289c3c42d708184b33..c4efc6adccf65d46d9d85b22bba3b173de2d780e 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISUConfig.hh
@@ -126,6 +126,7 @@ namespace VISU
     static void Registry(const char* theComment, TStorableEngine theEngine);
     static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString);
     static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
+    static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, const QString& theDefaultValue);
     static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
     static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
     static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
index 8a691fd463f73a1af1366f1c0df165bfb158b957..275d3e2e92fa7d8a1db3c37a92cb81238acd9f6f 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -107,7 +107,7 @@ VISU::ColoredPrs3d_i
  
     myField = anOrigin->GetField();
     myMeshName = myField->myMeshName;
-    myEntity = myField->myEntity;
+    myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity;
     myIteration = anOrigin->GetIteration();
     myFieldName = anOrigin->GetFieldName();
     
@@ -128,7 +128,7 @@ VISU::ColoredPrs3d_i
     SetItalicTitle(anOrigin->IsItalicTitle());
     SetShadowTitle(anOrigin->IsShadowTitle());
     SetTitFontType(anOrigin->GetTitFontType());
-    float r,g,b;
+    vtkFloatingPointType r,g,b;
     anOrigin->GetTitleColor(&r,&g,&b);
     SetTitleColor(r,g,b);
     
@@ -341,7 +341,9 @@ VISU::ColoredPrs3d_i
 
 void
 VISU::ColoredPrs3d_i
-::GetTitleColor(float* theR, float* theG, float* theB)
+::GetTitleColor(vtkFloatingPointType* theR, 
+               vtkFloatingPointType* theG, 
+               vtkFloatingPointType* theB)
 {
   *theR = myTitleColor[0]; 
   *theG = myTitleColor[1]; 
@@ -350,7 +352,9 @@ VISU::ColoredPrs3d_i
 
 void
 VISU::ColoredPrs3d_i
-::SetTitleColor(float theR, float theG, float theB)
+::SetTitleColor(vtkFloatingPointType theR, 
+               vtkFloatingPointType theG, 
+               vtkFloatingPointType theB)
 {
   myTitleColor[0] = theR; 
   myTitleColor[1] = theG; 
@@ -415,7 +419,9 @@ VISU::ColoredPrs3d_i
 
 void
 VISU::ColoredPrs3d_i
-::GetLabelColor(float* theR, float* theG, float* theB)
+::GetLabelColor(vtkFloatingPointType* theR, 
+               vtkFloatingPointType* theG, 
+               vtkFloatingPointType* theB)
 {
   *theR = myLabelColor[0]; 
   *theG = myLabelColor[1]; 
@@ -424,7 +430,9 @@ VISU::ColoredPrs3d_i
 
 void
 VISU::ColoredPrs3d_i
-::SetLabelColor(float theR, float theG, float theB)
+::SetLabelColor(vtkFloatingPointType theR, 
+               vtkFloatingPointType theG, 
+               vtkFloatingPointType theB)
 {
   myLabelColor[0] = theR; 
   myLabelColor[1] = theG; 
@@ -470,11 +478,11 @@ VISU::ColoredPrs3d_i
   // Scalar Bar origin
   QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
 
-  float aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
+  vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
   aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
   myPosition[0] = aXorigin;
 
-  float aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
+  vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
   aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
   myPosition[1] = aYorigin;
 
index 4762f3d17b875190d3e3ff45b3eeb51758a2b46d..26a6d38e6b4d02190668cfb6d7ce8d189f6c66c9 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
@@ -135,7 +135,7 @@ namespace VISU
     VISU::ScalarMap::Orientation myOrientation;
     std::string myTitle;
     int myNumberOfLabels;
-    float myPosition[2], myWidth, myHeight;
+    vtkFloatingPointType myPosition[2], myWidth, myHeight;
 
   public:
     //----------------------------------------------------------------------------
@@ -166,7 +166,7 @@ namespace VISU
     void
     SameAsParams(const ColoredPrs3d_i* theOrigin);
 
-    const VISU::PField&
+    virtual const VISU::PField&
     GetField() const;
 
     const std::string& 
@@ -218,11 +218,15 @@ namespace VISU
 
     virtual 
     void
-    GetTitleColor(float* theR, float* theG, float* theB);
+    GetTitleColor(vtkFloatingPointType* theR, 
+                 vtkFloatingPointType* theG, 
+                 vtkFloatingPointType* theB);
     
     virtual
     void
-    SetTitleColor(float theR, float theG, float theB);    
+    SetTitleColor(vtkFloatingPointType theR, 
+                 vtkFloatingPointType theG, 
+                 vtkFloatingPointType theB);    
 
     virtual
     bool
@@ -258,11 +262,15 @@ namespace VISU
 
     virtual 
     void
-    GetLabelColor(float* theR, float* theG, float* theB);
+    GetLabelColor(vtkFloatingPointType* theR, 
+                 vtkFloatingPointType* theG, 
+                 vtkFloatingPointType* theB);
 
     virtual
     void
-    SetLabelColor(float theR, float theG, float theB);
+    SetLabelColor(vtkFloatingPointType theR, 
+                 vtkFloatingPointType theG, 
+                 vtkFloatingPointType theB);
 
     //----------------------------------------------------------------------------
   protected:
@@ -276,13 +284,13 @@ namespace VISU
     bool myIsItalicTitle;
     bool myIsShadowTitle;
     int  myTitFontType;
-    float myTitleColor[3];
+    vtkFloatingPointType myTitleColor[3];
 
     bool myIsBoldLabel;
     bool myIsItalicLabel;
     bool myIsShadowLabel;
     int  myLblFontType;
-    float myLabelColor[3];
+    vtkFloatingPointType myLabelColor[3];
 
     VISU_ScalarMapPL* myScalarMapPL;
     bool myIsFixedRange;
index b1dc814ba896de75545557e01071e18aaacccbbc..26b5074b7d53df1085dc9afc4702a2fc3d9a537c 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -1206,7 +1206,6 @@ VISU_MEDConvertor
   if(theFamily->myIsDone) 
     return 0;
 
-  const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
   SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily;
   CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
   if(!anIsOnAllElements){
index f4a975aae5375fef6d5f5732e19851e73ad7a6e3..97d470418fa36056efd5860917778a56f52dcfa7 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index d88ecb5d693b27c9a984f67e81353178b18f4b77..9df67004fc9e1b90c5f86946f2fd36a51aff1b29 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
 #include "VISU_Convertor.hxx"
 #include "VISU_PipeLineUtils.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkAppendPolyData.h>
 
 using namespace VISU;
 using namespace std;
 
-static float EPS_machine = 1.0E-7;
+static vtkFloatingPointType EPS_machine = 1.0E-7;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -311,6 +313,9 @@ VISU::CutLines_i
 {
   if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2);
+    anActor->SetRepresentation(aDispMode);
     return anActor;
   }
   return NULL;
@@ -325,8 +330,8 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
     anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
     SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
     
-    typedef set<float> TXCont;
-    typedef map<float,float> TXYMap;
+    typedef set<vtkFloatingPointType> TXCont;
+    typedef map<vtkFloatingPointType,vtkFloatingPointType> TXYMap;
     typedef map<int,TXYMap> TXYMapCont;
     typedef map<long,long> TLineIdCont;
     
@@ -340,9 +345,9 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
     TXCont aXCont;
     TXYMapCont aXYMapCont; 
     TLineIdCont aLineIdCont;  // Define internal numeration of lines
-    const float *aDirLn = myCutLinesPL->GetDirLn();
-    const float *aBasePnt = myCutLinesPL->GetBasePnt();
-    const float *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
+    const vtkFloatingPointType *aDirLn = myCutLinesPL->GetDirLn();
+    const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt();
+    const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
     for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){
       vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine);
       aDataSet->Update();
@@ -364,10 +369,12 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
       if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
       aLineIdCont[iLine] = jLine++;
       TXYMap& aXYMap = aXYMapCont[iLine];
-      float aPnt[3], aVect[3], aDist;
+      vtkFloatingPointType aPnt[3], aVect[3], aDist;
       for(int i = 0; i < aNbPoints; i++){
        aDataSet->GetPoint(i,aPnt);
-       Sub(aPnt,aBasePnt,aVect);
+        for(int j = 0; j < 3; j++)
+          aVect[i] = aPnt[i] - aBasePnt[i];
+       //VISU::Sub(aPnt,aBasePnt,aVect);
        if ( fabs(aBoundPrjLn[2]) < EPS_machine )
          aDist = 0.5;
        else
@@ -394,19 +401,19 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
        TXYMap aNewXYMap;
        TXYMap& aXYMap = aXYMapCont[iLine];
        TXYMap::const_iterator aXYMapIter = aXYMap.begin();
-       std::list<float> XKeys;
+       std::list<vtkFloatingPointType> XKeys;
        for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first);
        XKeys.sort();
        if (XKeys.size() > 1) {
-         float a_first_indx = XKeys.front();
-         float a_last_indx = XKeys.back();
+         vtkFloatingPointType a_first_indx = XKeys.front();
+         vtkFloatingPointType a_last_indx = XKeys.back();
          if (a_first_indx > a_last_indx){
            XKeys.reverse();
-           float tmp = a_first_indx;
+           vtkFloatingPointType tmp = a_first_indx;
            a_first_indx = a_last_indx;
            a_last_indx = tmp;
          }
-         std::list<float>::const_iterator aIter = XKeys.begin();
+         std::list<vtkFloatingPointType>::const_iterator aIter = XKeys.begin();
          for (int k=0;k<XKeys.size() && aIter != XKeys.end();k++,aIter++){
            // Warning: value '1.0' come from workaround:
            // see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
@@ -431,9 +438,9 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
        aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
        aXCont.insert(aXYMapIter[0]->first);
        for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){
-         float aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
+         vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
          aY[2] = (aY[0] + aY[1])/2.0;
-         float aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
+         vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
          aX[2] = (aX[0] + aX[1])/2.0;
          aNewXYMap[aX[2]] = aY[2];
          aXCont.insert(aX[2]);
@@ -454,7 +461,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
     aTableOfReal->SetNbColumns(iEnd);
     TXCont::const_iterator aXContIter = aXCont.begin();
     for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){
-      float aDist = *aXContIter; 
+      vtkFloatingPointType aDist = *aXContIter; 
       aTableOfReal->PutValue(aDist,1,i+1);
       aString.sprintf("%d",i);
       aTableOfReal->SetColumnTitle(i+1,aString.latin1());
@@ -467,7 +474,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
        TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist);
        // Can we find some value that belong to the line and have the same X coordinate?
        if(aXYMapIter == aXYMap.end()) continue;
-       float aVal = aXYMapIter->second;
+       vtkFloatingPointType aVal = aXYMapIter->second;
        aTableOfReal->PutValue(aVal,iLineId+2,i+1);
       }
     }
index 18c4bc191420d37762e33e2957f3826cd3e78f6d..99dc2fc2c3321fbb35d1691d85109a7fe1254c5a 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index d5c0ea04ac4fd0c0057b12bae0c172e453b178d3..c4b952e594f443d0349300035b7275d033483f24 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -29,6 +29,8 @@
 #include "VISU_CutPlanes_i.hh"
 #include "VISU_Actor.h"
 
+#include "SUIT_ResourceMgr.h"
+
 using namespace VISU;
 using namespace std;
 
@@ -189,6 +191,9 @@ VISU::CutPlanes_i
 {
   if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1);
+    anActor->SetRepresentation(aDispMode);
     return anActor;
   }
   return NULL;
index 46d5e0cd9b30595e61b58a2a145354ff73d429ed..4ccc62700e11230fe4559061729aa72c100b1d86 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index 83f679ce03552b0a79252f047ada9e81046c6fa3..7f9b4b7fc5f4826286da927fa5f5ff2b57b3f5ad 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -31,6 +31,8 @@
 #include "VISU_DeformedShapePL.hxx"
 #include "VISU_Convertor.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
 
@@ -170,9 +172,13 @@ VISU::DeformedShape_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
   VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
-  anActor->SetRepresentation(1);
-  anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
   anActor->SetVTKMapping(false);
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int  aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1);
+  bool toShrink  = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false);
+  anActor->SetRepresentation(aDispMode);
+  if (toShrink) anActor->SetShrink();
+  anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
   return anActor;
 }
 
index 3767af61f6c5802dcde83d3ea3baef96a9b12bff..c2e6777f0c03e6fef52592464049cbde4546e7b5 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index 91b8ef80fbdc5f9a9d214cca5d7dd3585dbea8ff..dec25f6a5443f24d2a723bde514fc3d77ce9e726 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_DumpPython.cc
@@ -39,6 +39,8 @@
 #include "VISU_StreamLines_i.hh"
 #include "VISU_Plot3D_i.hh"
 #include "VISU_Table_i.hh"
+#include "VISU_GaussPoints_i.hh"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
 
 #include "utilities.h"
 
@@ -53,7 +55,8 @@
 
 using namespace std;
 
-namespace VISU{
+namespace VISU
+{
   static std::string PREFIX("  ");
 
   typedef std::map<std::string,std::string> TName2EntryMap;
@@ -139,15 +142,27 @@ namespace VISU{
               std::string thePrefix);
 
 
+  //===========================================================================
+  void
+  Prs3dToPython(VISU::Prs3d_i* theServant,
+               std::ostream& theStr,
+               std::string& theName,
+               std::string thePrefix)
+  {
+    float x, y, z;
+    theServant->GetOffset(x,y,z);
+    theStr<<thePrefix<<theName<<".SetOffset("<<x<<","<<y<<","<<z<<")"<<endl;
+  }
+
   //===========================================================================
   std::string
-  ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
-                   VISU::ScalarMap_i* theServant,
-                   std::ostream& theStr,
-                   std::string& theName,
-                   const std::string& theConstructorName,
-                   const std::string& theArgumentName,
-                   std::string thePrefix)
+  ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
+                      VISU::ColoredPrs3d_i* theServant,
+                      std::ostream& theStr,
+                      std::string& theName,
+                      const std::string& theConstructorName,
+                      const std::string& theArgumentName,
+                      std::string thePrefix)
   {
     std::string aParam;
     switch(theServant->GetEntity()){
@@ -175,10 +190,41 @@ namespace VISU{
     theStr<<thePrefix<<"if "<<theName<<":"<<endl;
     thePrefix += PREFIX;
 
+    // Add to Name->Object map
     theStr<<thePrefix<<"aName2ObjectMap['"<<theName<<"'] = "<<theName<<endl;
 
+    // Set name (as this object could be renamed by user)
+    CORBA::String_var aNameInStudy = theSObject->GetName();
+    theStr<<thePrefix<<"visu.SetName("<<theName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
+    // Set parameters common for all Prs3d objects (offset values)
+    Prs3dToPython(theServant,theStr,theName,thePrefix);
+
+    // Set parameters
     theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
 
+    theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<","<<theServant->GetPosY()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<","<<theServant->GetHeight()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
+
+    return thePrefix;
+  }
+
+
+  std::string
+  ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
+                   VISU::ScalarMap_i* theServant,
+                   std::ostream& theStr,
+                   std::string& theName,
+                   const std::string& theConstructorName,
+                   const std::string& theArgumentName,
+                   std::string thePrefix)
+  {
+    thePrefix = ColoredPrs3dToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+
+    std::string aParam;
     switch(theServant->GetScaling()){
     case LINEAR:
       aParam = "VISU.LINEAR";
@@ -200,12 +246,6 @@ namespace VISU{
     }
     theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
 
-    theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<","<<theServant->GetPosY()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<","<<theServant->GetHeight()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
-
     return thePrefix;
   }
 
@@ -359,6 +399,10 @@ namespace VISU{
       theStr<<thePrefix<<"if "<<aName<<":"<<endl;
       std::string aPrefix2 = thePrefix + PREFIX;
 
+      // Set name (as this object could be renamed by user)
+      CORBA::String_var aNameInStudy = theSObject->GetName();
+      theStr<<aPrefix2<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 1"<<endl;
+
       DumpChildrenToPython(theStudy,
                           theIsPublished,
                           theIsValidScript,
@@ -466,15 +510,17 @@ namespace VISU{
               std::string thePrefix)
   {
     std::string aName = GetName(theSObject);
-    if(aName == "")
+    if (aName == "")
       return;
 
+    CORBA::String_var anID = theSObject->GetID();
+    CORBA::String_var aNameInStudy = theSObject->GetName();
+
     CORBA::Object_var anObj = SObjectToObject(theSObject);
-    if(!CORBA::is_nil(anObj)){
+    if (!CORBA::is_nil(anObj)) {
       VISU::Base_var aBase = VISU::Base::_narrow(anObj);
       if(!CORBA::is_nil(aBase)){
        std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
-       CORBA::String_var anID = theSObject->GetID();
 
         VISU::VISUType aType = aBase->GetType();
         switch(aType){
@@ -485,14 +531,28 @@ namespace VISU{
            if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
              switch(anId){
              case Result_i::eImportFile:
-               theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
+               //theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
+               theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
+
+               theStr<<thePrefix<<aName<<".SetBuildGroups("<<
+                 aServant->IsGroupsDone()<<")"<<
+                 endl;
+
+               theStr<<thePrefix<<aName<<".SetBuildFields("<<
+                 aServant->IsFieldsDone()<<","<<
+                 aServant->IsMinMaxDone()<<")"<<
+                 endl;
+
+               theStr<<thePrefix<<aName<<".Build(0,1)"<<endl;
+
+               theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
                break;
              case Result_i::eCopyAndImportFile:
                theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
+               theStr<<thePrefix<<"if "<<aName<<":"<<endl;
                break;
              }
 
-             theStr<<thePrefix<<"if "<<aName<<":"<<endl;
              thePrefix += PREFIX;
 
              theArgumentName = aName;
@@ -554,7 +614,7 @@ namespace VISU{
           }
           return;
         case VISU::TMESH:
-          if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
+          if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){            
            VISU::Entity anEntity = aServant->GetEntity();
            const std::string& aSubMeshName = aServant->GetSubMeshName();
            if(anEntity >= 0){
@@ -594,8 +654,16 @@ namespace VISU{
            theStr<<thePrefix<<"if "<<aName<<":"<<endl;
            thePrefix += PREFIX;
 
+           // Add to Name->Object map
            theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
 
+           // Set name (as this object could be renamed by user)
+           theStr<<thePrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
+           // Set parameters common for all Prs3d objects (offset values)
+           Prs3dToPython(aServant,theStr,aName,thePrefix);
+
+           // Set presentation parameters
            SALOMEDS::Color aColor;
            aColor = aServant->GetCellColor();
            theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
@@ -701,6 +769,40 @@ namespace VISU{
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
+        case VISU::TSCALARMAPONDEFORMEDSHAPE:
+          if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
+           thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix);
+
+           theStr<<thePrefix<<aName<<".SetSourceRange("<<aServant->GetSourceRangeMin()<<","<<aServant->GetSourceRangeMax()<<")"<<endl;
+           theStr<<thePrefix<<aName<<".SetScale("<<aServant->GetScale()<<")"<<endl;
+
+           std::string aParam;
+           VISU::Entity anEntity = aServant->GetScalarEEntity();
+           switch(anEntity){
+           case NODE:
+             aParam = "VISU.NODE";
+             break;
+           case EDGE:
+             aParam = "VISU.EDGE";
+             break;
+           case FACE:
+             aParam = "VISU.FACE";
+             break;
+           case CELL:
+             aParam = "VISU.CELL";
+             break;
+           }
+
+           theStr<<thePrefix<<aName<<".SetScalarField("<<
+             "'"<<aServant->GetScalarMeshName()<<"',"<<
+             "'"<<aServant->GetScalarFieldName()<<"',"<<
+             aServant->GetScalarIteration()<<","<<
+             aParam<<
+             ")"<<endl;
+
+           theStr<<thePrefix<<"pass"<<endl<<endl;
+          }
+          return;
         case VISU::TVECTORS:
           if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(GetServant(anObj).in())){
            thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix);
@@ -839,8 +941,7 @@ namespace VISU{
           return;
         case VISU::TPLOT3D:
           if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
-            thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,
-                                         "Plot3DOnField", theArgumentName, thePrefix);
+            thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,"Plot3DOnField", theArgumentName, thePrefix);
 
            std::string aParam;
            switch(aServant->GetOrientationType()){
@@ -857,6 +958,12 @@ namespace VISU{
             theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
+        case VISU::TGAUSSPOINTS:
+          if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
+           thePrefix = ColoredPrs3dToPython(theSObject,aServant,theStr,aName,"GaussPointsOnField",theArgumentName,thePrefix);
+           theStr<<thePrefix<<"pass"<<endl<<endl;
+          }
+          return;
         case VISU::TCURVE:
           if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
           {
@@ -896,8 +1003,7 @@ namespace VISU{
           }
          return;
         case VISU::TTABLE:
-          if(Table_i* aServant = dynamic_cast<Table_i*>(GetServant(anObj).in())){
-           SALOMEDS::SObject_var aSObject = aServant->GetSObject();
+          if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
            SALOMEDS::GenericAttribute_var anAttr;
            if(theSObject->FindAttribute(anAttr,"AttributeComment")){
              using namespace SALOMEDS;
@@ -921,6 +1027,10 @@ namespace VISU{
 
                  theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
                  theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+                 // Set name (as this object could be renamed by user)
+                 theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 2"<<endl;
+
                  theStr<<endl;
 
                  theArgumentName = aName;
@@ -944,6 +1054,10 @@ namespace VISU{
 
                  theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
                  theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+                 // Set name (as this object could be renamed by user)
+                 theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
                  theStr<<endl;
 
                  theArgumentName = aName;
@@ -976,9 +1090,9 @@ namespace VISU{
           return;
        }
       }
-    }else{
+    } else { /*if(!CORBA::is_nil(anObj))*/
       SALOMEDS::GenericAttribute_var anAttr;
-      if(theSObject->FindAttribute(anAttr,"AttributeComment")){
+      if (theSObject->FindAttribute(anAttr,"AttributeComment")) {
        SALOMEDS::AttributeComment_var aComment =
          SALOMEDS::AttributeComment::_narrow(anAttr);
        CORBA::String_var aValue = aComment->Value();
@@ -986,8 +1100,8 @@ namespace VISU{
        Storable::StrToMap(aValue.in(),aMap);
        bool anIsExist;
        QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
-       if(anIsExist){
-         if(strcmp(aTypeName.latin1(),"ImportTables") == 0){
+       if (anIsExist) {
+         if (strcmp(aTypeName.latin1(),"ImportTables") == 0) {
            QString aFileName = VISU::Storable::FindValue(aMap,"myFileName",&anIsExist);
            if(anIsExist){
              std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
@@ -1009,7 +1123,7 @@ namespace VISU{
              theStr<<thePrefix<<"pass"<<endl<<endl;
              return;
            }
-         }else if(strcmp(aTypeName.latin1(),"VIEW3D") == 0){
+         } else if (strcmp(aTypeName.latin1(),"VIEW3D") == 0) {
            std::string aName = GetName(theSObject);
            theStr<<thePrefix<<aName<<" = aBuilder.NewObject(aSComponent)"<<endl;
 
@@ -1024,9 +1138,40 @@ namespace VISU{
 
            theStr<<thePrefix<<"pass"<<endl<<endl;
            return;
+         } else if (aTypeName == "ENTITY" || aTypeName == "FAMILY" || aTypeName == "GROUP") {
+           // Set name (as this object could be renamed by user)
+           string aMeshName = VISU::Storable::FindValue(aMap,"myMeshName").latin1();
+           string aSubMeshName = VISU::Storable::FindValue(aMap,"myName").latin1();
+           string anEntityTypeKey = "myEntityId";
+           if (aTypeName == "ENTITY") anEntityTypeKey = "myId";
+           int anEntity = VISU::Storable::FindValue(aMap,anEntityTypeKey,"0").toInt();
+           std::string anEntityType;
+           switch ((TEntity)anEntity) {
+           case NODE_ENTITY: anEntityType = "VISU.NODE"; break;
+           case EDGE_ENTITY: anEntityType = "VISU.EDGE"; break;
+           case FACE_ENTITY: anEntityType = "VISU.FACE"; break;
+           case CELL_ENTITY: anEntityType = "VISU.CELL"; break;
+           }
+
+           if (aTypeName == "ENTITY" ) {
+             theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<",'"<<aMeshName
+                   <<"',"<<anEntityType<<",'"<<aNameInStudy.in()<<"')"<<endl;
+           }
+           else if (aTypeName == "FAMILY") {
+             if (aSubMeshName != aNameInStudy.in()) {
+               theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<",'"<<aMeshName
+                     <<"',"<<anEntityType<<",'"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+             }
+           }
+           else { // "GROUP"
+             if (aSubMeshName != aNameInStudy.in()) {
+               theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<",'"<<aMeshName
+                     <<"','"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+             }
+           }
          }
        }
-      }else{
+      } else {
        DumpTableAttrToPython(theStudy,
                              theIsPublished,
                              theIsValidScript,
@@ -1117,6 +1262,10 @@ namespace VISU{
        std::string aPrefix = thePrefix + PREFIX;
        theArgumentName = aName;
 
+       // Set name (as this object could be renamed by user)
+       CORBA::String_var aNameInStudy = aSObject->GetName();
+       theStr<<aPrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+
        SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
        for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
          SALOMEDS::SObject_var aRefSObj = aCurveIter->Value();
@@ -1170,6 +1319,15 @@ namespace VISU{
     VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
     VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
 
+    //Output the script that sets up the visul parameters.
+    if(theIsPublished) {
+      char* script = aStudy->GetDefaultScript("Post-Pro", aPrefix.c_str());
+      if(script && strlen(script) > 0) {
+       aStr << script;
+       CORBA::string_free(script);
+      }
+    }
+
     aStr<<aPrefix<<"pass"<<endl;
 
 #ifndef COUT
index 93da92ac33f85fb5c43216f9cd0df2be2f7c2676..f8fb14a02f870eb09393028a1b272e2d4ce41d74 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   :
@@ -154,16 +154,16 @@ VISU::GaussPoints_i
   int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() );
   SetBiColor( aBicolor == 0 );
 
-  float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
+  vtkFloatingPointType aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
   SetSpacing( aSpacing );
 
-  float aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
+  vtkFloatingPointType aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
   SetScaleFactor( aScaleFactor );
 
   int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
   SetPrimitiveType( aPrimitiveType );
 
-  float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
+  vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
   SetClamp( aClamp );
 
   int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) );
@@ -178,7 +178,7 @@ VISU::GaussPoints_i
   int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) );
   SetMagnification( aMagnification / 100.0 );
 
-  float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
+  vtkFloatingPointType anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
   SetMagnificationIncrement( anIncrement );
 
   bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() );
@@ -187,7 +187,7 @@ VISU::GaussPoints_i
   QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() );
   SetColor( aColor );
 
-  float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
+  vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
   SetAlphaThreshold( anAlphaThreshold );
 
   int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() );
@@ -322,12 +322,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetScaleFactor( float theScaleFactor )
+::SetScaleFactor( vtkFloatingPointType theScaleFactor )
 {
   myGaussPointsPL->SetScale( theScaleFactor );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetScaleFactor()
 {
@@ -376,12 +376,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetAlphaThreshold( float theAlphaThreshold )
+::SetAlphaThreshold( vtkFloatingPointType theAlphaThreshold )
 {
   myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetAlphaThreshold()
 {
@@ -416,7 +416,7 @@ VISU::GaussPoints_i
   return myGaussPointsPL->GetPrimitiveType();
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetMaximumSupportedSize()
 {
@@ -425,12 +425,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetClamp(float theClamp)
+::SetClamp(vtkFloatingPointType theClamp)
 {
   myGaussPointsPL->SetClamp( theClamp );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetClamp()
 {
@@ -439,12 +439,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetGeomSize( float theGeomSize )
+::SetGeomSize( vtkFloatingPointType theGeomSize )
 {
   myGaussPointsPL->SetSize( theGeomSize );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetGeomSize()
 {
@@ -453,12 +453,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetMinSize( float theMinSize )
+::SetMinSize( vtkFloatingPointType theMinSize )
 {
   myGaussPointsPL->SetMinSize( theMinSize );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetMinSize()
 {
@@ -467,12 +467,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetMaxSize( float theMaxSize )
+::SetMaxSize( vtkFloatingPointType theMaxSize )
 {
   myGaussPointsPL->SetMaxSize( theMaxSize );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetMaxSize()
 {
@@ -481,12 +481,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetMagnification( float theMagnification )
+::SetMagnification( vtkFloatingPointType theMagnification )
 {
   myGaussPointsPL->SetMagnification( theMagnification );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetMagnification()
 {
@@ -495,12 +495,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetMagnificationIncrement( float theIncrement )
+::SetMagnificationIncrement( vtkFloatingPointType theIncrement )
 {
   myGaussPointsPL->SetMagnificationIncrement( theIncrement );
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetMagnificationIncrement()
 {
@@ -639,14 +639,14 @@ VISU::GaussPoints_i
 
   vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
   aTitleProp->SetFontFamily(myTitFontType);
-  aTitleProp->SetColor(myTitleColor);
+  aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
   (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
   (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
   (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
   
   vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
   aLabelProp->SetFontFamily(myLblFontType);
-  aLabelProp->SetColor(myLabelColor);
+  aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
   (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
   (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
   (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
@@ -666,7 +666,7 @@ VISU::GaussPoints_i
       anActor->SetBarVisibility(true);
       myPipeLine->GetMapper()->SetScalarVisibility(1);
 
-      float aRange[2];
+      vtkFloatingPointType aRange[2];
       myScalarMapPL->GetSourceRange(aRange);
       aScalarBarCtrl->SetRangeLocal(aRange);
       
@@ -687,7 +687,7 @@ VISU::GaussPoints_i
       }
       
       if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){
-       float aRangeGlobal[2];
+       vtkFloatingPointType aRangeGlobal[2];
        //
        aRangeGlobal[0] = aTMinMax.first;
        aRangeGlobal[1] = aTMinMax.second;
@@ -813,12 +813,12 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
 {
   mySpacing = theSpacing;
 }
 
-float
+vtkFloatingPointType
 VISU::GaussPoints_i
 ::GetSpacing() const 
 {
index aa9893bbcc85dbb439f93d8446d8c79096f547a6..54d53d6b4a4433360579f3fe9dbcd56944cf79b9 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
@@ -86,11 +86,11 @@ namespace VISU
     void
     SetIsDeformed( bool theIsDeformed );
 
-    float
+    vtkFloatingPointType
     GetScaleFactor();
 
     void
-    SetScaleFactor( float theScaleFactor );
+    SetScaleFactor( vtkFloatingPointType theScaleFactor );
 
     //! Get color for Geometry mode of the presentation.
     QColor
@@ -132,10 +132,10 @@ namespace VISU
 
     //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
     void
-    SetAlphaThreshold(float theAlphaThreshold);
+    SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
 
     //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
-    float
+    vtkFloatingPointType
     GetAlphaThreshold();
 
     //! Redirect the request to VISU_GaussPointsPL::SetResolution.
@@ -153,55 +153,55 @@ namespace VISU
     GetPrimitiveType();
 
     //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
-    float 
+    vtkFloatingPointType 
     GetMaximumSupportedSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetClamp.
     void
-    SetClamp(float theClamp);
+    SetClamp(vtkFloatingPointType theClamp);
 
     //! Redirect the request to VISU_GaussPointsPL::GetClamp.
-    float
+    vtkFloatingPointType
     GetClamp();
 
     //! Redirect the request to VISU_GaussPointsPL::SetSize.
     void
-    SetGeomSize(float theGeomSize);
+    SetGeomSize(vtkFloatingPointType theGeomSize);
 
     //! Redirect the request to VISU_GaussPointsPL::GetSize.
-    float 
+    vtkFloatingPointType 
     GetGeomSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMinSize.
     void
-    SetMinSize(float theMinSize);
+    SetMinSize(vtkFloatingPointType theMinSize);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMinSize.
-    float 
+    vtkFloatingPointType 
     GetMinSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
     void
-    SetMaxSize(float theMaxSize);
+    SetMaxSize(vtkFloatingPointType theMaxSize);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
-    float 
+    vtkFloatingPointType 
     GetMaxSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMagnification.
     void
-    SetMagnification(float theMagnification);
+    SetMagnification(vtkFloatingPointType theMagnification);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMagnification.
-    float
+    vtkFloatingPointType
     GetMagnification();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
     void
-    SetMagnificationIncrement(float theIncrement);
+    SetMagnificationIncrement(vtkFloatingPointType theIncrement);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
-    float
+    vtkFloatingPointType
     GetMagnificationIncrement();
 
     //! Set flag indicating which scalar bar is active.
@@ -230,10 +230,10 @@ namespace VISU
 
     //! Set value of the distance between global and local scalar bars.
     void
-    SetSpacing(const float theSpacing);
+    SetSpacing(const vtkFloatingPointType theSpacing);
 
     //! Get value of the distance between global and local scalar bars.
-    float
+    vtkFloatingPointType
     GetSpacing() const;
 
     //! Let know is the global range is already calculated
@@ -279,7 +279,7 @@ namespace VISU
     bool myIsDispGlobalScalarBar;
     bool myIsActiveLocalScalarBar;
     QColor myColor;
-    float mySpacing;
+    vtkFloatingPointType mySpacing;
     int myFaceLimit;
 
     QString myMainTexture;
index be502de48afc60c2a7b96fd14b5a5761bd12d577..cd1ba85bdbba67cf849abfd61328891db151ff36 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Gen_i.cc
@@ -85,6 +85,7 @@
 #include <strstream>
 
 #include "Utils_ExceptHandlers.hxx"
+#include "CASCatch.hxx"
 
 using namespace std;
 
@@ -238,18 +239,23 @@ namespace VISU
                    const char* theFieldName, 
                    CORBA::Double theIteration)
   {
+    CASCatch_TRY{       
 #ifndef _DEXCEPT_
-    try{
+      try{
 #endif
-      if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
-       return true;
+       if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
+         return true;
 #ifndef _DEXCEPT_
-    }catch(std::exception& exc){
-      INFOS("Follow exception was occured :\n"<<exc.what());
-    }catch(...){
-      INFOS("Unknown exception was occured!");
-    }
+      }catch(std::exception& exc){
+       INFOS("Follow exception was occured :\n"<<exc.what());
+      }catch(...){
+       INFOS("Unknown exception was occured!");
+      }
 #endif
+    }CASCatch_CATCH(Standard_Failure) {
+      Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+      INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+    }
     return false;
   }
 
@@ -299,58 +305,69 @@ namespace VISU
   //===========================================================================
   SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
                                      const char* theURL,
-                                     bool isMultiFile)
+                                     bool theIsMultiFile)
   {
     Mutex mt(myMutex);
-    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
-    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
+    string aTmpDir = theURL;
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
-    int aCounter = 0;
-    TColStd_SequenceOfAsciiString aFileNames;
-    SALOMEDS::Study_var aStudy = theComponent->GetStudy();
-
-    //CORBA::Boolean anIsValidScript;
-    //Engines::TMPFile_var aDump = DumpPython(aStudy,false,anIsValidScript);
+    
+    typedef std::vector<std::string> TFileNames;
+    TFileNames aFileNames;
+    TFileNames aFiles;
 
-    SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent);
-    for (; itBig->More(); itBig->Next()) {
-      SALOMEDS::SObject_var gotBranch = itBig->Value();
+    SALOMEDS::Study_var aStudy = theComponent->GetStudy();
+    SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
+    for (; anIter->More(); anIter->Next()) {
+      SALOMEDS::SObject_var gotBranch = anIter->Value();
       CORBA::Object_var anObj = SObjectToObject(gotBranch);
       if(CORBA::is_nil(anObj)) continue;
-      if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
-       switch(pResult->GetCreationId()){
+      if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+       switch(aResult->GetCreationId()){
        case Result_i::eImportFile:
        case Result_i::eCopyAndImportFile: {
-         const QFileInfo& aFileInfo = pResult->GetFileInfo();
-         QString aPrefix("");
-         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
-         QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
-         static QString aCommand;
-         aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
-
-         int aRes = system(aCommand);
-         if(aRes){
-           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
-           continue;
-         }else
-           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aCommand = "<<aCommand);
-
-         TCollection_AsciiString aString(strdup(aFileName.latin1()));
-         aFileNames.Append(aString);
+         const QFileInfo& aFileInfo = aResult->GetFileInfo();
+         const std::string& aName = aResult->GetName();
+         std::string aFileName = std::string("_") + aName;
+         std::string aFile = aFileInfo.filePath().latin1();
+         if(theIsMultiFile){
+           aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName;
+
+           std::ostringstream aStream;
+           aStream<<"cp "<<aFile<<" "<<aTmpDir<<aFileName;
+           std::string aCommand = aStream.str();
+           if(system(aCommand.c_str()) != 0){
+             INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
+             continue;
+           }
+         }
+         aFileNames.push_back(aFileName);
+         aFiles.push_back(aFile);
        }}
       }
     }
-    SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.Length() - "<<aFileNames.Length());
-    if(aFileNames.Length() > 0){
-      SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
-      aSeq->length(aFileNames.Length());
-      for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--)
-       aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString());
-      aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), isMultiFile);
-      if(!isMultiFile)
-       SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
+
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<<aFileNames.size());
+
+    SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
+    if(!aFileNames.empty()){
+      aListOfFileNames->length(aFileNames.size());
+      for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
+       aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str();
+    }
+
+    SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames;
+    aListOfFiles->length(aFiles.size());
+    if(!aFiles.empty()){
+      for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
+       aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str();
     }
+
+    SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
+    if(theIsMultiFile)
+      aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile);
+    else
+      aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in());
+
     return aStreamFile._retn();
   }
 
@@ -588,6 +605,85 @@ namespace VISU
     }
   }
 
+  void VISU_Gen_i::RenameMeshInStudy(Result_ptr theResult,
+                                    string     theMeshName,
+                                    int        theEntity,      // -1 for group indication
+                                    string     theSubMeshName, // Family or Group name
+                                    string     theNewName)
+  {
+    if (myStudyDocument->GetProperties()->IsLocked()) return;
+    Mutex mt(myMutex);
+
+    Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+    if (!pResult) return;
+
+    QString aComment;
+    VISU::VISUType aType;
+    if (theEntity >= 0)
+      if (theSubMeshName == "")
+       aType = VISU::TENTITY;
+      else
+       aType = VISU::TFAMILY;
+    else
+      aType = VISU::TGROUP;
+
+    switch (aType) {
+    case VISU::TENTITY:
+      aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
+                      VISU::TENTITY, theMeshName.c_str(), theEntity);
+      break;
+    case VISU::TFAMILY:
+      aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
+                      VISU::TFAMILY, theMeshName.c_str(), theEntity, theSubMeshName.c_str());
+      break;
+    case VISU::TGROUP:
+      aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
+                      VISU::TGROUP, theMeshName.c_str(), theSubMeshName.c_str());
+      break;
+    }
+
+    string aResultEntry = pResult->GetEntry();
+    string anEntry = pResult->GetEntry(aComment.latin1());
+    if (anEntry == "") return;
+
+    SALOMEDS::SObject_ptr aSObject = myStudyDocument->FindObjectID(anEntry.c_str());
+
+    SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
+    aStudyBuilder->NewCommand(); // There is a transaction
+
+    SALOMEDS::GenericAttribute_var anAttr =
+      aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName");
+    SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow(anAttr);
+    aNameAttr->SetValue(theNewName.c_str());
+
+    aStudyBuilder->CommitCommand();
+  }
+
+  void VISU_Gen_i::RenameEntityInStudy(Result_ptr   theResult,
+                                      const char*  theMeshName,
+                                      VISU::Entity theEntity,
+                                      const char*  theNewName)
+  {
+    RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName);
+  }
+
+  void VISU_Gen_i::RenameFamilyInStudy(Result_ptr   theResult,
+                                      const char*  theMeshName,
+                                      VISU::Entity theEntity,
+                                      const char*  theFamilyName,
+                                      const char*  theNewName)
+  {
+    RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName);
+  }
+
+  void VISU_Gen_i::RenameGroupInStudy(Result_ptr  theResult,
+                                     const char* theMeshName,
+                                     const char* theGroupName,
+                                     const char* theNewName)
+  {
+    RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName);
+  }
+
   Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult,
                                    const char* theMeshName,
                                    VISU::Entity theEntity)
index d8008b2f4c533f3ccf327f9e3b0dd056cf4b8f49..04870fc561122ea5a5fe920754936ce374470720 100644 (file)
@@ -1,11 +1,25 @@
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//
-//
-//  File   : VISU_GEN_i.h file
+//  File   : VISU_Gen_i.hh
 //  Author : Alexey Petrov
 //  Module : VISU
-//  $Header:
 
 #ifndef __VISU_GEN_I_H__
 #define __VISU_GEN_I_H__
@@ -15,6 +29,8 @@
 #include "SALOME_Component_i.hxx"
 #include "SALOME_NamingService.hxx"
 
+#include <string>
+
 namespace VISU
 {
   class Result_i;
@@ -91,6 +107,33 @@ namespace VISU
     ImportMedField(SALOME_MED::FIELD_ptr theField);
 
 
+    //Rename Presentation Of Submeshes
+    void
+    RenameMeshInStudy(Result_ptr  theResult,
+                     std::string theMeshName,
+                     int         theEntity,      // -1 for group indication
+                     std::string theSubMeshName, // Family or Group name
+                     std::string theNewName);
+    virtual
+    void
+    RenameEntityInStudy(Result_ptr   theResult,
+                       const char*  theMeshName,
+                       VISU::Entity theEntity,
+                       const char*  theNewName);
+    virtual
+    void
+    RenameFamilyInStudy(Result_ptr   theResult,
+                       const char*  theMeshName,
+                       VISU::Entity theEntity,
+                       const char*  theFamilyName,
+                       const char*  theNewName);
+    virtual
+    void
+    RenameGroupInStudy(Result_ptr  theResult,
+                      const char* theMeshName,
+                      const char* theGroupName,
+                      const char* theNewName);
+
     //Create Presentation Of Submeshes
     virtual
     Mesh_ptr
index a3a39f287a8c7df7239f05753f7253cc0d9fc859..649d25df0b09e7b2f82aef2d831f9dab26a62a67 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 4198c8a6497849222fb098c9207f99461cea2058..0f0077bc244aa7e1e4a435b459082b38508940a9 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -29,6 +29,8 @@
 #include "VISU_IsoSurfaces_i.hh"
 #include "VISU_Actor.h"
 
+#include "SUIT_ResourceMgr.h"
+
 using namespace VISU;
 using namespace std;
 
@@ -115,8 +117,9 @@ CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){
 }
 
 
-void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax){ 
-  float aRange[2] = {theMin, theMax};
+void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
+{ 
+  vtkFloatingPointType aRange[2] = {theMin, theMax};
   myIsoSurfacesPL->SetRange(aRange);
 }
 CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){
@@ -142,6 +145,9 @@ VISU::IsoSurfaces_i
 {
   if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int  aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
+    anActor->SetRepresentation(aDispMode);
     return anActor;
   }
   return NULL;
index b36074aee0e578ce3a5ef75a6d686cf9a554e7d8..0916b66d05d201603a9b35b553920dee8dfa4e4f 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index 2a65400b55d2c1fdca3a026fb360a75e0ca3665b..cdd8dc00fa725248bae5612f76a02a4dc3395973 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -35,6 +35,8 @@
 
 #include "SALOME_Event.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 using namespace VISU;
 using namespace std;
 
@@ -227,7 +229,9 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
     if (myResult->GetInput() == NULL)
       throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
     if (!theRestoring) {
-      myPresentType = VISU::SHADED;
+      myPresentType =  VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
+      if(myEntity == VISU::NODE_ENTITY)
+       myPresentType = VISU::POINT;
       myName = GenerateName().latin1();
       myCellColor.R = 0.0;  myCellColor.G = myCellColor.B = 1.0;
       myNodeColor.R = myNodeColor.G = 1.0;  myNodeColor.B = 1.0;
@@ -273,7 +277,8 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
       myMeshPL->Init();
       string aResultEntry = myResult->GetEntry();
       string anEntry = myResult->GetEntry(aComment.latin1());
-      if(anEntry == "") throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
+      if(anEntry == "") 
+       throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
       mySObject = myStudy->FindObjectID(anEntry.c_str());
       SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
       SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
@@ -298,6 +303,9 @@ VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& th
   VISU_MeshAct* anActor = VISU_MeshAct::New();
   try{
     VISU::Prs3d_i::CreateActor(anActor,theIO);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    bool toShrink  = aResourceMgr->booleanValue("VISU", "mesh_shrink", false);
+    if (toShrink) anActor->SetShrink();
     UpdateActor(anActor);
   }catch (...) {
     anActor->Delete();
index 7649f1abfa997861e31bf4e9aaca807c39d20108..d405a95baeb7aaefa8dd5011175ddde6e605cad7 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index 0cc631b20c278920007658e0fc3ff79aed51ed7c..d86ca318333de8fa0ea93bbb963ab641722cdbb5 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "VISU_Plot3D_i.hh"
@@ -26,6 +26,8 @@
 
 #include "VISU_Actor.h"
 
+#include "SUIT_ResourceMgr.h"
+
 using namespace VISU;
 using namespace std;
 
@@ -190,6 +192,9 @@ VISU::Plot3D_i
 {
   if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2);
+    anActor->SetRepresentation(aDispMode);
     return anActor;
   }
   return NULL;
index 58006072d4fd698d02593eab47f01c7488149882..6b861fba8647cfffdbfa18ae545e150abfd96b10 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef VISU_Plot3D_i_HeaderFile
index 64bb0bb90bfec3c1aa23295cabfad5bb568bdf5b..70d0e429985a68baf146ddc17c79fc7a5a38ab0e 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Prs3d_i.cc
@@ -252,7 +252,7 @@ VISU::Prs3d_i
 
     theActor->SetPrs3d(this);
     theActor->SetShrinkFactor();
-    theActor->SetPosition(myOffset);
+    theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
     theActor->SetPipeLine(GetPipeLine());
 
     theActor->SetFactory(this);
@@ -265,8 +265,8 @@ VISU::Prs3d_i
   }catch(std::bad_alloc& ex){
     throw std::runtime_error("CreateActor >> No enough memory");
     throw ex;
-  } catch(std::exception& ex){
-    throw ex;
+  } catch(std::exception&){
+    throw;
   }catch(...) {
     throw std::runtime_error("CreateActor >> unexpected exception was caught!!!");
   }
@@ -295,7 +295,7 @@ VISU::Prs3d_i
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
   theActor->ShallowCopyPL(myPipeLine);
-  theActor->SetPosition(myOffset);
+  theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
   theActor->Modified();
 }
 
@@ -342,7 +342,9 @@ GetClippingPlane(vtkIdType theID) const
 
 void
 VISU::Prs3d_i
-::SetPlaneParam (float theDir[3], float theDist, vtkPlane* thePlane) 
+::SetPlaneParam (vtkFloatingPointType theDir[3], 
+                vtkFloatingPointType theDist, 
+                vtkPlane* thePlane) 
 {
   myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
 }
@@ -351,14 +353,14 @@ VISU::Prs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::Prs3d_i
-::GetBounds(float aBounds[6])
+::GetBounds(vtkFloatingPointType aBounds[6])
 {
   myPipeLine->GetMapper()->GetBounds(aBounds);
 }
 
 void 
 VISU::Prs3d_i
-::SetOffset(const float* theOffsets)
+::SetOffset(const CORBA::Float* theOffsets)
 {
   myOffset[0] = theOffsets[0];
   myOffset[1] = theOffsets[1];
@@ -367,7 +369,9 @@ VISU::Prs3d_i
 
 void
 VISU::Prs3d_i
-::SetOffset(float theDx, float theDy, float theDz)
+::SetOffset(CORBA::Float theDx, 
+           CORBA::Float theDy, 
+           CORBA::Float theDz)
 {
   myOffset[0] = theDx;
   myOffset[1] = theDy;
@@ -376,7 +380,7 @@ VISU::Prs3d_i
 
 void
 VISU::Prs3d_i
-::GetOffset(float* theOffsets)
+::GetOffset(CORBA::Float* theOffsets)
 {
   theOffsets[0] = myOffset[0];
   theOffsets[1] = myOffset[1];
@@ -385,7 +389,9 @@ VISU::Prs3d_i
 
 void 
 VISU::Prs3d_i
-::GetOffset(float& theDx, float& theDy, float& theDz)
+::GetOffset(CORBA::Float& theDx, 
+           CORBA::Float& theDy, 
+           CORBA::Float& theDz)
 {
   theDx = myOffset[0];
   theDy = myOffset[1];
index 4d410fb268a3706e12d5523c16168f0f1929a163..29634d143b23aea052780a1919900c13c657881b 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
@@ -35,7 +35,8 @@
 #include "SALOME_GenericObj_i.hh"
 #include "SALOME_InteractiveObject.hxx"
 
-#include <boost/signals/signal0.hpp>
+#include "VTKViewer.h"
+
 #include <vtkSmartPointer.h>
 
 class VISU_PipeLine;
@@ -184,25 +185,31 @@ namespace VISU
     GetClippingPlane(vtkIdType theID) const;
 
     void
-    SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane);
+    SetPlaneParam(vtkFloatingPointType theDir[3], 
+                 vtkFloatingPointType theDist, 
+                 vtkPlane* thePlane);
 
     //----------------------------------------------------------------------------
     void
-    GetBounds(float aBounds[6]);
+    GetBounds(vtkFloatingPointType aBounds[6]);
 
     void
-    SetOffset(const float* theOffsets);
+    SetOffset(const CORBA::Float* theOffsets);
 
     virtual
     void
-    SetOffset(float theDx, float theDy, float theDz);
+    SetOffset(CORBA::Float theDx, 
+             CORBA::Float theDy, 
+             CORBA::Float theDz);
 
     void
-    GetOffset(float* theOffsets);
+    GetOffset(CORBA::Float* theOffsets);
 
     virtual
     void
-    GetOffset(float& theDx, float& theDy, float& theDz);
+    GetOffset(CORBA::Float& theDx, 
+             CORBA::Float& theDy, 
+             CORBA::Float& theDz);
 
     //----------------------------------------------------------------------------
   protected:
@@ -220,7 +227,7 @@ namespace VISU
     CheckDataSet();
 
     bool myAddToStudy;
-    float myOffset[3];
+    CORBA::Float myOffset[3];
     Result_i *myResult;
     VISU_PipeLine *myPipeLine;
     SALOMEDS::SObject_var mySObject;
index 321696a102c96837606b2331b70ff8f35e1c6bc1..3a1126cae4290edd810de19d801e5ee27ab19ae5 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
index d62ada673004ef857a885e50ecd2f2918b21f148..c9bc3de6b1a2b126d3f18dd9aee613f02308bbbc 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index 2a85df8166ad105511b8a8743bca50ed8d1e1c30..2abc3b876941c576d581cb8d1dfca7259fe08267 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Result_i.cc
@@ -213,12 +213,14 @@ namespace VISU
     aStudyBuilder->Addreference(aNewObj,aRefSObj);
   }
 
-  string 
+
+  //---------------------------------------------------------------
+  inline
+  std::string 
   CreateAttributes(_PTR(Study) theStudyDocument,
                   const string& theFatherEntry, 
                   const string& theIOR, 
                   const string& theName,
-                  const string& thePersistentRef, 
                   const string& theComment,
                   CORBA::Boolean theCreateNew)
   {
@@ -244,11 +246,6 @@ namespace VISU
       _PTR(AttributeName) aName (anAttr);
       aName->SetValue(theName);
     }
-    if (thePersistentRef != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributePersistentRef");
-      _PTR(AttributePersistentRef) aPRef (anAttr);
-      aPRef->SetValue(thePersistentRef);
-    }
     if (theComment != "") {
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeComment");
       _PTR(AttributeComment) aCmnt (anAttr);
@@ -257,6 +254,54 @@ namespace VISU
     return aNewObj->GetID();
   }
 
+
+  //---------------------------------------------------------------
+  inline
+  void 
+  UpdateAttributes(_PTR(Study) theStudyDocument,
+                  const string& theEntry,
+                  const string& theIOR, 
+                  const string& theName,
+                  const string& theComment)
+  {
+    TLock aLock(myMutex);
+
+    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+    _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+
+    _PTR(GenericAttribute) anAttr;
+    if (theIOR != "") {
+      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
+      _PTR(AttributeIOR) anIOR (anAttr);
+      anIOR->SetValue(theIOR);
+    }
+    if (theName != "") {
+      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeName");
+      _PTR(AttributeName) aName (anAttr);
+      aName->SetValue(theName);
+    }
+    if (theComment != "") {
+      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeComment");
+      _PTR(AttributeComment) aCmnt (anAttr);
+      aCmnt->SetValue(theComment);
+    }
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  void 
+  RemoveSObject(_PTR(Study) theStudyDocument,
+                  const string& theEntry)
+  {
+    TLock aLock(myMutex);
+
+    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+    _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+    aStudyBuilder->RemoveObject(aSObject);
+  }
+
+
   //---------------------------------------------------------------
   struct TResultManager
   {
@@ -339,6 +384,9 @@ namespace VISU
                VISU_Convertor* theInput,
                CORBA::Boolean* theIsDone,
                std::string theResultEntry,
+               CORBA::Boolean theIsAtOnce,
+               CORBA::Boolean theIsBuildGroups,
+               CORBA::Boolean theIsBuildFields,
                _PTR(Study) theStudy)
   {
     if(*theIsDone)
@@ -371,7 +419,6 @@ namespace VISU
                         theResultEntry,
                         "",
                         aMeshName,
-                        "",
                         aComment.latin1(),
                         true);
     
@@ -382,9 +429,29 @@ namespace VISU
                         aMesh->myEntry,
                         "",
                         "Families",
-                        "",
                         aComment.latin1(),
                         true);
+
+      if(theIsBuildGroups){
+       aMesh->myGroupsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          "",
+                          "",
+                          "",
+                          true);
+      }
+       
+      if(theIsBuildFields){
+       aMesh->myFieldsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          "",
+                          "",
+                          "",
+                          true);
+      }
+      
       //Import entities
       TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
@@ -419,7 +486,6 @@ namespace VISU
                           aSubMeshesEntry, 
                           "", 
                           anEntityName.c_str(), 
-                          "", 
                           aComment.latin1(), 
                           true);
       }
@@ -434,6 +500,7 @@ namespace VISU
              VISU_Convertor* theInput,
              CORBA::Boolean* theIsDone,
              CORBA::Boolean theIsBuild,
+             CORBA::Boolean theIsAtOnce,
              _PTR(Study) theStudy)
   {
     if(!theIsBuild || *theIsDone)
@@ -479,7 +546,6 @@ namespace VISU
                             aMeshOnEntity->myEntry,
                             "",
                             aFamilyName,
-                            "",
                             aComment.latin1(),
                             true);
        }
@@ -489,14 +555,13 @@ namespace VISU
       if(!aGroupMap.empty()){
        aComment.sprintf("myComment=GROUPS;myMeshName=%s",
                         aMeshName.c_str());
-       string aGroupsEntry =
-         CreateAttributes(theStudy,
-                          aMesh->myEntry,
-                          "",
-                          "Groups",
-                          "",
-                          aComment.latin1(),
-                          true);
+
+       UpdateAttributes(theStudy,
+                        aMesh->myGroupsEntry,
+                        "",
+                        "Groups",
+                        aComment.latin1());
+
        TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
        for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
          const string& aGroupName = aGroupMapIter->first;
@@ -505,10 +570,9 @@ namespace VISU
                           TGROUP,aMeshName.c_str(),aGroupName.c_str());
          aGroup->myEntry = 
            CreateAttributes(theStudy,
-                            aGroupsEntry,
+                            aMesh->myGroupsEntry,
                             "",
                             aGroupName,
-                            "",
                             aComment.latin1(),
                             true);
          const TFamilySet& aFamilySet = aGroup->myFamilySet;
@@ -520,7 +584,9 @@ namespace VISU
                            aFamily->myEntry);
          }
        }
-      }
+      }else if(!theIsAtOnce)
+       RemoveSObject(theStudy,
+                     aMesh->myGroupsEntry);
     }
     
     ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
@@ -533,6 +599,7 @@ namespace VISU
              VISU_Convertor* theInput,
              CORBA::Boolean* theIsDone,
              CORBA::Boolean theIsBuild,
+             CORBA::Boolean theIsAtOnce,
              _PTR(Study) theStudy)
   {
     if(!theIsBuild || *theIsDone)
@@ -559,9 +626,7 @@ namespace VISU
        continue;
       
       //Import fields
-      string aFieldsEntry;
-      bool anIsFieldsEntryCreated = false;
-      
+      bool anIsFieldsEntryUpdated = false;
       TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
        const TEntity& anEntity = aMeshOnEntityMapIter->first;
@@ -569,18 +634,17 @@ namespace VISU
        const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
        TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
        for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
-         if(!anIsFieldsEntryCreated){
+         if(!anIsFieldsEntryUpdated){
            aComment.sprintf("myComment=FIELDS;myMeshName=%s",
                             aMeshName.c_str());
-           aFieldsEntry =
-             CreateAttributes(theStudy,
-                              aMesh->myEntry,
-                              "",
-                              "Fields",
-                              "",
-                              aComment.latin1(),
-                              true);
-           anIsFieldsEntryCreated = true;
+
+           UpdateAttributes(theStudy,
+                            aMesh->myFieldsEntry,
+                            "",
+                            "Fields",
+                            aComment.latin1());
+
+           anIsFieldsEntryUpdated = true;
          }
          const string& aFieldName = aFieldMapIter->first;
          const PField& aField = aFieldMapIter->second;
@@ -595,10 +659,9 @@ namespace VISU
                           aField->myNbComp);
          aField->myEntry = 
            CreateAttributes(theStudy,
-                            aFieldsEntry,
+                            aMesh->myFieldsEntry,
                             "",
                             aFieldNameWithUnit.latin1(),
-                            "",
                             aComment.latin1(),
                             true);
          CreateReference(theStudy,
@@ -621,12 +684,15 @@ namespace VISU
                               aField->myEntry,
                               "",
                               aTimeStampId,
-                              "",
                               aComment.latin1(),
                               true);
          }
        }
       }
+
+      if(!anIsFieldsEntryUpdated && !theIsAtOnce)
+       RemoveSObject(theStudy,
+                     aMesh->myFieldsEntry);
     }
     
     ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
@@ -670,6 +736,7 @@ namespace VISU
                theInput,
                theIsFieldsDone,
                theIsBuildFields,
+               false,
                theStudy);
 
     BuildMinMax(theResult,
@@ -732,6 +799,9 @@ namespace VISU
                  theBuildArgs.myInput,
                  theBuildArgs.myIsEntitiesDone,
                  theBuildArgs.myResultEntry,
+                 false,
+                 theBuildArgs.myIsBuildGroups,
+                 theBuildArgs.myIsBuildFields,
                  theBuildArgs.myStudy);
     {
       boost::thread aThread(boost::bind(&BuildGroups,
@@ -739,6 +809,7 @@ namespace VISU
                                        theBuildArgs.myInput,
                                        theBuildArgs.myIsGroupsDone,
                                        theBuildArgs.myIsBuildGroups,
+                                       false,
                                        theBuildArgs.myStudy));
     }
     {
@@ -787,20 +858,23 @@ VISU::Result_i
 ::Result_i (SALOMEDS::Study_ptr theStudy,
            const ESourceId& theSourceId,
            const ECreationId& theCreationId,
-           CORBA::Boolean theIsBuildImmediately):
+           CORBA::Boolean theIsBuildImmediately,
+           CORBA::Boolean theIsBuildFields,
+           CORBA::Boolean theIsBuildMinMax,
+           CORBA::Boolean theIsBuildGroups):
   myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)),
   myCreationId(theCreationId),
   mySourceId(theSourceId),
   myIsBuildImmediately(theIsBuildImmediately),
-  myInput(NULL),
+  myIsBuildFields(theIsBuildFields),
+  myIsBuildMinMax(theIsBuildMinMax),
+  myIsBuildGroups(theIsBuildGroups),
   myIsEntitiesDone(false),
   myIsFieldsDone(false),
   myIsGroupsDone(false),
   myIsMinMaxDone(false),
-  myIsBuildFields(true),
-  myIsBuildGroups(true),
-  myIsBuildMinMax(true),
-  myIsAllDone(false)
+  myIsAllDone(false),
+  myInput(NULL)
 {
   myStudy = ProcessEvent(new TGetStudy(myStudyDocument->StudyId()));
 }
@@ -992,7 +1066,6 @@ VISU::Result_i
                     aSComponentEntry.in(),
                     anIOR.in(),
                     myName,
-                    "",
                     aComment.latin1(),
                     true);
   mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
@@ -1006,18 +1079,23 @@ VISU::Result_i
                  myInput,
                  &myIsEntitiesDone,
                  aResultEntry,
+                 theIsAtOnce,
+                 myIsBuildGroups,
+                 myIsBuildFields,
                  myStudy);
     
     BuildGroups(this,
                myInput,
                &myIsGroupsDone,
                myIsBuildGroups,
+               theIsAtOnce,
                myStudy);
 
     BuildFields(this,
                myInput,
                &myIsFieldsDone,
                myIsBuildFields,
+               theIsAtOnce,
                myStudy);
     
     BuildMinMax(this,
@@ -1181,7 +1259,8 @@ Restore(SALOMEDS::SObject_ptr theSObject,
 
     SALOMEDS::SObject_var aRefSObj, aTargetRefSObj;
     if (mySObject->FindSubObject(1, aRefSObj) &&
-       aRefSObj->ReferencedObject(aTargetRefSObj)) {
+       aRefSObj->ReferencedObject(aTargetRefSObj)) 
+    {
       if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference.");
       SALOMEDS::SComponent_var aCompRefSObj = aTargetRefSObj->GetFatherComponent();
       CORBA::String_var aDataType = aCompRefSObj->ComponentDataType();
@@ -1258,7 +1337,21 @@ Restore(SALOMEDS::SObject_ptr theSObject,
       }
       if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId);
       myInput = CreateConvertor(myFileInfo.filePath().latin1());
-      myInput->Build();
+
+      myInput->BuildEntities();
+      if(myIsBuildFields){
+       myInput->BuildFields();
+       myIsFieldsDone = true;
+       if(myIsBuildMinMax){
+         myInput->BuildMinMax();
+         myIsMinMaxDone = true;
+       }
+      }
+      if(myIsBuildGroups){
+       myInput->BuildGroups();
+       myIsGroupsDone = true;
+      }
+
       QString aComment;
       aComment.sprintf("myComment=%s;myType=%d;myFileName=%s;myInitFileName=%s",
                       GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(),
@@ -1269,8 +1362,8 @@ Restore(SALOMEDS::SObject_ptr theSObject,
       SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
       aCmnt->SetValue(aComment.latin1());
     }
-    bool isBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
-    if (isBuildAll)
+    bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
+    if(anIsBuildAll)
       BuildAll();
     return this;
   } catch(std::exception& exc) {
@@ -1357,6 +1450,9 @@ VISU::Result_i
   Storable::DataToStream(theStr,"myName",myName.c_str());
   Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
   Storable::DataToStream(theStr,"myCreationId",myCreationId);
+  Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
+  Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
+  Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone);
 }
 
 
@@ -1374,11 +1470,20 @@ VISU::Result_i
   if(aCreationId == eImportMed || aCreationId == eImportMedField)
     aSourceId = eRestoredComponent;
 
-  VISU::Result_i* pResult = new VISU::Result_i(aStudy,aSourceId,aCreationId);
-  if (pResult == NULL)
+  CORBA::Boolean anIsBuildFields = Storable::FindValue(theMap,"myIsBuildFields","0").toInt();
+  CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","0").toInt();
+  CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","0").toInt();
+
+  VISU::Result_i* aResult = new VISU::Result_i(aStudy,
+                                              aSourceId,
+                                              aCreationId,
+                                              anIsBuildFields,
+                                              anIsBuildMinMax,
+                                              anIsBuildGroups);
+  if (aResult == NULL)
     return NULL;
 
-  return pResult->Restore(theSObject,theMap,thePrefix);
+  return aResult->Restore(theSObject,theMap,thePrefix);
 }
 
 
@@ -1446,11 +1551,13 @@ VISU::Result_i
 //function : GetAxisInfo
 //purpose  :
 //=======================================================================
-const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
-                                             TAxis         theAxis,
-                                             gp_Dir&       thePlaneNormal)
+const Result_i::TAxisInfo* 
+Result_i
+::GetAxisInfo(const string& theMeshName,
+             TAxis         theAxis,
+             gp_Dir&       thePlaneNormal)
 {
-  const vector< float >* components = NULL;
+  const TAxisInfo* components = NULL;
 
   if ( theAxis < AXIS_X || theAxis > AXIS_Z ) {
     MESSAGE(" Bad axis index " << theAxis );
@@ -1496,7 +1603,7 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
       if ( nbPnt != 8 )
         continue;
       vtkPoints * points = cell->GetPoints();
-      float* coords[ 4 ];
+      vtkFloatingPointType* coords[ 4 ];
       coords[0] = points->GetPoint( 0 );
       coords[1] = points->GetPoint( 1 );
       coords[2] = points->GetPoint( 3 );
@@ -1504,10 +1611,10 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
       gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
       for ( iAx = 0; iAx < nbAxes; ++iAx )
       {
-        float* coo = coords[ iAx + 1 ];
+        vtkFloatingPointType* coo = coords[ iAx + 1 ];
         gp_Pnt p( coo[0], coo[1], coo[2] );
         // min size
-        float size = p0.SquareDistance( p );
+        vtkFloatingPointType size = p0.SquareDistance( p );
         if ( size > FLT_MIN && size < minSize[ iAx ] )
           minSize[ iAx ] = size;
         // axis direction
@@ -1537,34 +1644,34 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
 
     // get and sort intermediate component values - projections of nodes
     // on axis direction; define bnd box
-    set< float > comps[ 3 ];
+    set< vtkFloatingPointType > comps[ 3 ];
     Bnd_Box box;
     vtkPoints * points = aMesh->GetPoints();
     vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
     for ( iP = 0; iP < nbP; ++iP )
     {
-      float* coo = points->GetPoint( iP );
+      vtkFloatingPointType* coo = points->GetPoint( iP );
       gp_Pnt p( coo[0], coo[1], coo[2] );
       box.Add( p );
       for ( iAx = 0; iAx < nbAxes; ++iAx ) {
         const gp_Dir& dir = gInfo->myAxis[ iAx ];
-        float dot = dir.XYZ() * p.XYZ();
+        vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
         comps[ iAx ].insert( dot );
       }
     }
 
     // find a range of projections of bnd box corners on each axis
-    float range[3], firstValue[3];
+    vtkFloatingPointType range[3], firstValue[3];
     double x[2],y[2],z[2];
     box.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
     for ( iAx = 0; iAx < nbAxes; ++iAx ) {
-      set< float > bndComps;
+      set< vtkFloatingPointType > bndComps;
       const gp_Dir& dir = gInfo->myAxis[ iAx ];
       for ( int iX = 0; iX < 2; ++iX ) {
         for ( int iY = 0; iY < 2; ++iY ) {
           for ( int iZ = 0; iZ < 2; ++iZ ) {
             gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
-            float dot = dir.XYZ() * p.XYZ();
+            vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
             bndComps.insert( dot );
           }
         }
@@ -1576,14 +1683,14 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
     // compute component values
     for ( iAx = 0; iAx < nbAxes; ++iAx )
     {
-      list< float > values;
+      list< vtkFloatingPointType > values;
       int nbVals = 0;
-      set< float >& comp = comps[ iAx ];
-      set< float >::iterator val = comp.begin();
-      float bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
-      float tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
+      set< vtkFloatingPointType >& comp = comps[ iAx ];
+      set< vtkFloatingPointType >::iterator val = comp.begin();
+      vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
+      vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
       for ( ; val != comp.end(); ++val ) {
-        float value = ( *val - first ) / rng;
+        vtkFloatingPointType value = ( *val - first ) / rng;
         if ( value > bnd ) {
           values.push_back( value );
           bnd = value + tol;
@@ -1591,9 +1698,9 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
         }
       }
       // store values in gInfo
-      vector< float >& myComp = gInfo->myComponets[ iAx ];
+      vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
       myComp.resize( nbVals );
-      list< float >::iterator v = values.begin();
+      list< vtkFloatingPointType >::iterator v = values.begin();
       for ( int i = 0; v != values.end(); ++v )
         myComp[ i++ ] = *v;
     }
index c1d4bde4478bb82668fd32241eeace399d511b98..72025fdae3b0095c82ec6b61b2ec47cc66562ad0 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Result_i.hh
 #define __VISU_RESULT_I_H__
 
 #include "VISUConfig.hh"
+#include "VISU_BoostSignals.h"
 #include "SALOME_GenericObj_i.hh"
 
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/signal0.hpp>
+#include "VTKViewer.h"
 
 #include <gp_Dir.hxx>
 #include <vector>
@@ -72,7 +72,10 @@ namespace VISU
     Result_i(SALOMEDS::Study_ptr theStudy,
             const ESourceId& theSourceId,
             const ECreationId& theCreationId,
-            CORBA::Boolean theIsBuildImmediately = true);
+            CORBA::Boolean theIsBuildImmediately = true,
+            CORBA::Boolean theIsBuildFields = true,
+            CORBA::Boolean theIsBuildMinMax = true,
+            CORBA::Boolean theIsBuildGroups = true);
 
     virtual ~Result_i();
     virtual void RemoveFromStudy();
@@ -173,17 +176,18 @@ namespace VISU
     // Info on structured mesh contained in TInput
   public:
     typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis;
-    const std::vector< float >* GetAxisInfo(const std::string& theMeshName,
-                                            TAxis              theAxis,
-                                            gp_Dir&            thePlaneNormal);
+    typedef std::vector< vtkFloatingPointType > TAxisInfo;
+    const TAxisInfo* GetAxisInfo(const std::string& theMeshName,
+                                TAxis              theAxis,
+                                gp_Dir&            thePlaneNormal);
     // Return i,j or k values and cutting plane normal for theAxis.
     // In the case of any problems, return NULL pointer
   private:
     struct TGridInfo {
-      std::vector< float > myComponets[ 3 ];
-      gp_Dir               myAxis     [ 3 ];
+      TAxisInfo myComponets[ 3 ];
+      gp_Dir    myAxis     [ 3 ];
     };
-    map< string, TGridInfo > myMeshName2GridInfoMap;
+    std::map< std::string, TGridInfo > myMeshName2GridInfoMap;
   };
 
   Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
index 9b8868e34f352262ec469a5c9453892e8edd94bb..71fe93cb66710aa562b41751fce78e75e029bfd6 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_ScalarMapOnDeformedShape_i.cc
@@ -31,6 +31,8 @@
 #include "VISU_Convertor.hxx"
 #include "VISU_ScalarMapAct.h"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkUnstructuredGrid.h>
 #include <vtkProperty.h>
 #include <vtkMapper.h>
@@ -102,6 +104,7 @@ ScalarMapOnDeformedShape_i(Result_i* theResult,
 VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity, 
                                                         const char* theFieldName, int theIteration)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
   myIsColored = true;
   myColor.R = myColor.G = myColor.B = 0.5;
   VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
@@ -116,6 +119,7 @@ VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName
 
 VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
   TSuperClass::Restore(theMap);
   
   SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
@@ -138,6 +142,7 @@ VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TResto
 
 void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
   TSuperClass::ToStream(theStr);
   
   Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
@@ -161,15 +166,21 @@ void
 VISU::ScalarMapOnDeformedShape_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
+  int theScalarIter = this->GetScalarIteration();
+  string theScalarMeshName = this->GetScalarMeshName();
+  string theScalarFieldName = this->GetScalarFieldName();
+  if(MYDEBUG) cout << "SameAs:"<<endl
+                  << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
+
   TSuperClass::SameAs(theOrigin);
 
   if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
     ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
 
-    // increment the scalar iteration for using in VISU_TimeAnimation class implementation.
     this->SetScalarField(anOrigin->GetScalarMeshName().c_str(),
                         anOrigin->GetScalarFieldName().c_str(),
-                        anOrigin->GetScalarIteration() + 1,
+                        theScalarIter,
                         anOrigin->GetScalarEntity());
     Update();
   }
@@ -184,26 +195,27 @@ CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){
 }
 
 void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){
-  float aRange[2];
-  aRange[0] = float(theMinRange);
-  aRange[1] = float(theMaxRange);
+  vtkFloatingPointType aRange[2];
+  aRange[0] = vtkFloatingPointType(theMinRange);
+  aRange[1] = vtkFloatingPointType(theMaxRange);
   myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
 }
 
 CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){
-  float aRange[2];
+  vtkFloatingPointType aRange[2];
   myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
   return aRange[0];
 }
 
 CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){
-  float aRange[2];
+  vtkFloatingPointType aRange[2];
   myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
   return aRange[1];
 }
 
 void VISU::ScalarMapOnDeformedShape_i::DoHook()
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
   if(!myPipeLine)
     myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
   
@@ -215,8 +227,13 @@ void VISU::ScalarMapOnDeformedShape_i::DoHook()
 
 VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
   VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
-  anActor->SetRepresentation(2);
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int  aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
+  bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
+  anActor->SetRepresentation(aDispMode);
+  if (toShrink) anActor->SetShrink();
   anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
   anActor->SetVTKMapping(false);
   return anActor;
@@ -224,6 +241,7 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In
 
 
 void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<<endl;
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     if(IsColored()){
       anActor->SetBarVisibility(true);
@@ -239,15 +257,18 @@ void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
 
 void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
                                                      const char* theFieldName,
-                                                     const int   theIteration,
-                                                     const VISU::TEntity  theEntity)
+                                                     int   theIteration,
+                                                     VISU::TEntity  theEntity)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
+  if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
+  if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
+  myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+  TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
+                                                             theEntity,
+                                                             theFieldName,
+                                                             theIteration)->GetVTKOutput();
   if (myScalarMapOnDeformedShapePL){
-    myField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
-    TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
-                                                               theEntity,
-                                                               theFieldName,
-                                                               theIteration)->GetVTKOutput();
     myScalarMapOnDeformedShapePL->SetScalars(aOut);
   }
   this->SetScalarMeshName(theMeshName);
@@ -256,6 +277,13 @@ void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
   this->SetScalarEntity(theEntity);
 }
 
+void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
+                                                     const char* theFieldName,
+                                                     CORBA::Long  theIteration,
+                                                     VISU::Entity  theEntity)
+{
+  this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
+}
 
 void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
   myScalarMeshName = theName;
@@ -274,6 +302,8 @@ std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
 void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
   myScalarIteration = theValue;
 }
+
+
 int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
   return myScalarIteration;
 }
@@ -281,6 +311,22 @@ int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
 void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
   myScalarEntity = theValue;
 }
+
 VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
   return myScalarEntity;
 }
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+  myScalarEntity = VISU::TEntity(theValue);
+}
+
+VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+  return VISU::Entity(myScalarEntity);
+}
+
+const VISU::PField&
+VISU::ScalarMapOnDeformedShape_i
+::GetField() const 
+{ 
+  return myScalarField;
+}
index 68b7d6e73420c115e3e4031218875a4b379820ed..b2a5729fec2cb7a7f95be448dcb293f65dd099d0 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // File:    VISU_ScalarMapOnDeformedShape_i.hh
@@ -77,6 +77,9 @@ namespace VISU{
     void
     SameAs(const Prs3d_i* theOrigin);
 
+    virtual const VISU::PField&
+    GetField() const;
+
     VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
    
   protected:
@@ -92,6 +95,7 @@ namespace VISU{
     std::string myScalarFieldName;
     VISU::TEntity myScalarEntity;
     int myScalarIteration;
+    PField myScalarField;
 
   public:
     static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
@@ -116,8 +120,13 @@ namespace VISU{
 
     virtual void SetScalarField(const char* theMeshName,
                                const char* theFieldName,
-                               const int   theIteration,
-                               const VISU::TEntity  theEntity);
+                               int   theIteration,
+                               VISU::TEntity  theEntity);
+    
+    virtual void SetScalarField(const char* theMeshName,
+                               const char* theFieldName,
+                               CORBA::Long  theIteration,
+                               VISU::Entity  theEntity);
 
     virtual void SetScalarFieldName(const char* theName);
     virtual std::string GetScalarFieldName();
@@ -127,6 +136,8 @@ namespace VISU{
     virtual std::string GetScalarMeshName();
     virtual void SetScalarEntity(const VISU::TEntity theValue);
     virtual VISU::TEntity GetScalarEntity();
+    virtual void SetScalarEEntity(const VISU::Entity theValue);
+    virtual VISU::Entity GetScalarEEntity();
   };
 }
 #endif
index 19bdd8dab31163858924ebdc0938cf4ea1906f39..2a26f380d115a3da46362fa0ed8912ba4edf58c8 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -240,7 +240,7 @@ VISU::ScalarMap_i
 {
   if(theMin > theMax) 
     return;
-  float aScalarRange[2] = {theMin, theMax};
+  vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
   myScalarMapPL->SetScalarRange(aScalarRange);
   myIsFixedRange = true;
 }
@@ -310,9 +310,12 @@ VISU::ScalarMap_i
   try{
     TSuperClass::CreateActor(anActor,theIO);
     anActor->SetBarVisibility(true);
-    anActor->SetRepresentation(2);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int  aDispMode = aResourceMgr->integerValue("VISU", "scalar_map_represent", 2);
+    bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
     bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
+    anActor->SetRepresentation(aDispMode);
+    if (toShrink) anActor->SetShrink();
     anActor->SetShading(toUseShading);
     UpdateActor(anActor);
   }catch(...){
@@ -339,14 +342,14 @@ VISU::ScalarMap_i
 
     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
     aTitleProp->SetFontFamily(myTitFontType);
-    aTitleProp->SetColor(myTitleColor);
+    aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
     (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
     (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
     (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
 
     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
     aLabelProp->SetFontFamily(myLblFontType);
-    aLabelProp->SetColor(myLabelColor);
+    aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
     (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
     (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
     (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
index 0d275401489a67c15888a160ac96371d8f42d0b4..c3999cca0d5fd6568f9b95b5cd84903f93bf0cd5 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index fbeeb75f5c204a386db9f79602741464f6536c6b..8bf6fa27e50159256beaa76fdfd3bb443bde040b 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.cxx
@@ -31,6 +31,8 @@
 #include "VISU_StreamLinesPL.hxx"
 #include "VISU_Convertor.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkDataSetMapper.h>
 #include <vtkAppendFilter.h>
 #include <vtkUnstructuredGrid.h>
@@ -271,6 +273,9 @@ VISU::StreamLines_i
 {
   if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int  aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1);
+    anActor->SetRepresentation(aDispMode);
     return anActor;
   }
   return NULL;
index 4ae3150f08a2ba6962e5f2cfbe3936c28d077d68..03c6ec960a563edef75c4094b659d5fefa9f8348 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index 4f0151bfbee5231e66f4a202318d17491457ccb6..4713feda4ef26700f8578bd94ce48c4731c4aa79 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Table_i.cc
index 3fd6dc6547e414e35c7fcc50f45759fd98f635a3..5ba1efc3db4b22d76cacdcdfe7fe3b0ffcf23a11 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Table_i.hh
index c1db8093ddd405f3201c51f57c8751832da4c621..b337e3ada5c446474d6bd7cef5ab5a41c5666690 100644 (file)
@@ -1,6 +1,21 @@
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VISU_TimeAnimation.cxx
 //  Author : Vitaly SMETANNIKOV
 
 #include "SALOMEDSClient_AttributeComment.hxx"
 #include "SALOMEDSClient_AttributeName.hxx"
+#include "CASCatch.hxx"
 
 #include <qpixmap.h>
 #include <qimage.h>
 #include <qstrlist.h>
+#include <qdir.h>
 
 using namespace std;
 
@@ -64,18 +81,21 @@ VISU_TimeAnimation::VISU_TimeAnimation (_PTR(Study) theStudy,
   if (!CORBA::is_nil(theView3D)) {
     VISU::View3D_i* pView = dynamic_cast<VISU::View3D_i*>(GetServant(theView3D).in());
     SUIT_ViewWindow* aVW = pView->GetViewWindow();
-    myView = VISU::GetViewWindow(aVW);
+    myView = dynamic_cast<SVTK_ViewWindow*>(aVW);
     connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
   }
 
-  myMaxVal = 0;
-  myMinVal = 0;
+  myTimeMinVal = 0;
+  myTimeMaxVal = 0;
   myTimeMin = 0;
   myTimeMax = 0;
   myLastError = "";
   myCycling = false;
 
   myAnimEntry = "";
+
+  myDumpPath = "";
+  myAVIMaker = "jpeg2yuv";
 }
 
 
@@ -90,6 +110,25 @@ VISU_TimeAnimation::~VISU_TimeAnimation()
   for (int i = 0; i < getNbFields(); i++) {
     clearData(myFieldsLst[i]);
   }
+
+  /* Terminates the execution of the thread. 
+   * The thread may or may not be terminated immediately, 
+   * depending on the operating system's scheduling policies. 
+   *  
+   * Use QThread::wait() after terminate() for synchronous termination.
+   *
+   * When the thread is terminated, all threads waiting for the the thread to finish will be woken up.
+   * 
+   * Warning: This function is dangerous, and its use is discouraged. 
+   * The thread can be terminated at any point in its code path. 
+   * Threads can be terminated while modifying data. 
+   * There is no chance for the thread to cleanup after itself, 
+   * unlock any held mutexes, etc. In short, use this function only if absolutely necessary. 
+   */
+  myDumpPath = "";
+  QThread::wait(100);
+  QThread::terminate();
+  QThread::wait(400);
 }
 
 
@@ -162,13 +201,10 @@ namespace
                        FieldData& theData,
                        VISU::Result_i* theResult,
                        bool theIsRangeDefined,
-                       CORBA::Double& theMinVal,
-                       CORBA::Double& theMaxVal,
                        CORBA::Double theTimeMin,
                        CORBA::Double theTimeMax)
   {
-    theMinVal = VTK_LARGE_FLOAT;
-    theMaxVal = -VTK_LARGE_FLOAT;
+    double aMin = VTK_LARGE_FLOAT, aMax = -VTK_LARGE_FLOAT;
 
     _PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
     anIter->Next(); // First is reference on support
@@ -197,13 +233,27 @@ namespace
       QString aFieldName = VISU::Storable::FindValue(aTimeMap,"myFieldName");
       int aTimeStampId = VISU::Storable::FindValue(aTimeMap,"myTimeStampId").toInt();
       
+      bool anIsCreated = false;
       TPrs3d* aPresent = new TPrs3d(theResult, false);
-      aPresent->Create(aMeshName.latin1(), anEntity,
-                      aFieldName.latin1(), aTimeStampId);
-      theData.myPrs[aFrameId++] = aPresent;
-
-      theMinVal = std::min(aPresent->GetMin(),theMinVal);
-      theMaxVal = std::max(aPresent->GetMax(),theMaxVal);
+      CASCatch_TRY{       
+       try{
+         if(aPresent->Create(aMeshName.latin1(),anEntity,aFieldName.latin1(),aTimeStampId)){
+           anIsCreated = true;
+           theData.myPrs[aFrameId++] = aPresent;
+           aMin = std::min(aPresent->GetMin(), aMin);
+           aMax = std::max(aPresent->GetMax(), aMax);
+         }
+       }catch(std::exception& exc){
+         INFOS("Follow exception was occured :\n"<<exc.what());
+       }catch(...){
+         INFOS("Unknown exception was occured!");
+       }
+      }CASCatch_CATCH(Standard_Failure) {
+       Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+       INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+      }
+      if(!anIsCreated)
+       aPresent->_remove_ref();
     }
     theData.myNbFrames = aFrameId;
 
@@ -212,7 +262,7 @@ namespace
       if( aRangeType != 1 ){
        for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
          if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
-           aPrs->SetRange(theMinVal, theMaxVal);
+           aPrs->SetRange(aMin, aMax);
            aPrs->SetOffset(theData.myOffset);
          }
        }
@@ -220,7 +270,7 @@ namespace
       if (theData.myPrsType == VISU::TISOSURFACE)
        for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++)
          if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(theData.myPrs[aFrameId]))
-           aPrs->SetSubRange(theMinVal, theMaxVal);
+           aPrs->SetSubRange(aMin, aMax);
     }
   }
 }
@@ -246,100 +296,80 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                                       aData,
                                       aResult,
                                       isRangeDefined(),
-                                      myMinVal,
-                                      myMaxVal,
-                                      myTimeMin,
-                                      myTimeMax);
+                                      myTimeMinVal,
+                                      myTimeMaxVal);
     break;
   case VISU::TISOSURFACE: // Iso Surfaces
     GeneratePresentations<IsoSurfaces_i>(myStudy,
                                         aData,
                                         aResult,
                                         isRangeDefined(),
-                                        myMinVal,
-                                        myMaxVal,
-                                        myTimeMin,
-                                        myTimeMax);
+                                        myTimeMinVal,
+                                        myTimeMaxVal);
     break;
   case VISU::TCUTPLANES: // Cut Planes
     GeneratePresentations<CutPlanes_i>(myStudy,
                                       aData,
                                       aResult,
                                       isRangeDefined(),
-                                      myMinVal,
-                                      myMaxVal,
-                                      myTimeMin,
-                                      myTimeMax);
+                                      myTimeMinVal,
+                                      myTimeMaxVal);
     break;
   case VISU::TCUTLINES: // Cut Lines
     GeneratePresentations<CutLines_i>(myStudy,
                                      aData,
                                      aResult,
                                      isRangeDefined(),
-                                     myMinVal,
-                                     myMaxVal,
-                                     myTimeMin,
-                                     myTimeMax);
+                                     myTimeMinVal,
+                                     myTimeMaxVal);
     break;
   case VISU::TPLOT3D: // Plot3d
     GeneratePresentations<Plot3D_i>(myStudy,
                                    aData,
                                    aResult,
                                    isRangeDefined(),
-                                   myMinVal,
-                                   myMaxVal,
-                                   myTimeMin,
-                                   myTimeMax);
+                                   myTimeMinVal,
+                                   myTimeMaxVal);
     break;
   case VISU::TDEFORMEDSHAPE: // Deformed Shape
     GeneratePresentations<DeformedShape_i>(myStudy,
                                           aData,
                                           aResult,
                                           isRangeDefined(),
-                                          myMinVal,
-                                          myMaxVal,
-                                          myTimeMin,
-                                          myTimeMax);
+                                          myTimeMinVal,
+                                          myTimeMaxVal);
     break;
   case VISU::TVECTORS: // Vectors
     GeneratePresentations<Vectors_i>(myStudy,
                                     aData,
                                     aResult,
                                     isRangeDefined(),
-                                    myMinVal,
-                                    myMaxVal,
-                                    myTimeMin,
-                                    myTimeMax);
+                                    myTimeMinVal,
+                                    myTimeMaxVal);
     break;
   case VISU::TSTREAMLINES: // Stream Lines
     GeneratePresentations<StreamLines_i>(myStudy,
                                         aData,
                                         aResult,
                                         isRangeDefined(),
-                                        myMinVal,
-                                        myMaxVal,
-                                        myTimeMin,
-                                        myTimeMax);
+                                        myTimeMinVal,
+                                        myTimeMaxVal);
     break;
   case VISU::TGAUSSPOINTS: // Gauss Points
     GeneratePresentations<GaussPoints_i>(myStudy,
                                         aData,
                                         aResult,
                                         isRangeDefined(),
-                                        myMinVal,
-                                        myMaxVal,
-                                        myTimeMin,
-                                        myTimeMax);
+                                        myTimeMinVal,
+                                        myTimeMaxVal);
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
     GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
                                                      aData,
                                                      aResult,
                                                      isRangeDefined(),
-                                                     myMinVal,
-                                                     myMaxVal,
-                                                     myTimeMin,
-                                                     myTimeMax);
+                                                     myTimeMinVal,
+                                                     myTimeMaxVal);
     break;
   default:
     MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
@@ -570,9 +600,15 @@ void VISU_TimeAnimation::run()
   double aOneVal = 1;
   if (myFieldsLst[0].myNbFrames > 2)
     aOneVal = myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0];
+  myFileIndex = 0;
+  int aNbFiles = 0;
+  QValueList<int> anIndexList;
+
   qApp->lock();
   while (myIsActive) {
     emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+    if(!(myFieldsLst[0].myField))
+      break;
     for (int i = 0; i < getNbFields(); i++) {
       FieldData& aData = myFieldsLst[i];
       if (myFrame > 0) {
@@ -605,6 +641,7 @@ void VISU_TimeAnimation::run()
       }
     }
     int delay = (int)(1000. * k / mySpeed);
+    isDumping = !myDumpPath.isEmpty();
     if (delay < 1 && isDumping) {
       // We must unlock mutex for some time before grabbing to allow view updating
       delay = 1;
@@ -616,19 +653,61 @@ void VISU_TimeAnimation::run()
     if (isDumping) {
       // We must unlock mutex for some time before grabbing to allow view updating
       qApp->unlock();
-      msleep(100);
+      msleep(delay);
       qApp->lock();
+      if(!(myFieldsLst[0].myField)) // break, if field was deleted.
+       break;
+      if (myDumpFormat.compare("AVI") != 0) {
+       QString aFile(myDumpPath);
+       QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
+       int aPos = -1;
+       while ((aPos = aName.find(".")) > -1 )
+         aName.replace(aPos, 1, "_");
+       aFile += aName;
+       aFile += ".";
+       aFile += myDumpFormat.lower();
+       myView->dumpViewToFormat(aFile,myDumpFormat);
+      } else {
+       QFileInfo aFileInfo(myDumpPath);
+       QString aDirPath = aFileInfo.dirPath(true);
+       QString aBaseName = aFileInfo.fileName();
+
+       switch (myFrame) {
+       case 0: 
+         break;
+       case 1:
+         myFileIndex += 5;
+         break;
+       default:
+         if (myProportional) {
+           double p = (myFieldsLst[0].myTiming[myFrame] -
+                       myFieldsLst[0].myTiming[myFrame-1]) / aOneVal;
+           myFileIndex += (long) (5*p);
+         } else {
+           myFileIndex += 5;
+         }
+       }
 
-      QPixmap px = QPixmap::grabWindow(myView->winId());
-      QString aFile(myDumpPath);
-      QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
-      int aPos = -1;
-      while ((aPos = aName.find(".")) > -1 )
-       aName.replace(aPos, 1, "_");
-      aFile += aName;
-      aFile += ".";
-      aFile += myDumpFormat.lower();
-      px.save(aFile, myDumpFormat);
+       QString aFile = aDirPath + QDir::separator() + aBaseName;
+       aFile += "_";
+       aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0');
+       aFile += ".jpeg";
+
+       /* check image size is divisable 16
+       myView->dumpViewToFormat(aFile,"JPEG");
+       */
+       SUIT_ViewWindow* aView = myView;
+       QImage img = aView->dumpView();
+       if (!img.isNull()) {
+         int width = img.width(); width = (width/16)*16;
+         int height = img.height(); height = (height/16)*16;
+         QImage copy = img.copy(0, 0, width, height);
+         if (copy.save(aFile, "JPEG")) {
+           anIndexList.append(myFileIndex);
+           aNbFiles++;
+         }
+       }
+      }
     }
 
     if (!myIsActive) break;
@@ -643,6 +722,58 @@ void VISU_TimeAnimation::run()
        myFrame = 0;
     }
   }
+
+  // make AVI file if need
+  if (isDumping && myDumpFormat.compare("AVI") == 0) {
+    double aFPS = 17.3 * mySpeed;
+
+    QFileInfo aFileInfo(myDumpPath);
+    QString aDirPath = aFileInfo.dirPath(true);
+    QString aBaseName = aFileInfo.fileName();
+
+    // add missing files
+    if (anIndexList.count() > 1) {
+      QString aFFile = aDirPath + QDir::separator() + 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).rightJustify(8, '0'));
+       QStringList aCommands;
+       for (int j = aStartIndex+1; j < anEndIndex; j++) {
+         QString aFile = aFFile.arg(QString::number(j).rightJustify(8, '0'));
+         aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+       }
+       system(aCommands.join(" ; \\\n").latin1());
+       aStartIndex = anEndIndex;
+      }
+    }
+
+    // make AVI file
+    QString aPattern = aDirPath + QDir::separator() + aBaseName;
+    aPattern += "_\%08d.jpeg";
+
+    QString aCmd = myAVIMaker;
+    aCmd += " -I p";
+    aCmd += " -v 0";
+    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 += " | yuv2lav";
+    aCmd += QString(" -o %1").arg(myDumpPath);
+    system(aCmd.latin1());
+
+    // remove temporary jpeg files
+    aCmd = "( ";
+    aCmd += QString("cd %1").arg(aDirPath);
+    aCmd += "; ls";
+    aCmd += QString(" | egrep '%1_[0-9]*.jpeg'").arg(aBaseName);
+    aCmd += " | xargs rm";
+    aCmd += " )";
+    system(aCmd.latin1());
+  }
+
   emit stopped();
   qApp->unlock();
   QThread::exit();
@@ -701,7 +832,8 @@ std::string VISU_TimeAnimation::setDumpFormat(const char* theFormat)
 {
   myDumpFormat = theFormat;
   QStrList aDumpFormats = QImageIO::outputFormats();
-  if (myDumpFormat.isEmpty() || aDumpFormats.find(theFormat) < 0) {
+  if (myDumpFormat.isEmpty() || 
+      (aDumpFormats.find(theFormat) < 0 && myDumpFormat.compare("AVI") != 0)) {
     if (aDumpFormats.find("JPEG"))
       myDumpFormat = "JPEG";
     else
@@ -710,6 +842,19 @@ std::string VISU_TimeAnimation::setDumpFormat(const char* theFormat)
   return myDumpFormat.latin1();
 }
 
+//------------------------------------------------------------------------
+bool VISU_TimeAnimation::checkAVIMaker() const
+{
+  QStrList aDumpFormats = QImageIO::outputFormats();
+  if (aDumpFormats.find("JPEG") < 0) return false;
+
+  QString aCmd("which ");
+  aCmd += myAVIMaker;
+  aCmd += " >& /dev/null";
+  int iErr = system(aCmd.latin1());
+  return (iErr == 0);
+}
+
 //************************************************************************
 int VISU_TimeAnimation::myNBAnimations = 0;
 QString VISU_TimeAnimation::GenerateName()
@@ -771,8 +916,8 @@ SALOMEDS::SObject_ptr VISU_TimeAnimation::publishInStudy()
   std::string aSComponentEntry = aSComponent->GetID();
 
   QString aComment;
-  aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
-                   VISU::TANIMATION,myMinVal,myMaxVal);
+  aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+                   VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
 
   string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","",
                                           GenerateName(),"",aComment,true);
@@ -814,8 +959,8 @@ void VISU_TimeAnimation::saveAnimation()
   std::string aSComponentEntry = aSComponent->GetID();
 
   QString aComment;
-  aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
-                   VISU::TANIMATION,myMinVal,myMaxVal);
+  aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+                   VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
 
   _PTR(GenericAttribute) anAttr;
   anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment");
@@ -881,8 +1026,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
   VISU::Storable::StrToMap(strIn,aMap);
   bool isExist;
 
-  myMinVal = VISU::Storable::FindValue(aMap,"myMinVal",&isExist).toDouble();
-  myMaxVal = VISU::Storable::FindValue(aMap,"myMaxVal",&isExist).toDouble();
+  myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble();
+  myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble();
 
   _PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
   for (anIter->Init(); anIter->More(); anIter->Next()) {
@@ -939,8 +1084,7 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
     aData.myPrs[0]->GetOffset(aData.myOffset);
     for (int i = 1; i < aData.myNbFrames; i++) {
       //jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
-      //enk 06.02.2006:aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
-      aData.myPrs[i]->SameAsParams(aData.myPrs[i-1]);//enk 06.02.2006: initializing from previous presentation
+      aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
     }
   }
   string aStr = aAnimSObject->GetID();
index 4e9360f6dc47e6ef59f36e9dee6b1caefd1c981f..438bc8d77c113ff7efdd72d5d1b331b568622d85 100644 (file)
@@ -1,6 +1,21 @@
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VISU_TimeAnimation.h
 //  Author : Vitaly SMETANNIKOV
@@ -20,7 +35,8 @@
 class SVTK_ViewWindow;
 class VISU_Actor;
 
-namespace VISU{
+namespace VISU
+{
   class Result_i;
   class ColoredPrs3d_i;
 }
@@ -34,7 +50,7 @@ struct FieldData
   std::vector<VISU::ColoredPrs3d_i*> myPrs;     // Presentations
   std::vector<VISU_Actor*> myActors;         // Actors
   std::vector<double> myTiming;              // time values
-  float myOffset[3];
+  CORBA::Float myOffset[3];
 };
 
 
@@ -66,6 +82,7 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
   SVTK_ViewWindow* getViewer() { return myView; }
   void clearView();
   void clearData(FieldData& theData);
+  void clearFieldData() { myFieldsLst.clear();};
 
   void stopAnimation();
   void startAnimation();
@@ -93,14 +110,15 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
   CORBA::Boolean isProportional() { return myProportional; }
 
   void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
-    { myMaxVal = theMax; myMinVal = theMin; }
+    { myTimeMinVal = theMin; myTimeMaxVal = theMax; }
 
-  CORBA::Double getMinRange() { return myMinVal; }
-  CORBA::Double getMaxRange() { return myMaxVal; }
-  CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
+  CORBA::Double getMinRange() { return myTimeMinVal; }
+  CORBA::Double getMaxRange() { return myTimeMaxVal; }
+  CORBA::Boolean isRangeDefined() { return !((myTimeMaxVal == 0) && (myTimeMinVal == myTimeMaxVal)); }
 
   void dumpTo(const char* thePath) { myDumpPath = thePath; }
   std::string setDumpFormat(const char* theFormat);
+  bool checkAVIMaker() const;
 
   QString getLastErrorMsg() { return myLastError; }
 
@@ -132,7 +150,7 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
 
  private slots:
    void onViewDeleted();
-   
+
  private:
   QString myLastError;
 
@@ -144,10 +162,12 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
   bool myCycling;
   _PTR(Study) myStudy;
 
-  double myMaxVal, myMinVal;
-  double myTimeMin, myTimeMax;
+  double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
+  double myTimeMin   , myTimeMax   ; //!< Range of time stams, available for animation
   QString myDumpPath;
   QString myDumpFormat;
+  QString myAVIMaker;
+  long myFileIndex;
   SVTK_ViewWindow* myView;
 
   QString myAnimEntry;
index 071ba81109455fc4f7672e11ac95d854ce3f8da3..1ab9c2549a4970939ee0140343d0d10caa6ae874 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Vectors_i.cc
@@ -31,6 +31,8 @@
 #include "VISU_VectorsPL.hxx"
 #include "VISU_Convertor.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkProperty.h>
 
 using namespace VISU;
@@ -194,6 +196,9 @@ VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)&
     anActor->SetBarVisibility(true);
     anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
     anActor->GetProperty()->SetLineWidth(GetLineWidth());
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    int  aDispMode = aResourceMgr->integerValue("VISU", "vectors_represent", 1);
+    anActor->SetRepresentation(aDispMode);
     UpdateActor(anActor);
   }catch(...){
     anActor->Delete();
index 39eb8e32fd218b462c3b26d69514391dd5f7b24b..de635e83e9ff702af844cebcdce1334a08473a92 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_PrsObject_i.hxx
index c86ac5d8cd41b7aa83fbb1c2ed9cf0794ddebd8d..29c69d215329ec00af4c72e545299389e48626fb 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_ViewManager_i.cc
@@ -257,31 +257,29 @@ namespace VISU {
   //===========================================================================
   // VISU namespace functions
   //===========================================================================
-  SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame)
+  vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow)
   {
-    return dynamic_cast<SVTK_ViewWindow*>(theStudyFrame);
-  }
-
-  vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame)
-  {
-    return GetViewWindow(theStudyFrame)->getRenderer();
+    if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(theViewWindow))
+      return vw->getRenderer();
+    return NULL;
   }
 
-  vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame)
+  vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow)
   {
-    return GetRenderer(theStudyFrame)->GetActiveCamera();
+    return GetRenderer(theViewWindow)->GetActiveCamera();
   }
 
   void RepaintView (SUIT_ViewWindow* theViewWindow)
   {
-    SVTK_ViewWindow* vf = GetViewWindow(theViewWindow);
-    vf->getRenderer()->ResetCameraClippingRange();
-    vf->getRenderWindow()->Render();
+    if (SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow)) {
+      vf->getRenderer()->ResetCameraClippingRange();
+      vf->getRenderWindow()->Render();
+    }
   }
 
-  VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs)
+  VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs)
   {
-    SVTK_ViewWindow* vf = GetViewWindow(theStudyFrame);
+    SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
     if (!vf) return NULL;
     if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
     vtkRenderer *aRen = vf->getRenderer();
@@ -306,7 +304,7 @@ namespace VISU {
       }
     }
     if (aResActor) {
-      RepaintView(theStudyFrame);
+      RepaintView(theViewWindow);
       return aResActor;
     }
     if(thePrs != NULL && theDisplaing < eErase){
@@ -321,7 +319,7 @@ namespace VISU {
        return NULL;
       }
     }
-    RepaintView(theStudyFrame);
+    RepaintView(theViewWindow);
     return anVISUActor;
   }
 
index 276271e065b5bb415c9b0a428adce72903f85498..f026c2aa6db51f130faa0c1f014d2234743a1f5a 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_ViewManager_i.hh
@@ -64,14 +64,13 @@ namespace VISU {
     SalomeApp_Application *myApplication;
   };
 
-  SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame);
-  vtkRenderer*     GetRenderer   (SUIT_ViewWindow* theStudyFrame);
-  vtkCamera*       GetCamera     (SUIT_ViewWindow* theStudyFrame);
+  vtkRenderer*     GetRenderer   (SUIT_ViewWindow* theViewWindow);
+  vtkCamera*       GetCamera     (SUIT_ViewWindow* theViewWindow);
 
-  void RepaintView (SUIT_ViewWindow* theStudyFrame);
+  void RepaintView (SUIT_ViewWindow* theViewWindow);
 
   enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
-  VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs = NULL);
+  VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs = NULL);
   void UpdatePlot2d (Plot2d_ViewFrame *theView, int theDisplaying, Curve_i* theCurve);
 
   VISU_I_EXPORT VISU_Actor* GetActor (VISU::Prs3d_i* thePrs, SVTK_ViewWindow* theViewWindow);
index d404fa0f7af26d96fc1880f3f7a620f195d432b7..22adc03a33963bc05f6e8a308afecd7541ecd312 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_View_i.cc
 #include "VISU_Gen_i.hh"
 #include "VISU_Prs3d_i.hh"
 #include "VISU_Table_i.hh"
+#include "VISU_ScalarMap_i.hh"
 #include "VISU_ViewManager_i.hh"
 
 #include "VisuGUI_TableDlg.h"
 
 #include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
 
 #include "SALOME_Event.hxx"
 
@@ -1520,7 +1522,7 @@ namespace VISU {
       }else{
        if(SUIT_ViewManager* aViewManager = myApplication->activeViewManager()){
          if(SUIT_ViewWindow* aView = aViewManager->getActiveView()){
-           if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aView)){
+           if(dynamic_cast<SVTK_ViewWindow*>(aView)){
              myView3D->myViewManager = aViewManager;
              myResult = aViewManager->getActiveView();
            }
@@ -1557,7 +1559,7 @@ namespace VISU {
       {}
       virtual void Execute()
       {
-       SVTK_ViewWindow* vf = VISU::GetViewWindow(myVW);
+       SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(myVW);
        vtkRenderer* Renderer = vf->getRenderer();
        vtkActorCollection* theActors = Renderer->GetActors();
        theActors->InitTraversal();
@@ -1759,7 +1761,7 @@ namespace VISU {
   {
     Storable::DataToStream(theStr,"myType",VISU::TVIEW3D);
 
-    float backint[3];
+    vtkFloatingPointType backint[3];
     GetRenderer(theViewWindow)->GetBackground(backint);
     Storable::DataToStream(theStr,"myColor.R",backint[0]);
     Storable::DataToStream(theStr,"myColor.G",backint[1]);
@@ -1786,7 +1788,7 @@ namespace VISU {
     Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theViewWindow));
 
     double aScaleFactor[3];
-    VISU::GetViewWindow(theViewWindow)->GetScale(aScaleFactor);
+    (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->GetScale(aScaleFactor);
     Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]);
     Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]);
     Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]);
@@ -1841,13 +1843,13 @@ namespace VISU {
     aColor[1] = int(255.0*theColor.G);
     aColor[2] = int(255.0*theColor.B);
     QColor aNewColor (aColor[0],aColor[1],aColor[2]);
-    VISU::GetViewWindow(theViewWindow)->setBackgroundColor(aNewColor);
+    (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->setBackgroundColor(aNewColor);
   }
 
   SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow)
   {
     SALOMEDS::Color aColor;
-    float backint[3];
+    vtkFloatingPointType backint[3];
     GetRenderer(theViewWindow)->GetBackground(backint);
     aColor.R = backint[0];  aColor.G = backint[1];  aColor.B = backint[2];
     return aColor;
@@ -1922,7 +1924,7 @@ namespace VISU {
     SUIT_ViewWindow* aVW = GetViewWindow();
     if (aVW) {
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFitAll));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFitAll));
       Update();
     }
   }
@@ -1936,27 +1938,27 @@ namespace VISU {
     switch (theType) {
     case VISU::View3D::FRONT :
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFrontView));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFrontView));
       break;
     case VISU::View3D::BACK :
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onBackView));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onBackView));
       break;
     case VISU::View3D::LEFT :
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onLeftView));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onLeftView));
       break;
     case VISU::View3D::RIGHT :
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onRightView));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onRightView));
       break;
     case VISU::View3D::TOP :
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onTopView));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onTopView));
       break;
     case VISU::View3D::BOTTOM :
       ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
-                      (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onBottomView));
+                      (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onBottomView));
       break;
     }
     Update();
@@ -2126,7 +2128,7 @@ namespace VISU {
   void View3D_i::ScaleView (SUIT_ViewWindow* theViewWindow,
                            VISU::View3D::Axis theAxis, CORBA::Double theParam)
   {
-    SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theViewWindow);
+    SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
     double aScaleFactor[3];
     aViewWindow->GetScale(aScaleFactor);
     aScaleFactor[theAxis] = theParam;
@@ -2136,7 +2138,7 @@ namespace VISU {
   void SetScaleView (SUIT_ViewWindow* theViewWindow, const CORBA::Double theScale[3])
   {
     double aScale[3] = {theScale[0], theScale[1], theScale[2]};
-    VISU::GetViewWindow(theViewWindow)->SetScale(aScale);
+    (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->SetScale(aScale);
   }
 
   void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam)
@@ -2145,7 +2147,7 @@ namespace VISU {
     SUIT_ViewWindow* aVW = GetViewWindow();
     if (aVW) {
       double aScale[3];
-      VISU::GetViewWindow(aVW)->GetScale(aScale);
+      (dynamic_cast<SVTK_ViewWindow*>(aVW))->GetScale(aScale);
       aScale[theAxis] = theParam;
       ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
     }
@@ -2160,4 +2162,316 @@ namespace VISU {
       ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
     }
   }
+
+  //================================================
+  // Certain presentation view parameters management
+  //================================================
+  class TPrsManageEvent: public SALOME_Event
+  {
+  protected:
+    View3D_i* myView3D;
+    ScalarMap_ptr myPrs;
+    string myError;
+
+    TPrsManageEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+      myView3D(theView3D),
+      myPrs(ScalarMap::_duplicate(thePrs)),
+      myError("Unknown error occured")
+    {}
+    VISU_Actor* GetMyActor()
+    {
+      SUIT_ViewWindow* aVW = myView3D->GetViewWindow();
+      SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aVW);
+      if (!aVW) {
+       myError = "Corrupted view window";
+      } else {
+       ScalarMap_i* aPrs = dynamic_cast<ScalarMap_i*>(VISU::GetServant(myPrs).in());
+       if (!aPrs) {
+         myError = "Corrupted presentation";
+       } else {
+         VISU_Actor* anActor = VISU::GetActor(aPrs, vw);
+         if (!anActor) {
+           myError = "No actor found. Display the presentation at first.";
+         } else {
+           myError = "";
+           return anActor;
+         }
+       }
+      }
+      return NULL;
+    }
+  };
+
+  // Get
+  class TGetPrsTypeEvent: public TPrsManageEvent {
+  public:
+    typedef VISU::PresentationType TResult;
+    TResult myResult;
+    TGetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+      TPrsManageEvent(theView3D, thePrs), myResult(VISU::SHRINK) {}
+    virtual void Execute() {
+      if (VISU_Actor* anActor = GetMyActor())
+       myResult = (VISU::PresentationType)anActor->GetRepresentation();
+    }
+  };
+
+  class TGetShrinkedEvent: public TPrsManageEvent {
+  public:
+    typedef bool TResult;
+    TResult myResult;
+    TGetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+      TPrsManageEvent(theView3D, thePrs), myResult(false) {}
+    virtual void Execute() {
+      if (VISU_Actor* anActor = GetMyActor()) {
+       if (anActor->IsShrunkable())
+         myResult = anActor->IsShrunk();
+       else
+         myResult = false;
+      }
+    }
+  };
+
+  class TGetShadedEvent: public TPrsManageEvent {
+  public:
+    typedef bool TResult;
+    TResult myResult;
+    TGetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+      TPrsManageEvent(theView3D, thePrs), myResult(false) {}
+    virtual void Execute() {
+      if (VISU_Actor* anActor = GetMyActor())
+       if (VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor))
+         myResult = aScalarMapActor->IsShading();
+    }
+  };
+
+  class TGetOpacityEvent: public TPrsManageEvent {
+  public:
+    typedef double TResult;
+    TResult myResult;
+    TGetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+      TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {}
+    virtual void Execute() {
+      if (VISU_Actor* anActor = GetMyActor()) {
+       vtkFloatingPointType oldvalue = anActor->GetOpacity();
+       myResult = (double)oldvalue;
+      }
+    }
+  };
+
+  class TGetLineWidthEvent: public TPrsManageEvent {
+  public:
+    typedef double TResult;
+    TResult myResult;
+    TGetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
+      TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {}
+    virtual void Execute() {
+      if (VISU_Actor* anActor = GetMyActor()) {
+       vtkFloatingPointType oldvalue = anActor->GetLineWidth();
+       myResult = (double)oldvalue;
+      }
+    }
+  };
+
+  // Set
+  class TSetPrsTypeEvent: public TPrsManageEvent {
+  private:
+    PresentationType myPrsType;
+  public:
+    typedef string TResult;
+    TResult myResult;
+    TSetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, PresentationType thePrsType):
+      TPrsManageEvent(theView3D, thePrs), myPrsType(thePrsType),
+      myResult("Unknown error occured")
+    {}
+    virtual void Execute() {
+      switch (myPrsType) {
+      case VISU::INSIDEFRAME:
+       {
+         VISU::VISUType aType = myPrs->GetType();
+         if (aType != VISU::TSCALARMAP &&
+             aType != VISU::TDEFORMEDSHAPE &&
+             aType != VISU::TSCALARMAPONDEFORMEDSHAPE) {
+           myResult = "Insideframe representation is not available for this type of presentations.";
+           return;
+         }
+       }
+       break;
+      case VISU::SURFACEFRAME:
+       myResult = "Surfaceframe representation is available only for mesh presentation.";
+       return;
+      case VISU::SHRINK:
+       myResult = "Use SetShrinked() method to shrink/unshrink presentation.";
+       return;
+      default:
+       break;
+      }
+      if (VISU_Actor* anActor = GetMyActor()) {
+       anActor->SetRepresentation((int)myPrsType);
+       SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+       vw->Repaint();
+       myResult = "";
+      } else {
+       myResult = myError;
+      }
+    }
+  };
+
+  class TSetShrinkedEvent: public TPrsManageEvent {
+  private:
+    bool myIsOn;
+  public:
+    typedef string TResult;
+    TResult myResult;
+    TSetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn):
+      TPrsManageEvent(theView3D, thePrs), myIsOn(isOn),
+      myResult("Unknown error occured")
+    {}
+    virtual void Execute() {
+      VISU::VISUType aType = myPrs->GetType();
+      if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) {
+       myResult = "Shrinked representation is not available for this type of presentations.";
+      } else {
+       if (VISU_Actor* anActor = GetMyActor()) {
+         if (anActor->IsShrunkable()) {
+           if (myIsOn) anActor->SetShrink();
+           else        anActor->UnShrink();
+           SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+           vw->Repaint();
+           myResult = "";
+         } else {
+           myResult = "This presentation is not shrunkable.";
+         }
+       } else {
+         myResult = myError;
+       }
+      }
+    }
+  };
+
+  class TSetShadedEvent: public TPrsManageEvent {
+  private:
+    bool myIsOn;
+  public:
+    typedef string TResult;
+    TResult myResult;
+    TSetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn):
+      TPrsManageEvent(theView3D, thePrs), myIsOn(isOn),
+      myResult("Unknown error occured")
+    {}
+    virtual void Execute() {
+      if (VISU_Actor* anActor = GetMyActor()) {
+       if (VISU_ScalarMapAct* aScalarMapActor =
+           dynamic_cast<VISU_ScalarMapAct*>(anActor)) {
+         aScalarMapActor->SetShading(myIsOn);
+         SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+         vw->Repaint();
+         myResult = "";
+       } else {
+         myResult = "Corrupted actor";
+       }
+      } else {
+       myResult = myError;
+      }
+    }
+  };
+
+  class TSetOpacityEvent: public TPrsManageEvent {
+  private:
+    double myOpacity;
+  public:
+    typedef string TResult;
+    TResult myResult;
+    TSetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theOpacity):
+      TPrsManageEvent(theView3D, thePrs), myOpacity(theOpacity),
+      myResult("Unknown error occured")
+    {}
+    virtual void Execute() {
+      VISU::VISUType aType = myPrs->GetType();
+      if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) {
+       myResult = "Opacity is meaningless for this type of presentations.";
+       return;
+      }
+      if (VISU_Actor* anActor = GetMyActor()) {
+       anActor->SetOpacity((vtkFloatingPointType)myOpacity);
+       SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+       vw->Repaint();
+       myResult = "";
+      } else {
+       myResult = myError;
+      }
+    }
+  };
+
+  class TSetLineWidthEvent: public TPrsManageEvent {
+  private:
+    double myLineWidth;
+  public:
+    typedef string TResult;
+    TResult myResult;
+    TSetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theLineWidth):
+      TPrsManageEvent(theView3D, thePrs), myLineWidth(theLineWidth),
+      myResult("Unknown error occured")
+    {}
+    virtual void Execute() {
+      if (myPrs->GetType() == VISU::TVECTORS) {
+       myResult = "Line Width is meaningless for Vectors presentation.";
+       return;
+      }
+      if (VISU_Actor* anActor = GetMyActor()) {
+       anActor->SetLineWidth((vtkFloatingPointType)myLineWidth);
+       SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
+       vw->Repaint();
+       myResult = "";
+      } else {
+       myResult = myError;
+      }
+    }
+  };
+
+  PresentationType View3D_i::GetPresentationType(ScalarMap_ptr thePrs)
+  {
+    return ProcessEvent(new TGetPrsTypeEvent(this,thePrs));
+  }
+  CORBA::Boolean View3D_i::IsShrinked(ScalarMap_ptr thePrs)
+  {
+    return ProcessEvent(new TGetShrinkedEvent(this,thePrs));
+  }
+  CORBA::Boolean View3D_i::IsShaded(ScalarMap_ptr thePrs)
+  {
+    return ProcessEvent(new TGetShadedEvent(this,thePrs));
+  }
+  CORBA::Double View3D_i::GetOpacity(ScalarMap_ptr thePrs)
+  {
+    return ProcessEvent(new TGetOpacityEvent(this,thePrs));
+  }
+  CORBA::Double View3D_i::GetLineWidth(ScalarMap_ptr thePrs)
+  {
+    return ProcessEvent(new TGetLineWidthEvent(this,thePrs));
+  }
+
+  char* View3D_i::SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType)
+  {
+    string aRet = ProcessEvent(new TSetPrsTypeEvent(this,thePrs,thePrsType));
+    return CORBA::string_dup(aRet.c_str());
+  }
+  char* View3D_i::SetShrinked(ScalarMap_ptr thePrs, CORBA::Boolean isShrinked)
+  {
+    string aRet = ProcessEvent(new TSetShrinkedEvent(this,thePrs,isShrinked));
+    return CORBA::string_dup(aRet.c_str());
+  }
+  char* View3D_i::SetShaded(ScalarMap_ptr thePrs, CORBA::Boolean isShaded)
+  {
+    string aRet = ProcessEvent(new TSetShadedEvent(this,thePrs,isShaded));
+    return CORBA::string_dup(aRet.c_str());
+  }
+  char* View3D_i::SetOpacity(ScalarMap_ptr thePrs, CORBA::Double theOpacity)
+  {
+    string aRet = ProcessEvent(new TSetOpacityEvent(this,thePrs,theOpacity));
+    return CORBA::string_dup(aRet.c_str());
+  }
+  char* View3D_i::SetLineWidth(ScalarMap_ptr thePrs, CORBA::Double theLineWidth)
+  {
+    string aRet = ProcessEvent(new TSetLineWidthEvent(this,thePrs,theLineWidth));
+    return CORBA::string_dup(aRet.c_str());
+  }
 }
index 17f199187041d25919ea3e2c106e9aed40108c74..c0c4e5058bc22121afc0d09b750d805e4bd3f199 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_View_i.hh
@@ -292,6 +292,19 @@ namespace VISU
 
     virtual void Close();
 
+    // Certain presentation view parameters management
+    virtual PresentationType GetPresentationType(ScalarMap_ptr thePrs);
+    virtual CORBA::Boolean   IsShrinked         (ScalarMap_ptr thePrs);
+    virtual CORBA::Boolean   IsShaded           (ScalarMap_ptr thePrs);
+    virtual CORBA::Double    GetOpacity         (ScalarMap_ptr thePrs);
+    virtual CORBA::Double    GetLineWidth       (ScalarMap_ptr thePrs);
+
+    virtual char* SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType);
+    virtual char* SetShrinked        (ScalarMap_ptr thePrs, CORBA::Boolean   isShrinked);
+    virtual char* SetShaded          (ScalarMap_ptr thePrs, CORBA::Boolean   isShaded);
+    virtual char* SetOpacity         (ScalarMap_ptr thePrs, CORBA::Double    theOpacity);
+    virtual char* SetLineWidth       (ScalarMap_ptr thePrs, CORBA::Double    theLineWidth);
+
   protected:
     static int myNbViewParams;
 
index 93d34b31e95746a29069fcde1a1e5ced7a66586c..384afc383f54e920675a51cf882dd8d769327a01 100644 (file)
 #  License along with this library; if not, write to the Free Software 
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 # 
-#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
-#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Module : VISU
-#  $Header$
 
 top_srcdir=@top_srcdir@
 top_builddir=../..
@@ -45,14 +43,20 @@ EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py bat
        visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \
        visu_table.py visu_big_table.py visu_view.py visu_delete.py \
        visu_swig_test.py test_events.py batch_test_events.py visu_split_views.py \
-       VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py VISU_Example_05.py VISU_Example_06.py
+       VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py \
+       VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py
 EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
 
 LIB_CLIENT_IDL =
 
-CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
-       $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
-       -I${MED_ROOT_DIR}/include/salome \
+CPPFLAGS += -ftemplate-depth-32 \
+       $(PYTHON_INCLUDES) \
+       $(HDF5_INCLUDES) \
+       $(QT_INCLUDES) \
+       $(VTK_INCLUDES) \
+       $(KERNEL_CXXFLAGS) \
+       $(GUI_CXXFLAGS) \
+       $(MED_CXXFLAGS) \
        $(BOOST_CPPFLAGS)
 
 LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine
index d8c19b65f00c0ba10e3fa9f71e2a975b7c2d34f9..04d1f8d5fb07fece6d23c079004ecf113ff96a93 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 # T 2.23, 28: Displaying fields (scalar and vectorial) on nodes, change presentation options.
 # Uses MED files ResOK_0000.med and Fields_group3D.med
 # 
@@ -80,6 +99,13 @@ cutplanes.SetNbPlanes(30)
 cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
 myView.DisplayOnly(cutplanes)
 
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+if scalarmapondefshape is None : print "Error"
+else : print "OK"
+scalarmapondefshape.SetScalarField(myMeshName,'pression',2,myCellEntity);
+myView.DisplayOnly(scalarmapondefshape)
+
 #%====================Stage4: Opening a new study and Med file import====================%
 
 # Opening a new study tempoparily commented due to a problem
@@ -131,6 +157,11 @@ else : print "OK"
 cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
 myView1.DisplayOnly(cutplanes1)
 
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+if scalarmapondefshape1 is None : print "Error"
+else : print "OK"
+myView1.DisplayOnly(scalarmapondefshape1)
 #%====================Stage6: Object browser popup====================%
 
 print "**** Stage6: Object browser popup"
index 38f2b6b6099ac26e04f76c6d81661222227bbe08..a65f4e509d7897ff04380a76302d045059874ab9 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 # T 2.24: Save/retrieve view parameters.
 # Uses MED file fra.med from ${DATA_DIR}/MedFiles directory.
 # 
index dfa066ccf838f46f1e882ac323e6a093286f212d..d8500beec3c216cf7e67fd32d2f93712b0af20f4 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 # Animation of "vitesse" field, stored in file TimeStamps.med
 # 
 # This script is equivalent to non-regression test script 003/A5
index 9ae4d1101401999828c4199f503477bdede62929..0d4d0551a610efa9cbff1ce2427b245d859cb471 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 # Show some results presentations in different 3D and 2D viewers
 # with different options (view parameters and display modes).
 # Uses MED files fra.med and TimeStamps.med from ${DATA_DIR}/MedFiles directory.
@@ -236,7 +255,7 @@ myResult = myVisu.ImportFile(medFile)
 anAnim = myVisu.CreateAnimation(myView);
 aSObj = myStudy.FindObjectIOR(myResult.GetID())
 aSObj = aSObj.FindSubObject(1)[1]
-aSObj = aSObj.FindSubObject(2)[1]
+aSObj = aSObj.FindSubObject(3)[1]
 aSObj = aSObj.FindSubObject(2)[1]
 anAnim.addField(aSObj)
 anAnim.setPresentationType(0,VISU.TISOSURFACE)
index a70943e40a2fe5d2874f81215bf394608ebb887c..26046ed90c5b3a1bb7902aeb171428383132874c 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 # Create a table and show it in Plot2d viewer
 # 
 # This script is equivalent to script VISU_SWIG/visu_big_table.py
index 622b6cb4621d6b21274b70268062f3430c3ea234..044000f6905e583979e3e5badfaaaec7201975f4 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 # Import a table from file and show it in Plot2d viewer
 
 import salome
index ddad586a1833a5bfcdb3421275d6f1b47cf6f82a..0f79ad0b790fcafcb919fc867320d0d254790c95 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Gen_s.cc
index ecb0c3d09d323d6172443985630ad81c49492044..01c167077ceeb26f2035870601f1286b937b1be2 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Gen_s.hh
index afd4231fc3f3c1fd8e2038b9e4e7b852c2febfde..f802f0ac43b9e45ffa196e53c6986ff7d810475e 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 """
 
 """
index df7f3c3ce95b2a2ef873e16c5872f9f784e327d1..804aaee130af59c85b0c43fc7b221aedd24f7dbd 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 ###############################################################
 #
 # File        : batch_test_events.py
index 559a3eb448664431ec4703ac1f9fd93433138526..62223534af84eed390d69436468e64c3b365085a 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 #
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : batchmode_visu.py
 #  Module : VISU
index aca745d10364d6c404dd722cf2b674afac6c4b9b..b1d23d916d269146cd876ffac5762f6f98fd61bf 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu_big_table.py
 #  Author : Vadim SANDLER
index 4bc74a8ba9cfe3b8587e5f7407597fbfae5aff0b..3c0f4249f761783176741ebdcf7234c519fb0a43 100644 (file)
@@ -1,13 +1,27 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : test_table.py
 #  Author : Alexey Petrov
 #  Module : VISU
-#  $Header: 
 
 from VISU import *
 from batchmode_visu_table import *
index f51543552419a4b48e9657aa1dcd626a10ba87ae..a08a91b0349ae750e28cb47cf21ad014f7f50183 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : batchmode_visu_view3d.py
 #  Module : VISU
@@ -246,7 +261,7 @@ myResult = myVisu.ImportFile(medFile)
 anAnim = myVisu.CreateAnimation(myView);
 aSObj = myStudy.FindObjectIOR(myResult.GetID())
 aSObj = aSObj.FindSubObject(1)[1]
-aSObj = aSObj.FindSubObject(2)[1]
+aSObj = aSObj.FindSubObject(3)[1]
 aSObj = aSObj.FindSubObject(2)[1]
 anAnim.addField(aSObj)
 anAnim.setPresentationType(0,VISU.TISOSURFACE)
index 1f9a4de79a811b50957e926adf6ca86cfca54857..280bb30d02d63e97c1224fda00fc3c7820a29056 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index df53a3e87ab16585a4220d6041cbe74d1938bbc2..385466fdb11156e2d64e6f7751b0a9177e99891c 100755 (executable)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 ###############################################################
 #
 # File        : test_events.py
index daadf7aa4f935a60d91c2587847a18132f5e3518..2d8b23bbeb046ed1ae561bab900b822aac6981fe 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu.py
 #  Module : VISU
@@ -81,6 +96,12 @@ def PublishComponent(theStudyDocument):
         pass
     
     return aSComponent;
+
+def SetName(theObj, theName):
+    anIOR  = myORB.object_to_string(theObj)
+    aSObj  = myLocalStudy.FindObjectIOR(anIOR)
+    anAttr = aSObj.FindAttribute("AttributeName")[1]
+    anAttr.SetValue(theName)
         
 def StrToMap(theString) :
     aPairList = split(theString,";")
@@ -339,7 +360,9 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
         while aFolderIter.More() :
             aFolderSObj = aFolderIter.Value()
             aFolderIter.Next()
-            anAttr = aFolderSObj.FindAttribute("AttributeName")[1]
+            anIsFound, anAttr = aFolderSObj.FindAttribute("AttributeName")
+            if not anIsFound :
+                continue
             anAttr = anAttr._narrow(SALOMEDS.AttributeName);
             aFolderName = anAttr.Value()
             print "    ", aFolderName
@@ -602,6 +625,23 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                             aPrsObj.RemoveFromStudy()
                                         else :
                                             aVISUObjList.append(aPrsObj)
+
+                                if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
+                                    print "          Creating ScalarMapOnDeformedShapeOnField",
+                                    aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+                                    if aPrsObj is None : print "Error"
+                                    else :
+                                        print ",OK"
+                                        theView.DisplayOnly(aPrsObj)
+                                        theView.FitAll()
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        if theIsAutoDelete :
+                                            aPrsObj.RemoveFromStudy()
+                                        else :
+                                            aVISUObjList.append(aPrsObj)
+                                
     return aVISUObjList
 
 
index fb90b2d627b8ceaa2ddab99f255ba00a55911ca6..401c5ffe347f994d5214d250bd61f2d5fb0c9dcd 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu_big_table.py
 #  Author : Vadim SANDLER
index d001d60184e3b12841c96c49573bdb594663b3f1..88514870060181aec3e1472b2c1025b8316bb49d 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 import VISU
 import SALOMEDS
 from visu_gui import *
index d21a239f4581529476650735428c6eaad97fe867..b5798331448e4dcf6a770552638f9523a85738f2 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu_gui.py
 #  Module : VISU
index 04715e52164ed55da9a5aeaa58bd6b54890e0ce2..2a7c7f9dee19afab916be7ceec1df792a967fd67 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu_med.py
 #  Module : VISU
@@ -13,8 +28,9 @@ import SALOMEDS
 import SALOME_MED
 import VISU
 
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
+if salome.hasDesktop():
+    from libSALOME_Swig import *
+    sg = SALOMEGUI_Swig()
 
 def getMedObjectFromStudy():
     mySO = salome.myStudy.FindObject("Objet MED")
@@ -47,7 +63,8 @@ medDir = os.getenv('DATA_DIR') + '/MedFiles/'
 def importMedFrom(medDir,medFile):
     medFile = medDir + medFile
     med_comp.readStructFileWithFieldType(medFile,salome.myStudyName)
-    sg.updateObjBrowser(1)
+    if salome.hasDesktop():
+        sg.updateObjBrowser(1)
   
 def importMed(medFile):
     importMedFrom(medDir,medFile)
index 1453c5adf02495d8c522d1cf681d691160ddf634..72ab668dde314a5eaa7dcfd2a98ea96bda48ff4a 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu_prs_exam.py
 #  Module : VISU
@@ -15,9 +30,9 @@ import SALOME
 import SALOME_MED
 import VISU
 
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
-
+if salome.hasDesktop():
+    from libSALOME_Swig import *
+    sg = SALOMEGUI_Swig()
 import visu_gui
 myVisu = visu_gui.myVisu
 
@@ -57,8 +72,8 @@ try:
            aScalarMap2 = myVisu.ScalarMapOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
            if(myField.getNumberOfComponents() > 1) :
              aCutPlanes = myVisu.CutPlanesOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
-
-           sg.updateObjBrowser(0)
+           if salome.hasDesktop():  
+               sg.updateObjBrowser(0)
        else :  print "We have no permission to rewrite medFile, so readStructFileWithFieldType can't open this file";
     else :  print  "We have no permission to read medFile, it will not be opened"; 
 except:
index 545ed7a3425bfc46f04df449dc3e73071a7ee9e5..887f885bd5343f382d5982eec29901fb4b3df150 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 import VISU
 import SALOMEDS
index 411e532e1ee50efc46fde37f884c8c63ce2a708c..2eb4a9dbb7f3b20ce988262544d0d395446cfe89 100644 (file)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 from libVISU_Swig import *
 medFile = os.getenv('DATA_DIR') + '/MedFiles/fra.med'
 myCon=Convertor(medFile)
index 780e698c04bd26c779193e0ff325abc4d8ffecd3..ab2c8724dc5e4665af5d033aba5cbf3107d69801 100644 (file)
@@ -1,8 +1,23 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : visu_table.py
 #  Author : Vadim SANDLER
index d301e592614cef59045829a07a9cc621a6b34a93..bc099d12e9d2b1126e4c9f0d87354ece87bb3e62 100644 (file)
@@ -1,13 +1,27 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#
-#
-#  File   : test_table.py
+#  File   : visu_view.py
 #  Author : Alexey Petrov
 #  Module : VISU
-#  $Header: 
 
 import SALOMEDS
 import VISU
index d1bf0721b70f110c225c02e0c58b47da5cfbc9e4..8d1c94a003771349d3c3b125a09623f3da6b83fe 100644 (file)
@@ -1,10 +1,25 @@
 #  VISU VISU_SWIG : binding of C++ implementation and Python
 #
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#
-#
-#  File   : batchmode_visu_view3d.py
+#  File   : visu_view3d.py
 #  Module : VISU
 
 import os
@@ -253,7 +268,7 @@ myResult = myVisu.ImportFile(medFile)
 anAnim = myVisu.CreateAnimation(myView);
 aSObj = myStudy.FindObjectIOR(myResult.GetID())
 aSObj = aSObj.FindSubObject(1)[1]
-aSObj = aSObj.FindSubObject(2)[1]
+aSObj = aSObj.FindSubObject(3)[1]
 aSObj = aSObj.FindSubObject(2)[1]
 anAnim.addField(aSObj)
 anAnim.setPresentationType(0,VISU.TISOSURFACE)
index 66b48653a131c88c9f337b424085efa3350d2cd5..9032e4d0907523a2927395cf87026aa042458b1e 100755 (executable)
@@ -1,3 +1,22 @@
+#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 #  File   : Makefile.in
 #  Author : Alexander Solovyov(OCN)
 #  Module : VVTK
@@ -63,16 +82,16 @@ CPPFLAGS += \
        $(OCC_INCLUDES) \
        $(VTK_INCLUDES) \
        $(BOOST_CPPFLAGS) \
-       -I$(KERNEL_ROOT_DIR)/include/salome \
-       -I$(GUI_ROOT_DIR)/include/salome \
-       -I${MED_ROOT_DIR}/include/salome
+       $(KERNEL_CXXFLAGS) \
+       $(GUI_CXXFLAGS) \
+       $(MED_CXXFLAGS)
 
 LDFLAGS += \
        $(QT_MT_LIBS) \
        $(OCC_LIBS) \
        $(VTK_LIBS) \
-       -L$(KERNEL_ROOT_DIR)/lib/salome \
-       -L$(GUI_ROOT_DIR)/lib/salome
+       $(KERNEL_LDFLAGS) \
+       $(GUI_LDFLAGS)
 
 LIBS+= -lsuit -lCAM -lSalomeObject -lSVTK -lOpUtil
 
index e8b032f12d13ee0d4ce0cf50cb64c6867f19507e..5954601c8c6165c58dafbb5e53de485d51e14b9b 100755 (executable)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifdef WNT
 #ifdef VISU_VVTK_EXPORTS
 #define VVTK_EXPORT __declspec(dllexport)
index 9d04759878202e582e0d658e41de7e7b9b80376d..b91a4aa7775ea14748c0de3309c07d4a438589bb 100755 (executable)
-//  SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-//  This library is free software; you can redistribute it and/or \r
-//  modify it under the terms of the GNU Lesser General Public \r
-//  License as published by the Free Software Foundation; either \r
-//  version 2.1 of the License. \r
-// \r
-//  This library is distributed in the hope that it will be useful, \r
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU \r
-//  Lesser General Public License for more details. \r
-// \r
-//  You should have received a copy of the GNU Lesser General Public \r
-//  License along with this library; if not, write to the Free Software \r
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA \r
-// \r
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-//  File   :\r
-//  Author :\r
-//  Module :\r
-//  $Header$\r
-\r
-#include "VVTK_ImageWriter.h"\r
-\r
-#include <qsemaphore.h>\r
-\r
-#include <vtkImageData.h>\r
-#include <vtkImageClip.h>\r
-#include <vtkJPEGWriter.h>\r
-#include <vtkSmartPointer.h>\r
-\r
-#ifdef _DEBUG_\r
-static int MYDEBUG = 0;\r
-#else\r
-static int MYDEBUG = 0;\r
-#endif\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriter\r
-::VVTK_ImageWriter(QSemaphore* theSemaphore,\r
-                  vtkImageData* theImageData,\r
-                  const std::string& theName,\r
-                  int theProgressive,\r
-                  int theQuality):\r
-  mySemaphore(theSemaphore),\r
-  myImageData(theImageData),\r
-  myName(theName),\r
-  myProgressive(theProgressive),\r
-  myQuality(theQuality),\r
-  myConstraint16Flag(true)\r
-{}\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriter\r
-::~VVTK_ImageWriter()\r
-{\r
-  if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this<<endl;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_ImageWriter\r
-::run()\r
-{\r
-  vtkJPEGWriter *aWriter = vtkJPEGWriter::New();\r
-  vtkImageData *anImageData = myImageData;\r
-  vtkSmartPointer<vtkImageClip> anImageClip;\r
-  //\r
-  if(myConstraint16Flag){ \r
-    int uExtent[6];\r
-    myImageData->GetUpdateExtent(uExtent);\r
-    unsigned int width = uExtent[1] - uExtent[0] + 1;\r
-    unsigned int height = uExtent[3] - uExtent[2] + 1;\r
-    width = (width / 16) * 16;\r
-    height= (height / 16) * 16;\r
-    uExtent[1] = uExtent[0] + width - 1;\r
-    uExtent[3] = uExtent[2] + height - 1;\r
-    //\r
-    anImageClip = vtkImageClip::New();\r
-    anImageClip->Delete();\r
-\r
-    anImageClip->SetInput(myImageData);\r
-    anImageClip->SetOutputWholeExtent(uExtent);\r
-    anImageClip->ClipDataOn();\r
-    anImageData = anImageClip->GetOutput();\r
-  }\r
-  //\r
-  aWriter->WriteToMemoryOff();\r
-  aWriter->SetFileName(myName.c_str());\r
-  aWriter->SetQuality(myQuality);\r
-  aWriter->SetProgressive(myProgressive);\r
-  aWriter->SetInput(anImageData);\r
-  aWriter->Write();\r
-\r
-  aWriter->Delete();\r
-  myImageData->Delete();\r
-\r
-  if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<\r
-               "- this = "<<this<<\r
-               "; total = "<<mySemaphore->total()<<\r
-               "; available = "<<mySemaphore->available()<<endl;\r
-  *mySemaphore -= 1;\r
-}\r
-\r
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   :
+//  Author :
+//  Module :
+//  $Header$
+
+#include "VVTK_ImageWriter.h"
+
+#include <qsemaphore.h>
+
+#include <vtkImageData.h>
+#include <vtkImageClip.h>
+#include <vtkJPEGWriter.h>
+#include <vtkSmartPointer.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriter
+::VVTK_ImageWriter(QSemaphore* theSemaphore,
+                  vtkImageData* theImageData,
+                  const std::string& theName,
+                  int theProgressive,
+                  int theQuality):
+  mySemaphore(theSemaphore),
+  myImageData(theImageData),
+  myName(theName),
+  myProgressive(theProgressive),
+  myQuality(theQuality),
+  myConstraint16Flag(true)
+{}
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriter
+::~VVTK_ImageWriter()
+{
+  if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this<<endl;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ImageWriter
+::run()
+{
+  vtkJPEGWriter *aWriter = vtkJPEGWriter::New();
+  vtkImageData *anImageData = myImageData;
+  vtkSmartPointer<vtkImageClip> anImageClip;
+  //
+  if(myConstraint16Flag){ 
+    int uExtent[6];
+    myImageData->GetUpdateExtent(uExtent);
+    unsigned int width = uExtent[1] - uExtent[0] + 1;
+    unsigned int height = uExtent[3] - uExtent[2] + 1;
+    width = (width / 16) * 16;
+    height= (height / 16) * 16;
+    uExtent[1] = uExtent[0] + width - 1;
+    uExtent[3] = uExtent[2] + height - 1;
+    //
+    anImageClip = vtkImageClip::New();
+    anImageClip->Delete();
+
+    anImageClip->SetInput(myImageData);
+    anImageClip->SetOutputWholeExtent(uExtent);
+    anImageClip->ClipDataOn();
+    anImageData = anImageClip->GetOutput();
+  }
+  //
+  aWriter->WriteToMemoryOff();
+  aWriter->SetFileName(myName.c_str());
+  aWriter->SetQuality(myQuality);
+  aWriter->SetProgressive(myProgressive);
+  aWriter->SetInput(anImageData);
+  aWriter->Write();
+
+  aWriter->Delete();
+  myImageData->Delete();
+
+  if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<
+               "- this = "<<this<<
+               "; total = "<<mySemaphore->total()<<
+               "; available = "<<mySemaphore->available()<<endl;
+  *mySemaphore -= 1;
+}
+
index 341fc0de2c6dd16943a79dd319a19ae87cf039e1..61e7579ad845a94b889e925a7865b4c6077d37ab 100755 (executable)
@@ -1,64 +1,64 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-//  This library is free software; you can redistribute it and/or \r
-//  modify it under the terms of the GNU Lesser General Public \r
-//  License as published by the Free Software Foundation; either \r
-//  version 2.1 of the License. \r
-// \r
-//  This library is distributed in the hope that it will be useful, \r
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU \r
-//  Lesser General Public License for more details. \r
-// \r
-//  You should have received a copy of the GNU Lesser General Public \r
-//  License along with this library; if not, write to the Free Software \r
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA \r
-// \r
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-//  File   :\r
-//  Author :\r
-//  Module :\r
-//  $Header$\r
-\r
-\r
-#ifndef _VVTK_ImageWriter_Header_File_\r
-#define _VVTK_ImageWriter_Header_File_\r
-\r
-#include <qthread.h>\r
-#include <string>\r
-\r
-class vtkImageData;\r
-class QSemaphore;\r
-\r
-\r
-class VVTK_ImageWriter : public QThread \r
-{\r
-public:\r
-  VVTK_ImageWriter(QSemaphore* theSemaphore,\r
-                  vtkImageData* theImageData,\r
-                  const std::string& theName,\r
-                  int theProgressive,\r
-                  int theQuality);\r
-\r
-  ~VVTK_ImageWriter();\r
-\r
- protected:\r
-  virtual\r
-  void\r
-  run();\r
-  \r
- protected:\r
-  QSemaphore* mySemaphore;\r
-  vtkImageData *myImageData;\r
-  std::string myName;\r
-  int   myProgressive;\r
-  int   myQuality;\r
-  bool  myConstraint16Flag;\r
-};\r
-#endif\r
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   :
+//  Author :
+//  Module :
+//  $Header$
+
+
+#ifndef _VVTK_ImageWriter_Header_File_
+#define _VVTK_ImageWriter_Header_File_
+
+#include <qthread.h>
+#include <string>
+
+class vtkImageData;
+class QSemaphore;
+
+
+class VVTK_ImageWriter : public QThread 
+{
+public:
+  VVTK_ImageWriter(QSemaphore* theSemaphore,
+                  vtkImageData* theImageData,
+                  const std::string& theName,
+                  int theProgressive,
+                  int theQuality);
+
+  ~VVTK_ImageWriter();
+
+ protected:
+  virtual
+  void
+  run();
+  
+ protected:
+  QSemaphore* mySemaphore;
+  vtkImageData *myImageData;
+  std::string myName;
+  int   myProgressive;
+  int   myQuality;
+  bool  myConstraint16Flag;
+};
+#endif
index bc9d364e0145f2d5b7321cc195a41f65d32cfab5..027e1c39539478e119ae0d8fc264657b215806ba 100755 (executable)
-//  SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-//  This library is free software; you can redistribute it and/or \r
-//  modify it under the terms of the GNU Lesser General Public \r
-//  License as published by the Free Software Foundation; either \r
-//  version 2.1 of the License. \r
-// \r
-//  This library is distributed in the hope that it will be useful, \r
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU \r
-//  Lesser General Public License for more details. \r
-// \r
-//  You should have received a copy of the GNU Lesser General Public \r
-//  License along with this library; if not, write to the Free Software \r
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA \r
-// \r
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-//  File   :\r
-//  Author :\r
-//  Module :\r
-//  $Header$\r
-\r
-#include "VVTK_ImageWriterMgr.h"\r
-#include "VVTK_ImageWriter.h"\r
-\r
-#include <vtkImageData.h>\r
-\r
-#include <qsemaphore.h>\r
-\r
-#include <limits>\r
-\r
-\r
-#ifdef _DEBUG_\r
-static int MYDEBUG = 0;\r
-#else\r
-static int MYDEBUG = 0;\r
-#endif\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriterMgr\r
-::VVTK_ImageWriterMgr()\r
-{\r
-  int aMax = std::numeric_limits<int>::max() / 2;\r
-  mySemaphore = new QSemaphore(aMax);\r
-  *mySemaphore += aMax;\r
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<\r
-               "- total = "<<mySemaphore->total()<<\r
-               "; available = "<<mySemaphore->available()<<endl;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_ImageWriterMgr\r
-::~VVTK_ImageWriterMgr()\r
-{\r
-  Stop();\r
-  delete mySemaphore;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_ImageWriterMgr\r
-::StartImageWriter(vtkImageData *theImageData,\r
-                  const std::string& theName,\r
-                  const int theProgressive,\r
-                  const int theQuality)\r
-{\r
-  VVTK_ImageWriter *anImageWriter = \r
-    new VVTK_ImageWriter(mySemaphore,\r
-                        theImageData,\r
-                        theName,\r
-                        theProgressive,\r
-                        theQuality);\r
-  myThreads.push_back(anImageWriter);\r
-\r
-  anImageWriter->start();\r
-\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_ImageWriterMgr\r
-::Stop()\r
-{\r
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<\r
-               "- total = "<<mySemaphore->total()<<\r
-               "; available = "<<mySemaphore->available()<<endl;\r
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;\r
-  *mySemaphore += myThreads.size();\r
-\r
-  for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){\r
-    VVTK_ImageWriter* anImageWriter = myThreads[anId];\r
-    anImageWriter->wait();\r
-    delete anImageWriter;\r
-  }\r
-  myThreads.clear();\r
-}\r
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   :
+//  Author :
+//  Module :
+//  $Header$
+
+#include "VVTK_ImageWriterMgr.h"
+#include "VVTK_ImageWriter.h"
+
+#include <vtkImageData.h>
+
+#include <qsemaphore.h>
+
+#include <limits>
+
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriterMgr
+::VVTK_ImageWriterMgr()
+{
+  int aMax = std::numeric_limits<int>::max() / 2;
+  mySemaphore = new QSemaphore(aMax);
+  *mySemaphore += aMax;
+  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
+               "- total = "<<mySemaphore->total()<<
+               "; available = "<<mySemaphore->available()<<endl;
+}
+
+
+//----------------------------------------------------------------------------
+VVTK_ImageWriterMgr
+::~VVTK_ImageWriterMgr()
+{
+  Stop();
+  delete mySemaphore;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ImageWriterMgr
+::StartImageWriter(vtkImageData *theImageData,
+                  const std::string& theName,
+                  const int theProgressive,
+                  const int theQuality)
+{
+  VVTK_ImageWriter *anImageWriter = 
+    new VVTK_ImageWriter(mySemaphore,
+                        theImageData,
+                        theName,
+                        theProgressive,
+                        theQuality);
+  myThreads.push_back(anImageWriter);
+
+  anImageWriter->start();
+
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ImageWriterMgr
+::Stop()
+{
+  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<
+               "- total = "<<mySemaphore->total()<<
+               "; available = "<<mySemaphore->available()<<endl;
+  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
+  *mySemaphore += myThreads.size();
+
+  for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
+    VVTK_ImageWriter* anImageWriter = myThreads[anId];
+    anImageWriter->wait();
+    delete anImageWriter;
+  }
+  myThreads.clear();
+}
index 81ca97fbdb3554ea2468f3bb152f05e898232f34..033806e3ea12e156776ae5798a1ecbe6a20666f9 100755 (executable)
@@ -1,65 +1,65 @@
-//  SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-//  This library is free software; you can redistribute it and/or \r
-//  modify it under the terms of the GNU Lesser General Public \r
-//  License as published by the Free Software Foundation; either \r
-//  version 2.1 of the License. \r
-// \r
-//  This library is distributed in the hope that it will be useful, \r
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU \r
-//  Lesser General Public License for more details. \r
-// \r
-//  You should have received a copy of the GNU Lesser General Public \r
-//  License along with this library; if not, write to the Free Software \r
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA \r
-// \r
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-//  File   :\r
-//  Author :\r
-//  Module :\r
-//  $Header$\r
-\r
-#ifndef _VVTK_ImageWriterMgr_Header_File_\r
-#define _VVTK_ImageWriterMgr_Header_File_\r
-\r
-#include <string>\r
-#include <vector>\r
-\r
-class QString;\r
-class vtkImageData;\r
-class VVTK_ImageWriter;\r
-class QSemaphore;\r
-\r
-class VVTK_ImageWriterMgr\r
-{\r
- public:\r
-  VVTK_ImageWriterMgr();\r
-  ~VVTK_ImageWriterMgr();\r
-  \r
-  void\r
-  StartImageWriter(vtkImageData *theImageData,\r
-                  const std::string& theName,\r
-                  const int theProgressive,\r
-                  const int theQuality);\r
-\r
-  void\r
-  Stop();\r
-\r
-  typedef std::vector<VVTK_ImageWriter*> TWriterThreads;\r
-\r
- protected:\r
-  TWriterThreads myThreads;\r
-\r
-  QSemaphore* mySemaphore;\r
-};\r
-\r
-\r
-#endif\r
-\r
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   :
+//  Author :
+//  Module :
+//  $Header$
+
+#ifndef _VVTK_ImageWriterMgr_Header_File_
+#define _VVTK_ImageWriterMgr_Header_File_
+
+#include <string>
+#include <vector>
+
+class QString;
+class vtkImageData;
+class VVTK_ImageWriter;
+class QSemaphore;
+
+class VVTK_ImageWriterMgr
+{
+ public:
+  VVTK_ImageWriterMgr();
+  ~VVTK_ImageWriterMgr();
+  
+  void
+  StartImageWriter(vtkImageData *theImageData,
+                  const std::string& theName,
+                  const int theProgressive,
+                  const int theQuality);
+
+  void
+  Stop();
+
+  typedef std::vector<VVTK_ImageWriter*> TWriterThreads;
+
+ protected:
+  TWriterThreads myThreads;
+
+  QSemaphore* mySemaphore;
+};
+
+
+#endif
+
index dd365c39fe85149875ae5506ed4939598223b6dc..95943f037f17af82163d9175fd7b839e1a5becd0 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 9e33bfa7eff937169b45f2358b6a4f75ba135cdf..046ffa9c01db593c42f22e184e8aa07f64872320 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 5b5e46bfc9ee1942046886b78ab8a9b58a830cee..18f4ef48aa124e92ef0f7dcc1197642d6c2e3d46 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -80,7 +80,7 @@ VVTK_MainWindow
   // Recording
   myRecordingToolBar = new QToolBar(this);
   myRecordingToolBar->setCloseMode(QDockWindow::Undocked);
-  myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+  myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_RECORD_LABEL"));
   moveDockWindow(myRecordingToolBar,Qt::DockLeft);
 
   myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"), 
@@ -173,7 +173,7 @@ void VVTK_MainWindow::onDumpView()
     fmt = "JPEG";
 
   QApplication::setOverrideCursor( Qt::waitCursor );
-  bool res = img.save( fileName, fmt.latin1() );
+  img.save( fileName, fmt.latin1() );
   QApplication::restoreOverrideCursor();
 }
 
@@ -263,7 +263,7 @@ VVTK_MainWindow1
 {
   myPtsToolBar = new QToolBar(this);
   myPtsToolBar->setCloseMode(QDockWindow::Undocked);
-  myPtsToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+  myPtsToolBar->setLabel(tr("LBL_TOOLBAR_GAUSS_LABEL"));
   moveDockWindow(myPtsToolBar,Qt::DockLeft);
 
   QPixmap aPixmap;
@@ -299,8 +299,7 @@ VVTK_MainWindow1
   myPickingAction->addTo( myPtsToolBar );
   connect(myPickingAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool)));
 
-  myPickingDlg = new VVTK_PickingDlg( this, "PickingDlg" );
-  myPickingDlg->SetAction( myPickingAction );
+  myPickingDlg = new VVTK_PickingDlg( myPickingAction, this, "PickingDlg" );
 
   // Plane/Sphere Segmentation
   aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH"));
@@ -384,6 +383,9 @@ void
 VVTK_MainWindow1
 ::OnSelectionModeSwitch(bool theIsSelectionOn)
 {
+  if ( theIsSelectionOn && !isVisible() )
+    return;
+  
   Selection_Mode aSelectionMode = SelectionMode();
   if(theIsSelectionOn && aSelectionMode != GaussPointSelection)
     SetSelectionMode(GaussPointSelection);
index 1d0b0bc38244f835a1f2beb53bc0caa3d8a56e17..dc440807467778a6007e7e8dd82348c66079b5ec 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifndef VVTK_MAINWINDOW_H
 #define VVTK_MAINWINDOW_H
 
index 06e1dabbdeeff91e1c4dcfc174b89ba65c5f015b..716ae439030b00da8022e2e8a8fd688f79b1df6a 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VVTK_PickingDlg.cxx
 //  Author : Oleg Uvarov
 #include "VISU_GaussPtsAct.h"
 #include "VISU_GaussPtsSettings.h"
 
+#include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
 
+#include "SVTK_MainWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 
 #include <vtkActorCollection.h>
 #include "QtxDblSpinBox.h"
 #include "QtxIntSpinBox.h"
 
+#include "LightApp_Application.h"
+
 using namespace std;
 
-VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name )
-  :QDialog( parent, name, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
-   myEventCallbackCommand( vtkCallbackCommand::New() ),
-   myPickingSettings( VISU_PickingSettings::New() )
+VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction,
+                                SVTK_MainWindow* theParent,
+                                const char* theName):
+  SVTK_DialogBase(theAction,
+                 theParent, 
+                 theName),
+  myEventCallbackCommand( vtkCallbackCommand::New() ),
+  myPickingSettings( VISU_PickingSettings::New() )
 {
   myPriority = 0.0;
   myEventCallbackCommand->Delete();
   myEventCallbackCommand->SetClientData(this); 
   myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents);
 
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
   setCaption( tr( "PICKING_DLG_TITLE" ) );
   setSizeGripEnabled(TRUE);
 
@@ -206,11 +225,16 @@ VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name )
   buttonClose->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonClose, 0, 2 );
 
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
   TopLayout->addWidget( aBox );
   TopLayout->addWidget( GroupButtons );
 
   connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) );
   connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) );
+  connect( buttonHelp,  SIGNAL( clicked() ), this, SLOT( onClickHelp() ) );
 }
 
 VVTK_PickingDlg::~VVTK_PickingDlg()
@@ -250,7 +274,7 @@ void VVTK_PickingDlg::Update()
     myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
     myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
 
-    float* aColor = myPickingSettings->GetColor();
+    vtkFloatingPointType* aColor = myPickingSettings->GetColor();
     mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ),
                                                               ( int )( aColor[1] * 255.0 ),
                                                               ( int )( aColor[2] * 255.0 ) ) );
@@ -349,7 +373,7 @@ void VVTK_PickingDlg::onClickApply()
   myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() );
 
   QColor aButtonColor = mySelectionColorButton->paletteBackgroundColor();
-  float aColor[3];
+  vtkFloatingPointType aColor[3];
   aColor[0] = aButtonColor.red() / 255.0;
   aColor[1] = aButtonColor.green() / 255.0;
   aColor[2] = aButtonColor.blue() / 255.0;
@@ -360,14 +384,21 @@ void VVTK_PickingDlg::onClickApply()
 
 void VVTK_PickingDlg::onClickClose()
 {
-  myAction->setOn( false );
   reject();
 }
 
-void VVTK_PickingDlg::done( int r )
+void VVTK_PickingDlg::onClickHelp()
 {
-  myAction->setOn( false );
-  QDialog::done( r );
+  QString aHelpFileName = "picking.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
 }
 
 void VVTK_PickingDlg::onColorButtonPressed()
index 72d3a4ecb42fa54f6298736f15216375a414fcb7..9cd68798953b6ad31f238af6a15463838dca0353 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VVTK_PickingDlg.h
 //  Author : Oleg Uvarov
@@ -11,7 +24,7 @@
 #ifndef VVTK_PICKINGDLG_H
 #define VVTK_PICKINGDLG_H
 
-#include <qdialog.h>
+#include "SVTK_DialogBase.h"
 
 #include <vtkObject.h>
 #include <vtkSmartPointer.h>
@@ -32,6 +45,7 @@ class QtxIntSpinBox;
 class VISU_GaussPtsAct;
 class VISU_PickingSettings;
 
+class SVTK_MainWindow;
 class SVTK_RenderWindowInteractor;
 
 //! Picking Dialog.
@@ -39,16 +53,16 @@ class SVTK_RenderWindowInteractor;
  * Uses for set up picking preferenses and apply
  * them to all actors in the current renderer.
  */
-class VVTK_PickingDlg : public QDialog
+class VVTK_PickingDlg : public SVTK_DialogBase
 {
   Q_OBJECT
 
 public:
-  VVTK_PickingDlg( QWidget* parent = 0, const char* name = 0 );
-  ~VVTK_PickingDlg();
+  VVTK_PickingDlg(QtxAction* theAction,
+                 SVTK_MainWindow* theParent,
+                 const char* theName);
 
-  //! Used to switch toggle state of the Picking action.
-  void             SetAction( QtxAction* theAction ) { myAction = theAction; }
+  ~VVTK_PickingDlg();
 
   //! Make an actor to listen the event of Update Picking Settings event.
   void             AddActor( VISU_GaussPtsAct* );
@@ -62,10 +76,9 @@ public:
   void             SetInteractor( SVTK_RenderWindowInteractor* );
 
 protected slots:
-  virtual void     done( int );
-
   void             onClickApply();
   void             onClickClose();
+  void             onClickHelp();
 
   void             onColorButtonPressed();
 
index f874be7b3ccfe50a2aa677800c08e790045fa057..58c8bc3640a0c14890fb10bb76c3535b52f0ac18 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 5ee04398c5028944d2eb99f18aab80cb25488625..722d17f2420c796b748e2a32ac3b1685a32c1c04 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 849f810a9ae976f6c9ced77804e7b8e1bdc86ef9..f39020f278d96a875469fb7fb13ebe489d469648 100755 (executable)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -318,13 +318,23 @@ VVTK_Recorder
 {
   myPaused = myPaused ? 0 : 1;
   if(myPaused && !myFrameIndexes.empty()){
-    size_t aLastId = myFrameIndexes.size() - 1;
-    myFrameIndexes[aLastId] *= -1;
+    myFrameIndexes.back() *= -1;
+    if(MYDEBUG) cout<<"VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back()<<endl;
   }
 }
 
 
 //----------------------------------------------------------------------------
+inline 
+int
+GetFrameIndex(double theStartTime,
+             double theFPS)
+{
+  double aTimeNow = vtkTimerLog::GetCurrentTime();
+  double aDelta = aTimeNow - theStartTime;
+  return int(aDelta*theFPS);
+}
+
 void
 VVTK_Recorder
 ::DoRecord()
@@ -336,13 +346,23 @@ VVTK_Recorder
     myFrameIndex = 0;
     myTimeStart = vtkTimerLog::GetCurrentTime();
   }else{
-    double aTimeNow = vtkTimerLog::GetCurrentTime();
-    double aDelta = aTimeNow - myTimeStart;
-    if(aDelta < 0.0)
+    int aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
+    if(aFrameIndex <= myFrameIndex)
       return;
 
-    int aFrameIndex = int(aDelta*myNbFPS);
-    if(aFrameIndex == myFrameIndex)
+    // If there was a "pause" we correct the myTimeStart
+    int aLastFrameIndex = myFrameIndexes.back();
+    if(aLastFrameIndex < 0){
+      myFrameIndexes.back() = abs(myFrameIndexes.back());
+      double aPauseTime = fabs((double)aFrameIndex - (double)myFrameIndex - 1) / myNbFPS;
+      if(MYDEBUG) 
+       cout<<"VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+         "; aPauseTime = "<<aPauseTime<<endl;
+      myTimeStart += aPauseTime;
+    }
+
+    aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
+    if(aFrameIndex <= myFrameIndex)
       return;
 
     myFrameIndex = aFrameIndex;
@@ -452,7 +472,7 @@ VVTK_Recorder
 
   if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aString<<endl;
 
-  QFileInfo aFileInfo(myName);
+  QFileInfo aFileInfo(myName.c_str());
   QString aDirPath = aFileInfo.dirPath(TRUE);
   QString aBaseName = aFileInfo.fileName();
   QString aCommand = 
@@ -462,6 +482,9 @@ VVTK_Recorder
     " | xargs rm " +
     ")";
 
+  aCommand = 
+    QString("rm ") + aDirPath + "/" + aBaseName + "*.jpeg";
+
   if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aCommand.latin1()<<endl;
   system(aCommand.latin1());
 }
index 82d39c275ae28d17cb2fa7c64d6fc982bbf15aec..4ec3adbc232c973ee43196459f89bbd5acfde9bf 100755 (executable)
-//  SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-//  This library is free software; you can redistribute it and/or \r
-//  modify it under the terms of the GNU Lesser General Public \r
-//  License as published by the Free Software Foundation; either \r
-//  version 2.1 of the License. \r
-// \r
-//  This library is distributed in the hope that it will be useful, \r
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU \r
-//  Lesser General Public License for more details. \r
-// \r
-//  You should have received a copy of the GNU Lesser General Public \r
-//  License along with this library; if not, write to the Free Software \r
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA \r
-// \r
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-//  File   : \r
-//  Author : \r
-//  Module : SALOME\r
-//  $Header$\r
-\r
-#ifndef _VVTK_Recorder_Header_File_\r
-#define _VVTK_Recorder_Header_File_\r
-\r
-#include <list>\r
-#include <string>\r
-#include <vector>\r
-\r
-#include <vtkObject.h>\r
-\r
-class vtkRenderWindow;\r
-class vtkCallbackCommand;\r
-class vtkWindowToImageFilter;\r
-class VVTK_ImageWriterMgr;\r
-//\r
-class VVTK_Recorder : public vtkObject \r
-{\r
- protected:\r
-  enum State {\r
-    VVTK_Recorder_Unknown=0,\r
-    VVTK_Recorder_Record,\r
-    VVTK_Recorder_Stop\r
-  };\r
-  \r
- public:\r
-  static VVTK_Recorder *New();\r
-  vtkTypeRevisionMacro(VVTK_Recorder,vtkObject);\r
-\r
-  void\r
-  SetRenderWindow(vtkRenderWindow* theRenderWindow);\r
-\r
-  vtkRenderWindow* \r
-  RenderWindow();\r
-\r
-  void \r
-  SetName(const char *theName);\r
-\r
-  const char* \r
-  Name() const;\r
-\r
-  void\r
-  SetNbFPS(const double theNbFPS);\r
-\r
-  double\r
-  NbFPS() const;\r
-\r
-  void\r
-  SetQuality(int theQuality);\r
-\r
-  int\r
-  GetQuality() const;\r
-\r
-  void\r
-  SetProgressiveMode(bool theProgressiveMode);\r
-\r
-  bool\r
-  GetProgressiveMode() const;\r
-\r
-  void\r
-  SetUseSkippedFrames(bool theUseSkippedFrames);\r
-\r
-  bool\r
-  UseSkippedFrames() const;\r
-\r
-  void\r
-  Record();\r
-\r
-  void\r
-  Pause();\r
-\r
-  void\r
-  Stop();\r
-\r
-  int\r
-  State() const;\r
-\r
-  int  \r
-  ErrorStatus() const;\r
-\r
-  void\r
-  CheckExistAVIMaker();\r
-\r
-protected :\r
-  VVTK_Recorder();\r
-\r
-  ~VVTK_Recorder();\r
-\r
-  void\r
-  DoRecord();\r
-\r
-  void\r
-  MakeFileAVI();\r
-\r
-  void\r
-  AddSkippedFrames();\r
-\r
-  void\r
-  PreWrite();\r
-\r
-  static\r
-  void\r
-  ProcessEvents(vtkObject* theObject, \r
-               unsigned long theEvent,\r
-               void* theClientData, \r
-               void* theCallData);\r
-\r
-protected :\r
-  int myState;\r
-  int myPaused;\r
-  int myErrorStatus;\r
-\r
-  float myPriority;\r
-  double myTimeStart;\r
-\r
-  int myFrameIndex;\r
-  int myNbWrittenFrames;\r
-\r
-  double myNbFPS;\r
-  int myQuality;\r
-  bool myProgressiveMode;\r
-\r
-  typedef std::vector<int> TFrameIndexes;\r
-  TFrameIndexes myFrameIndexes;\r
-  bool myUseSkippedFrames;\r
-\r
-  std::string myName;\r
-  std::string myNameAVIMaker;\r
-\r
-  vtkCallbackCommand *myCommand;\r
-  vtkRenderWindow *myRenderWindow;\r
-  vtkWindowToImageFilter *myFilter;\r
-  VVTK_ImageWriterMgr *myWriterMgr;\r
-\r
-\r
-private:\r
-  VVTK_Recorder(const VVTK_Recorder&);  //Not implemented\r
-  void operator=(const VVTK_Recorder&); //Not implemented\r
-};\r
-#endif\r
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   : 
+//  Author : 
+//  Module : SALOME
+//  $Header$
+
+#ifndef _VVTK_Recorder_Header_File_
+#define _VVTK_Recorder_Header_File_
+
+#include <list>
+#include <string>
+#include <vector>
+
+#include <vtkObject.h>
+
+class vtkRenderWindow;
+class vtkCallbackCommand;
+class vtkWindowToImageFilter;
+class VVTK_ImageWriterMgr;
+//
+class VVTK_Recorder : public vtkObject 
+{
+ protected:
+  enum State {
+    VVTK_Recorder_Unknown=0,
+    VVTK_Recorder_Record,
+    VVTK_Recorder_Stop
+  };
+  
+ public:
+  static VVTK_Recorder *New();
+  vtkTypeRevisionMacro(VVTK_Recorder,vtkObject);
+
+  void
+  SetRenderWindow(vtkRenderWindow* theRenderWindow);
+
+  vtkRenderWindow* 
+  RenderWindow();
+
+  void 
+  SetName(const char *theName);
+
+  const char* 
+  Name() const;
+
+  void
+  SetNbFPS(const double theNbFPS);
+
+  double
+  NbFPS() const;
+
+  void
+  SetQuality(int theQuality);
+
+  int
+  GetQuality() const;
+
+  void
+  SetProgressiveMode(bool theProgressiveMode);
+
+  bool
+  GetProgressiveMode() const;
+
+  void
+  SetUseSkippedFrames(bool theUseSkippedFrames);
+
+  bool
+  UseSkippedFrames() const;
+
+  void
+  Record();
+
+  void
+  Pause();
+
+  void
+  Stop();
+
+  int
+  State() const;
+
+  int  
+  ErrorStatus() const;
+
+  void
+  CheckExistAVIMaker();
+
+protected :
+  VVTK_Recorder();
+
+  ~VVTK_Recorder();
+
+  void
+  DoRecord();
+
+  void
+  MakeFileAVI();
+
+  void
+  AddSkippedFrames();
+
+  void
+  PreWrite();
+
+  static
+  void
+  ProcessEvents(vtkObject* theObject, 
+               unsigned long theEvent,
+               void* theClientData, 
+               void* theCallData);
+
+protected :
+  int myState;
+  int myPaused;
+  int myErrorStatus;
+
+  float myPriority;
+  double myTimeStart;
+
+  int myFrameIndex;
+  int myNbWrittenFrames;
+
+  double myNbFPS;
+  int myQuality;
+  bool myProgressiveMode;
+
+  typedef std::vector<int> TFrameIndexes;
+  TFrameIndexes myFrameIndexes;
+  bool myUseSkippedFrames;
+
+  std::string myName;
+  std::string myNameAVIMaker;
+
+  vtkCallbackCommand *myCommand;
+  vtkRenderWindow *myRenderWindow;
+  vtkWindowToImageFilter *myFilter;
+  VVTK_ImageWriterMgr *myWriterMgr;
+
+
+private:
+  VVTK_Recorder(const VVTK_Recorder&);  //Not implemented
+  void operator=(const VVTK_Recorder&); //Not implemented
+};
+#endif
index b188c99e001d1c752c5ea879907b4522730fef5e..bb495f1e788648d6c0871344e6bfd9a3464897a6 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 #include "VVTK_Recorder.h"
 
 #include "SUIT_FileDlg.h"
+#include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
 
 #include "QtxDblSpinBox.h"
 #include "QtxIntSpinBox.h"
 
+#include "LightApp_Application.h"
+
 #include <qcheckbox.h>
 #include <qcombobox.h>
 #include <qgroupbox.h>
@@ -127,8 +130,13 @@ VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecord
   aCloseButton->setAutoDefault( true );
   CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
 
+  QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup );
+  aHelpButton->setAutoDefault( true );
+  CommonGroupLayout->addWidget( aHelpButton, 0, 3 );
+
   connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
   connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+  connect( aHelpButton,  SIGNAL( clicked() ), this, SLOT( onHelp() ) );
 }
 
 VVTK_RecorderDlg::~VVTK_RecorderDlg()
@@ -162,6 +170,20 @@ void VVTK_RecorderDlg::onClose()
   reject();
 }
 
+void VVTK_RecorderDlg::onHelp()
+{
+  QString aHelpFileName = "animation_in_gauss_viewer.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 bool VVTK_RecorderDlg::onBrowseFile()
 {
   QString aRootDir = QString( getenv( "VISU_ROOT_DIR") );
index f46ef1b1b63dd9c8827a09e89ba3b94857530105..5c2ead334bf9af8f1b4807d9ec32a6b0324e8e1b 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -61,6 +61,7 @@ public:
 protected slots:
   void             onStart();
   void             onClose();
+  void             onHelp();
 
   bool             onBrowseFile();
 
index 484eff95d63b51e8dd2180f19b762ea2be0ee683..8517d78d31d21350fdc732436cf96a2d0d782eb2 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -125,7 +125,7 @@ VISU_FPSActor
       }
       std::ostringstream aStr;
       float aFPS = 1.0 / aLastRenderTimeInSeconds;
-      aStr<<"FPS: "<<aFPS<<"; NumberOfCells: "<<aNumberOfCells;
+      aStr<<"FPS: "<<aFPS<<"\n NumberOfCells: "<<aNumberOfCells;
       std::string anInput = aStr.str();
       SetInput(anInput.c_str());
       return Superclass::RenderOpaqueGeometry(theViewport);
@@ -164,7 +164,7 @@ VVTK_Renderer
   myFPSActor->SetMapper(aTextMapper);
   aTextMapper->Delete();
 
-  GetDevice()->AddActor2D(myFPSActor.GetPointer());
+  //GetDevice()->AddActor2D(myFPSActor.GetPointer());
 
   myGaussPointPicker->Delete();
 
@@ -236,19 +236,17 @@ vtkStandardNewMacro(VVTK_Renderer1);
 
 //----------------------------------------------------------------------------
 VVTK_Renderer1::VVTK_Renderer1():
-  //myImplicitFunctionWidget(VISU_ImplicitFunctionWidget::New()),
   myWidgetCtrl(VISU_WidgetCtrl::New()),
   myOutsideCursorSettings(NULL)
 {
   if(MYDEBUG) INFOS("VVTK_Renderer1() - "<<this);
 
-  //myImplicitFunctionWidget->SetPlaceFactor(1.1);
   myWidgetCtrl->SetPlaceFactor(1.1);
   //
-  VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
-  pPlanesWidget->SetOutlineTranslation(false);
-  vtkProperty* aSelectedPlaneProperty = pPlanesWidget->GetSelectedPlaneProperty();
-  vtkProperty* aPlaneProperty = pPlanesWidget->GetPlaneProperty();
+  VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
+  aPlanesWidget->SetOutlineTranslation(false);
+  vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty();
+  vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty();
   aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5);
   //
   myWidgetCtrl->Delete();
@@ -274,6 +272,7 @@ VVTK_Renderer1
   }
 }
 
+
 //----------------------------------------------------------------------------
 void
 VVTK_Renderer1
@@ -286,30 +285,32 @@ VVTK_Renderer1
     AdjustWidgetCtrl();
   }
 }
+
+
 //----------------------------------------------------------------------------
-void VVTK_Renderer1::AdjustWidgetCtrl()
+void
+VVTK_Renderer1
+::AdjustWidgetCtrl()
 {
-  if(SVTK_Renderer::OnAdjustActors()){
-    VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
-    pPlanesWidget->InitialPlaceWidget(myBndBox);
-    pPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
-                            0.5*(myBndBox[3] + myBndBox[2]),
-                            0.5*(myBndBox[5] + myBndBox[4]));
-    //
-    VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
-    pSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
-                            0.5*(myBndBox[3] + myBndBox[2]),
-                            0.5*(myBndBox[5] + myBndBox[4]));
-    float dX, dXmin=1.e20;
-    for (int i=0; i<3; ++i) {
-      dX=myBndBox[2*i+1]-myBndBox[2*i];
-      if (dX<dXmin){
-       dXmin=dX;
-      }
-    }
-    pSphereWidget->SetRadius(dXmin);
+  VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
+  aPlanesWidget->InitialPlaceWidget(myBndBox);
+  aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
+                          0.5*(myBndBox[3] + myBndBox[2]),
+                          0.5*(myBndBox[5] + myBndBox[4]));
+  //
+  VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget();
+  aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
+                          0.5*(myBndBox[3] + myBndBox[2]),
+                          0.5*(myBndBox[5] + myBndBox[4]));
+  
+  float aMinLength = VTK_LARGE_FLOAT;
+  for (int i=0; i<3; ++i) {
+    float aLength = myBndBox[2*i+1]-myBndBox[2*i];
+    aMinLength = std::min(aMinLength,aLength);
   }
+  aSphereWidget->SetRadius(aMinLength);
 }
+
 //----------------------------------------------------------------------------
 void 
 VVTK_Renderer1
@@ -329,7 +330,9 @@ VVTK_Renderer1
 }
 
 //----------------------------------------------------------------------------
-VISU_WidgetCtrl* VVTK_Renderer1::GetWidgetCtrl()
+VISU_WidgetCtrl* 
+VVTK_Renderer1
+::GetWidgetCtrl()
 {
   return myWidgetCtrl.GetPointer();
 }
index 1f566884ba4aa7c19a69df5532b691fc997929e3..6cf53326aec5d84f98cf561791ae86d1044ff193 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 525ef469ea83e42f82373336e4b0613204aad43f..4f8a9e5a3ec3ea77596ac3130a59e8fa203b113a 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VVTK_SegmentationCursorDlg.cxx
 //  Author : Oleg Uvarov
@@ -22,6 +35,7 @@
 #include "VISU_GaussPointsPL.hxx"
 #include "VISU_OpenGLPointSpriteMapper.hxx"
 
+#include "LightApp_Application.h"
 #include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
@@ -101,7 +115,7 @@ namespace VISU
     static TTextureMap aTextureMap;
     
     TTextureValue aTextureValue;
-    TTextureKey aTextureKey(theMainTexture,theAlphaTexture);
+    TTextureKey aTextureKey(theMainTexture.latin1(),theAlphaTexture.latin1());
     TTextureMap::const_iterator anIter = aTextureMap.find(aTextureKey);
     if(anIter != aTextureMap.end()){
       aTextureValue = anIter->second;
@@ -146,8 +160,6 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c
                                      myEventCallbackCommand.GetPointer(), 
                                      myPriority);
 
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
   setCaption( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) );
   setSizeGripEnabled(TRUE);
 
@@ -188,9 +200,9 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c
 
   QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup );
   myZOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup );
-  myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  //myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myZOriginSpinBox->setMinimumWidth( 100 );
-  myZOriginSpinBox->setValue( 0.0 );
+  myZOriginSpinBox->setValue( 1.0 );
 
   OriginGroupLayout->addWidget(   XOriginLabel,   0, 0 );
   OriginGroupLayout->addWidget( myXOriginSpinBox, 0, 1 );
@@ -386,11 +398,19 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c
   buttonClose->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonClose, 0, 2 );
 
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+  buttonHelp->setAutoDefault( TRUE );
+  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
   TopLayout->addWidget( myTabBox );
   TopLayout->addWidget( GroupButtons );
 
   connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) );
   connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) );
+  connect( buttonHelp,  SIGNAL( clicked() ), this, SLOT( onClickHelp() ) );
+
+  connect(parent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
+  connect(parent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
 }
 
 VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg()
@@ -468,13 +488,13 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation()
     myRadiusGroup->hide();
 
     VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
-    float origin[3];
+    vtkFloatingPointType origin[3];
     pPlanesWidget->GetOrigin( origin );
     myXOriginSpinBox->setValue( origin[0] );
     myYOriginSpinBox->setValue( origin[1] );
     myZOriginSpinBox->setValue( origin[2] );
 
-    float normal[3];
+    vtkFloatingPointType normal[3];
     pPlanesWidget->GetNormal( normal );
     myDXDirectionSpinBox->setValue( normal[0] );
     myDYDirectionSpinBox->setValue( normal[1] );
@@ -489,7 +509,7 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation()
     myRadiusGroup->show();
     
     VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
-    float origin[3], aRadius;
+    vtkFloatingPointType origin[3], aRadius;
     pSphereWidget->GetCenter(origin);
     myXOriginSpinBox->setValue( origin[0] );
     myYOriginSpinBox->setValue( origin[1] );
@@ -503,15 +523,15 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation()
 void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints()
 {
   int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
-  float aClamp = 200.0;
+  vtkFloatingPointType aClamp = 200.0;
   QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
   QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
-  float anAlphaThreshold = 0.1;
+  vtkFloatingPointType anAlphaThreshold = 0.1;
   int aResolution = 8;
   int aMinSize = 3;
   int aMaxSize = 33;
   int aMagnification = 100;
-  float anIncrement = 2.0;
+  vtkFloatingPointType anIncrement = 2.0;
 
   if( !myInsideCursorSettings->GetInitial() )
   {
@@ -570,11 +590,11 @@ void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints()
 
 void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints()
 {
-  float aClamp = 256.0;
+  vtkFloatingPointType aClamp = 256.0;
   int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
   QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
   QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
-  float anAlphaThreshold = 0.1;
+  vtkFloatingPointType anAlphaThreshold = 0.1;
   int aResolution = 8;
   int aSize = 25;
   bool aUniform = false;
@@ -592,7 +612,7 @@ void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints()
     myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() );
     myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() );
 
-    float* aColor = myOutsideCursorSettings->GetColor();
+    vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor();
     myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ),
                                        ( int )( aColor[1] * 255.0 ),
                                        ( int )( aColor[2] * 255.0 ) ) );
@@ -701,13 +721,13 @@ void VVTK_SegmentationCursorDlg::ApplySegmentationCursor()
   if( myIsPlaneSegmentation )
   {
     VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
-    float origin[3];
+    vtkFloatingPointType origin[3];
     origin[0] = myXOriginSpinBox->value();
     origin[1] = myYOriginSpinBox->value();
     origin[2] = myZOriginSpinBox->value();
     pPlanesWidget->SetOrigin( origin );
 
-    float normal[3];
+    vtkFloatingPointType normal[3];
     normal[0] = myDXDirectionSpinBox->value();
     normal[1] = myDYDirectionSpinBox->value();
     normal[2] = myDZDirectionSpinBox->value();
@@ -727,7 +747,7 @@ void VVTK_SegmentationCursorDlg::ApplySegmentationCursor()
   else
   {
     VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
-    float origin[3], aRadius;
+    vtkFloatingPointType origin[3], aRadius;
     origin[0] = myXOriginSpinBox->value();
     origin[1] = myYOriginSpinBox->value();
     origin[2] = myZOriginSpinBox->value();
@@ -786,7 +806,7 @@ void VVTK_SegmentationCursorDlg::ApplyOutsideGaussPoints()
   myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() );
 
   QColor aButtonColor = myOutsideSizeBox->getColor();
-  float aColor[3];
+  vtkFloatingPointType aColor[3];
   aColor[0] = aButtonColor.red() / 255.0;
   aColor[1] = aButtonColor.green() / 255.0;
   aColor[2] = aButtonColor.blue() / 255.0;
@@ -808,6 +828,20 @@ void VVTK_SegmentationCursorDlg::onClickClose()
   reject();
 }
 
+void VVTK_SegmentationCursorDlg::onClickHelp()
+{
+  QString aHelpFileName = "segmentation.htm";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 void VVTK_SegmentationCursorDlg::done( int r )
 {
   myPlaneAction->setOn( false );
@@ -818,6 +852,19 @@ void VVTK_SegmentationCursorDlg::done( int r )
   QDialog::done( r );
 }
 
+void VVTK_SegmentationCursorDlg::onParentShow()
+{
+  if(myPlaneAction->isOn() || mySphereAction->isOn())
+    show();
+  else
+    hide();
+}
+
+void VVTK_SegmentationCursorDlg::onParentHide()
+{
+  hide();
+}
+
 bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces()
 {
   if( !myInteractor )
index 6e521427499c3a86809f1f52230bc5e2eba39738..8f1e462a5e067076e63c6b5c65a803f1032c997d 100644 (file)
@@ -1,8 +1,21 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  CEA/DEN, EDF R&D
-//
-//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : VVTK_SegmentationCursorDlg.h
 //  Author : Oleg Uvarov
@@ -115,9 +128,12 @@ private:
 
 protected slots:
   virtual void     done( int );
+  void             onParentShow();
+  void             onParentHide();
 
   void             onClickApply();
   void             onClickClose();
+  void             onClickHelp();
 
 signals:
   void             scgClose();
index 654b69a7f5cf6149fa9fb7f35d22fbf985421ac0..18d1d020c7f701b25fd21a67eb356a8db1030352 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -48,8 +48,6 @@ using namespace std;
 VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) :
   QVBox( parent )
 {
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
   layout()->setSpacing( 0 );
   layout()->setMargin( 0 );
 
index 85eafa75d69779bde9dc033c609e947fd6f4d9b6..06e3971cb033d1b29c56b2d07fd1aab9ba07be5d 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
index 8c3cb03be3fe4d380f773b654668b86be76ed90d..a1eb30f7f804f325c8fae25618254fa65dab30b5 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #include "VVTK_ViewManager.h"
 #include "VVTK_ViewModel.h"
 
@@ -7,7 +26,7 @@ int VVTK_ViewManager::_VVTKViewMgr_Id = 0;
 VVTK_ViewManager
 ::VVTK_ViewManager( SUIT_Study* study, 
                    SUIT_Desktop* theDesktop ) 
-: SUIT_ViewManager( study, theDesktop )
+: SVTK_ViewManager( study, theDesktop )
 {
   myId = ++_VVTKViewMgr_Id;
   setViewModel( new VVTK_Viewer() );
index 101fa583c4ce08922420fae5ecd0f3d46c1d7243..e5d06348f06efb63adc31598e2d14de2602a4f4d 100644 (file)
@@ -1,13 +1,32 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifndef VVTK_VIEWMANAGER_H
 #define VVTK_VIEWMANAGER_H
 
-#include "SUIT_ViewManager.h"
+#include "SVTK_ViewManager.h"
 #include "VVTK.h"
 
 class SUIT_Desktop;
 
 //! Extend SUIT_ViewManager to deal with VVTK_Viewer
-class VVTK_EXPORT VVTK_ViewManager : public SUIT_ViewManager
+class VVTK_EXPORT VVTK_ViewManager : public SVTK_ViewManager
 {
   Q_OBJECT;
 public:
index e37788166805c9682d024b21562287cde436e73c..af6f65ed3c64c79544a322719643adde544aa733 100644 (file)
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
-
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #include "VVTK_ViewModel.h"
-#include "VVTK_ViewWindow.h"
-
-#include "SVTK_View.h"
-#include "SVTK_MainWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
 
-#include "VTKViewer_ViewModel.h"
+#include "VVTK_ViewWindow.h"
 
-//==========================================================
-VVTK_Viewer
-::VVTK_Viewer()
+VVTK_Viewer::
+VVTK_Viewer()
 {
-  myTrihedronSize = 105;
 }
 
-VVTK_Viewer
-::~VVTK_Viewer() 
-{}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::setViewManager(SUIT_ViewManager* theViewManager)
+VVTK_Viewer::
+~VVTK_Viewer() 
 {
-  SUIT_ViewModel::setViewManager(theViewManager);
-
-  if ( !theViewManager )
-    return;
-
-  connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), 
-          this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
-  
-  connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)), 
-          this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
-  
-  connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)), 
-          this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
 }
 
-
 //==========================================================
-SUIT_ViewWindow* 
-VVTK_Viewer
-::createView( SUIT_Desktop* theDesktop )
+SUIT_ViewWindow*
+VVTK_Viewer::
+createView( SUIT_Desktop* theDesktop )
 {
-  TViewWindow* aViewWindow = new TViewWindow(theDesktop);
+  TViewWindow* aViewWindow = new TViewWindow (theDesktop);
   aViewWindow->Initialize(this);
-    
+
   aViewWindow->setBackgroundColor( backgroundColor() );
   aViewWindow->SetTrihedronSize( trihedronSize() );
 
   return aViewWindow;
 }
-
-
-//==========================================================
-void
-VVTK_Viewer
-::contextMenuPopup( QPopupMenu* thePopup )
-{
-  thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
-
-  thePopup->insertSeparator();
-
-  if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
-    if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
-      thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
-    }
-  }
-}
-
-
-//==========================================================
-void 
-VVTK_Viewer
-::Repaint()
-{
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-    if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
-      aView->getMainWindow()->Repaint();
-    }
-  }
-}
-
-
-//==========================================================
-bool
-VVTK_Viewer
-::isVisible( const Handle(SALOME_InteractiveObject)& io )
-{
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
-    if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
-      if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow))
-       if(!aView->getView()->isVisible( io ))
-         return false;
-
-  return true;
-}
-
-
-//==========================================================
-void
-VVTK_Viewer
-::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-void 
-VVTK_Viewer
-::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-void 
-VVTK_Viewer
-::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
-{}
-
-
-//==========================================================
-QColor
-VVTK_Viewer
-::backgroundColor() const
-{
-  return myBgColor;
-}
-
-void
-VVTK_Viewer
-::setBackgroundColor( const QColor& theColor )
-{
-  if ( !theColor.isValid() )
-    return;
-
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-    if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
-      if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
-       aView->setBackgroundColor(theColor);
-      }
-    }
-  }
-
-  myBgColor = theColor;
-}
-
-//==========================================================
-int
-VVTK_Viewer
-::trihedronSize() const
-{
-  return myTrihedronSize;
-}
-
-void 
-VVTK_Viewer
-::setTrihedronSize( const int theSize )
-{
-  myTrihedronSize = theSize;
-  if(SUIT_ViewManager* aViewManager = getViewManager()){
-    QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
-    for ( int i = 0; i < aViews.count(); i++ ){
-      if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i ))){
-       aView->getMainWindow()->SetTrihedronSize( theSize );
-      }
-    }
-  }
-}
-
-//==========================================================
-void 
-VVTK_Viewer
-::onDumpView()
-{
-  if(SUIT_ViewWindow* aView = myViewManager->getActiveView())
-    aView->onDumpView();
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onChangeBgColor()
-{
-  if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
-    QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
-    setBackgroundColor(aColor);
-  }
-}
-
-//==========================================================
-void
-VVTK_Viewer
-::onShowToolbar() 
-{
-  QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
-  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-    if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
-      aView->getMainWindow()->getToolBar()->show();
-    }
-  }
-}
-
index 0846edcd0a3618c46bfb8597a30392ad6f6df0ab..fb7ca0dc850002571d25c3100473aa69e2c50dad 100644 (file)
@@ -1,18 +1,34 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifndef VVTK_VIEWMODEL_H
 #define VVTK_VIEWMODEL_H
 
 #include <qcolor.h>
 
 #include "VVTK.h"
-#include "SVTK_ViewModelBase.h"
-
-#include "SALOME_Prs.h"
-#include "SALOME_InteractiveObject.hxx"
+#include "SVTK_ViewModel.h"
 
 class VVTK_ViewWindow;
 
-//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View 
-class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
+//! VVTK View Model
+class VVTK_EXPORT VVTK_Viewer : public SVTK_Viewer
 {
   Q_OBJECT;
 
@@ -23,48 +39,11 @@ public:
   VVTK_Viewer();
   virtual ~VVTK_Viewer();
 
-  //! Redefine SUIT_ViewModel::createView
+  //! See #SUIT_ViewModel::createView
   virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
 
-  //! Redefine SUIT_ViewModel::setViewManager
-  virtual void setViewManager(SUIT_ViewManager* theViewManager);
-  //! Redefine SUIT_ViewModel::contextMenuPopup
-  virtual void contextMenuPopup( QPopupMenu* );
   //! See SUIT_ViewModel::getType
   virtual QString getType() const { return Type(); }
-
-  //! Redefine SALOME_View::Repaint
-  virtual void Repaint();
-
-  //! Redefine SALOME_View::isVisible
-  virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
-
-  //! Get background color of the viewer
-  QColor backgroundColor() const;
-
-  //! Set background color to the viewer
-  void   setBackgroundColor( const QColor& );
-
-  //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
-  int    trihedronSize() const;
-
-  //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
-  void   setTrihedronSize( const int );
-
-protected slots:
-  void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
-  void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
-  void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
-
-  void onDumpView();
-  void onShowToolbar();
-  void onChangeBgColor();
-
-private:
-  QColor myBgColor;
-  int    myTrihedronSize;
-  bool   mySelectionEnabled;
-  bool   myMultiSelectionEnabled;
 };
 
 #endif
index a181ad6ab21925511e82e4d4e2e6ac2e8f4c0872..cbd0d46a85a1c705e02917bfbd72d91da74b344c 100755 (executable)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -258,14 +258,17 @@ VVTK_ViewWindow
 }
 
 //----------------------------------------------------------------------------
-void 
+bool 
 VVTK_ViewWindow
 ::action( const int accelAction  )
 {
-  if(myMainWindow1->hasFocus())
-    myMainWindow1->action(accelAction);
-  if(myMainWindow2->hasFocus())
-    myMainWindow2->action(accelAction);
+  if ( myMainWindow1->hasFocus() )
+    myMainWindow1->action( accelAction );
+  else if ( myMainWindow2->hasFocus() )
+    myMainWindow2->action( accelAction );
+  else
+    return false;
+  return true;
 }
 
 //----------------------------------------------------------------------------
@@ -287,11 +290,7 @@ void
 VVTK_ViewWindow
 ::setBackgroundColor( const QColor& theColor )
 {
-  if( myMainWindow1->GetInteractor()->hasFocus() )
-    myMainWindow1->SetBackgroundColor( theColor );
-  else if( myMainWindow2->GetInteractor()->hasFocus() )
-    myMainWindow2->SetBackgroundColor( theColor );
-  else
-    myMainWindow->SetBackgroundColor( theColor );
+  myMainWindow1->SetBackgroundColor( theColor );
+  myMainWindow2->SetBackgroundColor( theColor );
 }
 
index 54e4745d03240bd4000d35b22049b5d180687f8c..ca0ab04c8630650bd967e74cb56c9b06e210f791 100755 (executable)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 #ifndef VVTK_VIEWWINDOW_H
 #define VVTK_VIEWWINDOW_H
 
@@ -105,7 +124,7 @@ public slots:
   //----------------------------------------------------------------------------
 protected:
   virtual 
-  void
+  bool
   action( const int );
 
   virtual QImage dumpView();