VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGenericCell.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00032 #ifndef __vtkGenericCell_h 00033 #define __vtkGenericCell_h 00034 00035 #include "vtkCommonDataModelModule.h" // For export macro 00036 #include "vtkCell.h" 00037 00038 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell 00039 { 00040 public: 00042 static vtkGenericCell *New(); 00043 00044 vtkTypeMacro(vtkGenericCell,vtkCell); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 00049 void SetPoints(vtkPoints *points); 00050 00053 void SetPointIds(vtkIdList *pointIds); 00054 00056 00057 void ShallowCopy(vtkCell *c); 00058 void DeepCopy(vtkCell *c); 00059 int GetCellType(); 00060 int GetCellDimension(); 00061 int IsLinear(); 00062 int RequiresInitialization(); 00063 void Initialize(); 00064 int RequiresExplicitFaceRepresentation(); 00065 void SetFaces(vtkIdType *faces); 00066 vtkIdType *GetFaces(); 00067 int GetNumberOfEdges(); 00068 int GetNumberOfFaces(); 00069 vtkCell *GetEdge(int edgeId); 00070 vtkCell *GetFace(int faceId); 00071 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00072 int EvaluatePosition(double x[3], double* closestPoint, 00073 int& subId, double pcoords[3], 00074 double& dist2, double *weights); 00075 void EvaluateLocation(int& subId, double pcoords[3], 00076 double x[3], double *weights); 00077 void Contour(double value, vtkDataArray *cellScalars, 00078 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00079 vtkCellArray *lines, vtkCellArray *polys, 00080 vtkPointData *inPd, vtkPointData *outPd, 00081 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00082 void Clip(double value, vtkDataArray *cellScalars, 00083 vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, 00084 vtkPointData *inPd, vtkPointData *outPd, 00085 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00086 int insideOut); 00087 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00088 double x[3], double pcoords[3], int& subId); 00089 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00090 void Derivatives(int subId, double pcoords[3], double *values, 00091 int dim, double *derivs); 00092 int GetParametricCenter(double pcoords[3]); 00093 double *GetParametricCoords(); 00094 int IsPrimaryCell(); 00096 00098 00100 virtual void InterpolateFunctions(double pcoords[3], double *weights); 00101 virtual void InterpolateDerivs(double pcoords[3], double *derivs); 00103 00105 00110 void SetCellType(int cellType); 00111 void SetCellTypeToEmptyCell() {this->SetCellType(VTK_EMPTY_CELL);} 00112 void SetCellTypeToVertex() {this->SetCellType(VTK_VERTEX);} 00113 void SetCellTypeToPolyVertex() {this->SetCellType(VTK_POLY_VERTEX);} 00114 void SetCellTypeToLine() {this->SetCellType(VTK_LINE);} 00115 void SetCellTypeToPolyLine() {this->SetCellType(VTK_POLY_LINE);} 00116 void SetCellTypeToTriangle() {this->SetCellType(VTK_TRIANGLE);} 00117 void SetCellTypeToTriangleStrip() {this->SetCellType(VTK_TRIANGLE_STRIP);} 00118 void SetCellTypeToPolygon() {this->SetCellType(VTK_POLYGON);} 00119 void SetCellTypeToPixel() {this->SetCellType(VTK_PIXEL);} 00120 void SetCellTypeToQuad() {this->SetCellType(VTK_QUAD);} 00121 void SetCellTypeToTetra() {this->SetCellType(VTK_TETRA);} 00122 void SetCellTypeToVoxel() {this->SetCellType(VTK_VOXEL);} 00123 void SetCellTypeToHexahedron() {this->SetCellType(VTK_HEXAHEDRON);} 00124 void SetCellTypeToWedge() {this->SetCellType(VTK_WEDGE);} 00125 void SetCellTypeToPyramid() {this->SetCellType(VTK_PYRAMID);} 00126 void SetCellTypeToPentagonalPrism() {this->SetCellType(VTK_PENTAGONAL_PRISM);} 00127 void SetCellTypeToHexagonalPrism() {this->SetCellType(VTK_HEXAGONAL_PRISM);} 00128 void SetCellTypeToPolyhedron() {this->SetCellType(VTK_POLYHEDRON);} 00129 void SetCellTypeToConvexPointSet() {this->SetCellType(VTK_CONVEX_POINT_SET);} 00130 void SetCellTypeToQuadraticEdge() {this->SetCellType(VTK_QUADRATIC_EDGE);} 00131 void SetCellTypeToCubicLine() {this->SetCellType(VTK_CUBIC_LINE);} 00132 void SetCellTypeToQuadraticTriangle() {this->SetCellType(VTK_QUADRATIC_TRIANGLE);} 00133 void SetCellTypeToBiQuadraticTriangle() {this->SetCellType(VTK_BIQUADRATIC_TRIANGLE);} 00134 void SetCellTypeToQuadraticQuad() {this->SetCellType(VTK_QUADRATIC_QUAD);} 00135 void SetCellTypeToQuadraticPolygon() {this->SetCellType(VTK_QUADRATIC_POLYGON);} 00136 void SetCellTypeToQuadraticTetra() {this->SetCellType(VTK_QUADRATIC_TETRA);} 00137 void SetCellTypeToQuadraticHexahedron() {this->SetCellType(VTK_QUADRATIC_HEXAHEDRON);} 00138 void SetCellTypeToQuadraticWedge() {this->SetCellType(VTK_QUADRATIC_WEDGE);} 00139 void SetCellTypeToQuadraticPyramid() {this->SetCellType(VTK_QUADRATIC_PYRAMID);} 00140 void SetCellTypeToQuadraticLinearQuad() {this->SetCellType(VTK_QUADRATIC_LINEAR_QUAD);} 00141 void SetCellTypeToBiQuadraticQuad() {this->SetCellType(VTK_BIQUADRATIC_QUAD);} 00142 void SetCellTypeToQuadraticLinearWedge() {this->SetCellType(VTK_QUADRATIC_LINEAR_WEDGE);} 00143 void SetCellTypeToBiQuadraticQuadraticWedge() { 00144 this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);} 00145 void SetCellTypeToTriQuadraticHexahedron() { 00146 this->SetCellType(VTK_TRIQUADRATIC_HEXAHEDRON);} 00147 void SetCellTypeToBiQuadraticQuadraticHexahedron() { 00148 this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);} 00150 00152 static vtkCell* InstantiateCell(int cellType); 00153 00154 protected: 00155 vtkGenericCell(); 00156 ~vtkGenericCell(); 00157 00158 vtkCell *Cell; 00159 00160 private: 00161 vtkGenericCell(const vtkGenericCell&); // Not implemented. 00162 void operator=(const vtkGenericCell&); // Not implemented. 00163 }; 00164 00165 #endif 00166 00167