Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | 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 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00038 #ifndef __vtkSpherePuzzle_h
00039 #define __vtkSpherePuzzle_h
00040 
00041 #include "vtkPolyDataSource.h"
00042 
00043 #define VTK_MAX_SPHERE_RESOLUTION 1024
00044 
00045 class vtkTransform;
00046 
00047 class VTK_EXPORT vtkSpherePuzzle : public vtkPolyDataSource 
00048 {
00049 public:
00050   vtkTypeRevisionMacro(vtkSpherePuzzle,vtkPolyDataSource);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00053   static vtkSpherePuzzle *New();
00054 
00056   void Reset();
00057 
00059   void MoveHorizontal(int section, int percentage, int rightFlag);
00060 
00062   void MoveVertical(int section, int percentage, int rightFlag);
00063   
00069   int SetPoint(double x, double y, double z);  
00070 
00074   void MovePoint(int percentage);  
00075 
00077   int *GetState() {return this->State;}
00078 
00079 protected:
00080   vtkSpherePuzzle();
00081   ~vtkSpherePuzzle();
00082 
00083   void Execute();
00084   void MarkVertical(int section);
00085   void MarkHorizontal(int section);  
00086   
00087   int State[32];
00088   
00089   // Stuff for storing a partial move.
00090   int PieceMask[32];
00091   vtkTransform *Transform;
00092 
00093   // Colors for faces.
00094   unsigned char Colors[96];
00095 
00096   // State for potential move.
00097   int Active;
00098   int VerticalFlag;
00099   int RightFlag;
00100   int Section;
00101 
00102 private:
00103   vtkSpherePuzzle(const vtkSpherePuzzle&); // Not implemented
00104   void operator=(const vtkSpherePuzzle&); // Not implemented
00105 };
00106 
00107 #endif
00108 
00109