+ orientation = orientation/2;
+ return orientation;
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvImageContour::updateWithFastCacheMode() {
+ // Compute orientation
+ int orientation = computeCurrentOrientation();
+
+ if ((mPreviousSlice == mSlice) && (mPreviousOrientation == orientation)) return;
+
+ vtkActor * actor = mListOfCachedContourActors[orientation][mSlice];
+ if (actor != NULL) {
+ mListOfCachedContourActors[orientation][mSlice]->VisibilityOn();
+ }
+ else {
+ vtkImageClip * mClipper;
+ vtkMarchingSquares * mSquares;
+ vtkActor * mSquaresActor;
+ createNewActor(&mSquaresActor, &mSquares, &mClipper, 0);
+ updateActor(mSquaresActor, mSquares, mClipper, mValue, orientation, mSlice);
+ mListOfCachedContourActors[orientation][mSlice] = mSquaresActor;
+ mSquaresActor->VisibilityOn();
+ }
+
+ if (mListOfCachedContourActors[mPreviousOrientation][mPreviousSlice] != NULL)
+ mListOfCachedContourActors[mPreviousOrientation][mPreviousSlice]->VisibilityOff();
+ mPreviousSlice = mSlice;
+ mPreviousOrientation = orientation;
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvImageContour::createNewActor(vtkActor ** actor,
+ vtkMarchingSquares ** squares,
+ vtkImageClip ** clipper,
+ int numImage) {
+ vtkActor * mSquaresActor = (*actor = vtkActor::New());
+ vtkImageClip * mClipper = (*clipper = vtkImageClip::New());
+ vtkMarchingSquares * mSquares = (*squares = vtkMarchingSquares::New());
+ vtkPolyDataMapper * mSquaresMapper = vtkPolyDataMapper::New();