From: enk Date: Tue, 12 Dec 2006 13:52:01 +0000 (+0000) Subject: Fix for Bug NPAL14202: X-Git-Tag: V3_2_4~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6c458290f7e1f94706cb6cef47e6352f73096dd8;p=modules%2Fvisu.git Fix for Bug NPAL14202: EDF 341 : Sweep is not working on ScalarMapOnDeformedShape --- diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 41dd9936..60c3bf5b 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -134,8 +134,7 @@ VISU_ScalarMapOnDeformedShapePL { this->UpdateScalars(); - vtkFloatingPointType aRange[2]; - GetSourceRange(aRange); + vtkFloatingPointType* aRange = GetScalarRange(); vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]}; if(myBarTable->GetScale() == VTK_SCALE_LOG10) @@ -174,9 +173,6 @@ VISU_ScalarMapOnDeformedShapePL if(aPipeLine){ SetScale(aPipeLine->GetScale()); SetScalars(aPipeLine->GetScalarsUnstructuredGrid()); - vtkFloatingPointType aRange[2]; - aPipeLine->GetSourceRange(aRange); - SetScalarRange(aRange); } Superclass::ShallowCopy(thePipeLine); } @@ -240,8 +236,7 @@ vtkFloatingPointType VISU_ScalarMapOnDeformedShapePL ::GetScale() { - vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor(); - return aScale; + return myScaleFactor; } /*! @@ -251,6 +246,7 @@ void VISU_ScalarMapOnDeformedShapePL ::SetMapScale(vtkFloatingPointType theMapScale) { + TSupperClass::SetMapScale(theMapScale); // enk::added myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale); Modified(); } diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index 244879cc..898e38f3 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -195,11 +195,27 @@ CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){ return myScalarMapOnDeformedShapePL->GetScale(); } +void +VISU::ScalarMapOnDeformedShape_i +::SetRange(CORBA::Double theMin, CORBA::Double theMax) +{ + if(theMin > theMax) + return; + vtkFloatingPointType aScalarRange[2] = {theMin, theMax}; + myScalarMapOnDeformedShapePL->SetScalarRange(aScalarRange); + myIsFixedRange = true; +} + void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){ - vtkFloatingPointType aRange[2]; - aRange[0] = vtkFloatingPointType(theMinRange); - aRange[1] = vtkFloatingPointType(theMaxRange); - myScalarMapOnDeformedShapePL->SetScalarRange(aRange); + SetRange(theMinRange,theMaxRange); +} + +void +VISU::ScalarMapOnDeformedShape_i +::SetSourceRange() +{ + myScalarMapOnDeformedShapePL->SetSourceRange(); + myIsFixedRange = false; } CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){ @@ -353,3 +369,24 @@ VISU::ScalarMapOnDeformedShape_i { return myScalarField; } + +void +VISU::ScalarMapOnDeformedShape_i +::SetMapScale(double theMapScale) +{ + myScalarMapOnDeformedShapePL->SetMapScale(theMapScale); +} + +CORBA::Double +VISU::ScalarMapOnDeformedShape_i +::GetMin() +{ + return myScalarMapOnDeformedShapePL->GetScalarRange()[0]; +} + +CORBA::Double +VISU::ScalarMapOnDeformedShape_i +::GetMax() +{ + return myScalarMapOnDeformedShapePL->GetScalarRange()[1]; +} diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh index 7914398b..01542563 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh @@ -64,6 +64,10 @@ namespace VISU{ virtual void SetScale(CORBA::Double theScale); virtual CORBA::Double GetScale(); + virtual + void + SetRange(CORBA::Double theMin, CORBA::Double theMax); + virtual CORBA::Boolean IsColored() { return myIsColored; } virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; } @@ -71,6 +75,19 @@ namespace VISU{ virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;} virtual void SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange); + + virtual + CORBA::Double + GetMin(); + + virtual + CORBA::Double + GetMax(); + + virtual + void + SetSourceRange(); + virtual CORBA::Double GetSourceRangeMin(); virtual CORBA::Double GetSourceRangeMax(); @@ -114,6 +131,11 @@ namespace VISU{ static Storable* Restore(SALOMEDS::SObject_ptr theSObject, const std::string& thePrefix, const Storable::TRestoringMap& theMap); + + virtual + void + SetMapScale(double theMapScale = 1.0); + static const std::string myComment; virtual const char* GetComment() const;