VTK  9.0.20210417
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 =========================================================================*/
40 #ifndef vtkEllipticalButtonSource_h
41 #define vtkEllipticalButtonSource_h
42 
43 #include "vtkButtonSource.h"
44 #include "vtkFiltersSourcesModule.h" // For export macro
45 
46 class vtkCellArray;
47 class vtkFloatArray;
48 class vtkPoints;
49 
50 class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
51 {
52 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
60 
62 
65  vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
66  vtkGetMacro(Width, double);
68 
70 
73  vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
74  vtkGetMacro(Height, double);
76 
78 
81  vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
82  vtkGetMacro(Depth, double);
84 
86 
89  vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
90  vtkGetMacro(CircumferentialResolution, int);
92 
94 
98  vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
99  vtkGetMacro(TextureResolution, int);
101 
103 
107  vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
108  vtkGetMacro(ShoulderResolution, int);
110 
112 
121  vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
122  vtkGetMacro(RadialRatio, double);
124 
126 
131  vtkSetMacro(OutputPointsPrecision, int);
132  vtkGetMacro(OutputPointsPrecision, int);
134 
135 protected:
137  ~vtkEllipticalButtonSource() override = default;
138 
140 
141  double Width;
142  double Height;
143  double Depth;
148  double RadialRatio;
149 
150 private:
151  // internal variable related to axes of ellipsoid
152  double A;
153  double A2;
154  double B;
155  double B2;
156  double C;
157  double C2;
158 
159  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
160  void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
161  vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
162  int startPoint, int incr);
163  void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
164  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
165 
167  void operator=(const vtkEllipticalButtonSource&) = delete;
168 };
169 
170 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkEllipticalButtonSource::New
static vtkEllipticalButtonSource * New()
Construct a circular button with depth 10% of its height.
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkEllipticalButtonSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkButtonSource.h
vtkEllipticalButtonSource::~vtkEllipticalButtonSource
~vtkEllipticalButtonSource() override=default
vtkEllipticalButtonSource
create a ellipsoidal-shaped button
Definition: vtkEllipticalButtonSource.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:181
vtkEllipticalButtonSource::RadialRatio
double RadialRatio
Definition: vtkEllipticalButtonSource.h:148
vtkEllipticalButtonSource::vtkEllipticalButtonSource
vtkEllipticalButtonSource()
vtkEllipticalButtonSource::ShoulderResolution
int ShoulderResolution
Definition: vtkEllipticalButtonSource.h:146
vtkEllipticalButtonSource::Width
double Width
Definition: vtkEllipticalButtonSource.h:141
vtkEllipticalButtonSource::TextureResolution
int TextureResolution
Definition: vtkEllipticalButtonSource.h:145
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:74
vtkEllipticalButtonSource::CircumferentialResolution
int CircumferentialResolution
Definition: vtkEllipticalButtonSource.h:144
vtkEllipticalButtonSource::Height
double Height
Definition: vtkEllipticalButtonSource.h:142
vtkEllipticalButtonSource::Depth
double Depth
Definition: vtkEllipticalButtonSource.h:143
vtkEllipticalButtonSource::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkButtonSource
abstract class for creating various button types
Definition: vtkButtonSource.h:54
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkEllipticalButtonSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkEllipticalButtonSource.h:147