VTK  9.2.6
vtkTemporalDelimitedTextReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTemporalDelimitedTextReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
41 #ifndef vtkTemporalDelimitedTextReader_h
42 #define vtkTemporalDelimitedTextReader_h
43 
44 #include "vtkDelimitedTextReader.h"
45 
46 #include "vtkIOInfovisModule.h" // module export
47 #include "vtkNew.h" // For ReadTable field
48 
49 #include <map> // To store the TimeMap
50 #include <vector> // To store the TimeMap
51 
52 class VTKIOINFOVIS_EXPORT vtkTemporalDelimitedTextReader : public vtkDelimitedTextReader
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
67  vtkGetMacro(TimeColumnName, std::string);
68  void SetTimeColumnName(const std::string name);
70 
72 
80  vtkGetMacro(TimeColumnId, int);
81  void SetTimeColumnId(const int idx);
83 
85 
90  vtkGetMacro(RemoveTimeStepColumn, bool);
91  void SetRemoveTimeStepColumn(bool rts);
93 
101  vtkMTimeType GetMTime() override;
102 
103 protected:
105  ~vtkTemporalDelimitedTextReader() override = default;
106 
113  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
114  vtkInformationVector* outputVector) override;
115  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
116  vtkInformationVector* outputVector) override;
117 
124  bool EnforceColumnName();
125 
130  void InternalModified();
131 
132  // Time column fields
133  std::string TimeColumnName = "";
134  std::string InternalColumnName = "";
135  vtkIdType TimeColumnId = -1;
136  bool RemoveTimeStepColumn = true;
137  std::map<double, std::vector<vtkIdType>> TimeMap;
138 
139  // Input file content and update
141  vtkMTimeType LastReadTime = 0;
143 
144 private:
146  void operator=(const vtkTemporalDelimitedTextReader&) = delete;
147 };
148 
149 #endif
Store vtkAlgorithm input/output information.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
record modification and/or execution time
Definition: vtkTimeStamp.h:35
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:332
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual vtkMTimeType GetMTime()
Return this object's modified time.
std::map< double, std::vector< vtkIdType > > TimeMap
reads a delimited ascii or unicode text files and and output a temporal vtkTable. ...
Store zero or more vtkInformation instances.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkDelimitedTextReader * New()