VTK: Filters/Modeling/vtkSpherePuzzle.h Source File

| 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:
27 vtkTypeMacro(vtkSpherePuzzle, vtkPolyDataAlgorithm);
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:
70 vtkSpherePuzzle();
71 ~vtkSpherePuzzle() override;
72
73 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
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];
81 vtkTransform* Transform;
82
83 // Colors for faces.
84 unsigned char Colors[96];
85
86 // State for potential move.
87 int Active;
88 int VerticalFlag;
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
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkSpherePuzzle
create a polygonal sphere centered at the origin
Definition: vtkSpherePuzzle.h:25
vtkSpherePuzzle::RightFlag
int RightFlag
Definition: vtkSpherePuzzle.h:89
vtkSpherePuzzle::MovePoint
void MovePoint(int percentage)
Move actually implements the pending move.
vtkSpherePuzzle::VerticalFlag
int VerticalFlag
Definition: vtkSpherePuzzle.h:88
vtkSpherePuzzle::MoveHorizontal
void MoveHorizontal(int section, int percentage, int rightFlag)
Move the top/bottom half one segment either direction.
vtkSpherePuzzle::MarkVertical
void MarkVertical(int section)
vtkSpherePuzzle::Reset
void Reset()
Reset the state of this puzzle back to its original state.
vtkSpherePuzzle::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkSpherePuzzle::SetPoint
int SetPoint(double x, double y, double z)
SetPoint will be called as the mouse moves over the screen.
vtkSpherePuzzle::MarkHorizontal
void MarkHorizontal(int section)
vtkSpherePuzzle::vtkSpherePuzzle
vtkSpherePuzzle()
vtkSpherePuzzle::Active
int Active
Definition: vtkSpherePuzzle.h:87
vtkSpherePuzzle::New
static vtkSpherePuzzle * New()
vtkSpherePuzzle::~vtkSpherePuzzle
~vtkSpherePuzzle() override
vtkSpherePuzzle::MoveVertical
void MoveVertical(int section, int percentage, int rightFlag)
Rotate vertical half of sphere along one of the longitude lines.
vtkSpherePuzzle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSpherePuzzle::GetState
int * GetState()
For drawing state as arrows.
Definition: vtkSpherePuzzle.h:67
vtkSpherePuzzle::Section
int Section
Definition: vtkSpherePuzzle.h:90
vtkSpherePuzzle::Transform
vtkTransform * Transform
Definition: vtkSpherePuzzle.h:81
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkPolyDataAlgorithm.h