VTK
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 =========================================================================*/
28 #ifndef vtkSpherePuzzle_h
29 #define vtkSpherePuzzle_h
30 
31 #include "vtkFiltersModelingModule.h" // For export macro
32 #include "vtkPolyDataAlgorithm.h"
33 
34 #define VTK_MAX_SPHERE_RESOLUTION 1024
35 
36 class vtkTransform;
37 
38 class VTKFILTERSMODELING_EXPORT vtkSpherePuzzle : public vtkPolyDataAlgorithm
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  static vtkSpherePuzzle *New();
45 
49  void Reset();
50 
54  void MoveHorizontal(int section, int percentage, int rightFlag);
55 
59  void MoveVertical(int section, int percentage, int rightFlag);
60 
69  int SetPoint(double x, double y, double z);
70 
76  void MovePoint(int percentage);
77 
81  int *GetState() {return this->State;}
82 
83 protected:
85  ~vtkSpherePuzzle() override;
86 
88  void MarkVertical(int section);
89  void MarkHorizontal(int section);
90 
91  int State[32];
92 
93  // Stuff for storing a partial move.
94  int PieceMask[32];
96 
97  // Colors for faces.
98  unsigned char Colors[96];
99 
100  // State for potential move.
101  int Active;
104  int Section;
105 
106 private:
107  vtkSpherePuzzle(const vtkSpherePuzzle&) = delete;
108  void operator=(const vtkSpherePuzzle&) = delete;
109 };
110 
111 #endif
vtkSpherePuzzle::Active
int Active
Definition: vtkSpherePuzzle.h:101
vtkSpherePuzzle::Transform
vtkTransform * Transform
Definition: vtkSpherePuzzle.h:95
vtkSpherePuzzle::GetState
int * GetState()
For drawing state as arrows.
Definition: vtkSpherePuzzle.h:81
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkSpherePuzzle::Section
int Section
Definition: vtkSpherePuzzle.h:104
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
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:102
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:38
vtkSpherePuzzle::RightFlag
int RightFlag
Definition: vtkSpherePuzzle.h:103
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:70
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44