VTK
9.5.20251120
Filters
Extraction
vtkExtractTimeSteps.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
25
26
#ifndef vtkExtractTimeSteps_h
27
#define vtkExtractTimeSteps_h
28
29
#include "vtkFiltersExtractionModule.h"
// for export macro
30
#include "
vtkPassInputTypeAlgorithm.h
"
31
32
#include <set>
// for time step indices
33
34
VTK_ABI_NAMESPACE_BEGIN
35
class
VTKFILTERSEXTRACTION_EXPORT
vtkExtractTimeSteps
:
public
vtkPassInputTypeAlgorithm
36
{
37
public
:
38
vtkTypeMacro(
vtkExtractTimeSteps
,
vtkPassInputTypeAlgorithm
);
39
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
40
41
static
vtkExtractTimeSteps
*
New
();
42
46
int
GetNumberOfTimeSteps
()
const
{
return
static_cast<
int
>
(this->
TimeStepIndices
.size()); }
47
51
void
AddTimeStepIndex
(
int
timeStepIndex);
52
54
58
void
SetTimeStepIndices
(
int
count,
const
int
* timeStepIndices);
59
void
GetTimeStepIndices
(
int
* timeStepIndices)
const
;
61
65
void
GenerateTimeStepIndices
(
int
begin,
int
end,
int
step);
66
68
71
void
ClearTimeStepIndices
()
72
{
73
this->
TimeStepIndices
.clear();
74
this->
Modified
();
75
}
76
77
79
83
vtkGetMacro(
UseRange
,
bool
);
84
vtkSetMacro(
UseRange
,
bool
);
85
vtkBooleanMacro(
UseRange
,
bool
);
87
89
92
vtkGetVector2Macro(
Range
,
int
);
93
vtkSetVector2Macro(
Range
,
int
);
95
97
101
vtkGetMacro(
TimeStepInterval
,
int
);
102
vtkSetClampMacro(
TimeStepInterval
,
int
, 1,
VTK_INT_MAX
);
104
105
// What timestep to provide when the requested time is between the timesteps
106
// the filter is set to extract
107
enum
108
{
109
PREVIOUS_TIMESTEP
,
// floor the time to the previous timestep
110
NEXT_TIMESTEP
,
// ceiling the time to the next timestep
111
NEAREST_TIMESTEP
// take the timestep whose absolute difference from the requested time is
112
// smallest
113
} EstimationMode;
115
120
vtkGetMacro(
TimeEstimationMode
,
int
);
121
vtkSetMacro(
TimeEstimationMode
,
int
);
122
void
SetTimeEstimationModeToPrevious
() { this->
SetTimeEstimationMode
(
PREVIOUS_TIMESTEP
); }
123
void
SetTimeEstimationModeToNext
() { this->
SetTimeEstimationMode
(
NEXT_TIMESTEP
); }
124
void
SetTimeEstimationModeToNearest
() { this->
SetTimeEstimationMode
(
NEAREST_TIMESTEP
); }
126
127
protected
:
128
vtkExtractTimeSteps
();
129
~vtkExtractTimeSteps
()
override
=
default
;
130
131
int
RequestData
(
vtkInformation
*,
vtkInformationVector
**,
vtkInformationVector
*)
override
;
132
int
RequestInformation
(
vtkInformation
*,
vtkInformationVector
**,
vtkInformationVector
*)
override
;
133
int
RequestUpdateExtent
(
vtkInformation
*,
vtkInformationVector
**,
vtkInformationVector
*)
override
;
134
135
std::set<int>
TimeStepIndices
;
136
bool
UseRange
;
137
int
Range
[2];
138
int
TimeStepInterval
;
139
int
TimeEstimationMode
;
140
141
private
:
142
vtkExtractTimeSteps
(
const
vtkExtractTimeSteps
&) =
delete
;
143
void
operator=(
const
vtkExtractTimeSteps
&) =
delete
;
144
};
145
146
VTK_ABI_NAMESPACE_END
147
#endif
// vtkExtractTimeSteps_h
vtkExtractTimeSteps::Range
int Range[2]
Definition
vtkExtractTimeSteps.h:137
vtkExtractTimeSteps::SetTimeEstimationModeToNext
void SetTimeEstimationModeToNext()
Get/Set what to do when the requested time is not one of the timesteps this filter is set to extract.
Definition
vtkExtractTimeSteps.h:123
vtkExtractTimeSteps::GenerateTimeStepIndices
void GenerateTimeStepIndices(int begin, int end, int step)
Generate a range of indices in [begin, end) with a step size of 'step'.
vtkExtractTimeSteps::New
static vtkExtractTimeSteps * New()
vtkExtractTimeSteps::TimeStepInterval
int TimeStepInterval
Definition
vtkExtractTimeSteps.h:138
vtkExtractTimeSteps::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkExtractTimeSteps::~vtkExtractTimeSteps
~vtkExtractTimeSteps() override=default
vtkExtractTimeSteps::ClearTimeStepIndices
void ClearTimeStepIndices()
Clear the time step indices.
Definition
vtkExtractTimeSteps.h:71
vtkExtractTimeSteps::TimeEstimationMode
int TimeEstimationMode
Definition
vtkExtractTimeSteps.h:139
vtkExtractTimeSteps::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
vtkExtractTimeSteps::GetNumberOfTimeSteps
int GetNumberOfTimeSteps() const
Get the number of time steps that will be extracted.
Definition
vtkExtractTimeSteps.h:46
vtkExtractTimeSteps::TimeStepIndices
std::set< int > TimeStepIndices
Definition
vtkExtractTimeSteps.h:135
vtkExtractTimeSteps::AddTimeStepIndex
void AddTimeStepIndex(int timeStepIndex)
Add a time step index.
vtkExtractTimeSteps::SetTimeEstimationMode
virtual void SetTimeEstimationMode(int)
Get/Set what to do when the requested time is not one of the timesteps this filter is set to extract.
vtkExtractTimeSteps::UseRange
bool UseRange
Definition
vtkExtractTimeSteps.h:136
vtkExtractTimeSteps::SetTimeEstimationModeToPrevious
void SetTimeEstimationModeToPrevious()
Get/Set what to do when the requested time is not one of the timesteps this filter is set to extract.
Definition
vtkExtractTimeSteps.h:122
vtkExtractTimeSteps::NEAREST_TIMESTEP
@ NEAREST_TIMESTEP
Definition
vtkExtractTimeSteps.h:111
vtkExtractTimeSteps::NEXT_TIMESTEP
@ NEXT_TIMESTEP
Definition
vtkExtractTimeSteps.h:110
vtkExtractTimeSteps::PREVIOUS_TIMESTEP
@ PREVIOUS_TIMESTEP
Definition
vtkExtractTimeSteps.h:109
vtkExtractTimeSteps::SetTimeEstimationModeToNearest
void SetTimeEstimationModeToNearest()
Get/Set what to do when the requested time is not one of the timesteps this filter is set to extract.
Definition
vtkExtractTimeSteps.h:124
vtkExtractTimeSteps::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
vtkExtractTimeSteps::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkExtractTimeSteps::SetTimeStepIndices
void SetTimeStepIndices(int count, const int *timeStepIndices)
Get/Set an array of time step indices.
vtkExtractTimeSteps::vtkExtractTimeSteps
vtkExtractTimeSteps()
vtkExtractTimeSteps::GetTimeStepIndices
void GetTimeStepIndices(int *timeStepIndices) const
Get/Set an array of time step indices.
vtkIndent
a simple class to control print indentation
Definition
vtkIndent.h:108
vtkInformationVector
Store zero or more vtkInformation instances.
Definition
vtkInformationVector.h:142
vtkInformation
Store vtkAlgorithm input/output information.
Definition
vtkInformation.h:173
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkPassInputTypeAlgorithm::vtkPassInputTypeAlgorithm
vtkPassInputTypeAlgorithm()
vtkPassInputTypeAlgorithm.h
VTK_INT_MAX
#define VTK_INT_MAX
Definition
vtkType.h:196
Generated on Thu Nov 20 2025 07:56:37 for VTK by
1.13.2