VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSpherePuzzle.h 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 =========================================================================*/ 00027 #ifndef __vtkSpherePuzzle_h 00028 #define __vtkSpherePuzzle_h 00029 00030 #include "vtkFiltersModelingModule.h" // For export macro 00031 #include "vtkPolyDataAlgorithm.h" 00032 00033 #define VTK_MAX_SPHERE_RESOLUTION 1024 00034 00035 class vtkTransform; 00036 00037 class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm 00038 { 00039 public: 00040 vtkTypeMacro(vtkSpherePuzzle,vtkPolyDataAlgorithm); 00041 void PrintSelf(ostream& os, vtkIndent indent); 00042 00043 static vtkSpherePuzzle *New(); 00044 00046 void Reset(); 00047 00049 void MoveHorizontal(int section, int percentage, int rightFlag); 00050 00052 void MoveVertical(int section, int percentage, int rightFlag); 00053 00059 int SetPoint(double x, double y, double z); 00060 00064 void MovePoint(int percentage); 00065 00067 int *GetState() {return this->State;} 00068 00069 protected: 00070 vtkSpherePuzzle(); 00071 ~vtkSpherePuzzle(); 00072 00073 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00074 void MarkVertical(int section); 00075 void MarkHorizontal(int section); 00076 00077 int State[32]; 00078 00079 // Stuff for storing a partial move. 00080 int PieceMask[32]; 00081 vtkTransform *Transform; 00082 00083 // Colors for faces. 00084 unsigned char Colors[96]; 00085 00086 // State for potential move. 00087 int Active; 00088 int VerticalFlag; 00089 int RightFlag; 00090 int Section; 00091 00092 private: 00093 vtkSpherePuzzle(const vtkSpherePuzzle&); // Not implemented 00094 void operator=(const vtkSpherePuzzle&); // Not implemented 00095 }; 00096 00097 #endif