VTK
vtkLine.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLine.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkLine_h
28 #define vtkLine_h
29 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 #include "vtkCell.h"
33 
35 {
36 public:
37  static vtkLine *New();
38  vtkTypeMacro(vtkLine,vtkCell);
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42 
43  int GetCellType() {return VTK_LINE;};
44  int GetCellDimension() {return 1;};
45  int GetNumberOfEdges() {return 0;};
46  int GetNumberOfFaces() {return 0;};
47  vtkCell *GetEdge(int) {return 0;};
48  vtkCell *GetFace(int) {return 0;};
49  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
50  void Contour(double value, vtkDataArray *cellScalars,
52  vtkCellArray *lines, vtkCellArray *polys,
53  vtkPointData *inPd, vtkPointData *outPd,
54  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
55  int EvaluatePosition(double x[3], double* closestPoint,
56  int& subId, double pcoords[3],
57  double& dist2, double *weights);
58  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
59  double *weights);
60  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
61  void Derivatives(int subId, double pcoords[3], double *values,
62  int dim, double *derivs);
63  virtual double *GetParametricCoords();
65 
67 
69  void Clip(double value, vtkDataArray *cellScalars,
71  vtkPointData *inPd, vtkPointData *outPd,
72  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
73  int insideOut);
75 
77  int GetParametricCenter(double pcoords[3]);
78 
80 
82  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
83  double x[3], double pcoords[3], int& subId);
85 
86 
88 
93  static int Intersection(double p1[3], double p2[3],
94  double x1[3], double x2[3],
95  double& u, double& v);
97 
98 
100 
106  static double DistanceToLine(double x[3], double p1[3], double p2[3],
107  double &t, double closestPoint[3]);
109 
110 
114  static double DistanceToLine(double x[3], double p1[3], double p2[3]);
115 
117 
123  static double DistanceBetweenLines(
124  double l0[3], double l1[3],
125  double m0[3], double m1[3],
126  double closestPt1[3], double closestPt2[3],
127  double &t1, double &t2 );
129 
131 
137  static double DistanceBetweenLineSegments(
138  double l0[3], double l1[3],
139  double m0[3], double m1[3],
140  double closestPt1[3], double closestPt2[3],
141  double &t1, double &t2 );
143 
145  static void InterpolationFunctions(double pcoords[3], double weights[2]);
147  static void InterpolationDerivs(double pcoords[3], double derivs[2]);
149 
151  virtual void InterpolateFunctions(double pcoords[3], double weights[2])
152  {
153  vtkLine::InterpolationFunctions(pcoords,weights);
154  }
155  virtual void InterpolateDerivs(double pcoords[3], double derivs[2])
156  {
157  vtkLine::InterpolationDerivs(pcoords,derivs);
158  }
160 
161 protected:
162  vtkLine();
163  ~vtkLine() {}
164 
165 private:
166  vtkLine(const vtkLine&); // Not implemented.
167  void operator=(const vtkLine&); // Not implemented.
168 };
169 
170 //----------------------------------------------------------------------------
171 inline int vtkLine::GetParametricCenter(double pcoords[3])
172 {
173  pcoords[0] = 0.5;
174  pcoords[1] = pcoords[2] = 0.0;
175  return 0;
176 }
177 
178 #endif
179 
180 
int GetCellType()
Definition: vtkLine.h:43
represent and manipulate point attribute data
Definition: vtkPointData.h:36
virtual void InterpolateDerivs(double pcoords[3], double derivs[2])
Definition: vtkLine.h:155
void PrintSelf(ostream &os, vtkIndent indent)
virtual double * GetParametricCoords()
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
vtkCell * GetEdge(int)
Definition: vtkLine.h:47
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
virtual void EvaluateLocation(int &subId, double pcoords[3], double x[3], double *weights)=0
virtual int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)=0
int vtkIdType
Definition: vtkType.h:275
~vtkLine()
Definition: vtkLine.h:163
static void InterpolationFunctions(double pcoords[3], double weights[2])
static void InterpolationDerivs(double pcoords[3], double derivs[2])
int GetCellDimension()
Definition: vtkLine.h:44
cell represents a 1D line
Definition: vtkLine.h:34
abstract class to specify cell behavior
Definition: vtkCell.h:61
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
vtkCell * GetFace(int)
Definition: vtkLine.h:48
virtual void Derivatives(int subId, double pcoords[3], double *values, int dim, double *derivs)=0
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
virtual void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)=0
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual void InterpolateFunctions(double pcoords[3], double weights[2])
Definition: vtkLine.h:151
virtual void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)=0
int GetNumberOfFaces()
Definition: vtkLine.h:46
int GetNumberOfEdges()
Definition: vtkLine.h:45
virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)=0
static vtkObject * New()
virtual int GetParametricCenter(double pcoords[3])
int GetParametricCenter(double pcoords[3])
Definition: vtkLine.h:171
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38