Salome HOME
Fix for Bug IPAL11495
authorapo <apo@opencascade.com>
Wed, 8 Feb 2006 06:28:55 +0000 (06:28 +0000)
committerapo <apo@opencascade.com>
Wed, 8 Feb 2006 06:28:55 +0000 (06:28 +0000)
   REGRESSION of the animation Iso Surfaces

src/VISU_I/VISU_TimeAnimation.cxx

index 34023596aa871814ea0b000a1f356459c69f4c96..ff691ec51f9ac4857b2cf5225afb44e8f67f4837 100644 (file)
@@ -162,10 +162,14 @@ namespace
                        FieldData& theData,
                        VISU::Result_i* theResult,
                        bool theIsRangeDefined,
-                       CORBA::Double theMinVal,
-                       CORBA::Double theMaxVal)
+                       CORBA::Double& theMinVal,
+                       CORBA::Double& theMaxVal,
+                       CORBA::Double theTimeMin,
+                       CORBA::Double theTimeMax)
   {
-    double aMin = VTK_LARGE_FLOAT, aMax = -VTK_LARGE_FLOAT;
+    theMinVal = VTK_LARGE_FLOAT;
+    theMaxVal = -VTK_LARGE_FLOAT;
+
     _PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
     anIter->Next(); // First is reference on support
 
@@ -181,9 +185,9 @@ namespace
 
       theData.myTiming[aFrameId] = VISU_TimeAnimation::getTimeValue(aTimeStamp);
       if (theIsRangeDefined) {
-       if (theData.myTiming[aFrameId] < theMinVal
+       if (theData.myTiming[aFrameId] < theTimeMin
          continue;
-       if (theData.myTiming[aFrameId] > theMaxVal
+       if (theData.myTiming[aFrameId] > theTimeMax
          break;
       }
 
@@ -198,8 +202,8 @@ namespace
                       aFieldName.latin1(), aTimeStampId);
       theData.myPrs[aFrameId++] = aPresent;
 
-      aMin = std::min(aPresent->GetMin(),aMin);
-      aMax = std::min(aPresent->GetMax(),aMax);
+      theMinVal = std::min(aPresent->GetMin(),theMinVal);
+      theMaxVal = std::max(aPresent->GetMax(),theMaxVal);
     }
     theData.myNbFrames = aFrameId;
 
@@ -208,7 +212,7 @@ namespace
       if( aRangeType != 1 ){
        for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
          if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
-           aPrs->SetRange(aMin, aMax);
+           aPrs->SetRange(theMinVal, theMaxVal);
            aPrs->SetOffset(theData.myOffset);
          }
        }
@@ -216,7 +220,7 @@ namespace
       if (theData.myPrsType == VISU::TISOSURFACE)
        for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++)
          if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(theData.myPrs[aFrameId]))
-           aPrs->SetSubRange(aMin, aMax);
+           aPrs->SetSubRange(theMinVal, theMaxVal);
     }
   }
 }
@@ -238,31 +242,94 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
   using namespace VISU;
   switch (aData.myPrsType) {
   case VISU::TSCALARMAP: // ScalarMap
-    GeneratePresentations<ScalarMap_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<ScalarMap_i>(myStudy,
+                                      aData,
+                                      aResult,
+                                      isRangeDefined(),
+                                      myMinVal,
+                                      myMaxVal,
+                                      myTimeMin,
+                                      myTimeMax);
     break;
   case VISU::TISOSURFACE: // Iso Surfaces
-    GeneratePresentations<IsoSurfaces_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<IsoSurfaces_i>(myStudy,
+                                        aData,
+                                        aResult,
+                                        isRangeDefined(),
+                                        myMinVal,
+                                        myMaxVal,
+                                        myTimeMin,
+                                        myTimeMax);
     break;
   case VISU::TCUTPLANES: // Cut Planes
-    GeneratePresentations<CutPlanes_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<CutPlanes_i>(myStudy,
+                                      aData,
+                                      aResult,
+                                      isRangeDefined(),
+                                      myMinVal,
+                                      myMaxVal,
+                                      myTimeMin,
+                                      myTimeMax);
     break;
   case VISU::TPLOT3D: // Plot3d
-    GeneratePresentations<Plot3D_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<Plot3D_i>(myStudy,
+                                   aData,
+                                   aResult,
+                                   isRangeDefined(),
+                                   myMinVal,
+                                   myMaxVal,
+                                   myTimeMin,
+                                   myTimeMax);
     break;
   case VISU::TDEFORMEDSHAPE: // Deformed Shape
-    GeneratePresentations<DeformedShape_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<DeformedShape_i>(myStudy,
+                                          aData,
+                                          aResult,
+                                          isRangeDefined(),
+                                          myMinVal,
+                                          myMaxVal,
+                                          myTimeMin,
+                                          myTimeMax);
     break;
   case VISU::TVECTORS: // Vectors
-    GeneratePresentations<Vectors_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<Vectors_i>(myStudy,
+                                    aData,
+                                    aResult,
+                                    isRangeDefined(),
+                                    myMinVal,
+                                    myMaxVal,
+                                    myTimeMin,
+                                    myTimeMax);
     break;
   case VISU::TSTREAMLINES: // Stream Lines
-    GeneratePresentations<StreamLines_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<StreamLines_i>(myStudy,
+                                        aData,
+                                        aResult,
+                                        isRangeDefined(),
+                                        myMinVal,
+                                        myMaxVal,
+                                        myTimeMin,
+                                        myTimeMax);
     break;
   case VISU::TGAUSSPOINTS: // Gauss Points
-    GeneratePresentations<GaussPoints_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<GaussPoints_i>(myStudy,
+                                        aData,
+                                        aResult,
+                                        isRangeDefined(),
+                                        myMinVal,
+                                        myMaxVal,
+                                        myTimeMin,
+                                        myTimeMax);
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
-    GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,aData,aResult,isRangeDefined(),myMinVal,myMaxVal);
+    GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
+                                                     aData,
+                                                     aResult,
+                                                     isRangeDefined(),
+                                                     myMinVal,
+                                                     myMaxVal,
+                                                     myTimeMin,
+                                                     myTimeMax);
     break;
   default:
     MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);