VTK: IO/Chemistry/vtkMoleculeReaderBase.h Source File

| VTK 9.3.1

vtkMoleculeReaderBase.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkMoleculeReaderBase_h
16 #define vtkMoleculeReaderBase_h
17
18 #include "vtkIOChemistryModule.h" // For export macro
19 #include "vtkPolyDataAlgorithm.h"
20
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkCellArray;
23 class vtkFloatArray;
24 class vtkDataArray;
25 class vtkIdTypeArray;
26 class vtkUnsignedCharArray;
27 class vtkUnsignedIntArray;
28 class vtkPoints;
29 class vtkStringArray;
30 class vtkMolecule;
31 class vtkPeriodicTable;
32
33 class VTKIOCHEMISTRY_EXPORT vtkMoleculeReaderBase : public vtkPolyDataAlgorithm
34 {
35 public:
36 vtkTypeMacro(vtkMoleculeReaderBase, vtkPolyDataAlgorithm);
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
39 vtkSetFilePathMacro(FileName);
40 vtkGetFilePathMacro(FileName);
41
43
46 vtkSetMacro(BScale, double);
47 vtkGetMacro(BScale, double);
49
51
54 vtkSetMacro(HBScale, double);
55 vtkGetMacro(HBScale, double);
57
61 vtkGetMacro(NumberOfAtoms, vtkIdType);
62
66 vtkGetMacro(NumberOfModels, unsigned int);
67
68 protected:
69 vtkMoleculeReaderBase();
70 ~vtkMoleculeReaderBase() override;
71
72 char* FileName;
73 double BScale;
74 double HBScale;
75 vtkIdType NumberOfAtoms;
76 unsigned int NumberOfModels;
77
78 int FillOutputPortInformation(int, vtkInformation*) override;
79 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
80
89 int ReadMolecule(FILE* fp, vtkPolyData* output);
90
99 unsigned int MakeAtomType(const char* atomType);
100
110 unsigned int MakeBonds(vtkPoints* points, vtkIdTypeArray* atomTypes, vtkCellArray* newBonds);
111
112 vtkNew<vtkPeriodicTable> PeriodicTable;
113 vtkSmartPointer<vtkMolecule> Molecule;
114 vtkSmartPointer<vtkPoints> Points;
115 vtkSmartPointer<vtkUnsignedCharArray> RGB;
116 vtkSmartPointer<vtkFloatArray> Radii;
117 vtkSmartPointer<vtkIdTypeArray> AtomType;
118 vtkSmartPointer<vtkStringArray> AtomTypeStrings;
119 vtkSmartPointer<vtkIdTypeArray> Residue;
120 vtkSmartPointer<vtkUnsignedCharArray> Chain;
121 vtkSmartPointer<vtkUnsignedCharArray> SecondaryStructures;
122 vtkSmartPointer<vtkUnsignedCharArray> SecondaryStructuresBegin;
123 vtkSmartPointer<vtkUnsignedCharArray> SecondaryStructuresEnd;
124 vtkSmartPointer<vtkUnsignedCharArray> IsHetatm;
125 vtkSmartPointer<vtkUnsignedIntArray> Model;
126
127 virtual void ReadSpecificMolecule(FILE* fp) = 0;
128
129 private:
130 vtkMoleculeReaderBase(const vtkMoleculeReaderBase&) = delete;
131 void operator=(const vtkMoleculeReaderBase&) = delete;
132 };
133
134 VTK_ABI_NAMESPACE_END
135 #endif
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMoleculeReaderBase
Read molecular data files.
Definition: vtkMoleculeReaderBase.h:34
vtkMoleculeReaderBase::MakeBonds
unsigned int MakeBonds(vtkPoints *points, vtkIdTypeArray *atomTypes, vtkCellArray *newBonds)
Creates molecular bonds (VTK cells) given atomic coordinates (VTK points) and atom types.
vtkMoleculeReaderBase::AtomTypeStrings
vtkSmartPointer< vtkStringArray > AtomTypeStrings
Definition: vtkMoleculeReaderBase.h:118
vtkMoleculeReaderBase::vtkMoleculeReaderBase
vtkMoleculeReaderBase()
vtkMoleculeReaderBase::SecondaryStructures
vtkSmartPointer< vtkUnsignedCharArray > SecondaryStructures
Definition: vtkMoleculeReaderBase.h:121
vtkMoleculeReaderBase::FillOutputPortInformation
int FillOutputPortInformation(int, vtkInformation *) override
Fill the output port information objects for this algorithm.
vtkMoleculeReaderBase::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMoleculeReaderBase::HBScale
double HBScale
Definition: vtkMoleculeReaderBase.h:74
vtkMoleculeReaderBase::Residue
vtkSmartPointer< vtkIdTypeArray > Residue
Definition: vtkMoleculeReaderBase.h:119
vtkMoleculeReaderBase::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
vtkMoleculeReaderBase::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkMoleculeReaderBase::FileName
char * FileName
Definition: vtkMoleculeReaderBase.h:72
vtkMoleculeReaderBase::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
vtkMoleculeReaderBase::MakeAtomType
unsigned int MakeAtomType(const char *atomType)
Given a string for the type (name) of an atom, returns a unique number for that atom.
vtkMoleculeReaderBase::RGB
vtkSmartPointer< vtkUnsignedCharArray > RGB
Definition: vtkMoleculeReaderBase.h:115
vtkMoleculeReaderBase::ReadSpecificMolecule
virtual void ReadSpecificMolecule(FILE *fp)=0
vtkMoleculeReaderBase::SecondaryStructuresEnd
vtkSmartPointer< vtkUnsignedCharArray > SecondaryStructuresEnd
Definition: vtkMoleculeReaderBase.h:123
vtkMoleculeReaderBase::Points
vtkSmartPointer< vtkPoints > Points
Definition: vtkMoleculeReaderBase.h:114
vtkMoleculeReaderBase::ReadMolecule
int ReadMolecule(FILE *fp, vtkPolyData *output)
Reads a molecule from the passed file pointer and creates a vtkPolyData.
vtkMoleculeReaderBase::PeriodicTable
vtkNew< vtkPeriodicTable > PeriodicTable
Definition: vtkMoleculeReaderBase.h:112
vtkMoleculeReaderBase::SecondaryStructuresBegin
vtkSmartPointer< vtkUnsignedCharArray > SecondaryStructuresBegin
Definition: vtkMoleculeReaderBase.h:122
vtkMoleculeReaderBase::BScale
double BScale
Definition: vtkMoleculeReaderBase.h:73
vtkMoleculeReaderBase::AtomType
vtkSmartPointer< vtkIdTypeArray > AtomType
Definition: vtkMoleculeReaderBase.h:117
vtkMoleculeReaderBase::Model
vtkSmartPointer< vtkUnsignedIntArray > Model
Definition: vtkMoleculeReaderBase.h:125
vtkMoleculeReaderBase::NumberOfModels
unsigned int NumberOfModels
Definition: vtkMoleculeReaderBase.h:76
vtkMoleculeReaderBase::IsHetatm
vtkSmartPointer< vtkUnsignedCharArray > IsHetatm
Definition: vtkMoleculeReaderBase.h:124
vtkMoleculeReaderBase::Chain
vtkSmartPointer< vtkUnsignedCharArray > Chain
Definition: vtkMoleculeReaderBase.h:120
vtkMoleculeReaderBase::Molecule
vtkSmartPointer< vtkMolecule > Molecule
Definition: vtkMoleculeReaderBase.h:113
vtkMoleculeReaderBase::~vtkMoleculeReaderBase
~vtkMoleculeReaderBase() override
vtkMoleculeReaderBase::Radii
vtkSmartPointer< vtkFloatArray > Radii
Definition: vtkMoleculeReaderBase.h:116
vtkMoleculeReaderBase::NumberOfAtoms
vtkIdType NumberOfAtoms
Definition: vtkMoleculeReaderBase.h:75
vtkMolecule
class describing a molecule
Definition: vtkMolecule.h:84
vtkNew< vtkPeriodicTable >
vtkPeriodicTable
Access to information about the elements.
Definition: vtkPeriodicTable.h:31
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkSmartPointer< vtkMolecule >
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkUnsignedIntArray
dynamic, self-adjusting array of unsigned int
Definition: vtkUnsignedIntArray.h:32
vtkX3D::points
@ points
Definition: vtkX3D.h:446
vtkPolyDataAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315