VTK  9.2.5
vtkEllipticalButtonSource.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkEllipticalButtonSource.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
43#ifndef vtkEllipticalButtonSource_h
44#define vtkEllipticalButtonSource_h
45
46#include "vtkButtonSource.h"
47#include "vtkFiltersSourcesModule.h" // For export macro
48
49class vtkCellArray;
50class vtkFloatArray;
51class vtkPoints;
52
53class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
54{
55public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
58
63
65
68 vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
69 vtkGetMacro(Width, double);
71
73
76 vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
77 vtkGetMacro(Height, double);
79
81
84 vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
85 vtkGetMacro(Depth, double);
87
89
92 vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
93 vtkGetMacro(CircumferentialResolution, int);
95
97
101 vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
102 vtkGetMacro(TextureResolution, int);
104
106
110 vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
111 vtkGetMacro(ShoulderResolution, int);
113
115
124 vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
125 vtkGetMacro(RadialRatio, double);
127
129
134 vtkSetMacro(OutputPointsPrecision, int);
135 vtkGetMacro(OutputPointsPrecision, int);
137
138protected:
140 ~vtkEllipticalButtonSource() override = default;
141
143
144 double Width;
145 double Height;
146 double Depth;
152
153private:
154 // internal variable related to axes of ellipsoid
155 double A;
156 double A2;
157 double B;
158 double B2;
159 double C;
160 double C2;
161
162 double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
163 void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
164 vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
165 int startPoint, int incr);
166 void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
167 void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
168
170 void operator=(const vtkEllipticalButtonSource&) = delete;
171};
172
173#endif
abstract class for creating various button types
object to represent cell connectivity
Definition: vtkCellArray.h:187
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
Definition: vtkFloatArray.h:42
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:40
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
#define VTK_INT_MAX
Definition: vtkType.h:155