VTK
9.2.6
Filters
Extraction
vtkExtractTimeSteps.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkExtractTimeSteps.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
=========================================================================*/
34
35
#ifndef vtkExtractTimeSteps_h
36
#define vtkExtractTimeSteps_h
37
38
#include "vtkFiltersExtractionModule.h"
// for export macro
39
#include "
vtkPassInputTypeAlgorithm.h
"
40
41
#include <set>
// for time step indices
42
43
class
VTKFILTERSEXTRACTION_EXPORT
vtkExtractTimeSteps
:
public
vtkPassInputTypeAlgorithm
44
{
45
public
:
46
vtkTypeMacro(
vtkExtractTimeSteps
,
vtkPassInputTypeAlgorithm
);
47
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
48
49
static
vtkExtractTimeSteps
*
New
();
50
54
int
GetNumberOfTimeSteps
()
const
{
return
static_cast<
int
>
(this->
TimeStepIndices
.size()); }
55
59
void
AddTimeStepIndex
(
int
timeStepIndex);
60
62
66
void
SetTimeStepIndices
(
int
count,
const
int
* timeStepIndices);
67
void
GetTimeStepIndices
(
int
* timeStepIndices)
const
;
69
73
void
GenerateTimeStepIndices
(
int
begin,
int
end,
int
step);
74
76
79
void
ClearTimeStepIndices
()
80
{
81
this->
TimeStepIndices
.clear();
82
this->
Modified
();
83
}
84
85
87
91
vtkGetMacro(
UseRange
,
bool
);
92
vtkSetMacro(
UseRange
,
bool
);
93
vtkBooleanMacro(
UseRange
,
bool
);
95
97
100
vtkGetVector2Macro(
Range
,
int
);
101
vtkSetVector2Macro(
Range
,
int
);
103
105
109
vtkGetMacro(
TimeStepInterval
,
int
);
110
vtkSetClampMacro(
TimeStepInterval
,
int
, 1,
VTK_INT_MAX
);
112
113
// What timestep to provide when the requested time is between the timesteps
114
// the filter is set to extract
115
enum
116
{
117
PREVIOUS_TIMESTEP
,
// floor the time to the previous timestep
118
NEXT_TIMESTEP
,
// ceiling the time to the next timestep
119
NEAREST_TIMESTEP
// take the timestep whose absolute difference from the requested time is
120
// smallest
121
} EstimationMode;
123
128
vtkGetMacro(
TimeEstimationMode
,
int
);
129
vtkSetMacro(
TimeEstimationMode
,
int
);
130
void
SetTimeEstimationModeToPrevious
() { this->
SetTimeEstimationMode
(
PREVIOUS_TIMESTEP
); }
131
void
SetTimeEstimationModeToNext
() { this->
SetTimeEstimationMode
(
NEXT_TIMESTEP
); }
132
void
SetTimeEstimationModeToNearest
() { this->
SetTimeEstimationMode
(
NEAREST_TIMESTEP
); }
134
135
protected
:
136
vtkExtractTimeSteps
();
137
~vtkExtractTimeSteps
()
override
=
default
;
138
139
int
RequestData
(
vtkInformation
*,
vtkInformationVector
**,
vtkInformationVector
*)
override
;
140
int
RequestInformation
(
vtkInformation
*,
vtkInformationVector
**,
vtkInformationVector
*)
override
;
141
int
RequestUpdateExtent
(
vtkInformation
*,
vtkInformationVector
**,
vtkInformationVector
*)
override
;
142
143
std::set<int>
TimeStepIndices
;
144
bool
UseRange
;
145
int
Range
[2];
146
int
TimeStepInterval
;
147
int
TimeEstimationMode
;
148
149
private
:
150
vtkExtractTimeSteps
(
const
vtkExtractTimeSteps
&) =
delete
;
151
void
operator=(
const
vtkExtractTimeSteps
&) =
delete
;
152
};
153
154
#endif
// vtkExtractTimeSteps_h
vtkExtractTimeSteps::Range
int Range[2]
Definition
vtkExtractTimeSteps.h:145
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:131
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:146
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:79
vtkExtractTimeSteps::TimeEstimationMode
int TimeEstimationMode
Definition
vtkExtractTimeSteps.h:147
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:54
vtkExtractTimeSteps::TimeStepIndices
std::set< int > TimeStepIndices
Definition
vtkExtractTimeSteps.h:143
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:144
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:130
vtkExtractTimeSteps::NEAREST_TIMESTEP
@ NEAREST_TIMESTEP
Definition
vtkExtractTimeSteps.h:119
vtkExtractTimeSteps::NEXT_TIMESTEP
@ NEXT_TIMESTEP
Definition
vtkExtractTimeSteps.h:118
vtkExtractTimeSteps::PREVIOUS_TIMESTEP
@ PREVIOUS_TIMESTEP
Definition
vtkExtractTimeSteps.h:117
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:132
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:34
vtkInformationVector
Store zero or more vtkInformation instances.
Definition
vtkInformationVector.h:36
vtkInformation
Store vtkAlgorithm input/output information.
Definition
vtkInformation.h:68
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:155
Generated on Sun Mar 2 2025 00:00:00 for VTK by
1.13.2