VTK
vtkMultiTimeStepAlgorithm.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMultiTimeStepAlgorithm.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 =========================================================================*/
27 #ifndef vtkMultiTimeStepAlgorithm_h
28 #define vtkMultiTimeStepAlgorithm_h
29 
30 #include "vtkCommonExecutionModelModule.h" // For export macro
31 #include "vtkAlgorithm.h"
32 #include "vtkSmartPointer.h" //needed for a private variable
33 
34 #include <vector> //needed for a private variable
35 #include "vtkDataObject.h" // needed for the smart pointer
36 
39 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkMultiTimeStepAlgorithm : public vtkAlgorithm
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46 
47 protected:
49 
51  {
52  };
53 
57  static vtkInformationDoubleVectorKey* UPDATE_TIME_STEPS();
58 
59 
61 
66  {
67  return 1;
68  };
70 
72 
77  {
78  return 1;
79  };
81 
87  {
88  return 1;
89  }
90 
96  {
97  return 1;
98  }
99 
101 
102  bool CacheData;
103  unsigned int NumberOfCacheEntries;
104 
105 private:
107  void operator=(const vtkMultiTimeStepAlgorithm&) = delete;
108 
109 
110  vtkSmartPointer<vtkMultiBlockDataSet> MDataSet; //stores all the temporal data sets
111  int RequestUpdateIndex; //keep track of the time looping index
112  std::vector<double> UpdateTimeSteps; //store the requested time steps
113 
114  bool IsInCache(double time, size_t& idx);
115 
116  struct TimeCache
117  {
118  TimeCache(double time, vtkDataObject* data) : TimeValue(time), Data(data)
119  {
120  }
121  double TimeValue;
123  };
124 
125  std::vector<TimeCache> Cache;
126 };
127 
128 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
Key for double vector values.
a simple class to control print indentation
Definition: vtkIndent.h:39
Superclass for algorithms that would like to make multiple time requests.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Composite dataset that organizes datasets into blocks.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
general representation of visualization data
Definition: vtkDataObject.h:64