VTK
dox/IO/vtkBYUReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBYUReader.h
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 =========================================================================*/
00030 #ifndef __vtkBYUReader_h
00031 #define __vtkBYUReader_h
00032 
00033 #include "vtkPolyDataAlgorithm.h"
00034 
00035 class VTK_IO_EXPORT vtkBYUReader : public vtkPolyDataAlgorithm 
00036 {
00037 public:
00038   static vtkBYUReader *New();
00039 
00040   vtkTypeMacro(vtkBYUReader,vtkPolyDataAlgorithm);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00044 
00045   vtkSetStringMacro(GeometryFileName);
00046   vtkGetStringMacro(GeometryFileName);
00048 
00050 
00051   virtual void SetFileName(const char* f) { this->SetGeometryFileName(f); }
00052   virtual char* GetFileName() { return this->GetGeometryFileName(); }
00054 
00056 
00057   vtkSetStringMacro(DisplacementFileName);
00058   vtkGetStringMacro(DisplacementFileName);
00060 
00062 
00063   vtkSetStringMacro(ScalarFileName);
00064   vtkGetStringMacro(ScalarFileName);
00066 
00068 
00069   vtkSetStringMacro(TextureFileName);
00070   vtkGetStringMacro(TextureFileName);
00072 
00074 
00075   vtkSetMacro(ReadDisplacement,int);
00076   vtkGetMacro(ReadDisplacement,int);
00077   vtkBooleanMacro(ReadDisplacement,int);
00079   
00081 
00082   vtkSetMacro(ReadScalar,int);
00083   vtkGetMacro(ReadScalar,int);
00084   vtkBooleanMacro(ReadScalar,int);
00086   
00088 
00090   vtkSetMacro(ReadTexture,int);
00091   vtkGetMacro(ReadTexture,int);
00092   vtkBooleanMacro(ReadTexture,int);
00094 
00096 
00097   vtkSetClampMacro(PartNumber,int,1,VTK_LARGE_INTEGER);
00098   vtkGetMacro(PartNumber,int);
00100 
00105   static int CanReadFile(const char *filename);
00106 
00107 protected:
00108   vtkBYUReader();
00109   ~vtkBYUReader();
00110 
00111   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00112   // This source does not know how to generate pieces yet.
00113   int ComputeDivisionExtents(vtkDataObject *output, 
00114                              int idx, int numDivisions);
00115 
00116   char *GeometryFileName;
00117   char *DisplacementFileName;
00118   char *ScalarFileName;
00119   char *TextureFileName;
00120   int ReadDisplacement;
00121   int ReadScalar;
00122   int ReadTexture;
00123   int PartNumber;
00124 
00125   void ReadGeometryFile(FILE *fp, int &numPts, vtkInformation *outInfo);
00126   void ReadDisplacementFile(int numPts, vtkInformation *outInfo);
00127   void ReadScalarFile(int numPts, vtkInformation *outInfo);
00128   void ReadTextureFile(int numPts, vtkInformation *outInfo);
00129 private:
00130   vtkBYUReader(const vtkBYUReader&);  // Not implemented.
00131   void operator=(const vtkBYUReader&);  // Not implemented.
00132 };
00133 
00134 #endif