VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkParametricSpline.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00043 #ifndef __vtkParametricSpline_h 00044 #define __vtkParametricSpline_h 00045 00046 class vtkSpline; 00047 class vtkPoints; 00048 00049 #include "vtkCommonComputationalGeometryModule.h" // For export macro 00050 #include "vtkParametricFunction.h" 00051 00052 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricSpline : public vtkParametricFunction 00053 { 00054 public: 00055 vtkTypeMacro(vtkParametricSpline,vtkParametricFunction); 00056 void PrintSelf(ostream& os, vtkIndent indent); 00057 00062 static vtkParametricSpline *New(); 00063 00065 virtual int GetDimension() {return 1;} 00066 00069 virtual void Evaluate(double u[3], double Pt[3], double Du[9]); 00070 00073 virtual double EvaluateScalar(double u[3], double Pt[3], double Du[9]); 00074 00076 00079 void SetXSpline(vtkSpline*); 00080 void SetYSpline(vtkSpline*); 00081 void SetZSpline(vtkSpline*); 00082 vtkGetObjectMacro(XSpline,vtkSpline); 00083 vtkGetObjectMacro(YSpline,vtkSpline); 00084 vtkGetObjectMacro(ZSpline,vtkSpline); 00086 00088 00091 void SetPoints(vtkPoints*); 00092 vtkGetObjectMacro(Points,vtkPoints); 00094 00096 00098 void SetNumberOfPoints(vtkIdType numPts); 00099 void SetPoint(vtkIdType index, double x, double y, double z); 00101 00103 00106 vtkSetMacro(Closed,int); 00107 vtkGetMacro(Closed,int); 00108 vtkBooleanMacro(Closed,int); 00110 00112 00114 vtkSetMacro(ParameterizeByLength,int); 00115 vtkGetMacro(ParameterizeByLength,int); 00116 vtkBooleanMacro(ParameterizeByLength,int); 00118 00120 00128 vtkSetClampMacro(LeftConstraint,int,0,3); 00129 vtkGetMacro(LeftConstraint,int); 00130 vtkSetClampMacro(RightConstraint,int,0,3); 00131 vtkGetMacro(RightConstraint,int); 00133 00135 00137 vtkSetMacro(LeftValue,double); 00138 vtkGetMacro(LeftValue,double); 00139 vtkSetMacro(RightValue,double); 00140 vtkGetMacro(RightValue,double); 00142 00143 protected: 00144 vtkParametricSpline(); 00145 ~vtkParametricSpline(); 00146 00147 // Points definition 00148 vtkPoints *Points; 00149 00150 // The interpolating splines for each of the x-y-z coordinates 00151 vtkSpline *XSpline; 00152 vtkSpline *YSpline; 00153 vtkSpline *ZSpline; 00154 00155 // Supplemental variables 00156 int Closed; 00157 int LeftConstraint; 00158 int RightConstraint; 00159 double LeftValue; 00160 double RightValue; 00161 int ParameterizeByLength; 00162 00163 // Initializing the spline 00164 unsigned long InitializeTime; 00165 int Initialize(); 00166 00167 // Internal variable for managing parametric coordinates 00168 double Length; 00169 double ClosedLength; 00170 00171 private: 00172 vtkParametricSpline(const vtkParametricSpline&); // Not implemented. 00173 void operator=(const vtkParametricSpline&); // Not implemented. 00174 }; 00175 00176 #endif