VTK
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 "vtkFiltersSourcesModule.h" // For export macro
44 #include "vtkButtonSource.h"
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:
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,
161  vtkFloatArray *normals, vtkFloatArray *tcoords,
162  int res, int c1StartPoint,int c1Incr,
163  int c2StartPoint,int s2Incr, int startPoint,int incr);
164  void CreatePolygons(vtkCellArray *newPolys, int num, int res, int startIdx);
165  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY,
166  double& xe, double& ye);
167 
169  void operator=(const vtkEllipticalButtonSource&) = delete;
170 };
171 
172 #endif
173 
174 
abstract class for creating various button types
#define VTK_DOUBLE_MAX
Definition: vtkType.h:169
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:159
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
static vtkPolyDataAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:33
create a ellipsoidal-shaped button
object to represent cell connectivity
Definition: vtkCellArray.h:44
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate 3D points
Definition: vtkPoints.h:33