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

common/vtkDataSet.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDataSet.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 =========================================================================*/
00069 #ifndef __vtkDataSet_h
00070 #define __vtkDataSet_h
00071 
00072 #include "vtkDataObject.h"
00073 #include "vtkCellData.h"
00074 #include "vtkPointData.h"
00075 #include "vtkGenericCell.h"
00076 #include "vtkCellTypes.h"
00077 
00078 class VTK_EXPORT vtkDataSet : public vtkDataObject
00079 {
00080 public:
00081   vtkTypeMacro(vtkDataSet,vtkDataObject);
00082   void PrintSelf(ostream& os, vtkIndent indent);
00083   
00087   virtual void CopyStructure(vtkDataSet *ds) = 0;
00088 
00091   virtual int GetNumberOfPoints() = 0;
00092 
00095   virtual int GetNumberOfCells() = 0;
00096 
00099   virtual float *GetPoint(int ptId) = 0;
00100 
00104   virtual void GetPoint(int id, float x[3]);
00105 
00108   virtual vtkCell *GetCell(int cellId) = 0;
00109 
00114   virtual void GetCell(int cellId, vtkGenericCell *cell) = 0;
00115 
00124   virtual void GetCellBounds(int cellId, float bounds[6]);
00125   
00129   virtual int GetCellType(int cellId) = 0;
00130 
00138   virtual void GetCellTypes(vtkCellTypes *types);
00139 
00143   virtual void GetCellPoints(int cellId, vtkIdList *ptIds) = 0;
00144 
00148   virtual void GetPointCells(int ptId, vtkIdList *cellIds) = 0;
00149 
00153   virtual void GetCellNeighbors(int cellId, vtkIdList *ptIds, 
00154             vtkIdList *cellIds);
00155 
00160   int FindPoint(float x, float y, float z)
00161     {
00162     float xyz[3];
00163     xyz[0] = x; xyz[1] = y; xyz[2] = z;
00164     return this->FindPoint (xyz);
00165     }
00166   virtual int FindPoint(float x[3]) = 0;
00167 
00176   virtual int FindCell(float x[3], vtkCell *cell, int cellId, float tol2, 
00177                        int& subId, float pcoords[3], float *weights) = 0;
00178 
00184   virtual int FindCell(float x[3], vtkCell *cell, vtkGenericCell *gencell,
00185              int cellId, float tol2, int& subId, float pcoords[3], 
00186              float *weights) = 0;
00187   
00194   virtual vtkCell *FindAndGetCell(float x[3], vtkCell *cell, int cellId, 
00195               float tol2, int& subId, float pcoords[3], 
00196               float *weights);
00197 
00200   unsigned long int GetMTime();
00201 
00204   vtkCellData *GetCellData() {return this->CellData;};
00205 
00208   vtkPointData *GetPointData() {return this->PointData;};
00209 
00212   virtual void Squeeze();
00213 
00216   virtual void ComputeBounds();
00217 
00220   float *GetBounds();
00221 
00225   void GetBounds(float bounds[6]);
00226 
00228   float *GetCenter();
00229 
00232   void GetCenter(float center[3]);
00233   
00237   float GetLength();
00238 
00240   void Initialize();
00241 
00248   void GetScalarRange(float range[2]);
00249 
00252   float *GetScalarRange();
00253   
00257   virtual int GetMaxCellSize() = 0;
00258 
00264   unsigned long GetActualMemorySize();
00265   
00267   int GetDataObjectType() 
00268     {return VTK_DATA_SET;}
00269   
00271   void ShallowCopy(vtkDataObject *src);  
00272   void DeepCopy(vtkDataObject *src);
00273   
00274 #ifndef VTK_REMOVE_LEGACY_CODE
00275 
00276   void GetCellPoints(int cellId, vtkIdList &ptIds)
00277     {VTK_LEGACY_METHOD(GetCellPoints,"3.2"); this->GetCellPoints(cellId, &ptIds);}
00278   void GetPointCells(int ptId, vtkIdList &cellIds)
00279     {VTK_LEGACY_METHOD(GetPointCells,"3.2"); this->GetPointCells(ptId, &cellIds);}
00280   void GetCellNeighbors(int cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00281     {VTK_LEGACY_METHOD(GetCellNeighbors,"3.2"); this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00282   virtual int GetDataSetType() 
00283     {VTK_LEGACY_METHOD(GetDataSetType,"3.2"); return this->GetDataObjectType();}
00284 #endif
00285   
00286 protected:
00287   // Constructor with default bounds (0,1, 0,1, 0,1).
00288   vtkDataSet();
00289   ~vtkDataSet();  
00290   vtkDataSet(const vtkDataSet&) {};
00291   void operator=(const vtkDataSet&) {};  
00292 
00293   vtkCellData *CellData;   // Scalars, vectors, etc. associated w/ each cell
00294   vtkPointData *PointData;   // Scalars, vectors, etc. associated w/ each point
00295   vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
00296   float Bounds[6];  // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
00297   float ScalarRange[2];
00298   float Center[3];
00299 
00300 private:
00301   void InternalDataSetCopy(vtkDataSet *src);  
00302 };
00303 
00304 inline void vtkDataSet::GetPoint(int id, float x[3])
00305 {
00306   float *pt = this->GetPoint(id);
00307   x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2]; 
00308 }
00309 
00310 #endif

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