]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge with OCC_development_generic_2006
authorapo <apo@opencascade.com>
Wed, 11 Jan 2006 08:24:19 +0000 (08:24 +0000)
committerapo <apo@opencascade.com>
Wed, 11 Jan 2006 08:24:19 +0000 (08:24 +0000)
31 files changed:
doc/salome/tui/VISU/doxyfile
idl/VISU_Gen.idl
src/PIPELINE/VISU_CutLinesPL.cxx
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
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_Gen_i.cc
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_Result_i.cc
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_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_SWIG/Makefile.in

index b4346ae412b2fe168c9fcd034d32689d2a388fcf..41139fc80ea295c08a021b32fcc2dd6864ce95c1 100755 (executable)
@@ -3,7 +3,7 @@
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME           = "SALOME v.3.1.0a"
+PROJECT_NAME           = "SALOME - VISU - v.3.1.0"
 PROJECT_NUMBER         = id#1.1
 OUTPUT_DIRECTORY       = ../
 CREATE_SUBDIRS         = NO
index 0ee7fe63ff10d3f481c08c55e1c2e30e57b2ad5b..e00e060041f65261e66febf22dad207e9ca0dcd6 100644 (file)
@@ -1917,6 +1917,22 @@ module VISU {
     /*! Shrinks and enlarges the 2D plot to fit the 2D viewer.
      */
     void FitAll();
+
+    /*! Set range of the 2D plot to X axis of the 2D viewer.
+     */
+    void FitXRange(in double xMin, in double xMax);
+
+    /*! Set range of the 2D plot to Y axis of the 2D viewer.
+     */
+    void FitYRange(in double yMin, in double yMax);
+
+    /*! Set range of the 2D plot to XY axis of the 2D viewer.
+     */
+    void FitRange(in double xMin, in double xMax,
+                 in double yMin, in double yMax);
+
+    void GetFitRanges(out double xMin,out double xMax,
+                     out double yMin,out double yMax);
   };
 
   //-------------------------------------------------------
index 7f53c95166b1f3dc2ef28bf7d0beda7274d84e3f..b518dfad7996c974b88c36c7abaadfb077cf746a 100644 (file)
@@ -113,6 +113,7 @@ void VISU_CutLinesPL::Update(){
   anAppendPolyData->Delete();
   //Calculate values for building of table
   vtkMath::Cross(aDir[0],aDir[1],myDirLn);
+  for (int i=0; i<3 ; i++) if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401
   GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn);
   VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt);
   CorrectPnt(myBasePnt,aBaseBounds);
index 19f17b0bf6de971946dcfe822a0a66621ce8b89e..5d6a80da3269d4384c646085863cb019312a4b43 100644 (file)
@@ -2763,8 +2763,10 @@ extern "C" {
   }
 }
 */
+
 void VisuGUI::createPreferences()
 {
+  // TAB: "Scalar Bar"
   int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
 
   int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), sbarTab );
@@ -2803,17 +2805,24 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( min, "step", 0.1 );
   setPreferenceProperty( max, "step", 0.1 );
 
+  // group: "Font"
   int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
