VTK  9.7.1
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
31 #ifndef vtkEllipticalButtonSource_h
32 #define vtkEllipticalButtonSource_h
33 
34 #include "vtkButtonSource.h"
35 #include "vtkFiltersSourcesModule.h" // For export macro
36 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkCellArray;
40 class vtkFloatArray;
41 class vtkPoints;
42 
43 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkEllipticalButtonSource : public vtkButtonSource
44 {
45 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53 
55 
58  vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
59  vtkGetMacro(Width, double);
61 
63 
66  vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
67  vtkGetMacro(Height, double);
69 
71 
74  vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
75  vtkGetMacro(Depth, double);
77 
79 
82  vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
83  vtkGetMacro(CircumferentialResolution, int);
85 
87 
91  vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
92  vtkGetMacro(TextureResolution, int);
94 
96 
100  vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
101  vtkGetMacro(ShoulderResolution, int);
103 
105 
114  vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
115  vtkGetMacro(RadialRatio, double);
117 
119 
124  vtkSetMacro(OutputPointsPrecision, int);
125  vtkGetMacro(OutputPointsPrecision, int);
127 
128 protected:
130  ~vtkEllipticalButtonSource() override = default;
131 
133 
134  double Width;
135  double Height;
136  double Depth;
141  double RadialRatio;
142 
143 private:
144  // internal variable related to axes of ellipsoid
145  double A;
146  double A2;
147  double B;
148  double B2;
149  double C;
150  double C2;
151 
152  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
153  void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
154  vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
155  int startPoint, int incr);
156  void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
157  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
158 
160  void operator=(const vtkEllipticalButtonSource&) = delete;
161 };
162 
163 VTK_ABI_NAMESPACE_END
164 #endif
abstract class for creating various button types
#define VTK_DOUBLE_MAX
Definition: vtkType.h:202
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:192
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
static vtkPolyDataAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:28
create a ellipsoidal-shaped button
object to represent cell connectivity
Definition: vtkCellArray.h:177
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate 3D points
Definition: vtkPoints.h:30