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 =========================================================================*/
00070 #ifndef __vtkDataSet_h
00071 #define __vtkDataSet_h
00072 
00073 #include "vtkDataObject.h"
00074 #include "vtkCellData.h"
00075 #include "vtkPointData.h"
00076 #include "vtkGenericCell.h"
00077 #include "vtkCellTypes.h"
00078 
00079 class VTK_COMMON_EXPORT vtkDataSet : public vtkDataObject
00080 {
00081 public:
00082   vtkTypeMacro(vtkDataSet,vtkDataObject);
00083   void PrintSelf(ostream& os, vtkIndent indent);
00084   
00088   virtual void CopyStructure(vtkDataSet *ds) = 0;
00089 
00092   virtual vtkIdType GetNumberOfPoints() = 0;
00093 
00096   virtual vtkIdType GetNumberOfCells() = 0;
00097 
00100   virtual float *GetPoint(vtkIdType ptId) = 0;
00101 
00105   virtual void GetPoint(vtkIdType id, float x[3]);
00106 
00109   virtual vtkCell *GetCell(vtkIdType cellId) = 0;
00110 
00115   virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
00116 
00125   virtual void GetCellBounds(vtkIdType cellId, float bounds[6]);
00126   
00130   virtual int GetCellType(vtkIdType cellId) = 0;
00131 
00139   virtual void GetCellTypes(vtkCellTypes *types);
00140 
00144   virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
00145 
00149   virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
00150 
00152 
00156   virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, 
00157                                 vtkIdList *cellIds);
00159 
00161 
00165   vtkIdType FindPoint(float x, float y, float z)
00166     {
00167     float xyz[3];
00168     xyz[0] = x; xyz[1] = y; xyz[2] = z;
00169     return this->FindPoint (xyz);
00170     }
00171   virtual vtkIdType FindPoint(float x[3]) = 0;
00173 
00175 
00183   virtual vtkIdType FindCell(float x[3], vtkCell *cell, vtkIdType cellId,
00184                              float tol2, int& subId, float pcoords[3],
00185                              float *weights) = 0;
00187 
00189 
00194   virtual vtkIdType FindCell(float x[3], vtkCell *cell,
00195                              vtkGenericCell *gencell, vtkIdType cellId,
00196                              float tol2, int& subId, float pcoords[3],
00197                              float *weights) = 0;
00199   
00201 
00207   virtual vtkCell *FindAndGetCell(float x[3], vtkCell *cell, vtkIdType cellId, 
00208                                   float tol2, int& subId, float pcoords[3], 
00209                                   float *weights);
00211 
00214   unsigned long int GetMTime();
00215 
00218   vtkCellData *GetCellData() {return this->CellData;};
00219 
00222   vtkPointData *GetPointData() {return this->PointData;};
00223 
00226   virtual void Squeeze();
00227 
00230   virtual void ComputeBounds();
00231 
00234   float *GetBounds();
00235 
00239   void GetBounds(float bounds[6]);
00240 
00242   float *GetCenter();
00243 
00246   void GetCenter(float center[3]);
00247   
00251   float GetLength();
00252 
00254   void Initialize();
00255 
00262   virtual void GetScalarRange(float range[2]);
00263 
00266   float *GetScalarRange();
00267   
00271   virtual int GetMaxCellSize() = 0;
00272 
00278   unsigned long GetActualMemorySize();
00279   
00281 
00282   int GetDataObjectType() 
00283     {return VTK_DATA_SET;}
00285   
00287 
00288   void ShallowCopy(vtkDataObject *src);  
00289   void DeepCopy(vtkDataObject *src);
00291 
00292 //BTX
00293   enum FieldDataType 
00294   {
00295     DATA_OBJECT_FIELD=0,
00296     POINT_DATA_FIELD=1,
00297     CELL_DATA_FIELD=2
00298   };
00299 //ETX
00300   
00301 protected:
00302   // Constructor with default bounds (0,1, 0,1, 0,1).
00303   vtkDataSet();
00304   ~vtkDataSet();  
00305 
00306   vtkCellData *CellData;   // Scalars, vectors, etc. associated w/ each cell
00307   vtkPointData *PointData;   // Scalars, vectors, etc. associated w/ each point
00308   vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
00309   float Bounds[6];  // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
00310   float ScalarRange[2];
00311   float Center[3];
00312 
00313 private:
00314   void InternalDataSetCopy(vtkDataSet *src);  
00315 private:
00316   vtkDataSet(const vtkDataSet&);  // Not implemented.
00317   void operator=(const vtkDataSet&);    // Not implemented.
00318 };
00319 
00320 inline void vtkDataSet::GetPoint(vtkIdType id, float x[3])
00321 {
00322   float *pt = this->GetPoint(id);
00323   x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2]; 
00324 }
00325 
00326 #endif

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