00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024 #ifndef __vtkLine_h
00025 #define __vtkLine_h
00026
00027 #include "vtkCell.h"
00028 class vtkIncrementalPointLocator;
00029
00030 class VTK_FILTERING_EXPORT vtkLine : public vtkCell
00031 {
00032 public:
00033 static vtkLine *New();
00034 vtkTypeRevisionMacro(vtkLine,vtkCell);
00035 void PrintSelf(ostream& os, vtkIndent indent);
00036
00038
00039 int GetCellType() {return VTK_LINE;};
00040 int GetCellDimension() {return 1;};
00041 int GetNumberOfEdges() {return 0;};
00042 int GetNumberOfFaces() {return 0;};
00043 vtkCell *GetEdge(int) {return 0;};
00044 vtkCell *GetFace(int) {return 0;};
00045 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00046 void Contour(double value, vtkDataArray *cellScalars,
00047 vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00048 vtkCellArray *lines, vtkCellArray *polys,
00049 vtkPointData *inPd, vtkPointData *outPd,
00050 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00051 int EvaluatePosition(double x[3], double* closestPoint,
00052 int& subId, double pcoords[3],
00053 double& dist2, double *weights);
00054 void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00055 double *weights);
00056 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00057 void Derivatives(int subId, double pcoords[3], double *values,
00058 int dim, double *derivs);
00059 virtual double *GetParametricCoords();
00061
00063
00065 void Clip(double value, vtkDataArray *cellScalars,
00066 vtkIncrementalPointLocator *locator, vtkCellArray *lines,
00067 vtkPointData *inPd, vtkPointData *outPd,
00068 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00069 int insideOut);
00071
00073 int GetParametricCenter(double pcoords[3]);
00074
00076
00078 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00079 double x[3], double pcoords[3], int& subId);
00081
00082
00084
00089 static int Intersection(double p1[3], double p2[3],
00090 double x1[3], double x2[3],
00091 double& u, double& v);
00093
00094
00096
00102 static double DistanceToLine(double x[3], double p1[3], double p2[3],
00103 double &t, double closestPoint[3]);
00105
00106
00110 static double DistanceToLine(double x[3], double p1[3], double p2[3]);
00111
00113
00119 static double DistanceBetweenLines(
00120 double l0[3], double l1[3],
00121 double m0[3], double m1[3],
00122 double closestPt1[3], double closestPt2[3],
00123 double &t1, double &t2 );
00125
00127
00133 static double DistanceBetweenLineSegments(
00134 double l0[3], double l1[3],
00135 double m0[3], double m1[3],
00136 double closestPt1[3], double closestPt2[3],
00137 double &t1, double &t2 );
00139
00141
00142 static void InterpolationFunctions(double pcoords[3], double weights[2]);
00143
00144
00145 static void InterpolationDerivs(double pcoords[3], double derivs[2]);
00146
00147
00148
00149 virtual void InterpolateFunctions(double pcoords[3], double weights[2])
00150 {
00151 vtkLine::InterpolationFunctions(pcoords,weights);
00152 }
00153 virtual void InterpolateDerivs(double pcoords[3], double derivs[2])
00154 {
00155 vtkLine::InterpolationDerivs(pcoords,derivs);
00156 }
00158
00159 protected:
00160 vtkLine();
00161 ~vtkLine() {};
00162
00163 private:
00164 vtkLine(const vtkLine&);
00165 void operator=(const vtkLine&);
00166 };
00167
00168
00169 inline int vtkLine::GetParametricCenter(double pcoords[3])
00170 {
00171 pcoords[0] = 0.5;
00172 pcoords[1] = pcoords[2] = 0.0;
00173 return 0;
00174 }
00175
00176 #endif
00177
00178