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

vtkImageBlockReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageBlockReader.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00036 #ifndef __vtkImageBlockReader_h
00037 #define __vtkImageBlockReader_h
00038 
00039 #include "vtkImageSource.h"
00040 
00041 class VTK_PARALLEL_EXPORT vtkImageBlockReader : public vtkImageSource
00042 {
00043 public:
00044   static vtkImageBlockReader *New();
00045   vtkTypeRevisionMacro(vtkImageBlockReader,vtkImageSource);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00051   vtkSetVector3Macro(Divisions, int);
00052   vtkGetVector3Macro(Divisions, int);
00054 
00056 
00058   vtkSetMacro(Overlap, int);
00059   vtkGetMacro(Overlap, int);
00061 
00063 
00065   vtkSetVector6Macro(WholeExtent, int);
00066   vtkGetVector6Macro(WholeExtent, int);
00068 
00070 
00072   vtkSetMacro(NumberOfScalarComponents, int);  
00073   vtkGetMacro(NumberOfScalarComponents, int);  
00075   
00077 
00079   vtkSetMacro(ScalarType, int);  
00080   vtkGetMacro(ScalarType, int);  
00082   
00084 
00085   vtkSetStringMacro(FilePattern);
00086   vtkGetStringMacro(FilePattern);
00088 
00089 protected:
00090   vtkImageBlockReader();
00091   ~vtkImageBlockReader();
00092   
00093   char *FilePattern;
00094 
00095   int WholeExtent[6];
00096   int NumberOfScalarComponents;
00097   int ScalarType;
00098   int Divisions[3];
00099   int Overlap;
00100 
00101 
00103 
00104   void Execute(vtkImageData *data);
00105   void ExecuteInformation();
00107 
00108   // This method computes the XYZExtents.
00109   void ComputeBlockExtents();
00110   void DeleteBlockExtents();
00111 
00112   // helper methods
00113   void Read(vtkImageData *data, int *ext);
00114   void ReadRemainder(vtkImageData *data, int *ext, int *doneExt);
00115   void ReadBlock(int xIdx, int yIdx, int zIdx, 
00116                  vtkImageData *data, int *ext);
00117 
00120   void ModifyOutputUpdateExtent();
00121 
00122   // extents (min, max) of the divisions.
00123   int *XExtents;
00124   int *YExtents;
00125   int *ZExtents;
00126 
00127 private:
00128   vtkImageBlockReader(const vtkImageBlockReader&);  // Not implemented.
00129   void operator=(const vtkImageBlockReader&);  // Not implemented.
00130 };
00131 
00132 
00133 #endif
00134 
00135