00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00027 #ifndef __vtkLine_h
00028 #define __vtkLine_h
00029
00030 #include "vtkCell.h"
00031
00032 class VTK_FILTERING_EXPORT vtkLine : public vtkCell
00033 {
00034 public:
00035 static vtkLine *New();
00036 vtkTypeRevisionMacro(vtkLine,vtkCell);
00037 void PrintSelf(ostream& os, vtkIndent indent);
00038
00040
00041 int GetCellType() {return VTK_LINE;};
00042 int GetCellDimension() {return 1;};
00043 int GetNumberOfEdges() {return 0;};
00044 int GetNumberOfFaces() {return 0;};
00045 vtkCell *GetEdge(int) {return 0;};
00046 vtkCell *GetFace(int) {return 0;};
00047 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00048 void Contour(double value, vtkDataArray *cellScalars,
00049 vtkPointLocator *locator, vtkCellArray *verts,
00050 vtkCellArray *lines, vtkCellArray *polys,
00051 vtkPointData *inPd, vtkPointData *outPd,
00052 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00053 int EvaluatePosition(double x[3], double* closestPoint,
00054 int& subId, double pcoords[3],
00055 double& dist2, double *weights);
00056 void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00057 double *weights);
00058 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00059 void Derivatives(int subId, double pcoords[3], double *values,
00060 int dim, double *derivs);
00061 virtual double *GetParametricCoords();
00063
00065
00067 void Clip(double value, vtkDataArray *cellScalars,
00068 vtkPointLocator *locator, vtkCellArray *lines,
00069 vtkPointData *inPd, vtkPointData *outPd,
00070 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00071 int insideOut);
00073
00075 int GetParametricCenter(double pcoords[3]);
00076
00078
00080 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00081 double x[3], double pcoords[3], int& subId);
00083
00084
00086
00091 static int Intersection(double p1[3], double p2[3],
00092 double x1[3], double x2[3],
00093 double& u, double& v);
00095
00096
00098
00104 static double DistanceToLine(double x[3], double p1[3], double p2[3],
00105 double &t, double closestPoint[3]);
00107
00108
00112 static double DistanceToLine(double x[3], double p1[3], double p2[3]);
00113
00115 static void InterpolationFunctions(double pcoords[3], double weights[2]);
00116
00117 protected:
00118 vtkLine();
00119 ~vtkLine() {};
00120
00121 private:
00122 vtkLine(const vtkLine&);
00123 void operator=(const vtkLine&);
00124 };
00125
00126
00127 inline int vtkLine::GetParametricCenter(double pcoords[3])
00128 {
00129 pcoords[0] = 0.5;
00130 pcoords[1] = pcoords[2] = 0.0;
00131 return 0;
00132 }
00133
00134 #endif
00135
00136