forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkParticlePathFilter.h
92 lines (75 loc) · 2.86 KB
/
vtkParticlePathFilter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*=========================================================================
Program: Visualization Toolkit
Module: vtkParticlePathFilter.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkParticlePathFilter
* @brief A Parallel Particle tracer for unsteady vector fields
*
* vtkParticlePathFilter is a filter that integrates a vector field to generate particle paths
*
*
* @sa
* vtkParticlePathFilterBase has the details of the algorithms
*/
#ifndef vtkParticlePathFilter_h
#define vtkParticlePathFilter_h
#include "vtkFiltersFlowPathsModule.h" // For export macro
#include "vtkParticleTracerBase.h"
#include "vtkSmartPointer.h" // For protected ivars.
#include <vector> // For protected ivars
class VTKFILTERSFLOWPATHS_EXPORT ParticlePathFilterInternal
{
public:
ParticlePathFilterInternal()
: Filter(nullptr)
{
}
void Initialize(vtkParticleTracerBase* filter);
virtual ~ParticlePathFilterInternal() = default;
virtual int OutputParticles(vtkPolyData* particles);
void SetClearCache(bool clearCache) { this->ClearCache = clearCache; }
bool GetClearCache() { return this->ClearCache; }
void Finalize();
void Reset();
private:
vtkParticleTracerBase* Filter;
// Paths doesn't seem to work properly. it is meant to make connecting lines
// for the particles
std::vector<vtkSmartPointer<vtkIdList>> Paths;
bool ClearCache; // false by default
};
class VTKFILTERSFLOWPATHS_EXPORT vtkParticlePathFilter : public vtkParticleTracerBase
{
public:
vtkTypeMacro(vtkParticlePathFilter, vtkParticleTracerBase);
void PrintSelf(ostream& os, vtkIndent indent) override;
static vtkParticlePathFilter* New();
protected:
vtkParticlePathFilter();
~vtkParticlePathFilter() override;
vtkParticlePathFilter(const vtkParticlePathFilter&) = delete;
void operator=(const vtkParticlePathFilter&) = delete;
void ResetCache() override;
int OutputParticles(vtkPolyData* particles) override;
void InitializeExtraPointDataArrays(vtkPointData* outputPD) override;
void AppendToExtraPointDataArrays(vtkParticleTracerBaseNamespace::ParticleInformation&) override;
void Finalize() override;
//
// Store any information we need in the output and fetch what we can
// from the input
//
int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) override;
ParticlePathFilterInternal It;
private:
vtkDoubleArray* SimulationTime;
vtkIntArray* SimulationTimeStep;
};
#endif