From 257babb4ce69e2c8728d717ad4c55a7a4ba2c59a Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 11 Jan 2006 08:24:19 +0000 Subject: [PATCH] Merge with OCC_development_generic_2006 --- doc/salome/tui/VISU/doxyfile | 2 +- idl/VISU_Gen.idl | 16 ++++++ src/PIPELINE/VISU_CutLinesPL.cxx | 1 + src/VISUGUI/VisuGUI.cxx | 73 ++++++++++++++++++------- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 11 ++-- src/VISU_I/VISU_ColoredPrs3d_i.cc | 76 ++++++++++++++------------- src/VISU_I/VISU_ColoredPrs3d_i.hh | 2 +- src/VISU_I/VISU_CutLines_i.cc | 4 -- src/VISU_I/VISU_CutLines_i.hh | 1 - src/VISU_I/VISU_CutPlanes_i.cc | 6 +-- src/VISU_I/VISU_CutPlanes_i.hh | 1 - src/VISU_I/VISU_DeformedShape_i.cc | 12 +++-- src/VISU_I/VISU_DeformedShape_i.hh | 2 +- src/VISU_I/VISU_Gen_i.cc | 12 ++--- src/VISU_I/VISU_IsoSurfaces_i.cc | 6 +-- src/VISU_I/VISU_IsoSurfaces_i.hh | 1 - src/VISU_I/VISU_Mesh_i.cc | 2 +- src/VISU_I/VISU_Mesh_i.hh | 2 +- src/VISU_I/VISU_Plot3D_i.cc | 24 +++++++-- src/VISU_I/VISU_Plot3D_i.hh | 20 ++++++- src/VISU_I/VISU_Result_i.cc | 8 ++- src/VISU_I/VISU_ScalarMap_i.cc | 19 ++++--- src/VISU_I/VISU_ScalarMap_i.hh | 2 +- src/VISU_I/VISU_StreamLines_i.cc | 12 +++-- src/VISU_I/VISU_StreamLines_i.hh | 2 +- src/VISU_I/VISU_TimeAnimation.cxx | 20 +++++-- src/VISU_I/VISU_TimeAnimation.h | 3 ++ src/VISU_I/VISU_Vectors_i.cc | 11 ++-- src/VISU_I/VISU_Vectors_i.hh | 2 +- src/VISU_I/VISU_ViewManager_i.cc | 6 ++- src/VISU_SWIG/Makefile.in | 14 ++--- 31 files changed, 241 insertions(+), 132 deletions(-) diff --git a/doc/salome/tui/VISU/doxyfile b/doc/salome/tui/VISU/doxyfile index b4346ae4..41139fc8 100755 --- a/doc/salome/tui/VISU/doxyfile +++ b/doc/salome/tui/VISU/doxyfile @@ -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 diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 0ee7fe63..e00e0600 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -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); }; //------------------------------------------------------- diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 7f53c951..b518dfad 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -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); diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 19f17b0b..5d6a80da 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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& ) diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 5faeddb0..a3523965 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -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)); } //------------------------------------------------------------------------ diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index b38c88b2..94b2e9d1 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -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(theOrigin)){ + DoHook(); - ColoredPrs3d_i* anOrigin = const_cast(theOrigin); + ColoredPrs3d_i* anOrigin = const_cast(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) diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 1e09eb7a..e03d772e 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -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. diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index caf7aee2..08857545 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -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 */ diff --git a/src/VISU_I/VISU_CutLines_i.hh b/src/VISU_I/VISU_CutLines_i.hh index 637e7b83..cdc7184a 100644 --- a/src/VISU_I/VISU_CutLines_i.hh +++ b/src/VISU_I/VISU_CutLines_i.hh @@ -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;}; diff --git a/src/VISU_I/VISU_CutPlanes_i.cc b/src/VISU_I/VISU_CutPlanes_i.cc index cff4a1a2..ac378461 100644 --- a/src/VISU_I/VISU_CutPlanes_i.cc +++ b/src/VISU_I/VISU_CutPlanes_i.cc @@ -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); +{ } diff --git a/src/VISU_I/VISU_CutPlanes_i.hh b/src/VISU_I/VISU_CutPlanes_i.hh index b6806243..66c2d913 100644 --- a/src/VISU_I/VISU_CutPlanes_i.hh +++ b/src/VISU_I/VISU_CutPlanes_i.hh @@ -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;}; diff --git a/src/VISU_I/VISU_DeformedShape_i.cc b/src/VISU_I/VISU_DeformedShape_i.cc index ae4dbe45..478b7dfc 100644 --- a/src/VISU_I/VISU_DeformedShape_i.cc +++ b/src/VISU_I/VISU_DeformedShape_i.cc @@ -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(theOrigin); - VISU::ScalarMap_i::SameAs(theOrigin); + TSuperClass::SameAs(theOrigin); - SetColor(aDefShape->GetColor()); - ShowColored(aDefShape->IsColored()); + if(const DeformedShape_i* aPrs3d = dynamic_cast(theOrigin)){ + DeformedShape_i* anOrigin = const_cast(aPrs3d); + SetColor(anOrigin->GetColor()); + ShowColored(anOrigin->IsColored()); + } } diff --git a/src/VISU_I/VISU_DeformedShape_i.hh b/src/VISU_I/VISU_DeformedShape_i.hh index 39606011..e6fccb44 100644 --- a/src/VISU_I/VISU_DeformedShape_i.hh +++ b/src/VISU_I/VISU_DeformedShape_i.hh @@ -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;}; diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 5e0a5867..46094327 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -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(aDir)); + string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir (const_cast(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(aDir)); + string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<(aDir)); + string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<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 !!!"); diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 39d883fc..19bdd8da 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -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(theOrigin); + if(const ScalarMap_i* aPrs3d = dynamic_cast(theOrigin)){ + ScalarMap_i* anOrigin = const_cast(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(); diff --git a/src/VISU_I/VISU_ScalarMap_i.hh b/src/VISU_I/VISU_ScalarMap_i.hh index 9e2e0b0d..8506e463 100644 --- a/src/VISU_I/VISU_ScalarMap_i.hh +++ b/src/VISU_I/VISU_ScalarMap_i.hh @@ -146,7 +146,7 @@ namespace VISU virtual void - SameAs(const ScalarMap_i* theOrigin); + SameAs(const Prs3d_i* theOrigin); virtual VISU_Actor* diff --git a/src/VISU_I/VISU_StreamLines_i.cc b/src/VISU_I/VISU_StreamLines_i.cc index 0ccf6dec..939cd3e0 100644 --- a/src/VISU_I/VISU_StreamLines_i.cc +++ b/src/VISU_I/VISU_StreamLines_i.cc @@ -102,10 +102,14 @@ StreamLines_i(Result_i* theResult, } -void VISU::StreamLines_i::SameAs(const StreamLines_i* theOrigin) { - StreamLines_i* aStreamLines = const_cast(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(theOrigin)) { + StreamLines_i* anOrigin = const_cast(aPrs3d); + SetSource(anOrigin->GetSource()); + } } diff --git a/src/VISU_I/VISU_StreamLines_i.hh b/src/VISU_I/VISU_StreamLines_i.hh index a952a901..2c5c4fef 100644 --- a/src/VISU_I/VISU_StreamLines_i.hh +++ b/src/VISU_I/VISU_StreamLines_i.hh @@ -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;} diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index ff41a959..11c0e3f3 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -62,6 +62,7 @@ VISU_TimeAnimation::VISU_TimeAnimation (_PTR(Study) theStudy, VISU::View3D_i* pView = dynamic_cast(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; +} + //======================================================================== //======================================================================== diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index 70a5d3f4..ab1242ab 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -129,6 +129,9 @@ class VISU_TimeAnimation: public QObject, public QThread void run(); QString GenerateName(); + private slots: + void onViewDeleted(); + private: QString myLastError; diff --git a/src/VISU_I/VISU_Vectors_i.cc b/src/VISU_I/VISU_Vectors_i.cc index 78c8e393..2826f819 100644 --- a/src/VISU_I/VISU_Vectors_i.cc +++ b/src/VISU_I/VISU_Vectors_i.cc @@ -97,11 +97,14 @@ Vectors_i(Result_i* theResult, } -void VISU::Vectors_i::SameAs(const VISU::Vectors_i* theOrigin) { - Vectors_i* aVectors = const_cast(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(theOrigin)){ + Vectors_i* anOrigin = const_cast(aPrs3d); + SetLineWidth(anOrigin->GetLineWidth()); + } } diff --git a/src/VISU_I/VISU_Vectors_i.hh b/src/VISU_I/VISU_Vectors_i.hh index 4750308c..d74c25ed 100644 --- a/src/VISU_I/VISU_Vectors_i.hh +++ b/src/VISU_I/VISU_Vectors_i.hh @@ -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;}; diff --git a/src/VISU_I/VISU_ViewManager_i.cc b/src/VISU_I/VISU_ViewManager_i.cc index f382e730..c86ac5d8 100644 --- a/src/VISU_I/VISU_ViewManager_i.cc +++ b/src/VISU_I/VISU_ViewManager_i.cc @@ -55,6 +55,8 @@ #include #include +#include + 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 + } } } }; diff --git a/src/VISU_SWIG/Makefile.in b/src/VISU_SWIG/Makefile.in index f1095218..93d34b31 100644 --- a/src/VISU_SWIG/Makefile.in +++ b/src/VISU_SWIG/Makefile.in @@ -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 -- 2.39.2