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 =========================================================================*/
43 #ifndef vtkEllipticalButtonSource_h
44 #define vtkEllipticalButtonSource_h
45 
46 #include "vtkFiltersSourcesModule.h" // For export macro
47 #include "vtkButtonSource.h"
48 
49 class vtkCellArray;
50 class vtkFloatArray;
51 class vtkPoints;
52 
53 class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
54 {
55 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
63 
65 
68  vtkSetClampMacro(Width,double,0.0,VTK_DOUBLE_MAX);
69  vtkGetMacro(Width,double);
71 
73 
76  vtkSetClampMacro(Height,double,0.0,VTK_DOUBLE_MAX);
77  vtkGetMacro(Height,double);
79 
81 
84  vtkSetClampMacro(Depth,double,0.0,VTK_DOUBLE_MAX);
85  vtkGetMacro(Depth,double);
87 
89 
92  vtkSetClampMacro(CircumferentialResolution,int,4,VTK_INT_MAX);
93  vtkGetMacro(CircumferentialResolution,int);
95 
97 
101  vtkSetClampMacro(TextureResolution,int,1,VTK_INT_MAX);
102  vtkGetMacro(TextureResolution,int);
104 
106 
110  vtkSetClampMacro(ShoulderResolution,int,1,VTK_INT_MAX);
111  vtkGetMacro(ShoulderResolution,int);
113 
115 
124  vtkSetClampMacro(RadialRatio,double,1.0,VTK_DOUBLE_MAX);
125  vtkGetMacro(RadialRatio,double);
127 
129 
134  vtkSetMacro(OutputPointsPrecision,int);
135  vtkGetMacro(OutputPointsPrecision,int);
137 
138 protected:
141 
143 
144  double Width;
145  double Height;
146  double Depth;
151  double RadialRatio;
152 
153 private:
154  //internal variable related to axes of ellipsoid
155  double A;
156  double A2;
157  double B;
158  double B2;
159  double C;
160  double C2;
161 
162  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
163  void InterpolateCurve(int inTextureRegion, vtkPoints *newPts, int numPts,
164  vtkFloatArray *normals, vtkFloatArray *tcoords,
165  int res, int c1StartPoint,int c1Incr,
166  int c2StartPoint,int s2Incr, int startPoint,int incr);
167  void CreatePolygons(vtkCellArray *newPolys, int num, int res, int startIdx);
168  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY,
169  double& xe, double& ye);
170 
172  void operator=(const vtkEllipticalButtonSource&) = delete;
173 };
174 
175 #endif
176 
177 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkButtonSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkButtonSource.h
vtkEllipticalButtonSource
create a ellipsoidal-shaped button
Definition: vtkEllipticalButtonSource.h:53
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkEllipticalButtonSource::RadialRatio
double RadialRatio
Definition: vtkEllipticalButtonSource.h:151
vtkEllipticalButtonSource::ShoulderResolution
int ShoulderResolution
Definition: vtkEllipticalButtonSource.h:149
vtkEllipticalButtonSource::Width
double Width
Definition: vtkEllipticalButtonSource.h:144
vtkEllipticalButtonSource::TextureResolution
int TextureResolution
Definition: vtkEllipticalButtonSource.h:148
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkEllipticalButtonSource::CircumferentialResolution
int CircumferentialResolution
Definition: vtkEllipticalButtonSource.h:147
vtkEllipticalButtonSource::Height
double Height
Definition: vtkEllipticalButtonSource.h:145
vtkEllipticalButtonSource::Depth
double Depth
Definition: vtkEllipticalButtonSource.h:146
vtkButtonSource
abstract class for creating various button types
Definition: vtkButtonSource.h:53
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:169
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkEllipticalButtonSource::~vtkEllipticalButtonSource
~vtkEllipticalButtonSource() override
Definition: vtkEllipticalButtonSource.h:140
vtkEllipticalButtonSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkEllipticalButtonSource.h:150