+public:
+ typedef vvImageContour Self;
+ typedef itk::SmartPointer<Self> Pointer;
+ itkNewMacro(Self);
+
+ void SetSlicer(vvSlicer * slicer);
+ void Update(double value);
+ void HideActors();
+ void ShowActors();
+ void SetColor(double r, double g, double b);
+ void SetLineWidth(double w);
+ void SetImage(vvImage * image);
+ void SetPreserveMemoryModeEnabled(bool b);
+
+protected:
+ vvSlicer * mSlicer;
+ int mSlice;
+ int mTSlice;
+ double mValue;
+ int mPreviousTSlice;
+ double mPreviousValue;
+ bool mHiddenImageIsUsed;
+ vvImage * mHiddenImage;
+ bool mDisplayModeIsPreserveMemory;
+
+ // For preserveMemory mode
+ std::vector<vtkSmartPointer<vtkActor> > mSquaresActorList;
+ std::vector<vtkSmartPointer<vtkImageClip> > mClipperList;
+ std::vector<vtkSmartPointer<vtkMarchingSquares> > mSquaresList;
+ std::vector<vtkSmartPointer<vtkPolyDataMapper> > mSquaresMapperList;
+
+ // For fast cache mode
+ int mPreviousSlice;
+ int mPreviousOrientation;
+ std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
+
+ // Functions
+ void InitializeCacheMode();
+ void UpdateWithPreserveMemoryMode();
+ void UpdateWithFastCacheMode();
+ void CreateNewActor(int numImage);
+ void UpdateActor(vtkActor * actor, vtkPolyDataMapper * mapper, vtkMarchingSquares * squares, vtkImageClip * clipper,
+ double threshold, int orientation, int slice);
+ void CreateActor(int orientation, int slice);
+ int ComputeCurrentOrientation();
+
+private: