VTK  9.0.1
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 =========================================================================*/
38 #ifndef vtkTemporalDelimitedTextReader_h
39 #define vtkTemporalDelimitedTextReader_h
40 
41 #include "vtkDelimitedTextReader.h"
42 
43 #include "vtkIOInfovisModule.h" // module export
44 #include "vtkNew.h" // For ReadTable field
45 
46 #include <map> // To store the TimeMap
47 #include <vector> // To store the TimeMap
48 
49 class VTKIOINFOVIS_EXPORT vtkTemporalDelimitedTextReader : public vtkDelimitedTextReader
50 {
51 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
64  vtkGetMacro(TimeColumnName, std::string);
67 
69 
77  vtkGetMacro(TimeColumnId, int);
78  void SetTimeColumnId(const int idx);
80 
82 
87  vtkGetMacro(RemoveTimeStepColumn, bool);
88  void SetRemoveTimeStepColumn(bool rts);
90 
98  vtkMTimeType GetMTime() override;
99 
100 protected:
102  ~vtkTemporalDelimitedTextReader() override = default;
103 
111  vtkInformationVector* outputVector) override;
112  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
113  vtkInformationVector* outputVector) override;
114 
122 
128 
129  // Time column fields
130  std::string TimeColumnName = "";
131  std::string InternalColumnName = "";
132  vtkIdType TimeColumnId = -1;
133  bool RemoveTimeStepColumn = true;
134  std::map<double, std::vector<vtkIdType> > TimeMap;
135 
136  // Input file content and update
138  vtkMTimeType LastReadTime = 0;
140 
141 private:
143  void operator=(const vtkTemporalDelimitedTextReader&) = delete;
144 };
145 
146 #endif
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::TimeMap
std::map< double, std::vector< vtkIdType > > TimeMap
Definition: vtkTemporalDelimitedTextReader.h:134
vtkTemporalDelimitedTextReader::SetTimeColumnName
void SetTimeColumnName(const std::string name)
vtkTemporalDelimitedTextReader::ReadTable
vtkNew< vtkTable > ReadTable
Definition: vtkTemporalDelimitedTextReader.h:137
vtkTemporalDelimitedTextReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkTemporalDelimitedTextReader::vtkTemporalDelimitedTextReader
vtkTemporalDelimitedTextReader()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkTemporalDelimitedTextReader::SetTimeColumnId
void SetTimeColumnId(const int idx)
vtkTemporalDelimitedTextReader::EnforceColumnName
bool EnforceColumnName()
This function checks if a user specified column has been set and check if this input is valid.
vtkTemporalDelimitedTextReader::GetMTime
vtkMTimeType GetMTime() override
Internal fields of this reader use a specific MTime (InternalMTime).
vtkTemporalDelimitedTextReader::New
static vtkTemporalDelimitedTextReader * New()
vtkTemporalDelimitedTextReader::InternalMTime
vtkTimeStamp InternalMTime
Definition: vtkTemporalDelimitedTextReader.h:139
vtkTemporalDelimitedTextReader::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkNew< vtkTable >
vtkDelimitedTextReader
reads in delimited ascii or unicode text files and outputs a vtkTable data structure.
Definition: vtkDelimitedTextReader.h:72
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkNew.h
vtkDelimitedTextReader.h
vtkTemporalDelimitedTextReader::InternalModified
void InternalModified()
When parameters specific of this reader are modified, we do not want to re-read the input file.
vtkTemporalDelimitedTextReader::SetRemoveTimeStepColumn
void SetRemoveTimeStepColumn(bool rts)
vtkTemporalDelimitedTextReader
reads a delimited ascii or unicode text files and and output a temporal vtkTable.
Definition: vtkTemporalDelimitedTextReader.h:50
vtkTemporalDelimitedTextReader::~vtkTemporalDelimitedTextReader
~vtkTemporalDelimitedTextReader() override=default
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293