VTK
dox/IO/Geometry/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 "vtkIOGeometryModule.h" // For export macro
00029 #include "vtkPolyDataAlgorithm.h"
00030 
00031 class vtkCellArray;
00032 class vtkFloatArray;
00033 class vtkDataArray;
00034 class vtkIdTypeArray;
00035 class vtkUnsignedCharArray;
00036 class vtkPoints;
00037 class vtkStringArray;
00038 class vtkMolecule;
00039 
00040 class VTKIOGEOMETRY_EXPORT vtkMoleculeReaderBase : public vtkPolyDataAlgorithm
00041 {
00042 public:
00043   vtkTypeMacro(vtkMoleculeReaderBase,vtkPolyDataAlgorithm);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00046   vtkSetStringMacro(FileName);
00047   vtkGetStringMacro(FileName);
00048 
00050 
00051   vtkSetMacro(BScale, double);
00052   vtkGetMacro(BScale, double);
00054 
00056 
00057   vtkSetMacro(HBScale, double);
00058   vtkGetMacro(HBScale, double);
00060 
00061   vtkGetMacro(NumberOfAtoms, int);
00062 
00063 protected:
00064   vtkMoleculeReaderBase();
00065   ~vtkMoleculeReaderBase();
00066 
00067   char *FileName;
00068   double BScale;
00069   double HBScale;
00070   int NumberOfAtoms;
00071 
00072   virtual int FillOutputPortInformation(int, vtkInformation *);
00073   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00074 
00075   int ReadMolecule(FILE *fp, vtkPolyData *output);
00076   int MakeAtomType(const char *atype);
00077   int MakeBonds(vtkPoints*, vtkIdTypeArray*, vtkCellArray*);
00078 
00079   vtkMolecule *Molecule;
00080   vtkPoints *Points;
00081   vtkUnsignedCharArray *RGB;
00082   vtkFloatArray *Radii;
00083   vtkIdTypeArray *AtomType;
00084   vtkStringArray *AtomTypeStrings;
00085   vtkIdTypeArray *Residue;
00086   vtkUnsignedCharArray *Chain;
00087   vtkUnsignedCharArray *SecondaryStructures;
00088   vtkUnsignedCharArray *SecondaryStructuresBegin;
00089   vtkUnsignedCharArray *SecondaryStructuresEnd;
00090   vtkUnsignedCharArray *IsHetatm;
00091 
00092   virtual void ReadSpecificMolecule(FILE* fp) = 0;
00093 
00094 private:
00095   vtkMoleculeReaderBase(const vtkMoleculeReaderBase&);  // Not implemented.
00096   void operator=(const vtkMoleculeReaderBase&);  // Not implemented.
00097 };
00098 
00099 #endif