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=========================================================================*/
59#ifndef vtkEllipticalButtonSource_h
60#define vtkEllipticalButtonSource_h
61
62#include "vtkButtonSource.h"
63#include "vtkFiltersSourcesModule.h" // For export macro
64
65class vtkCellArray;
66class vtkFloatArray;
67class vtkPoints;
68
69class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
70{
71public:
72 void PrintSelf(ostream& os, vtkIndent indent) override;
74
79
81
84 vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
85 vtkGetMacro(Width, double);
87
89
92 vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
93 vtkGetMacro(Height, double);
95
97
100 vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
101 vtkGetMacro(Depth, double);
103
105
108 vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
109 vtkGetMacro(CircumferentialResolution, int);
111
113
117 vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
118 vtkGetMacro(TextureResolution, int);
120
122
126 vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
127 vtkGetMacro(ShoulderResolution, int);
129
131
140 vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
141 vtkGetMacro(RadialRatio, double);
143
145
150 vtkSetMacro(OutputPointsPrecision, int);
151 vtkGetMacro(OutputPointsPrecision, int);
153
154protected:
156 ~vtkEllipticalButtonSource() override = default;
157
159
160 double Width;
161 double Height;
162 double Depth;
168
169private:
170 // internal variable related to axes of ellipsoid
171 double A;
172 double A2;
173 double B;
174 double B2;
175 double C;
176 double C2;
177
178 double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
179 void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
180 vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
181 int startPoint, int incr);
182 void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
183 void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
184
186 void operator=(const vtkEllipticalButtonSource&) = delete;
187};
188
189#endif
abstract class for creating various button types
object to represent cell connectivity
Definition: vtkCellArray.h:290
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:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:143
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
#define VTK_INT_MAX
Definition: vtkType.h:155