Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Common/vtkCell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCell.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00067 #ifndef __vtkCell_h
00068 #define __vtkCell_h
00069 
00070 #define VTK_CELL_SIZE 512
00071 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation
00072 
00073 #include "vtkObject.h"
00074 #include "vtkPoints.h"
00075 #include "vtkIdList.h"
00076 
00077 // Include vtkCellType to include the defined cell types
00078 #include "vtkCellType.h"
00079 
00080 class vtkCellArray;
00081 class vtkPointLocator;
00082 class vtkPointData;
00083 class vtkCellData;
00084 
00085 class VTK_COMMON_EXPORT vtkCell : public vtkObject
00086 {
00087 public:
00088   vtkTypeMacro(vtkCell,vtkObject);
00089   void PrintSelf(ostream& os, vtkIndent indent);
00090 
00093   void Initialize(int npts, vtkIdType *pts, vtkPoints *p);
00094 
00097   virtual vtkCell *MakeObject() = 0;
00098 
00102   virtual void ShallowCopy(vtkCell *c);
00103 
00106   virtual void DeepCopy(vtkCell *c);
00107 
00109   virtual int GetCellType() = 0;
00110 
00112   virtual int GetCellDimension() = 0;
00113 
00115   virtual int GetInterpolationOrder() {return 1;};
00116 
00118   vtkPoints *GetPoints() {return this->Points;};
00119 
00121   int GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();};
00122 
00124   virtual int GetNumberOfEdges() = 0;
00125 
00127   virtual int GetNumberOfFaces() = 0;
00128 
00130   vtkIdList *GetPointIds() {return this->PointIds;};
00131 
00133   vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);};
00134 
00136   virtual vtkCell *GetEdge(int edgeId) = 0;
00137 
00139   virtual vtkCell *GetFace(int faceId) = 0;
00140 
00146   virtual int CellBoundary(int subId, float pcoords[3], vtkIdList *pts) = 0;
00147 
00149 
00163   virtual int EvaluatePosition(float x[3], float* closestPoint, 
00164                                int& subId, float pcoords[3], 
00165                                float& dist2, float *weights) = 0;
00167 
00169 
00172   virtual void EvaluateLocation(int& subId, float pcoords[3], 
00173                                 float x[3], float *weights) = 0;
00175 
00177 
00188   virtual void Contour(float value, vtkDataArray *cellScalars, 
00189                        vtkPointLocator *locator, vtkCellArray *verts, 
00190                        vtkCellArray *lines, vtkCellArray *polys, 
00191                        vtkPointData *inPd, vtkPointData *outPd,
00192                        vtkCellData *inCd, vtkIdType cellId,
00193                        vtkCellData *outCd) = 0;
00195 
00197 
00208   virtual void Clip(float value, vtkDataArray *cellScalars, 
00209                     vtkPointLocator *locator, vtkCellArray *connectivity,
00210                     vtkPointData *inPd, vtkPointData *outPd,
00211                     vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 
00212                     int insideOut) = 0;
00214 
00216 
00219   virtual int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00220                                 float x[3], float pcoords[3], int& subId) = 0;
00222 
00230   virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
00231 
00233 
00245   virtual void Derivatives(int subId, float pcoords[3], float *values, 
00246                            int dim, float *derivs) = 0;
00248 
00249 
00252   void GetBounds(float bounds[6]);
00253 
00254 
00257   float *GetBounds();
00258 
00259 
00261   float GetLength2();
00262 
00263 
00269   virtual int GetParametricCenter(float pcoords[3]);
00270 
00271 
00273 
00280   static char HitBBox(float bounds[6], float origin[3], float dir[3], 
00281                       float coord[3], float& t);
00283 
00284   
00285   // left public for quick computational access
00286   vtkPoints *Points;
00287   vtkIdList *PointIds;
00288 
00289 protected:
00290   vtkCell();
00291   ~vtkCell();
00292 
00293   float Bounds[6];
00294 private:
00295   vtkCell(const vtkCell&);  // Not implemented.
00296   void operator=(const vtkCell&);  // Not implemented.
00297 };
00298 
00299 #endif
00300 
00301 

Generated on Thu Mar 28 14:19:14 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001