VTK  9.3.20240327
vtkXYZMolReader.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
17 #ifndef vtkXYZMolReader_h
18 #define vtkXYZMolReader_h
19 
20 #include "vtkIOChemistryModule.h" // For export macro
21 #include "vtkMoleculeReaderBase.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKIOCHEMISTRY_EXPORT vtkXYZMolReader : public vtkMoleculeReaderBase
25 {
26 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
30  static vtkXYZMolReader* New();
31 
36  virtual int CanReadFile(VTK_FILEPATH const char* name);
37 
39 
43  vtkSetMacro(TimeStep, int);
44  vtkGetMacro(TimeStep, int);
46 
48 
51  vtkGetMacro(MaxTimeStep, int);
53 
54 protected:
56  ~vtkXYZMolReader() override;
57 
58  void ReadSpecificMolecule(FILE* fp) override;
59 
64  char* GetNextLine(FILE* fp, char* line, int maxlen);
65 
66  int GetLine1(const char* line, int* cnt);
67  int GetLine2(const char* line, char* name);
68  int GetAtom(const char* line, char* atom, float* x);
69 
70  void InsertAtom(const char* atom, float* pos);
71 
72  vtkSetMacro(MaxTimeStep, int);
73 
74  int TimeStep;
76 
77 private:
78  vtkXYZMolReader(const vtkXYZMolReader&) = delete;
79  void operator=(const vtkXYZMolReader&) = delete;
80 };
81 
82 VTK_ABI_NAMESPACE_END
83 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
Read molecular data files.
read Molecular Data files
static vtkXYZMolReader * New()
char * GetNextLine(FILE *fp, char *line, int maxlen)
Get next line that is not a comment.
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the file with the given name can be read by this reader.
int GetAtom(const char *line, char *atom, float *x)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InsertAtom(const char *atom, float *pos)
~vtkXYZMolReader() override
int GetLine1(const char *line, int *cnt)
int GetLine2(const char *line, char *name)
void ReadSpecificMolecule(FILE *fp) override
@ name
Definition: vtkX3D.h:219
#define VTK_FILEPATH