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
00121 static double DistanceBetweenLines(
00122 double l0[3], double l1[3],
00123 double m0[3], double m1[3],
00124 double closestPt1[3], double closestPt2[3],
00125 double &t1, double &t2 );
00127
00129
00135 static double DistanceBetweenLineSegments(
00136 double l0[3], double l1[3],
00137 double m0[3], double m1[3],
00138 double closestPt1[3], double closestPt2[3],
00139 double &t1, double &t2 );
00141
00143
00144 static void InterpolationFunctions(double pcoords[3], double weights[2]);
00145
00146
00147 static void InterpolationDerivs(double pcoords[3], double derivs[2]);
00148
00149
00150
00151 virtual void InterpolateFunctions(double pcoords[3], double weights[2])
00152 {
00153 vtkLine::InterpolationFunctions(pcoords,weights);
00154 }
00155 virtual void InterpolateDerivs(double pcoords[3], double derivs[2])
00156 {
00157 vtkLine::InterpolationDerivs(pcoords,derivs);
00158 }
00160
00161 protected:
00162 vtkLine();
00163 ~vtkLine() {};
00164
00165 private:
00166 vtkLine(const vtkLine&);
00167 void operator=(const vtkLine&);
00168 };
00169
00170
00171 inline int vtkLine::GetParametricCenter(double pcoords[3])
00172 {
00173 pcoords[0] = 0.5;
00174 pcoords[1] = pcoords[2] = 0.0;
00175 return 0;
00176 }
00177
00178 #endif
00179
00180