VTK
dox/IO/vtkMoleculeReaderBase.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMoleculeReaderBase.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 =========================================================================*/
00025 #ifndef __vtkMoleculeReaderBase_h
00026 #define __vtkMoleculeReaderBase_h
00027 
00028 #include "vtkPolyDataAlgorithm.h"
00029 
00030 class vtkCellArray;
00031 class vtkFloatArray;
00032 class vtkDataArray;
00033 class vtkIdTypeArray;
00034 class vtkUnsignedCharArray;
00035 class vtkPoints;
00036 
00037 class VTK_IO_EXPORT vtkMoleculeReaderBase : public vtkPolyDataAlgorithm 
00038 {
00039 public:
00040   vtkTypeMacro(vtkMoleculeReaderBase,vtkPolyDataAlgorithm);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00043   vtkSetStringMacro(FileName);
00044   vtkGetStringMacro(FileName);
00045 
00047 
00048   vtkSetMacro(BScale, double);
00049   vtkGetMacro(BScale, double);
00051 
00053 
00054   vtkSetMacro(HBScale, double);
00055   vtkGetMacro(HBScale, double);
00057 
00058   vtkGetMacro(NumberOfAtoms, int);
00059 
00060 protected:
00061   vtkMoleculeReaderBase();
00062   ~vtkMoleculeReaderBase();
00063 
00064   char *FileName;
00065   double BScale;  
00066   double HBScale; 
00067   int NumberOfAtoms;
00068 
00069   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00070   int ReadMolecule(FILE *fp, vtkPolyData *output);
00071   int MakeAtomType(const char *atype);
00072   int MakeBonds(vtkPoints*, vtkIdTypeArray*, vtkCellArray*);
00073 
00074   vtkPoints *Points;
00075   vtkUnsignedCharArray *RGB;
00076   vtkFloatArray *Radii;
00077   vtkIdTypeArray *AtomType;
00078 
00079   virtual void ReadSpecificMolecule(FILE* fp) = 0;
00080   
00081 private:
00082   vtkMoleculeReaderBase(const vtkMoleculeReaderBase&);  // Not implemented.
00083   void operator=(const vtkMoleculeReaderBase&);  // Not implemented.
00084 };
00085 
00086 #endif