VTK
vtkCubicLine.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCubicLine.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 =========================================================================*/
35 #ifndef __vtkCubicLine_h
36 #define __vtkCubicLine_h
37 
38 #include "vtkNonLinearCell.h"
39 
40 class vtkLine;
41 class vtkDoubleArray;
42 
44 {
45 public:
46  static vtkCubicLine *New();
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
52  int GetCellType() {return VTK_CUBIC_LINE;};
53  int GetCellDimension() {return 1;};
54  int GetNumberOfEdges() {return 0;};
55  int GetNumberOfFaces() {return 0;};
56  vtkCell *GetEdge(int) {return 0;};
57  vtkCell *GetFace(int) {return 0;};
58  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
59  void Contour(double value, vtkDataArray *cellScalars,
61  vtkCellArray *lines, vtkCellArray *polys,
62  vtkPointData *inPd, vtkPointData *outPd,
63  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
64  int EvaluatePosition(double x[3], double* closestPoint,
65  int& subId, double pcoords[3],
66  double& dist2, double *weights);
67  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
68  double *weights);
69  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
70  void Derivatives(int subId, double pcoords[3], double *values,
71  int dim, double *derivs);
72  virtual double *GetParametricCoords();
74 
77  double GetParametricDistance(double pcoords[3]);
78 
80 
82  void Clip(double value, vtkDataArray *cellScalars,
84  vtkPointData *inPd, vtkPointData *outPd,
85  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
86  int insideOut);
88 
90  int GetParametricCenter(double pcoords[3]);
91 
93 
95  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
96  double x[3], double pcoords[3], int& subId);
98 
99 
100 
103  static void InterpolationFunctions(double pcoords[3], double weights[4]);
105  static void InterpolationDerivs(double pcoords[3], double derivs[4]);
107 
109  virtual void InterpolateFunctions(double pcoords[3], double weights[4])
110  {
111  vtkCubicLine::InterpolationFunctions(pcoords,weights);
112  }
113  virtual void InterpolateDerivs(double pcoords[3], double derivs[4])
114  {
115  vtkCubicLine::InterpolationDerivs(pcoords,derivs);
116  }
118 
119 protected:
120  vtkCubicLine();
121  ~vtkCubicLine();
122 
124  vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping
125 
126 private:
127  vtkCubicLine(const vtkCubicLine&); // Not implemented.
128  void operator=(const vtkCubicLine&); // Not implemented.
129 };
130 
131 //----------------------------------------------------------------------------
132 inline int vtkCubicLine::GetParametricCenter(double pcoords[3])
133 {
134 
135  pcoords[0]=pcoords[1] = pcoords[2] = 0.0;
136  return 0;
137 }
138 
139 #endif
140 
141 
142