VTK  9.2.20221001
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 VTK_ABI_NAMESPACE_BEGIN
53 class VTKIOINFOVIS_EXPORT vtkTemporalDelimitedTextReader : public vtkDelimitedTextReader
54 {
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
68  vtkGetMacro(TimeColumnName, std::string);
71 
73 
81  vtkGetMacro(TimeColumnId, int);
82  void SetTimeColumnId(const int idx);
84 
86 
91  vtkGetMacro(RemoveTimeStepColumn, bool);
92  void SetRemoveTimeStepColumn(bool rts);
94 
102  vtkMTimeType GetMTime() override;
103 
104 protected:
106  ~vtkTemporalDelimitedTextReader() override = default;
107 
115  vtkInformationVector* outputVector) override;
116  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
117  vtkInformationVector* outputVector) override;
118 
126 
132 
133  // Time column fields
134  std::string TimeColumnName = "";
135  std::string InternalColumnName = "";
136  vtkIdType TimeColumnId = -1;
137  bool RemoveTimeStepColumn = true;
138  std::map<double, std::vector<vtkIdType>> TimeMap;
139 
140  // Input file content and update
142  vtkMTimeType LastReadTime = 0;
144 
145 private:
147  void operator=(const vtkTemporalDelimitedTextReader&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #endif
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
a simple class to control print indentation
Definition: vtkIndent.h:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
reads a delimited ascii or unicode text files and and output a temporal vtkTable.
vtkMTimeType GetMTime() override
Internal fields of this reader use a specific MTime (InternalMTime).
static vtkTemporalDelimitedTextReader * New()
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
In order to fill the TIME_STEPS and TIME_RANGE keys, this method call the ReadData function that actu...
void SetRemoveTimeStepColumn(bool rts)
Set the RemoveTimeStepColumn flag If this boolean is true, the output will not contain the Time step ...
~vtkTemporalDelimitedTextReader() override=default
std::map< double, std::vector< vtkIdType > > TimeMap
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
bool EnforceColumnName()
This function checks if a user specified column has been set and check if this input is valid.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InternalModified()
When parameters specific of this reader are modified, we do not want to re-read the input file.
void SetTimeColumnId(const int idx)
Get/Set the column to use as time indicator.
void SetTimeColumnName(const std::string name)
Get/Set the name of the column to use as time indicator.
record modification and/or execution time
Definition: vtkTimeStamp.h:56
@ name
Definition: vtkX3D.h:231
@ string
Definition: vtkX3D.h:502
int vtkIdType
Definition: vtkType.h:326
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:281