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 =========================================================================*/
42 #ifndef __vtkEllipticalButtonSource_h
43 #define __vtkEllipticalButtonSource_h
44 
45 #include "vtkButtonSource.h"
46 
47 class vtkCellArray;
48 class vtkFloatArray;
49 class vtkPoints;
50 
52 {
53 public:
54  void PrintSelf(ostream& os, vtkIndent indent);
56 
59 
61 
62  vtkSetClampMacro(Width,double,0.0,VTK_DOUBLE_MAX);
63  vtkGetMacro(Width,double);
65 
67 
68  vtkSetClampMacro(Height,double,0.0,VTK_DOUBLE_MAX);
69  vtkGetMacro(Height,double);
71 
73 
74  vtkSetClampMacro(Depth,double,0.0,VTK_DOUBLE_MAX);
75  vtkGetMacro(Depth,double);
77 
79 
81  vtkSetClampMacro(CircumferentialResolution,int,4,VTK_LARGE_INTEGER);
82  vtkGetMacro(CircumferentialResolution,int);
84 
86 
88  vtkSetClampMacro(TextureResolution,int,1,VTK_LARGE_INTEGER);
89  vtkGetMacro(TextureResolution,int);
91 
93 
95  vtkSetClampMacro(ShoulderResolution,int,1,VTK_LARGE_INTEGER);
96  vtkGetMacro(ShoulderResolution,int);
98 
100 
107  vtkSetClampMacro(RadialRatio,double,1.0,VTK_DOUBLE_MAX);
108  vtkGetMacro(RadialRatio,double);
110 
111 protected:
114 
116 
117  double Width;
118  double Height;
119  double Depth;
123  double RadialRatio;
124 
125 private:
126  //internal variable related to axes of ellipsoid
127  double A;
128  double A2;
129  double B;
130  double B2;
131  double C;
132  double C2;
133 
134  double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
135  void InterpolateCurve(int inTextureRegion, vtkPoints *newPts, int numPts,
136  vtkFloatArray *normals, vtkFloatArray *tcoords,
137  int res, int c1StartPoint,int c1Incr,
138  int c2StartPoint,int s2Incr, int startPoint,int incr);
139  void CreatePolygons(vtkCellArray *newPolys, int num, int res, int startIdx);
140  void IntersectEllipseWithLine(double a2, double b2, double dX, double dY,
141  double& xe, double& ye);
142 
143  vtkEllipticalButtonSource(const vtkEllipticalButtonSource&); // Not implemented.
144  void operator=(const vtkEllipticalButtonSource&); // Not implemented.
145 };
146 
147 #endif
148 
149