From: eap Date: Wed, 4 May 2005 06:35:54 +0000 (+0000) Subject: PostPro 2005, T1.5: 2D fields displayed in 3D. Add SetMapScale() X-Git-Tag: V2_2_0_VISU_improvement_2005-05-27~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4cfc790c9927bb3c5573666092794e315f43138f;p=modules%2Fvisu.git PostPro 2005, T1.5: 2D fields displayed in 3D. Add SetMapScale() --- diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index 920e6427..69e0fb48 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -53,7 +53,8 @@ VISU_Plot3DPL::VISU_Plot3DPL(): myOrientation(VISU_CutPlanesPL::YZ), myIsRelative(true), myIsContour(false), - myPosition(0.5) + myPosition(0.5), + myScaleFactor(1.) { myAngle[0] = myAngle[1] = myAngle[2] = 0.; SetNumberOfContours(32); @@ -220,6 +221,7 @@ void VISU_Plot3DPL:: SetScaleFactor(float theScaleFactor) { + myScaleFactor = theScaleFactor; myWarpScalar->SetScaleFactor(theScaleFactor); } @@ -227,7 +229,7 @@ float VISU_Plot3DPL:: GetScaleFactor() const { - return myWarpScalar->GetScaleFactor(); + return myScaleFactor; } void @@ -365,3 +367,15 @@ void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const maxPos = aBoundPrj[1]; } +//======================================================================= +//function : SetMapScale +//purpose : +//======================================================================= + +void VISU_Plot3DPL::SetMapScale(float theMapScale) +{ + VISU_ScalarMapPL::SetMapScale(theMapScale); + + myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale); + Modified(); +} diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 467e81eb..71275838 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -108,12 +108,14 @@ public: float GetScaleFactor(vtkDataSet* theDataSet); + void SetMapScale(float theMapScale); + protected: virtual THook* DoHook(); float myAngle[3]; bool myIsRelative, myIsContour; - float myPosition; + float myPosition, myScaleFactor; VISU_CutPlanesPL::PlaneOrientation myOrientation; TVTKSmartPtr myCellDataToPointData; diff --git a/src/VISU_I/VISU_Plot3D_i.cc b/src/VISU_I/VISU_Plot3D_i.cc index 9528e62a..9a13def0 100644 --- a/src/VISU_I/VISU_Plot3D_i.cc +++ b/src/VISU_I/VISU_Plot3D_i.cc @@ -154,3 +154,8 @@ void VISU::Plot3D_i::DoHook() ScalarMap_i::DoHook(); } + +void VISU::Plot3D_i::SetMapScale(double theMapScale) +{ + myPlot3DPL->SetMapScale(theMapScale); +} diff --git a/src/VISU_I/VISU_Plot3D_i.hh b/src/VISU_I/VISU_Plot3D_i.hh index 48930196..fe68916a 100644 --- a/src/VISU_I/VISU_Plot3D_i.hh +++ b/src/VISU_I/VISU_Plot3D_i.hh @@ -47,6 +47,8 @@ namespace VISU { typedef VISU::Plot3D TInterface; VISU_Plot3DPL* GetPlot3DPL() { return myPlot3DPL; } + void SetMapScale(double theMapScale); + protected: virtual void DoHook();