VTK
vtkQuadraticLinearQuad.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadraticLinearQuad.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 =========================================================================*/
38 #ifndef __vtkQuadraticLinearQuad_h
39 #define __vtkQuadraticLinearQuad_h
40 
41 #include "vtkNonLinearCell.h"
42 
43 class vtkQuadraticEdge;
44 class vtkLine;
45 class vtkQuad;
46 class vtkDoubleArray;
47 
49 {
50 public:
51  static vtkQuadraticLinearQuad *New();
53  void PrintSelf(ostream & os, vtkIndent indent);
54 
56 
59  int GetCellDimension () { return 2; }
60  int GetNumberOfEdges () { return 4; }
61  int GetNumberOfFaces () { return 0; }
62  vtkCell *GetEdge (int);
63  vtkCell *GetFace (int) { return 0; }
65 
66  int CellBoundary (int subId, double pcoords[3], vtkIdList * pts);
67  void Contour (double value, vtkDataArray * cellScalars,
68  vtkIncrementalPointLocator * locator, vtkCellArray * verts,
69  vtkCellArray * lines, vtkCellArray * polys,
70  vtkPointData * inPd, vtkPointData * outPd, vtkCellData * inCd,
71  vtkIdType cellId, vtkCellData * outCd);
72  int EvaluatePosition (double x[3], double *closestPoint,
73  int &subId, double pcoords[3], double &dist2, double *weights);
74  void EvaluateLocation (int &subId, double pcoords[3], double x[3],
75  double *weights);
76  int Triangulate (int index, vtkIdList * ptIds, vtkPoints * pts);
77  void Derivatives (int subId, double pcoords[3], double *values, int dim,
78  double *derivs);
79  virtual double *GetParametricCoords ();
80 
82 
84  void Clip (double value, vtkDataArray * cellScalars,
85  vtkIncrementalPointLocator * locator, vtkCellArray * polys,
86  vtkPointData * inPd, vtkPointData * outPd,
87  vtkCellData * inCd, vtkIdType cellId, vtkCellData * outCd,
88  int insideOut);
90 
92 
94  int IntersectWithLine (double p1[3], double p2[3], double tol, double &t,
95  double x[3], double pcoords[3], int &subId);
97 
99  int GetParametricCenter(double pcoords[3]);
100 
102 
104  static void InterpolationFunctions (double pcoords[3], double weights[6]);
105  // Description:
106  // @deprecated Replaced by vtkQuadraticLinearQuad::InterpolateDerivs as of VTK 5.2
107  static void InterpolationDerivs (double pcoords[3], double derivs[12]);
108  // Description:
109  // Compute the interpolation functions/derivatives
110  // (aka shape functions/derivatives)
111  virtual void InterpolateFunctions (double pcoords[3], double weights[6])
112  {
114  }
115  virtual void InterpolateDerivs (double pcoords[3], double derivs[12])
116  {
118  }
119  // Description:
120  // Return the ids of the vertices defining edge (`edgeId`).
121  // Ids are related to the cell, not to the dataset.
122  static int *GetEdgeArray(int edgeId);
124 
125 protected:
128 
133 
134 private:
135  vtkQuadraticLinearQuad (const vtkQuadraticLinearQuad &); // Not implemented.
136  void operator = (const vtkQuadraticLinearQuad &); // Not implemented.
137 };
138 //----------------------------------------------------------------------------
139 inline int vtkQuadraticLinearQuad::GetParametricCenter(double pcoords[3])
140 {
141  pcoords[0] = pcoords[1] = 0.5;
142  pcoords[2] = 0.;
143  return 0;
144 }
145 
146 #endif