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=========================================================================*/
28#ifndef vtkSpherePuzzle_h
29#define vtkSpherePuzzle_h
30
31#include "vtkFiltersModelingModule.h" // For export macro
33
34#define VTK_MAX_SPHERE_RESOLUTION 1024
35
36class vtkTransform;
37
38class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
39{
40public:
42 void PrintSelf(ostream& os, vtkIndent indent);
43
45
49 void Reset();
50
54 void MoveHorizontal(int section, int percentage, int rightFlag);
55
59 void MoveVertical(int section, int percentage, int rightFlag);
60
69 int SetPoint(double x, double y, double z);
70
76 void MovePoint(int percentage);
77
81 int *GetState() {return this->State;}
82
83protected:
86
88 void MarkVertical(int section);
89 void MarkHorizontal(int section);
90
91 int State[32];
92
93 // Stuff for storing a partial move.
94 int PieceMask[32];
96
97 // Colors for faces.
98 unsigned char Colors[96];
99
100 // State for potential move.
105
106private:
107 vtkSpherePuzzle(const vtkSpherePuzzle&) VTK_DELETE_FUNCTION;
108 void operator=(const vtkSpherePuzzle&) VTK_DELETE_FUNCTION;
109};
110
111#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
create a polygonal sphere centered at the origin
void MovePoint(int percentage)
Move actually implements the pending move.
void MoveHorizontal(int section, int percentage, int rightFlag)
Move the top/bottom half one segment either direction.
void MarkVertical(int section)
int * GetState()
For drawing state as arrows.
void Reset()
Reset the state of this puzzle back to its original state.
static vtkSpherePuzzle * New()
int SetPoint(double x, double y, double z)
SetPoint will be called as the mouse moves over the screen.
void MarkHorizontal(int section)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void MoveVertical(int section, int percentage, int rightFlag)
Rotate vertical half of sphere along one of the longitude lines.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTransform * Transform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61