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 =========================================================================*/
00066 #ifndef __vtkCell_h
00067 #define __vtkCell_h
00068 
00069 #define VTK_CELL_SIZE 512
00070 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation
00071 
00072 #include "vtkObject.h"
00073 #include "vtkPoints.h"
00074 #include "vtkScalars.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_EXPORT vtkCell : public vtkObject
00086 {
00087 public:
00088   vtkTypeMacro(vtkCell,vtkObject);
00089   void PrintSelf(ostream& os, vtkIndent indent);
00090 
00093   void Initialize(int npts, int *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   int 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 
00162   virtual int EvaluatePosition(float x[3], float* closestPoint, 
00163                                int& subId, float pcoords[3], 
00164                                float& dist2, float *weights) = 0;
00165 
00169   virtual void EvaluateLocation(int& subId, float pcoords[3], 
00170                                 float x[3], float *weights) = 0;
00171 
00183   virtual void Contour(float value, vtkScalars *cellScalars, 
00184                        vtkPointLocator *locator, vtkCellArray *verts, 
00185                        vtkCellArray *lines, vtkCellArray *polys, 
00186                        vtkPointData *inPd, vtkPointData *outPd,
00187                        vtkCellData *inCd, int cellId, vtkCellData *outCd) = 0;
00188 
00200   virtual void Clip(float value, vtkScalars *cellScalars, 
00201                     vtkPointLocator *locator, vtkCellArray *connectivity,
00202                     vtkPointData *inPd, vtkPointData *outPd,
00203                     vtkCellData *inCd, int cellId, vtkCellData *outCd, 
00204                     int insideOut) = 0;
00205 
00209   virtual int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00210                                 float x[3], float pcoords[3], int& subId) = 0;
00211 
00219   virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
00220 
00233   virtual void Derivatives(int subId, float pcoords[3], float *values, 
00234                            int dim, float *derivs) = 0;
00235 
00236 
00239   void GetBounds(float bounds[6]);
00240 
00241 
00244   float *GetBounds();
00245 
00246 
00248   float GetLength2();
00249 
00250 
00256   virtual int GetParametricCenter(float pcoords[3]);
00257 
00258 
00266   static char HitBBox(float bounds[6], float origin[3], float dir[3], 
00267                       float coord[3], float& t);
00268 
00269   
00270   // left public for quick computational access
00271   vtkPoints *Points;
00272   vtkIdList *PointIds;
00273 
00274 #ifndef VTK_REMOVE_LEGACY_CODE
00275 
00276   void DeepCopy(vtkCell &c) 
00277     {VTK_LEGACY_METHOD(DeepCopy,"3.2"); this->DeepCopy(&c);}
00278   void ShallowCopy(vtkCell &c) 
00279     {VTK_LEGACY_METHOD(ShallowCopy,"3.2"); this->ShallowCopy(&c);}
00280 #endif
00281   
00282 protected:
00283   vtkCell();
00284   ~vtkCell();
00285   vtkCell(const vtkCell&) {};
00286   void operator=(const vtkCell&) {};
00287 
00288   float Bounds[6];
00289 
00290 };
00291 
00292 #endif
00293 
00294 

Generated on Wed Nov 21 12:26:51 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001