From: apo Date: Thu, 25 Sep 2008 11:33:44 +0000 (+0000) Subject: Fix for Bug VISU200819961 X-Git-Tag: TG_VISU_2008_Development_Finished~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ee89a1b9aae207aba1ab49c434c28c61759657c9;p=modules%2Fvisu.git Fix for Bug VISU200819961 Sweep functionality doesn?t operate with Gauss Points presentation. --- diff --git a/src/VISUGUI/VisuGUI_Sweep.cxx b/src/VISUGUI/VisuGUI_Sweep.cxx index f447bb5a..1b5ee038 100644 --- a/src/VISUGUI/VisuGUI_Sweep.cxx +++ b/src/VISUGUI/VisuGUI_Sweep.cxx @@ -35,7 +35,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" -#include "VISU_ScalarMap_i.hh" +#include "VISU_ColoredPrs3d_i.hh" #include "VISU_Actor.h" #include "QtxDockWidget.h" @@ -337,15 +337,15 @@ void VisuGUI_Sweep::onSelectionChanged() connect( myViewWindow, SIGNAL( destroyed( QObject * ) ), this, SLOT( onSelectionChanged() ) ); } - VISU::ScalarMap_i* aScalarMap = dynamic_cast< VISU::ScalarMap_i* >( aPrs3d ); - anIsValidSelection &= ( aScalarMap && aScalarMap->IsTimeStampFixed() ); + VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aPrs3d ); + anIsValidSelection &= ( aColoredPrs3d && aColoredPrs3d->IsTimeStampFixed() ); - if ( myScalarMap ) { - myScalarMap->SetMapScale( 1.0 ); - myScalarMap->UpdateActors(); + if ( myColoredPrs3d ) { + myColoredPrs3d->SetMapScale( 1.0 ); + myColoredPrs3d->UpdateActors(); } - myScalarMap = aScalarMap; + myColoredPrs3d = aColoredPrs3d; anIsValidSelection &= ( anActor && anActor->GetVisibility() ); @@ -356,7 +356,7 @@ void VisuGUI_Sweep::onSelectionChanged() //---------------------------------------------------------------------------- void VisuGUI_Sweep::onValueChanged( int value ) { - bool anIsValidSelection = ( myScalarMap && myActor.GetPointer() ); + bool anIsValidSelection = ( myColoredPrs3d && myActor.GetPointer() ); if ( !anIsValidSelection ) return; @@ -397,8 +397,8 @@ void VisuGUI_Sweep::onValueChanged( int value ) } try { - myScalarMap->SetMapScale( aValue ); - myScalarMap->UpdateActor( myActor ); + myColoredPrs3d->SetMapScale( aValue ); + myColoredPrs3d->UpdateActor( myActor ); myViewWindow->Repaint(); } catch (std::exception& exc) { INFOS( "Follow exception was occured :\n" << exc.what() ); diff --git a/src/VISUGUI/VisuGUI_Sweep.h b/src/VISUGUI/VisuGUI_Sweep.h index 23fa3402..09117472 100644 --- a/src/VISUGUI/VisuGUI_Sweep.h +++ b/src/VISUGUI/VisuGUI_Sweep.h @@ -55,7 +55,7 @@ class VisuGUI; namespace VISU { - class ScalarMap_i; + class ColoredPrs3d_i; } @@ -132,7 +132,7 @@ private: SVTK_ViewWindow* myViewWindow; vtkSmartPointer< VISU_Actor > myActor; - SALOME::GenericObjPtr< VISU::ScalarMap_i > myScalarMap; + SALOME::GenericObjPtr< VISU::ColoredPrs3d_i > myColoredPrs3d; }; diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 8736573f..241d65b7 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -1881,6 +1881,15 @@ VISU::ColoredPrs3d_i } +//---------------------------------------------------------------------------- +void +VISU::ColoredPrs3d_i +::SetMapScale(double theMapScale) +{ + GetSpecificPL()->SetMapScale(theMapScale); +} + + //---------------------------------------------------------------------------- void VISU::ColoredPrs3d_i diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 52f5f631..a99da51a 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -571,6 +571,10 @@ namespace VISU vtkFloatingPointType theG, vtkFloatingPointType theB); + virtual + void + SetMapScale(double theMapScale = 1.0); + VISU_ColoredPL* GetSpecificPL() const { diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 75c66379..dc1640be 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -378,14 +378,6 @@ VISU::ScalarMap_i TSuperClass::CreatePipeLine(myScalarMapPL); } -//---------------------------------------------------------------------------- -void -VISU::ScalarMap_i -::SetMapScale(double theMapScale) -{ - GetSpecificPL()->SetMapScale(theMapScale); -} - //---------------------------------------------------------------------------- VISU_Actor* VISU::ScalarMap_i @@ -444,8 +436,8 @@ VISU::ScalarMap_i VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar(); aScalarBar->SetLookupTable( aLookupTable ); - aScalarBar->SetDistribution( GetSpecificPL()->GetDistribution() ); - aScalarBar->SetDistributionVisibility( GetIsDistributionVisible() ); + //aScalarBar->SetDistribution( GetSpecificPL()->GetDistribution() ); + //aScalarBar->SetDistributionVisibility( GetIsDistributionVisible() ); aScalarBar->SetTitle(GetScalarBarTitle().c_str()); aScalarBar->SetOrientation(GetBarOrientation()); diff --git a/src/VISU_I/VISU_ScalarMap_i.hh b/src/VISU_I/VISU_ScalarMap_i.hh index 5eff7e76..ce4090a3 100644 --- a/src/VISU_I/VISU_ScalarMap_i.hh +++ b/src/VISU_I/VISU_ScalarMap_i.hh @@ -163,10 +163,6 @@ namespace VISU Restore(SALOMEDS::SObject_ptr theSObject, const Storable::TRestoringMap& theMap); - virtual - void - SetMapScale(double theMapScale = 1.0); - virtual void SameAs(const Prs3d_i* theOrigin);