-  int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
-  addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
-  int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
-  addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
+  int tfont = addPreference( tr( "VISU_TITLE" ), fontGr,
+                             LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
+  addPreference( tr( "VISU_TITLE" ), fontGr,
+                 LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
+  int lfont = addPreference( tr( "VISU_LABELS" ), fontGr,
+                             LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
+  addPreference( tr( "VISU_LABELS" ), fontGr,
+                 LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
 
   QStringList fam;
   fam.append( tr( "VISU_FONT_ARIAL" ) );
   fam.append( tr( "VISU_FONT_COURIER" ) );
   fam.append( tr( "VISU_FONT_TIMES" ) );
-  int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) );
+  int wflag = ( QtxListResourceEdit::FontItem::All &
+                ( ~( QtxListResourceEdit::FontItem::Size |
+                     QtxListResourceEdit::FontItem::UserSize ) ) );
 
   setPreferenceProperty( tfont, "families", fam );
   setPreferenceProperty( tfont, "system", false );
@@ -2822,18 +2831,23 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( lfont, "system", false );
   setPreferenceProperty( lfont, "widget_flags", wflag );
 
+  // group: "Colors & Labels"
   int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
 
-  int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
+  int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr,
+                              LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
   setPreferenceProperty( numcol, "min", 2 );
   setPreferenceProperty( numcol, "max", 256 );
 
-  int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
+  int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
+                              LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
   setPreferenceProperty( numlab, "min", 2 );
   setPreferenceProperty( numlab, "max", 65 );
 
+  // group: "Orientation"
   int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
-  int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
+  int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr,
+                              LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
   QStringList orients;
   orients.append( tr( "VISU_VERTICAL" ) );
   orients.append( tr( "VISU_HORIZONTAL" ) );
@@ -2843,11 +2857,16 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( orient, "strings", orients );
   setPreferenceProperty( orient, "indexes", indices );
 
+  // group: "Origin & Size Vertical"
   int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
-  int xv = addPreference( tr( "VISU_X" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
-  int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
-  int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
-  int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
+  int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
+  int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
+  int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
+  int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
   setPreferenceProperty( xv, "step", 0.1 );
   setPreferenceProperty( yv, "step", 0.1 );
   setPreferenceProperty( wv, "step", 0.1 );
@@ -2861,11 +2880,16 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( wv, "max", 1.0 );
   setPreferenceProperty( hv, "max", 1.0 );
 
+  // group: "Origin & Size Horizontal"
   int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
-  int xh = addPreference( tr( "VISU_X" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
-  int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
-  int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
-  int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
+  int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
+  int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
+  int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
+  int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
+                          LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
   setPreferenceProperty( xh, "step", 0.1 );
   setPreferenceProperty( yh, "step", 0.1 );
   setPreferenceProperty( wh, "step", 0.1 );
@@ -2879,23 +2903,29 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( wh, "max", 1.0 );
   setPreferenceProperty( hh, "max", 1.0 );
 
+  // group: "Scalar bars default position"
   int scalarBarGr = addPreference( tr( "Scalar bars default position" ), sbarTab );
   addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
 
   int srangeTab = addPreference( tr( "Sweep, MED import" ) );
 
+  // group: "Sweeping preferences"
   int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
   setPreferenceProperty( sweepGr, "columns", 1 );
 
-  int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
-  int nbcycles   = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
-  int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+  int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
+                                  LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+  int nbcycles   = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr,
+                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
+  int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGr,
+                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
   setPreferenceProperty( timestep, "min",  0.1 );
   setPreferenceProperty( timestep, "step", 0.1 );
   setPreferenceProperty( timestep, "max",  1000 );
   setPreferenceProperty( nbcycles, "max",  100  );
   setPreferenceProperty( nbsteps,  "max",  200  );
 
+  // group: "MED files import"
   int importGr = addPreference( tr( "MED files import" ), srangeTab );
   setPreferenceProperty( importGr, "columns", 1 );
   addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
@@ -2904,6 +2934,11 @@ void VisuGUI::createPreferences()
   addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
   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,
+                 LightApp_Preferences::Bool, "VISU", "represent_shading" );
 }
 
 void VisuGUI::preferencesChanged( const QString&, const QString& )
index 5faeddb01d08eede95b3940b0b2fc6e03292ae2f..a3523965bb2e69493350f66fe4c81869e80b9361 100644 (file)
@@ -375,9 +375,9 @@ void ArrangeDlg::acceptViewWindow()
          aDist = fabs(aBounds[5] - aBounds[4]);
        }
        float aOffset[3];
-       aOffset[0] = (aBounds[1] < aBounds[0]) ? -aBounds[1] : -aBounds[0];
-        aOffset[1] = (aBounds[3] < aBounds[2]) ? -aBounds[3] : -aBounds[2];
-        aOffset[2] = (aBounds[5] < aBounds[4]) ? -aBounds[5] : -aBounds[4];
+        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;
@@ -1032,6 +1032,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   aSaveLay->addWidget(aPathLbl, 1, 0);
 
   myPathEdit = new QLineEdit(aSaveBox);
+  myPathEdit->setReadOnly(true);
   myPathEdit->setEnabled(false);
   connect(mySaveCheck, SIGNAL( toggled(bool)),
          myPathEdit, SLOT( setEnabled(bool) ));
@@ -1246,9 +1247,9 @@ void VisuGUI_TimeAnimationDlg::onSetupDlg()
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onBrowse()
 {
-  QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/","Select path");
+  QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path");
   if (!aPath.isEmpty())
-    myPathEdit->setText(aPath);
+    myPathEdit->setText(Qtx::addSlash(aPath));
 }
 
 //------------------------------------------------------------------------
index b38c88b23ec21f2bc2865035e9d2bd5ebcb2c57f..94b2e9d15ecc23baa5a2e8372cb8376660ab8ed0 100644 (file)
@@ -78,47 +78,49 @@ VISU::ColoredPrs3d_i
 
 void
 VISU::ColoredPrs3d_i
-::SameAs(const ColoredPrs3d_i* theOrigin)
+::SameAs(const Prs3d_i* theOrigin)
 {
-  DoHook();
+  if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
+    DoHook();
 
-  ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(theOrigin);
+    ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
  
-  myField = anOrigin->GetField();
-  myMeshName = myField->myMeshName;
-  myEntity = myField->myEntity;
-  myIteration = anOrigin->GetIteration();
-  myFieldName = anOrigin->GetFieldName();
-
-  Build(-1);
-
-  TSuperClass::SameAs(theOrigin);
-
-  SetScalarMode(anOrigin->GetScalarMode());
-  SetNbColors(anOrigin->GetNbColors());
-  SetBarOrientation(anOrigin->GetBarOrientation());
-
-  SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
-  SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
-  SetLabels(anOrigin->GetLabels());
-  SetTitle(anOrigin->GetTitle());
-
-  SetBoldTitle(anOrigin->IsBoldTitle());
-  SetItalicTitle(anOrigin->IsItalicTitle());
-  SetShadowTitle(anOrigin->IsShadowTitle());
-  SetTitFontType(anOrigin->GetTitFontType());
-  float r,g,b;
-  anOrigin->GetTitleColor(&r,&g,&b);
-  SetTitleColor(r,g,b);
-
-  SetBoldLabel(anOrigin->IsBoldLabel());
-  SetItalicLabel(anOrigin->IsItalicLabel());
-  SetShadowLabel(anOrigin->IsShadowLabel());
-  SetLblFontType(anOrigin->GetLblFontType());
-  anOrigin->GetLabelColor(&r,&g,&b);
-  SetLabelColor(r,g,b);
+    myField = anOrigin->GetField();
+    myMeshName = myField->myMeshName;
+    myEntity = myField->myEntity;
+    myIteration = anOrigin->GetIteration();
+    myFieldName = anOrigin->GetFieldName();
+    
+    Build(-1);
+    
+    TSuperClass::SameAs(theOrigin);
+    
+    SetScalarMode(anOrigin->GetScalarMode());
+    SetNbColors(anOrigin->GetNbColors());
+    SetBarOrientation(anOrigin->GetBarOrientation());
+    
+    SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
+    SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
+    SetLabels(anOrigin->GetLabels());
+    SetTitle(anOrigin->GetTitle());
+    
+    SetBoldTitle(anOrigin->IsBoldTitle());
+    SetItalicTitle(anOrigin->IsItalicTitle());
+    SetShadowTitle(anOrigin->IsShadowTitle());
+    SetTitFontType(anOrigin->GetTitFontType());
+    float r,g,b;
+    anOrigin->GetTitleColor(&r,&g,&b);
+    SetTitleColor(r,g,b);
+    
+    SetBoldLabel(anOrigin->IsBoldLabel());
+    SetItalicLabel(anOrigin->IsItalicLabel());
+    SetShadowLabel(anOrigin->IsShadowLabel());
+    SetLblFontType(anOrigin->GetLblFontType());
+    anOrigin->GetLabelColor(&r,&g,&b);
+    SetLabelColor(r,g,b);
+  }
 }
-
+  
 void
 VISU::ColoredPrs3d_i
 ::SameAsParams(const ColoredPrs3d_i* theOrigin)
index 1e09eb7aab94582ae96de9adbfe8ad13f4fe073d..e03d772eae5123da9cbe52c9c451904bbbe6b47f 100644 (file)
@@ -156,7 +156,7 @@ namespace VISU
 
     virtual 
     void
-    SameAs(const ColoredPrs3d_i* theOrigin);
+    SameAs(const Prs3d_i* theOrigin);
 
     /*!
      *  \brief Works like SameAs() method, but keep myIteration value unchanged.
index caf7aee2d09b1460b68d9e14416c6e33797d35de..08857545a1c74e35fdbf29dcae44cc1f5e0ed27f 100644 (file)
@@ -81,10 +81,6 @@ CutLines_i(Result_i* theResult,
 }
 
 
-void VISU::CutLines_i::SameAs(const CutLines_i* theOrigin){
-  VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
 /*! Copy map to /a myMapCurvesInverted.
  * \param theCurves - map
  */
index 637e7b8390c6ec418f28f438d4d7fe0893553cba..cdc7184a97ce058b7eb9deb1b05718bf31880141 100644 (file)
@@ -45,7 +45,6 @@ namespace VISU{
     explicit
     CutLines_i(Result_i* theResult,
               SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const CutLines_i* theOrigin);
     virtual ~CutLines_i();
 
     virtual VISU::VISUType GetType() { return VISU::TCUTLINES;};
index cff4a1a2cfd95b4cc31aeb1074d9af03727e626f..ac3784618cce1ec8fa31588ca4fac0cae7e2d39a 100644 (file)
@@ -72,11 +72,7 @@ CutPlanes_i(Result_i* theResult,
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myCutPlanesPL(NULL)
-{}
-
-
-void VISU::CutPlanes_i::SameAs(const CutPlanes_i* theOrigin){
-  VISU::ScalarMap_i::SameAs(theOrigin);
+{
 }
 
 
index b68062433558f41aacf53d253b4df4b1686d3116..66c2d913f970afa26cedcbdbb7227a22f0a67f9e 100644 (file)
@@ -45,7 +45,6 @@ namespace VISU{
     explicit
     CutPlanes_i(Result_i* theResult,
                SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const CutPlanes_i* theOrigin);
     virtual ~CutPlanes_i();
 
     virtual VISU::VISUType GetType() { return VISU::TCUTPLANES;};
index ae4dbe45f9329356342ad81a693c89c9a7e4f84d..478b7dfc5fe7269975b9f78bfad5b0ea855de3de 100644 (file)
@@ -90,13 +90,15 @@ DeformedShape_i(Result_i* theResult,
 }
 
 
-void VISU::DeformedShape_i::SameAs(const DeformedShape_i* theOrigin)
+void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
 {
-  DeformedShape_i* aDefShape = const_cast<DeformedShape_i*>(theOrigin);
-  VISU::ScalarMap_i::SameAs(theOrigin);
+  TSuperClass::SameAs(theOrigin);
 
-  SetColor(aDefShape->GetColor());
-  ShowColored(aDefShape->IsColored());
+  if(const DeformedShape_i* aPrs3d = dynamic_cast<const DeformedShape_i*>(theOrigin)){
+    DeformedShape_i* anOrigin = const_cast<DeformedShape_i*>(aPrs3d);
+    SetColor(anOrigin->GetColor());
+    ShowColored(anOrigin->IsColored());
+  }
 }
 
 
index 396060115188d6ea97b249bc28799a212418eed9..e6fccb4485313709dd9b7561ebfd96d9359453f8 100644 (file)
@@ -45,7 +45,7 @@ namespace VISU{
     explicit
     DeformedShape_i(Result_i* theResult,
                    SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const DeformedShape_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~DeformedShape_i();
 
     virtual VISU::VISUType GetType() { return VISU::TDEFORMEDSHAPE;};
index 5e0a5867cc6fcae7c427b1042d348c2e71c0c744..46094327556f95c5b5224555e7b564b57d22e4e9 100644 (file)
@@ -263,8 +263,8 @@ namespace VISU
     Mutex mt(myMutex);
     SALOMEDS::Study_var aStudy = theComponent->GetStudy();
     SALOMEDS::StudyBuilder_var  aStudyBuilder = aStudy->NewBuilder();
-    const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
-    TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
+    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
     VisuTmpDir = aTmpDir.ToCString();
     SALOMEDS::ListOfFileNames_var aSeq =
       SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
@@ -300,8 +300,8 @@ namespace VISU
                                      bool isMultiFile)
   {
     Mutex mt(myMutex);
-    const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
-    TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
+    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
     int aCounter = 0;
     TColStd_SequenceOfAsciiString aFileNames;
@@ -357,8 +357,8 @@ namespace VISU
                                           bool isMultiFile)
   {
     Mutex mt(myMutex);
-    const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
-    TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
+    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
     int aCounter = 0;
     TColStd_SequenceOfAsciiString aFileNames;
index 2ea83ae041645291bdf262d3e1fe96548dd7ba60..c1e45c917d7929210244c6e8290bd6737e9905a0 100644 (file)
@@ -70,11 +70,7 @@ IsoSurfaces_i(Result_i* theResult,
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myIsoSurfacesPL(NULL)
-{}
-
-
-void VISU::IsoSurfaces_i::SameAs(const IsoSurfaces_i* theOrigin) {
-  VISU::ScalarMap_i::SameAs(theOrigin);
+{
 }
 
 
index 9b442b68ba11918a8d52a31bd5dae820a481e349..94e099155f6c267a1d7d365f1cdeec9c80adde47 100644 (file)
@@ -45,7 +45,6 @@ namespace VISU{
     explicit
     IsoSurfaces_i(Result_i* theResult,
                  SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const IsoSurfaces_i* theOrigin);
     virtual ~IsoSurfaces_i();
 
     virtual VISU::VISUType GetType() { return VISU::TISOSURFACE;};
index fd62cdc115d7252b36c8c362c77f0d9c534533f1..701e27ebd8e1230d4a87342ed444ba50037cde2c 100644 (file)
@@ -80,7 +80,7 @@ void VISU::Mesh_i::RemoveFromStudy()
 }
 
 
-void VISU::Mesh_i::SameAs (const Mesh_i* theOrigin)
+void VISU::Mesh_i::SameAs (const Prs3d_i* theOrigin)
 {
   return; // "SameAs" command for mesh is not valid in current architecture
 }
index 6f7ffd5f2bce994717ad775d33a5a36d2b87d75d..a9eb6f7efdb51db3dfb4d6c4bf6ccd316bbcc193 100644 (file)
@@ -44,7 +44,7 @@ namespace VISU{
     explicit
     Mesh_i(Result_i* theResult,
           SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Mesh_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~Mesh_i();
     virtual void RemoveFromStudy();
 
index cb6dff6142132d652f050b9d297cb931738a094a..8b9fe28fb252c07355f900b89685c2b0e1bc1edb 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/
+//
 
 #include "VISU_Plot3D_i.hh"
 
@@ -49,11 +68,6 @@ VISU::Plot3D_i
   myPlot3DPL(NULL)
 {}
 
-void VISU::Plot3D_i::SameAs (const Plot3D_i* theOrigin)
-{
-  VISU::ScalarMap_i::SameAs(theOrigin);
-}
-
 VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
                                        const char* theFieldName, int theIteration)
 {
index 9e21442458657188dd0320ff12db19c5fcc24cd6..a20df36301779223aebed246cbdef493e6e517e7 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/
+//
 
 #ifndef VISU_Plot3D_i_HeaderFile
 #define VISU_Plot3D_i_HeaderFile
@@ -20,7 +39,6 @@ namespace VISU {
     explicit
     Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject);
 
-    virtual void SameAs (const Plot3D_i* theOrigin);
     virtual ~Plot3D_i();
 
     virtual VISU::VISUType GetType() { return VISU::TPLOT3D; };
index 8ca0c2f71b497b214c7d907bda0ba2ceee9be668..f16ae64cdef5dee3a50098a7fc255cdf15a638e1 100644 (file)
@@ -1177,7 +1177,13 @@ Restore(SALOMEDS::SObject_ptr theSObject,
       SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp);
       aStudyBuilder->LoadWith(aCompRefSObj, aDriver);
       if (strcmp(aDataType, "MED") == 0){
-       myInput = CreateMEDConvertor(aTargetRefSObj);
+        // create field or MED converter
+        CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
+        SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
+        if(!CORBA::is_nil(aField))
+          myInput = CreateMEDFieldConvertor(aField);
+        else
+          myInput = CreateMEDConvertor(aTargetRefSObj);
        myInput->Build();
       }else
        throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
index 39d883fcdfc96167e05b7eadb6276febd304b9b7..19bdd8dab31163858924ebdc0938cf4ea1906f39 100644 (file)
@@ -123,18 +123,20 @@ VISU::ScalarMap_i
 //----------------------------------------------------------------------------
 void
 VISU::ScalarMap_i
-::SameAs(const ScalarMap_i* theOrigin)
+::SameAs(const Prs3d_i* theOrigin)
 {
   TSuperClass::SameAs(theOrigin);
 
-  ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(theOrigin);
+  if(const ScalarMap_i* aPrs3d = dynamic_cast<const ScalarMap_i*>(theOrigin)){
+    ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
  
-  SetRange(anOrigin->GetMin(), anOrigin->GetMax());
-  myIsFixedRange = anOrigin->IsRangeFixed();
+    SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+    myIsFixedRange = anOrigin->IsRangeFixed();
 
-  SetScaling(anOrigin->GetScaling());
-
-  Update();
+    SetScaling(anOrigin->GetScaling());
+    
+    Update();
+  }
 }
 
 
@@ -309,6 +311,9 @@ VISU::ScalarMap_i
     TSuperClass::CreateActor(anActor,theIO);
     anActor->SetBarVisibility(true);
     anActor->SetRepresentation(2);
+    SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+    bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false);
+    anActor->SetShading(toUseShading);
     UpdateActor(anActor);
   }catch(...){
     anActor->Delete();
index 9e2e0b0d4cef0235ca8995199a7db47a42d09208..8506e46317bcd2a08f0f7dd7a795def55c4b8d44 100644 (file)
@@ -146,7 +146,7 @@ namespace VISU
 
     virtual 
     void
-    SameAs(const ScalarMap_i* theOrigin);
+    SameAs(const Prs3d_i* theOrigin);
 
     virtual 
     VISU_Actor* 
index 0ccf6dec34e8bddbaa510e52b7c0aacbb0565189..939cd3e031fd42e868792dc8c61fa49cfe8fb70c 100644 (file)
@@ -102,10 +102,14 @@ StreamLines_i(Result_i* theResult,
 }
 
 
-void VISU::StreamLines_i::SameAs(const StreamLines_i* theOrigin) {
-  StreamLines_i* aStreamLines = const_cast<StreamLines_i*>(theOrigin);
-  VISU::DeformedShape_i::SameAs(theOrigin);
-  SetSource(aStreamLines->GetSource());
+void VISU::StreamLines_i::SameAs(const Prs3d_i* theOrigin)
+{
+  TSuperClass::SameAs(theOrigin);
+
+  if(const StreamLines_i* aPrs3d = dynamic_cast<const StreamLines_i*>(theOrigin)) {
+    StreamLines_i* anOrigin = const_cast<StreamLines_i*>(aPrs3d);
+    SetSource(anOrigin->GetSource());
+  }
 }
 
 
index a952a9010f57f10c6b6e49ae0533d2f62954777e..2c5c4fef6f5a24e247ee5431d5899a23d2e1967f 100644 (file)
@@ -46,7 +46,7 @@ namespace VISU{
     explicit
     StreamLines_i(Result_i* theResult,
                  SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const StreamLines_i* theOriginal);
+    virtual void SameAs(const Prs3d_i* theOriginal);
     virtual ~StreamLines_i();
 
     virtual VISU::VISUType GetType() { return VISU::TSTREAMLINES;}
index ff41a959c4e05630afe8ba85e0f5aeedb1074ced..11c0e3f3e3b4f5d34a4157289fd3ee131ab661d6 100644 (file)
@@ -62,6 +62,7 @@ VISU_TimeAnimation::VISU_TimeAnimation (_PTR(Study) theStudy,
     VISU::View3D_i* pView = dynamic_cast<VISU::View3D_i*>(GetServant(theView3D).in());
     SUIT_ViewWindow* aVW = pView->GetViewWindow();
     myView = VISU::GetViewWindow(aVW);
+    connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
   }
 
   myMaxVal = 0;
@@ -504,8 +505,12 @@ void VISU_TimeAnimation::run()
     }
     myView->Repaint(false);
 
-    int delay = 100;
     if (isDumping) {
+      // We must unlock mutex for some time before grabbing to allow view updating
+      qApp->unlock();
+      msleep(100);
+      qApp->lock();
+
       QPixmap px = QPixmap::grabWindow(myView->winId());
       QString aFile(myDumpPath);
       QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
@@ -532,11 +537,11 @@ void VISU_TimeAnimation::run()
                  myFieldsLst[0].myTiming[myFrame]) / aOneVal;
        }
       }
-      delay = (int)(1000. * k / mySpeed);
+      int delay = (int)(1000. * k / mySpeed);
+      qApp->unlock();
+      msleep(delay);
+      qApp->lock();
     }
-    qApp->unlock();
-    msleep(delay);
-    qApp->lock();
 
     if (!myIsActive) break;
 
@@ -830,6 +835,11 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
   myAnimEntry = aStr.c_str();
 }
 
+void VISU_TimeAnimation::onViewDeleted()
+{
+  myView = 0;
+}
+
 
 //========================================================================
 //========================================================================
index 70a5d3f4a391f5d4e36b23c567fd34233294b9a6..ab1242abd58e3d9cebd66a28c9505026a2a26907 100644 (file)
@@ -129,6 +129,9 @@ class VISU_TimeAnimation: public QObject, public QThread
   void run();
   QString GenerateName();
 
+ private slots:
+   void onViewDeleted();
+   
  private:
   QString myLastError;
 
index 78c8e393a07c271dfb033a69a54fe26e3b65d88a..2826f8198b254d3d8cd90b28c1a5c82b4f850392 100644 (file)
@@ -97,11 +97,14 @@ Vectors_i(Result_i* theResult,
 }
 
 
-void VISU::Vectors_i::SameAs(const VISU::Vectors_i* theOrigin) {
-  Vectors_i* aVectors = const_cast<Vectors_i*>(theOrigin);
-  VISU::DeformedShape_i::SameAs(theOrigin);
+void VISU::Vectors_i::SameAs(const VISU::Prs3d_i* theOrigin)
+{
+  TSuperClass::SameAs(theOrigin);
 
-  SetLineWidth(aVectors->GetLineWidth());
+  if(const Vectors_i* aPrs3d = dynamic_cast<const Vectors_i*>(theOrigin)){
+    Vectors_i* anOrigin = const_cast<Vectors_i*>(aPrs3d);
+    SetLineWidth(anOrigin->GetLineWidth());
+  }
 }
 
 
index 4750308c5b0630b3bf98b54a7b3e2884b3658e9a..d74c25edad368e9d65f555f85de4ba2153721ec5 100644 (file)
@@ -45,7 +45,7 @@ namespace VISU{
     explicit
     Vectors_i(Result_i* theResult,
              SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Vectors_i* theOrigin);
+    virtual void SameAs(const Prs3d_i* theOrigin);
     virtual ~Vectors_i();
 
     virtual VISU::VISUType GetType() { return VISU::TVECTORS;};
index f382e73011d70ff7ab99d8bfb9f364486e71de34..c86ac5d8cd41b7aa83fbb1c2ed9cf0794ddebd8d 100644 (file)
@@ -55,6 +55,8 @@
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 
+#include <qapplication.h>
+
 using namespace std;
 
 #ifdef _DEBUG_
@@ -169,8 +171,10 @@ namespace VISU {
       //if (CheckStudy(myStudyDocument)) {
       if (myApplication) {
        TViewFrame* pView = new TViewFrame (myApplication);
-       if (pView->Create(1))
+       if (pView->Create(1)) {
          myResult = pView->_this();
+         qApp->processEvents(); // Fix for bug 9929
+       }
       }
     }
   };
index f109521824a72305e507d7f593d1a8553d89c42a..93d34b31e95746a29069fcde1a1e5ced7a66586c 100644 (file)
@@ -36,18 +36,19 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 
 # Libraries targets
 
-LIB = libVISU_Swigcmodule.la 
+LIB = libVISU_Swigcmodule.la
 LIB_SRC = VISU_Gen_s.cc
-SWIG_FLAGS += 
+SWIG_FLAGS +=
 
 SWIG_DEF = libVISU_Swig.i
 EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
-       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_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
 EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
 
-LIB_CLIENT_IDL = 
+LIB_CLIENT_IDL =
 
 CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
        $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
@@ -57,4 +58,3 @@ CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDE
 LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine
 
 @CONCLUDE@
\ No newline at end of file