VTK  9.3.20240418
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
a simple class to control print indentation
Definition: vtkIndent.h:108
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:160