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

Common/vtkStructuredData.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkStructuredData.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00028 #ifndef __vtkStructuredData_h
00029 #define __vtkStructuredData_h
00030 
00031 #include "vtkObject.h"
00032 
00033 class vtkIdList;
00034 
00035 #define VTK_UNCHANGED 0
00036 #define VTK_SINGLE_POINT 1
00037 #define VTK_X_LINE 2
00038 #define VTK_Y_LINE 3
00039 #define VTK_Z_LINE 4
00040 #define VTK_XY_PLANE 5
00041 #define VTK_YZ_PLANE 6
00042 #define VTK_XZ_PLANE 7
00043 #define VTK_XYZ_GRID 8
00044 #define VTK_EMPTY 9
00045 
00046 class VTK_COMMON_EXPORT vtkStructuredData : public vtkObject 
00047 {
00048 public:
00049   vtkTypeRevisionMacro(vtkStructuredData,vtkObject);
00050 
00052 
00057   static int SetDimensions(int inDim[3], int dim[3]);
00058   static int SetExtent(int inExt[6], int ext[6]);
00060 
00062   static int GetDataDimension(int dataDescription);
00063 
00065 
00066   static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, 
00067                             int dataDescription, int dim[3]);
00069 
00071   static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3]);
00072 
00074 
00076   static void GetCellNeigbors(vtkIdType cellId, vtkIdList *ptIds, 
00077                               vtkIdList *cellIds, int dim[3]);
00079 
00081 
00083   static vtkIdType ComputePointId(int dim[3], int ijk[3]) {
00084     return ijk[2]*dim[0]*dim[1] + ijk[1]*dim[0] + ijk[0];}
00086 
00088 
00090   static vtkIdType ComputeCellId(int dim[3], int ijk[3]) {
00091     return ijk[2]*(dim[0]-1)*(dim[1]-1) + ijk[1]*(dim[0]-1) + ijk[0];};
00093 
00094 protected:
00095   vtkStructuredData() {};
00096   ~vtkStructuredData() {};
00097   
00098 private:
00099   vtkStructuredData(const vtkStructuredData&);  // Not implemented.
00100   void operator=(const vtkStructuredData&);  // Not implemented.
00101 };
00102 
00103 
00104 #endif
00105