]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL 19642 The sweep function doesn't work properly
authordmv <dmv@opencascade.com>
Mon, 19 May 2008 07:17:35 +0000 (07:17 +0000)
committerdmv <dmv@opencascade.com>
Mon, 19 May 2008 07:17:35 +0000 (07:17 +0000)
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_DeformedShapePL.hxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_Plot3DPL.hxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx
src/PIPELINE/VISU_VectorsPL.cxx

index 6631af081dda168fcf1ec15b0334ffc25b797cec..2a7f2c6a8d58ca1896766755b0f2716a48499701 100644 (file)
@@ -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 );
 }
 
 
index 6011e501175ce531c838a7011fb2883612867382..b3283bea6f929afffb00239c09e4d05aeed723e1 100644 (file)
@@ -99,6 +99,7 @@ protected:
                bool theIsCopyInput);
 
   vtkFloatingPointType myScaleFactor;
+  vtkFloatingPointType myMapScaleFactor;
   vtkWarpVector *myWarpVector;
   vtkCellDataToPointData* myCellDataToPointData;
 
index c53afe9d5bd1613343b0713f65555c8738c60a08..ed3750fc98da5e99604968c15c69e0d7ccc60fbe 100644 (file)
@@ -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 ) {
index 8585fb8ba2b4a36bba1cc79cfc84c1db2d9efaa2..7ec96d884bc7eb52ee8367e1f43ef00633533ac2 100644 (file)
@@ -146,7 +146,7 @@ protected:
 
   vtkFloatingPointType myAngle[3];
   bool myIsRelative, myIsContour;
-  vtkFloatingPointType myPosition, myScaleFactor;
+  vtkFloatingPointType myPosition, myScaleFactor, myMapScaleFactor;
   VISU_CutPlanesPL::PlaneOrientation myOrientation;
 
   vtkSmartPointer<vtkCellDataToPointData> myCellDataToPointData;
index 54ff4f87d1ab7144301338235aed7ef73b6aa27d..008939b52849b0001417f56c7313caf67d14abf3 100644 (file)
@@ -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);
 }
 
 //----------------------------------------------------------------------------
index 041a37d21082088c2b5b983b7ecd669cb35c1b77..ea7373598ebd0ce482d1d2bdf4fa6837e61d0b5e 100644 (file)
@@ -135,6 +135,7 @@ private:
   VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
 
   vtkFloatingPointType myScaleFactor;
+  vtkFloatingPointType myMapScaleFactor;
   vtkWarpVector  *myWarpVector;
   VISU_MergeFilter *myScalarsMergeFilter;
   vtkSmartPointer<vtkUnstructuredGrid> myScalars;
index 5192eefb9364d98ace4df4742eceac1571b35a0f..72b29ff8cf42db20c7a4c82bd22269ce05243290 100644 (file)
@@ -368,6 +368,7 @@ VISU_VectorsPL
 ::SetMapScale(vtkFloatingPointType theMapScale)
 {
   VISU_ScalarMapPL::SetMapScale(theMapScale);
+  myMapScaleFactor = theMapScale;
 
   myBaseGlyph->SetScaleFactor(myScaleFactor*theMapScale);
   myTransformedGlyph->SetScaleFactor(myScaleFactor*theMapScale);