VTK  9.1.0
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=========================================================================*/
49#ifndef vtkEllipticalButtonSource_h
50#define vtkEllipticalButtonSource_h
51
52#include "vtkButtonSource.h"
53#include "vtkFiltersSourcesModule.h" // For export macro
54
55class vtkCellArray;
56class vtkFloatArray;
57class vtkPoints;
58
59class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
60{
61public:
62 void PrintSelf(ostream& os, vtkIndent indent) override;
64
69
71
74 vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
75 vtkGetMacro(Width, double);
77
79
82 vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
83 vtkGetMacro(Height, double);
85
87
90 vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
91 vtkGetMacro(Depth, double);
93
95
98 vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
99 vtkGetMacro(CircumferentialResolution, int);
101
103
107 vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
108 vtkGetMacro(TextureResolution, int);
110
112
116 vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
117 vtkGetMacro(ShoulderResolution, int);
119
121
130 vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
131 vtkGetMacro(RadialRatio, double);
133
135
140 vtkSetMacro(OutputPointsPrecision, int);
141 vtkGetMacro(OutputPointsPrecision, int);
143
144protected:
146 ~vtkEllipticalButtonSource() override = default;
147
149
150 double Width;
151 double Height;
152 double Depth;
158
159private:
160 // internal variable related to axes of ellipsoid
161 double A;
162 double A2;
163 double B;
164 double B2;
165 double C;
166 double C2;
167
168 double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
169 void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
170 vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
171 int startPoint, int incr);
172 void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
173 void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
174
176 void operator=(const vtkEllipticalButtonSource&) = delete;
177};
178
179#endif
abstract class for creating various button types
object to represent cell connectivity
Definition: vtkCellArray.h:190
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:45
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:43
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
#define VTK_INT_MAX
Definition: vtkType.h:155