VTK  9.2.6
vtkEvenlySpacedStreamlines2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkEvenlySpacedStreamlines2D.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=========================================================================*/
89#ifndef vtkEvenlySpacedStreamlines2D_h
90#define vtkEvenlySpacedStreamlines2D_h
91
92#include "vtkFiltersFlowPathsModule.h" // For export macro
94
95#include <array> // for std::array
96#include <vector> // for std::vector
97
100class vtkDataArray;
101class vtkDoubleArray;
102class vtkExecutive;
103class vtkGenericCell;
104class vtkIdList;
106class vtkImageData;
107class vtkIntArray;
109class vtkPoints;
110class vtkStreamTracer;
111
112class VTKFILTERSFLOWPATHS_EXPORT vtkEvenlySpacedStreamlines2D : public vtkPolyDataAlgorithm
113{
114public:
116 void PrintSelf(ostream& os, vtkIndent indent) override;
117
126
128
134 vtkSetVector3Macro(StartPosition, double);
135 vtkGetVector3Macro(StartPosition, double);
137
139
149 vtkGetObjectMacro(Integrator, vtkInitialValueProblemSolver);
150 void SetIntegratorType(int type);
155
161
167
175 int GetIntegrationStepUnit() { return this->IntegrationStepUnit; }
176
178
181 vtkSetMacro(MaximumNumberOfSteps, vtkIdType);
182 vtkGetMacro(MaximumNumberOfSteps, vtkIdType);
184
186
190 vtkSetMacro(MinimumNumberOfLoopPoints, vtkIdType);
191 vtkGetMacro(MinimumNumberOfLoopPoints, vtkIdType);
193
195
202 vtkSetMacro(InitialIntegrationStep, double);
203 vtkGetMacro(InitialIntegrationStep, double);
205
207
211 vtkSetMacro(SeparatingDistance, double);
212 vtkGetMacro(SeparatingDistance, double);
214
216
220 vtkSetMacro(SeparatingDistanceRatio, double);
221 vtkGetMacro(SeparatingDistanceRatio, double);
223
225
229 vtkSetMacro(ClosedLoopMaximumDistance, double);
230 vtkGetMacro(ClosedLoopMaximumDistance, double);
232
234
239 vtkSetMacro(LoopAngle, double);
240 vtkGetMacro(LoopAngle, double);
242
244
247 vtkSetMacro(TerminalSpeed, double);
248 vtkGetMacro(TerminalSpeed, double);
250
252
257 vtkSetMacro(ComputeVorticity, bool);
258 vtkGetMacro(ComputeVorticity, bool);
260
266
275 void SetInterpolatorType(int interpType);
276
277protected:
280
285 {
287 DISTANCE_RATIO
288 };
289 // hide the superclass' AddInput() from the user and the compiler
291 {
292 vtkErrorMacro(<< "AddInput() must be called with a vtkDataSet not a vtkDataObject.");
293 }
294
297
300 double ConvertToLength(double interval, int unit, double cellLength);
301
302 static void GetBounds(vtkCompositeDataSet* cds, double bounds[6]);
303 void InitializeSuperposedGrid(double* bounds);
304 void AddToAllPoints(vtkPolyData* streamline);
306 template <typename T>
307 void InitializePoints(T& points);
309
311 void* clientdata, vtkPoints* points, vtkDataArray* velocity, int direction);
313 void* clientdata, vtkPoints* points, vtkDataArray* velocity, int direction);
314 template <typename CellCheckerType>
315 bool ForEachCell(double* point, CellCheckerType checker, vtkPoints* points = nullptr,
316 vtkDataArray* velocity = nullptr, int direction = 1);
317 template <int distanceType>
319 double* point, vtkIdType cellId, vtkPoints* points, vtkDataArray* velocity, int direction);
321 double* point, vtkIdType cellId, vtkPoints* points, vtkDataArray* velocity, int direction);
323 int ComputeCellLength(double* cellLength);
324
325 // starting from global x-y-z position
326 double StartPosition[3];
327
329
332 // SeparatingDistance can be in cell length or arc length. This member
333 // stores SeparatingDistance in arc length. It is computed when
334 // the filter executes.
338 // ClosedLoopMaximumDistance can be in cell length or arc length.
339 // This member stores ClosedLoopMaximumDistance in arc length. It is
340 // computed when the filter executes.
342 double LoopAngle;
344
348
349 // Prototype showing the integrator type to be set by the user.
351
353
355
357 // grid superposed over InputData. The grid cell height and width is
358 // SeparatingDistance
360 // AllPoints[i][j] is the point for point j on the streamlines that
361 // falls over cell id i in SuperposedGrid. AllPoint[i].size() tell
362 // us how many points fall over cell id i.
363 std::vector<std::vector<std::array<double, 3>>> AllPoints;
364
365 // CurrentPoints[i][j] is the point id for point j on the current streamline that
366 // falls over cell id i in SuperposedGrid. CurrentPoints[i].size() tell us
367 // how many points fall over cell id i.
368 std::vector<std::vector<vtkIdType>> CurrentPoints;
369 // Min and Max point ids stored in a cell of SuperposedGrid
370 std::vector<vtkIdType> MinPointIds;
371 // The index of the first point for the current
372 // direction. Note we integrate streamlines both forward and
373 // backward.
375 // The previous integration direction.
377
378 // queue of streamlines to be processed
380
381private:
383 void operator=(const vtkEvenlySpacedStreamlines2D&) = delete;
384};
385
386#endif
An abstract class for obtaining the interpolated velocity values at a point.
abstract superclass for composite (multi-block or AMR) datasets
abstract superclass for arrays of numeric data
general representation of visualization data
dynamic, self-adjusting array of double
Evenly spaced streamline generator for 2D.
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)
~vtkEvenlySpacedStreamlines2D() override
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()
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)
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.
vtkAbstractInterpolatedVelocityField * InterpolatorPrototype
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:31
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
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
Definition vtkIntArray.h:40
represent and manipulate 3D points
Definition vtkPoints.h:34
Superclass for algorithms that produce only polydata as output.
maintain a list of polygonal data objects
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
Streamline generator.
int vtkIdType
Definition vtkType.h:332