VTK  9.0.1
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
vtkSpherePuzzle::Active
int Active
Definition: vtkSpherePuzzle.h:95
vtkSpherePuzzle::Transform
vtkTransform * Transform
Definition: vtkSpherePuzzle.h:89
vtkSpherePuzzle::GetState
int * GetState()
For drawing state as arrows.
Definition: vtkSpherePuzzle.h:75
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkSpherePuzzle::Section
int Section
Definition: vtkSpherePuzzle.h:98
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSpherePuzzle::VerticalFlag
int VerticalFlag
Definition: vtkSpherePuzzle.h:96
vtkPolyDataAlgorithm.h
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkSpherePuzzle
create a polygonal sphere centered at the origin
Definition: vtkSpherePuzzle.h:32
vtkSpherePuzzle::RightFlag
int RightFlag
Definition: vtkSpherePuzzle.h:97
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41