VTK  9.7.1
vtkTemporalPathLineFilter.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
27 #ifndef vtkTemporalPathLineFilter_h
28 #define vtkTemporalPathLineFilter_h
29 
30 #include "vtkFiltersGeneralModule.h" // For export macro
31 #include "vtkPolyDataAlgorithm.h"
32 #include "vtkTemporalAlgorithm.h" // For temporal algorithm
33 
34 #ifndef __VTK_WRAP__
35 #define vtkPolyDataAlgorithm vtkTemporalAlgorithm<vtkPolyDataAlgorithm>
36 #endif
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkPoints;
40 class vtkCellArray;
41 class vtkMergePoints;
42 class vtkFloatArray;
43 
44 VTK_ABI_NAMESPACE_END
45 #include "vtkSmartPointer.h" // for memory safety
46 #include <set> // Because we want to use it
47 VTK_ABI_NAMESPACE_BEGIN
48 class ParticleTrail;
49 class vtkTemporalPathLineFilterInternals;
51 
52 // Excluded from JavaScript wrapping because it defines vtkPolyDataAlgorithm as
53 // vtkTemporalAlgorithm<vtkPolyDataAlgorithm> which confuses other filters in VTK::FiltersCore
55  : public vtkPolyDataAlgorithm
56 {
57 public:
59 
63 #ifndef __VTK_WRAP__
64 #undef vtkPassInputTypeAlgorithm
65 #endif
67  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
70 #if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML)
72 #endif
73 
75 
79  vtkSetMacro(MaskPoints, int);
80  vtkGetMacro(MaskPoints, int);
82 
84 
92  vtkSetMacro(MaxTrackLength, unsigned int);
93  vtkGetMacro(MaxTrackLength, unsigned int);
95 
97 
105  vtkSetStringMacro(IdChannelArray);
106  vtkGetStringMacro(IdChannelArray);
108 
110 
118  vtkSetVector3Macro(MaxStepDistance, double);
119  vtkGetVector3Macro(MaxStepDistance, double);
121 
123 
129  vtkSetMacro(KeepDeadTrails, bool);
130  vtkGetMacro(KeepDeadTrails, bool);
132 
137  void Flush();
138 
144  void SetSelectionConnection(vtkAlgorithmOutput* algOutput);
145 
151  void SetSelectionData(vtkDataSet* input);
152 
153 protected:
155  ~vtkTemporalPathLineFilter() override;
156 
157  //
158  // Make sure the pipeline knows what type we expect as input
159  //
160  int FillInputPortInformation(int port, vtkInformation* info) override;
162 
163  int Initialize(vtkInformation* request, vtkInformationVector** inputVector,
164  vtkInformationVector* outputVector) override;
165  int Execute(vtkInformation* request, vtkInformationVector** inputVector,
166  vtkInformationVector* outputVector) override;
167  int Finalize(vtkInformation* request, vtkInformationVector** inputVector,
168  vtkInformationVector* outputVector) override;
169  void IncrementTrail(TrailPointer trail, vtkDataSet* input, vtkIdType i);
170 
171  TrailPointer GetTrail(vtkIdType i);
172 
173  // void Initialize(vtkDataSet* input, vtkDataSet* selection,
174  // vtkPolyData* pathLines, vtkPolyData* particles);
175 
176  // internal data variables
177  int NumberOfTimeSteps = 0;
178  int MaskPoints = 200;
179  unsigned int MaxTrackLength = 10;
180  unsigned int LastTrackLength = 10;
181  char* IdChannelArray = nullptr;
182  double MaxStepDistance[3] = { 1, 1, 1 };
183  double LatestTime;
184  bool KeepDeadTrails = false;
185  bool BackwardTime = false;
186  //
187 
194 
195  void AccumulateTrails(vtkDataSet* input, vtkDataSet* selection);
196  void ClearTrailMarks();
197  void ProcessTrails(vtkDataSet* input, vtkDataSet* selection);
198  void RemoveDeadTrails();
199  void PostExecute(vtkDataSet* input, vtkPolyData* pathLines, vtkPolyData* particles);
200  void InitializeExecute(vtkDataSet* input, vtkPolyData* pathLines);
201 
202  //
203 private:
205  void operator=(const vtkTemporalPathLineFilter&) = delete;
206 };
207 
208 VTK_ABI_NAMESPACE_END
209 #endif
vtkSmartPointer< vtkFloatArray > TrailId
vtkSmartPointer< vtkCellArray > Vertices
vtkSmartPointer< vtkPoints > VertexCoordinates
Generate a Polydata Pointset from any Dataset.
#define vtkCreateWrappedTemporalAlgorithmInterface()
vtkSmartPointer< ParticleTrail > TrailPointer
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
Proxy object to connect input/output ports.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
merge exactly coincident points
vtkSmartPointer< vtkPoints > LineCoordinates
vtkSmartPointer< vtkTemporalPathLineFilterInternals > Internals
object to represent cell connectivity
Definition: vtkCellArray.h:177
#define VTK_WRAPEXCLUDE_JAVASCRIPT
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
vtkSmartPointer< vtkCellArray > PolyLines
represent and manipulate 3D points
Definition: vtkPoints.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.