VTK  9.0.3
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 =========================================================================*/
22 #ifndef vtkSpherePuzzle_h
23 #define vtkSpherePuzzle_h
24 
25 #include "vtkFiltersModelingModule.h" // For export macro
26 #include "vtkPolyDataAlgorithm.h"
27 
28 #define VTK_MAX_SPHERE_RESOLUTION 1024
29 
30 class vtkTransform;
31 
32 class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
38  static vtkSpherePuzzle* New();
39 
43  void Reset();
44 
48  void MoveHorizontal(int section, int percentage, int rightFlag);
49 
53  void MoveVertical(int section, int percentage, int rightFlag);
54 
63  int SetPoint(double x, double y, double z);
64 
70  void MovePoint(int percentage);
71 
75  int* GetState() { return this->State; }
76 
77 protected:
79  ~vtkSpherePuzzle() override;
80 
82  void MarkVertical(int section);
83  void MarkHorizontal(int section);
84 
85  int State[32];
86 
87  // Stuff for storing a partial move.
88  int PieceMask[32];
90 
91  // Colors for faces.
92  unsigned char Colors[96];
93 
94  // State for potential move.
95  int Active;
97  int RightFlag;
98  int Section;
99 
100 private:
101  vtkSpherePuzzle(const vtkSpherePuzzle&) = delete;
102  void operator=(const vtkSpherePuzzle&) = delete;
103 };
104 
105 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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)
void Reset()
Reset the state of this puzzle back to its original state.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int SetPoint(double x, double y, double z)
SetPoint will be called as the mouse moves over the screen.
void MarkHorizontal(int section)
static vtkSpherePuzzle * New()
~vtkSpherePuzzle() override
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) override
Methods invoked by print to print information about the object including superclasses.
int * GetState()
For drawing state as arrows.
vtkTransform * Transform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55