VTK: IO/Infovis/vtkTemporalDelimitedTextReader.h Source File

| VTK 9.3.1

vtkTemporalDelimitedTextReader.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
29 #ifndef vtkTemporalDelimitedTextReader_h
30 #define vtkTemporalDelimitedTextReader_h
31
32 #include "vtkDelimitedTextReader.h"
33
34 #include "vtkIOInfovisModule.h" // module export
35 #include "vtkNew.h" // For ReadTable field
36
37 #include <map> // To store the TimeMap
38 #include <vector> // To store the TimeMap
39
40 VTK_ABI_NAMESPACE_BEGIN
41 class VTKIOINFOVIS_EXPORT vtkTemporalDelimitedTextReader : public vtkDelimitedTextReader
42 {
43 public:
44 static vtkTemporalDelimitedTextReader* New();
45 vtkTypeMacro(vtkTemporalDelimitedTextReader, vtkDelimitedTextReader);
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
56 vtkGetMacro(TimeColumnName, std::string);
57 void SetTimeColumnName(std::string name);
59
61
69 vtkGetMacro(TimeColumnId, int);
70 void SetTimeColumnId(int idx);
72
74
79 vtkGetMacro(RemoveTimeStepColumn, bool);
80 void SetRemoveTimeStepColumn(bool rts);
82
90 vtkMTimeType GetMTime() override;
91
92 protected:
93 vtkTemporalDelimitedTextReader();
94 ~vtkTemporalDelimitedTextReader() override = default;
95
102 int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
103 vtkInformationVector* outputVector) override;
104 int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
105 vtkInformationVector* outputVector) override;
106
113 bool EnforceColumnName();
114
119 void InternalModified();
120
121 // Time column fields
122 std::string TimeColumnName;
123 std::string InternalColumnName;
124 vtkIdType TimeColumnId = -1;
125 bool RemoveTimeStepColumn = true;
126 std::map<double, std::vector<vtkIdType>> TimeMap;
127
128 // Input file content and update
129 vtkNew<vtkTable> ReadTable;
130 vtkMTimeType LastReadTime = 0;
131 vtkTimeStamp InternalMTime;
132
133 private:
134 vtkTemporalDelimitedTextReader(const vtkTemporalDelimitedTextReader&) = delete;
135 void operator=(const vtkTemporalDelimitedTextReader&) = delete;
136 };
137
138 VTK_ABI_NAMESPACE_END
139 #endif
vtkDelimitedTextReader
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
Definition: vtkDelimitedTextReader.h:68
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
vtkNew< vtkTable >
vtkTemporalDelimitedTextReader
reads a delimited ascii or unicode text files and and output a temporal vtkTable.
Definition: vtkTemporalDelimitedTextReader.h:42
vtkTemporalDelimitedTextReader::ReadTable
vtkNew< vtkTable > ReadTable
Definition: vtkTemporalDelimitedTextReader.h:129
vtkTemporalDelimitedTextReader::GetMTime
vtkMTimeType GetMTime() override
Internal fields of this reader use a specific MTime (InternalMTime).
vtkTemporalDelimitedTextReader::New
static vtkTemporalDelimitedTextReader * New()
vtkTemporalDelimitedTextReader::RequestInformation
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...
vtkTemporalDelimitedTextReader::SetRemoveTimeStepColumn
void SetRemoveTimeStepColumn(bool rts)
Set the RemoveTimeStepColumn flag If this boolean is true, the output will not contain the Time step ...
vtkTemporalDelimitedTextReader::~vtkTemporalDelimitedTextReader
~vtkTemporalDelimitedTextReader() override=default
vtkTemporalDelimitedTextReader::InternalMTime
vtkTimeStamp InternalMTime
Definition: vtkTemporalDelimitedTextReader.h:131
vtkTemporalDelimitedTextReader::InternalColumnName
std::string InternalColumnName
Definition: vtkTemporalDelimitedTextReader.h:123
vtkTemporalDelimitedTextReader::TimeMap
std::map< double, std::vector< vtkIdType > > TimeMap
Definition: vtkTemporalDelimitedTextReader.h:126
vtkTemporalDelimitedTextReader::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkTemporalDelimitedTextReader::EnforceColumnName
bool EnforceColumnName()
This function checks if a user specified column has been set and check if this input is valid.
vtkTemporalDelimitedTextReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTemporalDelimitedTextReader::InternalModified
void InternalModified()
When parameters specific of this reader are modified, we do not want to re-read the input file.
vtkTemporalDelimitedTextReader::TimeColumnName
std::string TimeColumnName
Definition: vtkTemporalDelimitedTextReader.h:122
vtkTemporalDelimitedTextReader::SetTimeColumnName
void SetTimeColumnName(std::string name)
Get/Set the name of the column to use as time indicator.
vtkTemporalDelimitedTextReader::SetTimeColumnId
void SetTimeColumnId(int idx)
Get/Set the column to use as time indicator.
vtkTemporalDelimitedTextReader::vtkTemporalDelimitedTextReader
vtkTemporalDelimitedTextReader()
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkDelimitedTextReader.h
vtkNew.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270