From: dmv Date: Mon, 19 May 2008 07:17:35 +0000 (+0000) Subject: NPAL 19642 The sweep function doesn't work properly X-Git-Tag: TG_start_Deformed_CutPlanes~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aed0a487f416b272e9cd68ff3d031fe2d6c46729;p=modules%2Fvisu.git NPAL 19642 The sweep function doesn't work properly --- diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 6631af08..2a7f2c6a 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -39,7 +39,8 @@ vtkStandardNewMacro(VISU_DeformedShapePL); //---------------------------------------------------------------------------- VISU_DeformedShapePL ::VISU_DeformedShapePL(): - myScaleFactor(0.0) + myScaleFactor(0.0), + myMapScaleFactor(1.0) { SetIsShrinkable(true); @@ -139,8 +140,8 @@ VISU_DeformedShapePL { if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), theScale)) return; - - myWarpVector->SetScaleFactor(theScale); + + myWarpVector->SetScaleFactor(theScale*myMapScaleFactor); myScaleFactor = theScale; } @@ -215,9 +216,14 @@ void VISU_DeformedShapePL ::SetMapScale(vtkFloatingPointType theMapScale) { + myMapScaleFactor = theMapScale; Superclass::SetMapScale(theMapScale); - myWarpVector->SetScaleFactor(myScaleFactor*theMapScale); + vtkFloatingPointType aMapScale = myScaleFactor * theMapScale; + if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), aMapScale)) + return; + + myWarpVector->SetScaleFactor( aMapScale ); } diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index 6011e501..b3283bea 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -99,6 +99,7 @@ protected: bool theIsCopyInput); vtkFloatingPointType myScaleFactor; + vtkFloatingPointType myMapScaleFactor; vtkWarpVector *myWarpVector; vtkCellDataToPointData* myCellDataToPointData; diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index c53afe9d..ed3750fc 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -56,7 +56,8 @@ VISU_Plot3DPL myIsRelative(true), myIsContour(false), myPosition(0.5), - myScaleFactor(1.0) + myScaleFactor(1.0), + myMapScaleFactor(1.0) { SetIsShrinkable(false); @@ -315,7 +316,7 @@ VISU_Plot3DPL ::SetScaleFactor(vtkFloatingPointType theScaleFactor) { myScaleFactor = theScaleFactor; - myWarpScalar->SetScaleFactor(theScaleFactor); + myWarpScalar->SetScaleFactor(theScaleFactor*myMapScaleFactor); } @@ -524,6 +525,7 @@ void VISU_Plot3DPL ::SetMapScale(vtkFloatingPointType theMapScale) { + myMapScaleFactor = theMapScale; Superclass::SetMapScale(theMapScale); if ( myIsContour ) { diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 8585fb8b..7ec96d88 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -146,7 +146,7 @@ protected: vtkFloatingPointType myAngle[3]; bool myIsRelative, myIsContour; - vtkFloatingPointType myPosition, myScaleFactor; + vtkFloatingPointType myPosition, myScaleFactor, myMapScaleFactor; VISU_CutPlanesPL::PlaneOrientation myOrientation; vtkSmartPointer myCellDataToPointData; diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 54ff4f87..008939b5 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -55,7 +55,8 @@ vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL) */ VISU_ScalarMapOnDeformedShapePL ::VISU_ScalarMapOnDeformedShapePL(): - myScaleFactor(0.0) + myScaleFactor(0.0), + myMapScaleFactor(1.0) { myWarpVector = vtkWarpVector::New(); @@ -264,7 +265,7 @@ VISU_ScalarMapOnDeformedShapePL if(VISU::CheckIsSameValue(myScaleFactor, theScale)) return; - myWarpVector->SetScaleFactor(theScale); + myWarpVector->SetScaleFactor(theScale*myMapScaleFactor); myScaleFactor = theScale; } @@ -276,7 +277,7 @@ vtkFloatingPointType VISU_ScalarMapOnDeformedShapePL ::GetScale() { - return myWarpVector->GetScaleFactor(); + return myScaleFactor; } //---------------------------------------------------------------------------- @@ -287,8 +288,15 @@ void VISU_ScalarMapOnDeformedShapePL ::SetMapScale(vtkFloatingPointType theMapScale) { + myMapScaleFactor = theMapScale; Superclass::SetMapScale(theMapScale); - myWarpVector->SetScaleFactor(myScaleFactor*theMapScale); + + vtkFloatingPointType aMapScale = myScaleFactor * theMapScale; + + if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), aMapScale)) + return; + + myWarpVector->SetScaleFactor(aMapScale); } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index 041a37d2..ea737359 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -135,6 +135,7 @@ private: VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&); vtkFloatingPointType myScaleFactor; + vtkFloatingPointType myMapScaleFactor; vtkWarpVector *myWarpVector; VISU_MergeFilter *myScalarsMergeFilter; vtkSmartPointer myScalars; diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 5192eefb..72b29ff8 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -368,6 +368,7 @@ VISU_VectorsPL ::SetMapScale(vtkFloatingPointType theMapScale) { VISU_ScalarMapPL::SetMapScale(theMapScale); + myMapScaleFactor = theMapScale; myBaseGlyph->SetScaleFactor(myScaleFactor*theMapScale); myTransformedGlyph->SetScaleFactor(myScaleFactor*theMapScale);