Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkSpherePuzzle.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSpherePuzzle.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00031 #ifndef __vtkSpherePuzzle_h
00032 #define __vtkSpherePuzzle_h
00033 
00034 #include "vtkPolyDataSource.h"
00035 
00036 #define VTK_MAX_SPHERE_RESOLUTION 1024
00037 
00038 class vtkTransform;
00039 
00040 class VTK_EXPORT vtkSpherePuzzle : public vtkPolyDataSource 
00041 {
00042 public:
00043   vtkTypeRevisionMacro(vtkSpherePuzzle,vtkPolyDataSource);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00046   static vtkSpherePuzzle *New();
00047 
00049   void Reset();
00050 
00052   void MoveHorizontal(int section, int percentage, int rightFlag);
00053 
00055   void MoveVertical(int section, int percentage, int rightFlag);
00056   
00062   int SetPoint(float x, float y, float z);  
00063 
00067   void MovePoint(int percentage);  
00068 
00070   int *GetState() {return this->State;}
00071 
00072 protected:
00073   vtkSpherePuzzle();
00074   ~vtkSpherePuzzle();
00075 
00076   void Execute();
00077   void MarkVertical(int section);
00078   void MarkHorizontal(int section);  
00079   
00080   int State[32];
00081   
00082   // Stuff for storing a partial move.
00083   int PieceMask[32];
00084   vtkTransform *Transform;
00085 
00086   // Colors for faces.
00087   unsigned char Colors[96];
00088 
00089   // State for potential move.
00090   int Active;
00091   int VerticalFlag;
00092   int RightFlag;
00093   int Section;
00094 
00095 private:
00096   vtkSpherePuzzle(const vtkSpherePuzzle&); // Not implemented
00097   void operator=(const vtkSpherePuzzle&); // Not implemented
00098 };
00099 
00100 #endif
00101 
00102