VTK  9.3.0
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
40 #ifndef vtkEllipticalButtonSource_h
41 #define vtkEllipticalButtonSource_h
42 
43 #include "vtkButtonSource.h"
44 #include "vtkFiltersSourcesModule.h" // For export macro
45 
46 VTK_ABI_NAMESPACE_BEGIN
47 class vtkCellArray;
48 class vtkFloatArray;
49 class vtkPoints;
50 
51 class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
52 {
53 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
61 
63 
66  vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
67  vtkGetMacro(Width, double);
69 
71 
74  vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
75  vtkGetMacro(Height, double);
77 
79 
82  vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
83  vtkGetMacro(Depth, double);
85 
87 
90  vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
91  vtkGetMacro(CircumferentialResolution, int);
93 
95 
99  vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
100  vtkGetMacro(TextureResolution, int);
102 
104 
108  vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
109  vtkGetMacro(ShoulderResolution, int);
111 
113 
122  vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
123  vtkGetMacro(RadialRatio, double);
125 
127 
132  vtkSetMacro(OutputPointsPrecision, int);
133  vtkGetMacro(OutputPointsPrecision, int);
135 
136 protected:
138  ~vtkEllipticalButtonSource() override = default;
139 
141 
142  double Width;
143  double Height;
144  double Depth;
149  double RadialRatio;
150 
151 private:
152  // internal variable related to axes of ellipsoid
153  double A;
154  double A2;
155  double B;
156  double B2;
157  double C;
158  double C2;
159 
160  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
161  void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
162  vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
163  int startPoint, int incr);
164  void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
165  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
166 
168  void operator=(const vtkEllipticalButtonSource&) = delete;
169 };
170 
171 VTK_ABI_NAMESPACE_END
172 #endif
abstract class for creating various button types
object to represent cell connectivity
Definition: vtkCellArray.h:185
create a ellipsoidal-shaped button
~vtkEllipticalButtonSource() override=default
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkEllipticalButtonSource * New()
Construct a circular button with depth 10% of its height.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:38
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
#define VTK_INT_MAX
Definition: vtkType.h:144