00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00049 #ifndef __vtkEllipticalButtonSource_h
00050 #define __vtkEllipticalButtonSource_h
00051
00052 #include "vtkButtonSource.h"
00053
00054 class vtkCellArray;
00055 class vtkFloatArray;
00056 class vtkPoints;
00057
00058 class VTK_GRAPHICS_EXPORT vtkEllipticalButtonSource : public vtkButtonSource
00059 {
00060 public:
00061 void PrintSelf(ostream& os, vtkIndent indent);
00062 vtkTypeRevisionMacro(vtkEllipticalButtonSource,vtkButtonSource);
00063
00065 static vtkEllipticalButtonSource *New();
00066
00068
00069 vtkSetClampMacro(Width,double,0.0,VTK_DOUBLE_MAX);
00070 vtkGetMacro(Width,double);
00072
00074
00075 vtkSetClampMacro(Height,double,0.0,VTK_DOUBLE_MAX);
00076 vtkGetMacro(Height,double);
00078
00080
00081 vtkSetClampMacro(Depth,double,0.0,VTK_DOUBLE_MAX);
00082 vtkGetMacro(Depth,double);
00084
00086
00088 vtkSetClampMacro(CircumferentialResolution,int,4,VTK_LARGE_INTEGER);
00089 vtkGetMacro(CircumferentialResolution,int);
00091
00093
00095 vtkSetClampMacro(TextureResolution,int,1,VTK_LARGE_INTEGER);
00096 vtkGetMacro(TextureResolution,int);
00098
00100
00102 vtkSetClampMacro(ShoulderResolution,int,1,VTK_LARGE_INTEGER);
00103 vtkGetMacro(ShoulderResolution,int);
00105
00107
00114 vtkSetClampMacro(RadialRatio,double,1.0,VTK_DOUBLE_MAX);
00115 vtkGetMacro(RadialRatio,double);
00117
00118 protected:
00119 vtkEllipticalButtonSource();
00120 ~vtkEllipticalButtonSource() {}
00121
00122 void Execute();
00123
00124 double Width;
00125 double Height;
00126 double Depth;
00127 int CircumferentialResolution;
00128 int TextureResolution;
00129 int ShoulderResolution;
00130 double RadialRatio;
00131
00132 private:
00133 vtkEllipticalButtonSource(const vtkEllipticalButtonSource&);
00134 void operator=(const vtkEllipticalButtonSource&);
00135
00136
00137 double A;
00138 double A2;
00139 double B;
00140 double B2;
00141 double C;
00142 double C2;
00143
00144 double ComputeDepth(int inTextureRegion, double x, double y, double n[3]);
00145 void InterpolateCurve(int inTextureRegion, vtkPoints *newPts, int numPts,
00146 vtkFloatArray *normals, vtkFloatArray *tcoords,
00147 int res, int c1StartPoint,int c1Incr,
00148 int c2StartPoint,int s2Incr, int startPoint,int incr);
00149 void CreatePolygons(vtkCellArray *newPolys, int num, int res, int startIdx);
00150 void IntersectEllipseWithLine(double a2, double b2, double dX, double dY,
00151 double& xe, double& ye);
00152
00153
00154 };
00155
00156 #endif
00157
00158