VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkQuadraticQuad.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadraticQuad.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 __vtkQuadraticQuad_h
36 #define __vtkQuadraticQuad_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkNonLinearCell.h"
40 
41 class vtkQuadraticEdge;
42 class vtkQuad;
43 class vtkDoubleArray;
44 
45 class VTKCOMMONDATAMODEL_EXPORT vtkQuadraticQuad : public vtkNonLinearCell
46 {
47 public:
48  static vtkQuadraticQuad *New();
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
55  int GetCellType() {return VTK_QUADRATIC_QUAD;};
56  int GetCellDimension() {return 2;}
57  int GetNumberOfEdges() {return 4;}
58  int GetNumberOfFaces() {return 0;}
59  vtkCell *GetEdge(int);
60  vtkCell *GetFace(int) {return 0;}
62 
63  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
64  void Contour(double value, vtkDataArray *cellScalars,
66  vtkCellArray *lines, vtkCellArray *polys,
67  vtkPointData *inPd, vtkPointData *outPd,
68  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
69  int EvaluatePosition(double x[3], double* closestPoint,
70  int& subId, double pcoords[3],
71  double& dist2, double *weights);
72  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
73  double *weights);
74  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
75  void Derivatives(int subId, double pcoords[3], double *values,
76  int dim, double *derivs);
77  virtual double *GetParametricCoords();
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 
92  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
93  double x[3], double pcoords[3], int& subId);
95 
96 
98  int GetParametricCenter(double pcoords[3]);
99 
102  static void InterpolationFunctions(double pcoords[3], double weights[8]);
105  static void InterpolationDerivs(double pcoords[3], double derivs[16]);
107 
109  virtual void InterpolateFunctions(double pcoords[3], double weights[8])
110  {
112  }
113  virtual void InterpolateDerivs(double pcoords[3], double derivs[16])
114  {
116  }
118 
119 protected:
121  ~vtkQuadraticQuad();
122 
124  vtkQuad *Quad;
125  vtkPointData *PointData;
126  vtkDoubleArray *Scalars;
127 
128  // In order to achieve some functionality we introduce a fake center point
129  // which require to have some extra functionalities compare to other non-linar
130  // cells
132  vtkDoubleArray *CellScalars;
133  void Subdivide(double *weights);
134  void InterpolateAttributes(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId,
135  vtkDataArray *cellScalars);
136 
137 private:
138  vtkQuadraticQuad(const vtkQuadraticQuad&); // Not implemented.
139  void operator=(const vtkQuadraticQuad&); // Not implemented.
140 };
141 //----------------------------------------------------------------------------
142 inline int vtkQuadraticQuad::GetParametricCenter(double pcoords[3])
143 {
144  pcoords[0] = pcoords[1] = 0.5;
145  pcoords[2] = 0.;
146  return 0;
147 }
148 
149 #endif
150 
151 
static void InterpolationDerivs(double pcoords[3], double derivs[16])
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
vtkDoubleArray * CellScalars
abstract superclass for non-linear cells
virtual void InterpolateFunctions(double pcoords[3], double weights[8])
vtkPointData * PointData
vtkQuadraticEdge * Edge
cell represents a parabolic, 8-node isoparametric quad
vtkCell * GetFace(int)
void PrintSelf(ostream &os, vtkIndent indent)
object to represent cell connectivity
Definition: vtkCellArray.h:49
vtkDoubleArray * Scalars
virtual void InterpolateDerivs(double pcoords[3], double derivs[16])
vtkCellData * CellData
cell represents a parabolic, isoparametric edge
static void InterpolationFunctions(double pcoords[3], double weights[8])
int GetParametricCenter(double pcoords[3])