VTK  9.2.6
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 =========================================================================*/
25 #ifndef vtkSpherePuzzle_h
26 #define vtkSpherePuzzle_h
27 
28 #include "vtkFiltersModelingModule.h" // For export macro
29 #include "vtkPolyDataAlgorithm.h"
30 
31 #define VTK_MAX_SPHERE_RESOLUTION 1024
32 
33 class vtkTransform;
34 
35 class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
41  static vtkSpherePuzzle* New();
42 
46  void Reset();
47 
51  void MoveHorizontal(int section, int percentage, int rightFlag);
52 
56  void MoveVertical(int section, int percentage, int rightFlag);
57 
66  int SetPoint(double x, double y, double z);
67 
73  void MovePoint(int percentage);
74 
78  int* GetState() { return this->State; }
79 
80 protected:
82  ~vtkSpherePuzzle() override;
83 
85  void MarkVertical(int section);
86  void MarkHorizontal(int section);
87 
88  int State[32];
89 
90  // Stuff for storing a partial move.
91  int PieceMask[32];
93 
94  // Colors for faces.
95  unsigned char Colors[96];
96 
97  // State for potential move.
98  int Active;
101  int Section;
102 
103 private:
104  vtkSpherePuzzle(const vtkSpherePuzzle&) = delete;
105  void operator=(const vtkSpherePuzzle&) = delete;
106 };
107 
108 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
create a polygonal sphere centered at the origin
a simple class to control print indentation
Definition: vtkIndent.h:39
int * GetState()
For drawing state as arrows.
vtkTransform * Transform
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.