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 =========================================================================*/ 00035 #ifndef vtkGenericCell_h 00036 #define vtkGenericCell_h 00037 00038 #include "vtkCommonDataModelModule.h" // For export macro 00039 #include "vtkCell.h" 00040 00041 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell 00042 { 00043 public: 00045 static vtkGenericCell *New(); 00046 00047 vtkTypeMacro(vtkGenericCell,vtkCell); 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 00052 void SetPoints(vtkPoints *points); 00053 00056 void SetPointIds(vtkIdList *pointIds); 00057 00059 00060 void ShallowCopy(vtkCell *c); 00061 void DeepCopy(vtkCell *c); 00062 int GetCellType(); 00063 int GetCellDimension(); 00064 int IsLinear(); 00065 int RequiresInitialization(); 00066 void Initialize(); 00067 int RequiresExplicitFaceRepresentation(); 00068 void SetFaces(vtkIdType *faces); 00069 vtkIdType *GetFaces(); 00070 int GetNumberOfEdges(); 00071 int GetNumberOfFaces(); 00072 vtkCell *GetEdge(int edgeId); 00073 vtkCell *GetFace(int faceId); 00074 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00075 int EvaluatePosition(double x[3], double* closestPoint, 00076 int& subId, double pcoords[3], 00077 double& dist2, double *weights); 00078 void EvaluateLocation(int& subId, double pcoords[3], 00079 double x[3], double *weights); 00080 void Contour(double value, vtkDataArray *cellScalars, 00081 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00082 vtkCellArray *lines, vtkCellArray *polys, 00083 vtkPointData *inPd, vtkPointData *outPd, 00084 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00085 void Clip(double value, vtkDataArray *cellScalars, 00086 vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, 00087 vtkPointData *inPd, vtkPointData *outPd, 00088 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00089 int insideOut); 00090 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00091 double x[3], double pcoords[3], int& subId); 00092 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00093 void Derivatives(int subId, double pcoords[3], double *values, 00094 int dim, double *derivs); 00095 int GetParametricCenter(double pcoords[3]); 00096 double *GetParametricCoords(); 00097 int IsPrimaryCell(); 00099 00101 00103 virtual void InterpolateFunctions(double pcoords[3], double *weights); 00104 virtual void InterpolateDerivs(double pcoords[3], double *derivs); 00106 00108 00113 void SetCellType(int cellType); 00114 void SetCellTypeToEmptyCell() {this->SetCellType(VTK_EMPTY_CELL);} 00115 void SetCellTypeToVertex() {this->SetCellType(VTK_VERTEX);} 00116 void SetCellTypeToPolyVertex() {this->SetCellType(VTK_POLY_VERTEX);} 00117 void SetCellTypeToLine() {this->SetCellType(VTK_LINE);} 00118 void SetCellTypeToPolyLine() {this->SetCellType(VTK_POLY_LINE);} 00119 void SetCellTypeToTriangle() {this->SetCellType(VTK_TRIANGLE);} 00120 void SetCellTypeToTriangleStrip() {this->SetCellType(VTK_TRIANGLE_STRIP);} 00121 void SetCellTypeToPolygon() {this->SetCellType(VTK_POLYGON);} 00122 void SetCellTypeToPixel() {this->SetCellType(VTK_PIXEL);} 00123 void SetCellTypeToQuad() {this->SetCellType(VTK_QUAD);} 00124 void SetCellTypeToTetra() {this->SetCellType(VTK_TETRA);} 00125 void SetCellTypeToVoxel() {this->SetCellType(VTK_VOXEL);} 00126 void SetCellTypeToHexahedron() {this->SetCellType(VTK_HEXAHEDRON);} 00127 void SetCellTypeToWedge() {this->SetCellType(VTK_WEDGE);} 00128 void SetCellTypeToPyramid() {this->SetCellType(VTK_PYRAMID);} 00129 void SetCellTypeToPentagonalPrism() {this->SetCellType(VTK_PENTAGONAL_PRISM);} 00130 void SetCellTypeToHexagonalPrism() {this->SetCellType(VTK_HEXAGONAL_PRISM);} 00131 void SetCellTypeToPolyhedron() {this->SetCellType(VTK_POLYHEDRON);} 00132 void SetCellTypeToConvexPointSet() {this->SetCellType(VTK_CONVEX_POINT_SET);} 00133 void SetCellTypeToQuadraticEdge() {this->SetCellType(VTK_QUADRATIC_EDGE);} 00134 void SetCellTypeToCubicLine() {this->SetCellType(VTK_CUBIC_LINE);} 00135 void SetCellTypeToQuadraticTriangle() {this->SetCellType(VTK_QUADRATIC_TRIANGLE);} 00136 void SetCellTypeToBiQuadraticTriangle() {this->SetCellType(VTK_BIQUADRATIC_TRIANGLE);} 00137 void SetCellTypeToQuadraticQuad() {this->SetCellType(VTK_QUADRATIC_QUAD);} 00138 void SetCellTypeToQuadraticPolygon() {this->SetCellType(VTK_QUADRATIC_POLYGON);} 00139 void SetCellTypeToQuadraticTetra() {this->SetCellType(VTK_QUADRATIC_TETRA);} 00140 void SetCellTypeToQuadraticHexahedron() {this->SetCellType(VTK_QUADRATIC_HEXAHEDRON);} 00141 void SetCellTypeToQuadraticWedge() {this->SetCellType(VTK_QUADRATIC_WEDGE);} 00142 void SetCellTypeToQuadraticPyramid() {this->SetCellType(VTK_QUADRATIC_PYRAMID);} 00143 void SetCellTypeToQuadraticLinearQuad() {this->SetCellType(VTK_QUADRATIC_LINEAR_QUAD);} 00144 void SetCellTypeToBiQuadraticQuad() {this->SetCellType(VTK_BIQUADRATIC_QUAD);} 00145 void SetCellTypeToQuadraticLinearWedge() {this->SetCellType(VTK_QUADRATIC_LINEAR_WEDGE);} 00146 void SetCellTypeToBiQuadraticQuadraticWedge() { 00147 this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);} 00148 void SetCellTypeToTriQuadraticHexahedron() { 00149 this->SetCellType(VTK_TRIQUADRATIC_HEXAHEDRON);} 00150 void SetCellTypeToBiQuadraticQuadraticHexahedron() { 00151 this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);} 00153 00155 static vtkCell* InstantiateCell(int cellType); 00156 00157 protected: 00158 vtkGenericCell(); 00159 ~vtkGenericCell(); 00160 00161 vtkCell *Cell; 00162 00163 private: 00164 vtkGenericCell(const vtkGenericCell&); // Not implemented. 00165 void operator=(const vtkGenericCell&); // Not implemented. 00166 }; 00167 00168 #endif 00169 00170