00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024 #ifndef __vtkSpherePuzzle_h
00025 #define __vtkSpherePuzzle_h
00026
00027 #include "vtkPolyDataAlgorithm.h"
00028
00029 #define VTK_MAX_SPHERE_RESOLUTION 1024
00030
00031 class vtkTransform;
00032
00033 class VTK_GRAPHICS_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
00034 {
00035 public:
00036 vtkTypeRevisionMacro(vtkSpherePuzzle,vtkPolyDataAlgorithm);
00037 void PrintSelf(ostream& os, vtkIndent indent);
00038
00039 static vtkSpherePuzzle *New();
00040
00042 void Reset();
00043
00045 void MoveHorizontal(int section, int percentage, int rightFlag);
00046
00048 void MoveVertical(int section, int percentage, int rightFlag);
00049
00055 int SetPoint(double x, double y, double z);
00056
00060 void MovePoint(int percentage);
00061
00063 int *GetState() {return this->State;}
00064
00065 protected:
00066 vtkSpherePuzzle();
00067 ~vtkSpherePuzzle();
00068
00069 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00070 void MarkVertical(int section);
00071 void MarkHorizontal(int section);
00072
00073 int State[32];
00074
00075
00076 int PieceMask[32];
00077 vtkTransform *Transform;
00078
00079
00080 unsigned char Colors[96];
00081
00082
00083 int Active;
00084 int VerticalFlag;
00085 int RightFlag;
00086 int Section;
00087
00088 private:
00089 vtkSpherePuzzle(const vtkSpherePuzzle&);
00090 void operator=(const vtkSpherePuzzle&);
00091 };
00092
00093 #endif