VTK  9.3.20240424
vtkEllipticalButtonSource.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
50#ifndef vtkEllipticalButtonSource_h
51#define vtkEllipticalButtonSource_h
52
53#include "vtkButtonSource.h"
54#include "vtkFiltersSourcesModule.h" // For export macro
55
56VTK_ABI_NAMESPACE_BEGIN
57class vtkCellArray;
58class vtkFloatArray;
59class vtkPoints;
60
61class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
62{
63public:
64 void PrintSelf(ostream& os, vtkIndent indent) override;
66
71
73
76 vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
77 vtkGetMacro(Width, double);
79
81
84 vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
85 vtkGetMacro(Height, double);
87
89
92 vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
93 vtkGetMacro(Depth, double);
95
97
100 vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
101 vtkGetMacro(CircumferentialResolution, int);
103
105
109 vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
110 vtkGetMacro(TextureResolution, int);
112
114
118 vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
119 vtkGetMacro(ShoulderResolution, int);
121
123
132 vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
133 vtkGetMacro(RadialRatio, double);
135
137
142 vtkSetMacro(OutputPointsPrecision, int);
143 vtkGetMacro(OutputPointsPrecision, int);
145
146protected:
148 ~vtkEllipticalButtonSource() override = default;
149
151
152 double Width;
153 double Height;
154 double Depth;
160
161private:
162 // internal variable related to axes of ellipsoid
163 double A;
164 double A2;
165 double B;
166 double B2;
167 double C;
168 double C2;
169
170 double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
171 void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
172 vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
173 int startPoint, int incr);
174 void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
175 void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
176
178 void operator=(const vtkEllipticalButtonSource&) = delete;
179};
180
181VTK_ABI_NAMESPACE_END
182#endif
abstract class for creating various button types
object to represent cell connectivity
create a ellipsoidal-shaped button
~vtkEllipticalButtonSource() override=default
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkEllipticalButtonSource * New()
Construct a circular button with depth 10% of its height.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:139
#define VTK_DOUBLE_MAX
Definition vtkType.h:154
#define VTK_INT_MAX
Definition vtkType.h:144