VTK
vtkSpherePuzzle.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSpherePuzzle.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef __vtkSpherePuzzle_h
28 #define __vtkSpherePuzzle_h
29 
30 #include "vtkPolyDataAlgorithm.h"
31 
32 #define VTK_MAX_SPHERE_RESOLUTION 1024
33 
34 class vtkTransform;
35 
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
42  static vtkSpherePuzzle *New();
43 
45  void Reset();
46 
48  void MoveHorizontal(int section, int percentage, int rightFlag);
49 
51  void MoveVertical(int section, int percentage, int rightFlag);
52 
58  int SetPoint(double x, double y, double z);
59 
63  void MovePoint(int percentage);
64 
66  int *GetState() {return this->State;}
67 
68 protected:
70  ~vtkSpherePuzzle();
71 
73  void MarkVertical(int section);
74  void MarkHorizontal(int section);
75 
76  int State[32];
77 
78  // Stuff for storing a partial move.
79  int PieceMask[32];
81 
82  // Colors for faces.
83  unsigned char Colors[96];
84 
85  // State for potential move.
86  int Active;
88  int RightFlag;
89  int Section;
90 
91 private:
92  vtkSpherePuzzle(const vtkSpherePuzzle&); // Not implemented
93  void operator=(const vtkSpherePuzzle&); // Not implemented
94 };
95 
96 #endif