VTK  9.5.20250903
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
56
57VTK_ABI_NAMESPACE_BEGIN
58class vtkCellArray;
59class vtkFloatArray;
60class vtkPoints;
61
62class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkEllipticalButtonSource : public vtkButtonSource
63{
64public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
67
72
74
77 vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
78 vtkGetMacro(Width, double);
80
82
85 vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
86 vtkGetMacro(Height, double);
88
90
93 vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
94 vtkGetMacro(Depth, double);
96
98
101 vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
102 vtkGetMacro(CircumferentialResolution, int);
104
106
110 vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
111 vtkGetMacro(TextureResolution, int);
113
115
119 vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
120 vtkGetMacro(ShoulderResolution, int);
122
124
133 vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
134 vtkGetMacro(RadialRatio, double);
136
138
143 vtkSetMacro(OutputPointsPrecision, int);
144 vtkGetMacro(OutputPointsPrecision, int);
146
147protected:
149 ~vtkEllipticalButtonSource() override = default;
150
152
153 double Width;
154 double Height;
155 double Depth;
161
162private:
163 // internal variable related to axes of ellipsoid
164 double A;
165 double A2;
166 double B;
167 double B2;
168 double C;
169 double C2;
170
171 double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
172 void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
173 vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
174 int startPoint, int incr);
175 void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
176 void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
177
179 void operator=(const vtkEllipticalButtonSource&) = delete;
180};
181
182VTK_ABI_NAMESPACE_END
183#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:171
#define VTK_INT_MAX
Definition vtkType.h:161
#define VTK_MARSHALAUTO