VTK  9.2.6
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 =========================================================================*/
52 #ifndef vtkEllipticalButtonSource_h
53 #define vtkEllipticalButtonSource_h
54 
55 #include "vtkButtonSource.h"
56 #include "vtkFiltersSourcesModule.h" // For export macro
57 
58 class vtkCellArray;
59 class vtkFloatArray;
60 class vtkPoints;
61 
62 class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
63 {
64 public:
65  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
72 
74 
77  vtkSetClampMacro(Width, double, 0.0, VTK_DOUBLE_MAX);
78  vtkGetMacro(Width, double);
80 
82 
85  vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
86  vtkGetMacro(Height, double);
88 
90 
93  vtkSetClampMacro(Depth, double, 0.0, VTK_DOUBLE_MAX);
94  vtkGetMacro(Depth, double);
96 
98 
101  vtkSetClampMacro(CircumferentialResolution, int, 4, VTK_INT_MAX);
102  vtkGetMacro(CircumferentialResolution, int);
104 
106 
110  vtkSetClampMacro(TextureResolution, int, 1, VTK_INT_MAX);
111  vtkGetMacro(TextureResolution, int);
113 
115 
119  vtkSetClampMacro(ShoulderResolution, int, 1, VTK_INT_MAX);
120  vtkGetMacro(ShoulderResolution, int);
122 
124 
133  vtkSetClampMacro(RadialRatio, double, 1.0, VTK_DOUBLE_MAX);
134  vtkGetMacro(RadialRatio, double);
136 
138 
143  vtkSetMacro(OutputPointsPrecision, int);
144  vtkGetMacro(OutputPointsPrecision, int);
146 
147 protected:
149  ~vtkEllipticalButtonSource() override = default;
150 
152 
153  double Width;
154  double Height;
155  double Depth;
160  double RadialRatio;
161 
162 private:
163  // internal variable related to axes of ellipsoid
164  double A;
165  double A2;
166  double B;
167  double B2;
168  double C;
169  double C2;
170 
171  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
172  void InterpolateCurve(int inTextureRegion, vtkPoints* newPts, int numPts, vtkFloatArray* normals,
173  vtkFloatArray* tcoords, int res, int c1StartPoint, int c1Incr, int c2StartPoint, int s2Incr,
174  int startPoint, int incr);
175  void CreatePolygons(vtkCellArray* newPolys, int num, int res, int startIdx);
176  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY, double& xe, double& ye);
177 
179  void operator=(const vtkEllipticalButtonSource&) = delete;
180 };
181 
182 #endif
abstract class for creating various button types
object to represent cell connectivity
Definition: vtkCellArray.h:196
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:51
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:49
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
#define VTK_INT_MAX
Definition: vtkType.h:155