VTK  9.6.20260516
vtkEvenlySpacedStreamlines2D.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
79
80#ifndef vtkEvenlySpacedStreamlines2D_h
81#define vtkEvenlySpacedStreamlines2D_h
82
83#include "vtkDeprecation.h" // VTK_DEPRECATED_IN_9_7_0
84#include "vtkFiltersFlowPathsModule.h" // For export macro
86
87#include <array> // for std::array
88#include <vector> // for std::vector
89
90VTK_ABI_NAMESPACE_BEGIN
93class vtkDataArray;
94class vtkDoubleArray;
95class vtkExecutive;
96class vtkGenericCell;
97class vtkIdList;
99class vtkImageData;
100class vtkIntArray;
102class vtkPoints;
103class vtkStreamTracer;
104
105class VTKFILTERSFLOWPATHS_EXPORT vtkEvenlySpacedStreamlines2D : public vtkPolyDataAlgorithm
106{
107public:
109 void PrintSelf(ostream& os, vtkIndent indent) override;
110
119
121
127 vtkSetVector3Macro(StartPosition, double);
128 vtkGetVector3Macro(StartPosition, double);
130
132
143 void SetIntegratorType(int type);
148
153 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocatorToJumpAndWalkCellLocator() instead")
155
160 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocatorToModifiedBSPTree() instead")
162
171
173
179
181
188
190
197 vtkSetMacro(InitialIntegrationStep, double);
198 vtkGetMacro(InitialIntegrationStep, double);
200
202
206 vtkSetMacro(SeparatingDistance, double);
207 vtkGetMacro(SeparatingDistance, double);
209
211
215 vtkSetMacro(SeparatingDistanceRatio, double);
216 vtkGetMacro(SeparatingDistanceRatio, double);
218
220
224 vtkSetMacro(ClosedLoopMaximumDistance, double);
225 vtkGetMacro(ClosedLoopMaximumDistance, double);
227
229
234 vtkSetMacro(LoopAngle, double);
235 vtkGetMacro(LoopAngle, double);
237
239
242 vtkSetMacro(TerminalSpeed, double);
243 vtkGetMacro(TerminalSpeed, double);
245
247
252 vtkSetMacro(ComputeVorticity, bool);
253 vtkGetMacro(ComputeVorticity, bool);
255
260 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator(vtkAbstractCellLocator*) instead")
262
271 VTK_DEPRECATED_IN_9_7_0("Use SetCellLocator(vtkAbstractCellLocator*) instead")
272 void SetInterpolatorType(int interpType);
273
275
285
286protected:
289
298 // hide the superclass' AddInput() from the user and the compiler
300 {
301 vtkErrorMacro(<< "AddInput() must be called with a vtkDataSet not a vtkDataObject.");
302 }
303
306
309 double ConvertToLength(double interval, int unit, double cellLength);
310
311 static void GetBounds(vtkCompositeDataSet* cds, double bounds[6]);
312 void InitializeSuperposedGrid(double* bounds);
313 void AddToAllPoints(vtkPolyData* streamline);
315 template <typename T>
316 void InitializePoints(T& points);
318
320 void* clientdata, vtkPoints* points, vtkDataArray* velocity, int direction);
322 void* clientdata, vtkPoints* points, vtkDataArray* velocity, int direction);
323 template <typename CellCheckerType>
324 bool ForEachCell(double* point, CellCheckerType checker, vtkPoints* points = nullptr,
325 vtkDataArray* velocity = nullptr, int direction = 1);
326 template <int distanceType>
328 double* point, vtkIdType cellId, vtkPoints* points, vtkDataArray* velocity, int direction);
330 double* point, vtkIdType cellId, vtkPoints* points, vtkDataArray* velocity, int direction);
332 int ComputeCellLength(double* cellLength);
333
334 // starting from global x-y-z position
335 double StartPosition[3];
336
338
341 // SeparatingDistance can be in cell length or arc length. This member
342 // stores SeparatingDistance in arc length. It is computed when
343 // the filter executes.
347 // ClosedLoopMaximumDistance can be in cell length or arc length.
348 // This member stores ClosedLoopMaximumDistance in arc length. It is
349 // computed when the filter executes.
351 double LoopAngle;
353
357
358 // Prototype showing the integrator type to be set by the user.
360
362
364
366 // grid superposed over InputData. The grid cell height and width is
367 // SeparatingDistance
369 // AllPoints[i][j] is the point for point j on the streamlines that
370 // falls over cell id i in SuperposedGrid. AllPoint[i].size() tell
371 // us how many points fall over cell id i.
372 std::vector<std::vector<std::array<double, 3>>> AllPoints;
373
374 // CurrentPoints[i][j] is the point id for point j on the current streamline that
375 // falls over cell id i in SuperposedGrid. CurrentPoints[i].size() tell us
376 // how many points fall over cell id i.
377 std::vector<std::vector<vtkIdType>> CurrentPoints;
378 // Min and Max point ids stored in a cell of SuperposedGrid
379 std::vector<vtkIdType> MinPointIds;
380 // The index of the first point for the current
381 // direction. Note we integrate streamlines both forward and
382 // backward.
384 // The previous integration direction.
386
387 // queue of streamlines to be processed
389
390private:
392 void operator=(const vtkEvenlySpacedStreamlines2D&) = delete;
393};
394
395VTK_ABI_NAMESPACE_END
396#endif
an abstract base class for locators which find cells
An abstract class for obtaining the interpolated velocity values at a point.
abstract superclass for composite (multi-block or AMR) datasets
general representation of visualization data
dynamic, self-adjusting array of double
double ConvertToLength(double interval, int unit, double cellLength)
void SetIntegrator(vtkInitialValueProblemSolver *)
Set/get the integrator type to be used for streamline generation.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void SetIntegrationStepUnit(int unit)
Specify a uniform integration step unit for InitialIntegrationStep, and SeparatingDistance.
std::vector< std::vector< std::array< double, 3 > > > AllPoints
int GetIntegratorType()
Set/get the integrator type to be used for streamline generation.
vtkInitialValueProblemSolver * Integrator
static vtkEvenlySpacedStreamlines2D * New()
Construct object to start from position (0,0,0), with forward integration, terminal speed 1....
void SetInterpolatorType(int interpType)
Set the type of the velocity field interpolator to determine whether INTERPOLATOR_WITH_DATASET_POINT_...
static bool IsStreamlineTooCloseToOthers(void *clientdata, vtkPoints *points, vtkDataArray *velocity, int direction)
virtual void SetCellLocator(vtkAbstractCellLocator *)
Set / get the cell locator used to perform the FindCell() operation for vtkPointSet.
void SetInterpolatorTypeToCellLocator()
Set the velocity field interpolator type to the one involving a cell locator.
DistanceType
Do we test for separating distance or a ratio of the separating distance.
void InitializePoints(T &points)
void SetIntegratorTypeToRungeKutta4()
Set/get the integrator type to be used for streamline generation.
void AddToCurrentPoints(vtkIdType pointId)
void AddToAllPoints(vtkPolyData *streamline)
int SetupOutput(vtkInformation *inInfo, vtkInformation *outInfo)
void InitializeSuperposedGrid(double *bounds)
int ComputeCellLength(double *cellLength)
void SetInterpolatorPrototype(vtkAbstractInterpolatedVelocityField *ivf)
The object used to interpolate the velocity field during integration is of the same class as this pro...
const char * GetInputArrayToProcessName()
virtual void SetCellLocatorToJumpAndWalkCellLocator()
Set / get the cell locator used to perform the FindCell() operation for vtkPointSet.
int CheckInputs(vtkAbstractInterpolatedVelocityField *&func, int *maxCellSize)
bool IsTooClose(double *point, vtkIdType cellId, vtkPoints *points, vtkDataArray *velocity, int direction)
void SetIntegratorType(int type)
Set/get the integrator type to be used for streamline generation.
void SetIntegratorTypeToRungeKutta2()
Set/get the integrator type to be used for streamline generation.
void SetInterpolatorTypeToDataSetPointLocator()
Set the velocity field interpolator type to the one involving a dataset point locator.
bool IsLooping(double *point, vtkIdType cellId, vtkPoints *points, vtkDataArray *velocity, int direction)
virtual void SetCellLocatorToModifiedBSPTree()
Set / get the cell locator used to perform the FindCell() operation for vtkPointSet.
bool ForEachCell(double *point, CellCheckerType checker, vtkPoints *points=nullptr, vtkDataArray *velocity=nullptr, int direction=1)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static void GetBounds(vtkCompositeDataSet *cds, double bounds[6])
static bool IsStreamlineLooping(void *clientdata, vtkPoints *points, vtkDataArray *velocity, int direction)
std::vector< std::vector< vtkIdType > > CurrentPoints
Superclass for all pipeline executives in VTK.
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:135
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Integrate a set of ordinary differential equations (initial value problem) in time.
dynamic, self-adjusting array of int
represent and manipulate 3D points
Definition vtkPoints.h:140
maintain a list of polygonal data objects
concrete dataset represents vertices, lines, polygons, and triangle strips
Streamline generator.
#define vtkDataArray
#define VTK_DEPRECATED_IN_9_7_0(reason)
int vtkIdType
Definition vtkType.h:363