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
30
31#define VTK_MAX_SPHERE_RESOLUTION 1024
32
33class vtkTransform;
34
35class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
36{
37public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
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
80protected:
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;
102
103private:
104 vtkSpherePuzzle(const vtkSpherePuzzle&) = delete;
105 void operator=(const vtkSpherePuzzle&) = delete;
106};
107
108#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
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)
int * GetState()
For drawing state as arrows.
void Reset()
Reset the state of this puzzle back to its original state.
static vtkSpherePuzzle * New()
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)
~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.
vtkTransform * Transform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61