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 00048 00049 void ShallowCopy(vtkCell *c); 00050 void DeepCopy(vtkCell *c); 00051 int GetCellType(); 00052 int GetCellDimension(); 00053 int IsLinear(); 00054 int RequiresInitialization(); 00055 void Initialize(); 00056 int RequiresExplicitFaceRepresentation(); 00057 void SetFaces(vtkIdType *faces); 00058 vtkIdType *GetFaces(); 00059 int GetNumberOfEdges(); 00060 int GetNumberOfFaces(); 00061 vtkCell *GetEdge(int edgeId); 00062 vtkCell *GetFace(int faceId); 00063 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00064 int EvaluatePosition(double x[3], double* closestPoint, 00065 int& subId, double pcoords[3], 00066 double& dist2, double *weights); 00067 void EvaluateLocation(int& subId, double pcoords[3], 00068 double x[3], double *weights); 00069 void Contour(double value, vtkDataArray *cellScalars, 00070 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00071 vtkCellArray *lines, vtkCellArray *polys, 00072 vtkPointData *inPd, vtkPointData *outPd, 00073 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00074 void Clip(double value, vtkDataArray *cellScalars, 00075 vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, 00076 vtkPointData *inPd, vtkPointData *outPd, 00077 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00078 int insideOut); 00079 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00080 double x[3], double pcoords[3], int& subId); 00081 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00082 void Derivatives(int subId, double pcoords[3], double *values, 00083 int dim, double *derivs); 00084 int GetParametricCenter(double pcoords[3]); 00085 double *GetParametricCoords(); 00086 int IsPrimaryCell(); 00088 00090 00092 virtual void InterpolateFunctions(double pcoords[3], double *weights); 00093 virtual void InterpolateDerivs(double pcoords[3], double *derivs); 00095 00097 00102 void SetCellType(int cellType); 00103 void SetCellTypeToEmptyCell() {this->SetCellType(VTK_EMPTY_CELL);} 00104 void SetCellTypeToVertex() {this->SetCellType(VTK_VERTEX);} 00105 void SetCellTypeToPolyVertex() {this->SetCellType(VTK_POLY_VERTEX);} 00106 void SetCellTypeToLine() {this->SetCellType(VTK_LINE);} 00107 void SetCellTypeToPolyLine() {this->SetCellType(VTK_POLY_LINE);} 00108 void SetCellTypeToTriangle() {this->SetCellType(VTK_TRIANGLE);} 00109 void SetCellTypeToTriangleStrip() {this->SetCellType(VTK_TRIANGLE_STRIP);} 00110 void SetCellTypeToPolygon() {this->SetCellType(VTK_POLYGON);} 00111 void SetCellTypeToPixel() {this->SetCellType(VTK_PIXEL);} 00112 void SetCellTypeToQuad() {this->SetCellType(VTK_QUAD);} 00113 void SetCellTypeToTetra() {this->SetCellType(VTK_TETRA);} 00114 void SetCellTypeToVoxel() {this->SetCellType(VTK_VOXEL);} 00115 void SetCellTypeToHexahedron() {this->SetCellType(VTK_HEXAHEDRON);} 00116 void SetCellTypeToWedge() {this->SetCellType(VTK_WEDGE);} 00117 void SetCellTypeToPyramid() {this->SetCellType(VTK_PYRAMID);} 00118 void SetCellTypeToPentagonalPrism() {this->SetCellType(VTK_PENTAGONAL_PRISM);} 00119 void SetCellTypeToHexagonalPrism() {this->SetCellType(VTK_HEXAGONAL_PRISM);} 00120 void SetCellTypeToPolyhedron() {this->SetCellType(VTK_POLYHEDRON);} 00121 void SetCellTypeToConvexPointSet() {this->SetCellType(VTK_CONVEX_POINT_SET);} 00122 void SetCellTypeToQuadraticEdge() {this->SetCellType(VTK_QUADRATIC_EDGE);} 00123 void SetCellTypeToCubicLine() {this->SetCellType(VTK_CUBIC_LINE);} 00124 void SetCellTypeToQuadraticTriangle() {this->SetCellType(VTK_QUADRATIC_TRIANGLE);} 00125 void SetCellTypeToBiQuadraticTriangle() {this->SetCellType(VTK_BIQUADRATIC_TRIANGLE);} 00126 void SetCellTypeToQuadraticQuad() {this->SetCellType(VTK_QUADRATIC_QUAD);} 00127 void SetCellTypeToQuadraticTetra() {this->SetCellType(VTK_QUADRATIC_TETRA);} 00128 void SetCellTypeToQuadraticHexahedron() {this->SetCellType(VTK_QUADRATIC_HEXAHEDRON);} 00129 void SetCellTypeToQuadraticWedge() {this->SetCellType(VTK_QUADRATIC_WEDGE);} 00130 void SetCellTypeToQuadraticPyramid() {this->SetCellType(VTK_QUADRATIC_PYRAMID);} 00131 void SetCellTypeToQuadraticLinearQuad() {this->SetCellType(VTK_QUADRATIC_LINEAR_QUAD);} 00132 void SetCellTypeToBiQuadraticQuad() {this->SetCellType(VTK_BIQUADRATIC_QUAD);} 00133 void SetCellTypeToQuadraticLinearWedge() {this->SetCellType(VTK_QUADRATIC_LINEAR_WEDGE);} 00134 void SetCellTypeToBiQuadraticQuadraticWedge() { 00135 this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);} 00136 void SetCellTypeToTriQuadraticHexahedron() { 00137 this->SetCellType(VTK_TRIQUADRATIC_HEXAHEDRON);} 00138 void SetCellTypeToBiQuadraticQuadraticHexahedron() { 00139 this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);} 00141 00143 static vtkCell* InstantiateCell(int cellType); 00144 00145 protected: 00146 vtkGenericCell(); 00147 ~vtkGenericCell(); 00148 00149 vtkCell *Cell; 00150 00151 private: 00152 vtkGenericCell(const vtkGenericCell&); // Not implemented. 00153 void operator=(const vtkGenericCell&); // Not implemented. 00154 }; 00155 00156 #endif 00157 00158