VTK  9.3.1
vtkSpherePuzzle.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkSpherePuzzle_h
14 #define vtkSpherePuzzle_h
15 
16 #include "vtkFiltersModelingModule.h" // For export macro
17 #include "vtkPolyDataAlgorithm.h"
18 
19 #define VTK_MAX_SPHERE_RESOLUTION 1024
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkTransform;
23 
24 class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
25 {
26 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
30  static vtkSpherePuzzle* New();
31 
35  void Reset();
36 
40  void MoveHorizontal(int section, int percentage, int rightFlag);
41 
45  void MoveVertical(int section, int percentage, int rightFlag);
46 
55  int SetPoint(double x, double y, double z);
56 
62  void MovePoint(int percentage);
63 
67  int* GetState() { return this->State; }
68 
69 protected:
71  ~vtkSpherePuzzle() override;
72 
74  void MarkVertical(int section);
75  void MarkHorizontal(int section);
76 
77  int State[32];
78 
79  // Stuff for storing a partial move.
80  int PieceMask[32];
82 
83  // Colors for faces.
84  unsigned char Colors[96];
85 
86  // State for potential move.
87  int Active;
89  int RightFlag;
90  int Section;
91 
92 private:
93  vtkSpherePuzzle(const vtkSpherePuzzle&) = delete;
94  void operator=(const vtkSpherePuzzle&) = delete;
95 };
96 
97 VTK_ABI_NAMESPACE_END
98 #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:49
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:28
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.