VTK
vtkQuadraticPolygon.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadraticPolygon.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 vtkQuadraticPolygon_h
36 #define vtkQuadraticPolygon_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkNonLinearCell.h"
40 
41 class vtkQuadraticEdge;
42 class vtkPolygon;
43 class vtkIdTypeArray;
44 
46 {
47 public:
48  static vtkQuadraticPolygon *New();
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
56  int GetCellDimension() { return 2;}
57  int GetNumberOfEdges() { return this->GetNumberOfPoints() / 2; }
58  int GetNumberOfFaces() { return 0; }
59  vtkCell *GetEdge(int);
60  vtkCell *GetFace(int) { return 0; }
61  int IsPrimaryCell() { return 0; }
63 
65 
69  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
70  void Contour(double value, vtkDataArray *cellScalars,
72  vtkCellArray *lines, vtkCellArray *polys,
73  vtkPointData *inPd, vtkPointData *outPd,
74  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
75  void Clip(double value, vtkDataArray *cellScalars,
77  vtkPointData *inPd, vtkPointData *outPd,
78  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
79  int insideOut);
80  int EvaluatePosition(double x[3], double* closestPoint,
81  int& subId, double pcoords[3],
82  double& dist2, double *weights);
83  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
84  double *weights);
85  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
86  double x[3], double pcoords[3], int& subId);
87  virtual void InterpolateFunctions(double x[3], double *weights);
88  static void ComputeCentroid(vtkIdTypeArray *ids, vtkPoints *pts,
89  double centroid[3]);
90  int ParameterizePolygon(double p0[3], double p10[3], double &l10,
91  double p20[3], double &l20, double n[3]);
92  static int PointInPolygon(double x[3], int numPts, double *pts,
93  double bounds[6], double n[3]);
94  int Triangulate(vtkIdList *outTris);
95  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
96  int NonDegenerateTriangulate(vtkIdList *outTris);
97  static double DistanceToPolygon(double x[3], int numPts, double *pts,
98  double bounds[6], double closest[3]);
99  static int IntersectPolygonWithPolygon(int npts, double *pts, double bounds[6],
100  int npts2, double *pts2,
101  double bounds2[3], double tol,
102  double x[3]);
103  static int IntersectConvex2DCells(vtkCell *cell1, vtkCell *cell2,
104  double tol, double p0[3], double p1[3]);
106 
107  // Not implemented
108  void Derivatives(int subId, double pcoords[3], double *values,
109  int dim, double *derivs);
110 
112 
117  vtkGetMacro(UseMVCInterpolation, bool);
118  vtkSetMacro(UseMVCInterpolation, bool);
120 
121 protected:
124 
125  // variables used by instances of this class
128 
129  // Parameter indicating whether to use Mean Value Coordinate algorithm
130  // for interpolation. The parameter is true by default.
132 
134 
136  static void GetPermutationFromPolygon(vtkIdType nb, vtkIdList *permutation);
137  static void PermuteToPolygon(vtkIdType nbPoints, double *inPoints, double *outPoints);
138  static void PermuteToPolygon(vtkCell *inCell, vtkCell *outCell);
139  static void PermuteToPolygon(vtkPoints *inPoints, vtkPoints *outPoints);
140  static void PermuteToPolygon(vtkIdTypeArray *inIds, vtkIdTypeArray *outIds);
141  static void PermuteToPolygon(vtkDataArray *inDataArray, vtkDataArray *outDataArray);
142  void InitializePolygon();
144 
146 
148  static void GetPermutationToPolygon(vtkIdType nb, vtkIdList *permutation);
149  static void PermuteFromPolygon(vtkIdType nb, double *values);
150  static void ConvertFromPolygon(vtkIdList *ids);
152 
153 private:
154  vtkQuadraticPolygon(const vtkQuadraticPolygon&); // Not implemented.
155  void operator=(const vtkQuadraticPolygon&); // Not implemented.
156 };
157 
158 #endif
vtkQuadraticEdge * Edge
vtkIdType GetNumberOfPoints()
Definition: vtkCell.h:117
represent and manipulate point attribute data
Definition: vtkPointData.h:36
virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double *vtkNotUsed(weight))
Definition: vtkCell.h:306
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
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
abstract superclass for non-linear cells
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:275
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
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
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:44
virtual void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)=0
void PrintSelf(ostream &os, vtkIndent indent)
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual vtkCell * GetEdge(int edgeId)=0
a cell that represents a parabolic n-sided polygon
cell represents a parabolic, isoparametric edge
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
virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)=0
static vtkObject * New()
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38