VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
42 #ifndef __vtkEllipticalButtonSource_h
43 #define __vtkEllipticalButtonSource_h
44 
45 #include "vtkFiltersSourcesModule.h" // For export macro
46 #include "vtkButtonSource.h"
47 
48 class vtkCellArray;
49 class vtkFloatArray;
50 class vtkPoints;
51 
52 class VTKFILTERSSOURCES_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
53 {
54 public:
55  void PrintSelf(ostream& os, vtkIndent indent);
57 
60 
62 
63  vtkSetClampMacro(Width,double,0.0,VTK_DOUBLE_MAX);
64  vtkGetMacro(Width,double);
66 
68 
69  vtkSetClampMacro(Height,double,0.0,VTK_DOUBLE_MAX);
70  vtkGetMacro(Height,double);
72 
74 
75  vtkSetClampMacro(Depth,double,0.0,VTK_DOUBLE_MAX);
76  vtkGetMacro(Depth,double);
78 
80 
82  vtkSetClampMacro(CircumferentialResolution,int,4,VTK_INT_MAX);
83  vtkGetMacro(CircumferentialResolution,int);
85 
87 
89  vtkSetClampMacro(TextureResolution,int,1,VTK_INT_MAX);
90  vtkGetMacro(TextureResolution,int);
92 
94 
96  vtkSetClampMacro(ShoulderResolution,int,1,VTK_INT_MAX);
97  vtkGetMacro(ShoulderResolution,int);
99 
101 
108  vtkSetClampMacro(RadialRatio,double,1.0,VTK_DOUBLE_MAX);
109  vtkGetMacro(RadialRatio,double);
111 
112 protected:
115 
116  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
117 
118  double Width;
119  double Height;
120  double Depth;
124  double RadialRatio;
125 
126 private:
127  //internal variable related to axes of ellipsoid
128  double A;
129  double A2;
130  double B;
131  double B2;
132  double C;
133  double C2;
134 
135  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
136  void InterpolateCurve(int inTextureRegion, vtkPoints *newPts, int numPts,
137  vtkFloatArray *normals, vtkFloatArray *tcoords,
138  int res, int c1StartPoint,int c1Incr,
139  int c2StartPoint,int s2Incr, int startPoint,int incr);
140  void CreatePolygons(vtkCellArray *newPolys, int num, int res, int startIdx);
141  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY,
142  double& xe, double& ye);
143 
144  vtkEllipticalButtonSource(const vtkEllipticalButtonSource&); // Not implemented.
145  void operator=(const vtkEllipticalButtonSource&); // Not implemented.
146 };
147 
148 #endif
149 
150 
abstract class for creating various button types
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void PrintSelf(ostream &os, vtkIndent indent)
static vtkPolyDataAlgorithm * New()
create a ellipsoidal-shaped button
object to represent cell connectivity
Definition: vtkCellArray.h:49