VTK  9.1.0
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=========================================================================*/
90#ifndef vtkEvenlySpacedStreamlines2D_h
91#define vtkEvenlySpacedStreamlines2D_h
92
93#include "vtkFiltersFlowPathsModule.h" // For export macro
95
96#include <array> // for std::array
97#include <vector> // for std::vector
98
101class vtkDataArray;
102class vtkDoubleArray;
103class vtkExecutive;
104class vtkGenericCell;
105class vtkIdList;
107class vtkImageData;
108class vtkIntArray;
110class vtkPoints;
111class vtkStreamTracer;
112
113class VTKFILTERSFLOWPATHS_EXPORT vtkEvenlySpacedStreamlines2D : public vtkPolyDataAlgorithm
114{
115public:
117 void PrintSelf(ostream& os, vtkIndent indent) override;
118
127
129
135 vtkSetVector3Macro(StartPosition, double);
136 vtkGetVector3Macro(StartPosition, double);
138
140
150 vtkGetObjectMacro(Integrator, vtkInitialValueProblemSolver);
156
162
168
176 int GetIntegrationStepUnit() { return this->IntegrationStepUnit; }
177
179
182 vtkSetMacro(MaximumNumberOfSteps, vtkIdType);
183 vtkGetMacro(MaximumNumberOfSteps, vtkIdType);
185
187
191 vtkSetMacro(MinimumNumberOfLoopPoints, vtkIdType);
192 vtkGetMacro(MinimumNumberOfLoopPoints, vtkIdType);
194
196
203 vtkSetMacro(InitialIntegrationStep, double);
204 vtkGetMacro(InitialIntegrationStep, double);
206
208
212 vtkSetMacro(SeparatingDistance, double);
213 vtkGetMacro(SeparatingDistance, double);
215
217
221 vtkSetMacro(SeparatingDistanceRatio, double);
222 vtkGetMacro(SeparatingDistanceRatio, double);
224
226
230 vtkSetMacro(ClosedLoopMaximumDistance, double);
231 vtkGetMacro(ClosedLoopMaximumDistance, double);
233
235
240 vtkSetMacro(LoopAngle, double);
241 vtkGetMacro(LoopAngle, double);
243
245
248 vtkSetMacro(TerminalSpeed, double);
249 vtkGetMacro(TerminalSpeed, double);
251
253
258 vtkSetMacro(ComputeVorticity, bool);
259 vtkGetMacro(ComputeVorticity, bool);
261
267
277 void SetInterpolatorType(int interpType);
278
279protected:
282
287 {
289 DISTANCE_RATIO
290 };
291 // hide the superclass' AddInput() from the user and the compiler
293 {
294 vtkErrorMacro(<< "AddInput() must be called with a vtkDataSet not a vtkDataObject.");
295 }
296
299
302 double ConvertToLength(double interval, int unit, double cellLength);
303
304 static void GetBounds(vtkCompositeDataSet* cds, double bounds[6]);
305 void InitializeSuperposedGrid(double* bounds);
306 void AddToAllPoints(vtkPolyData* streamline);
308 template <typename T>
311
313 void* clientdata, vtkPoints* points, vtkDataArray* velocity, int direction);
315 void* clientdata, vtkPoints* points, vtkDataArray* velocity, int direction);
316 template <typename CellCheckerType>
317 bool ForEachCell(double* point, CellCheckerType checker, vtkPoints* points = nullptr,
318 vtkDataArray* velocity = nullptr, int direction = 1);
319 template <int distanceType>
321 double* point, vtkIdType cellId, vtkPoints* points, vtkDataArray* velocity, int direction);
323 double* point, vtkIdType cellId, vtkPoints* points, vtkDataArray* velocity, int direction);
325 int ComputeCellLength(double* cellLength);
326
327 // starting from global x-y-z position
328 double StartPosition[3];
329
331
334 // SeparatingDistance can be in cell length or arc length. This member
335 // stores SeparatingDistance in arc length. It is computed when
336 // the filter executes.
340 // ClosedLoopMaximumDistance can be in cell length or arc length.
341 // This member stores ClosedLoopMaximumDistance in arc length. It is
342 // computed when the filter executes.
344 double LoopAngle;
346
350
351 // Prototype showing the integrator type to be set by the user.
353
355
357
359 // grid superposed over InputData. The grid cell height and width is
360 // SeparatingDistance
362 // AllPoints[i][j] is the point for point j on the streamlines that
363 // falls over cell id i in SuperposedGrid. AllPoint[i].size() tell
364 // us how many points fall over cell id i.
365 std::vector<std::vector<std::array<double, 3>>> AllPoints;
366
367 // CurrentPoints[i][j] is the point id for point j on the current streamline that
368 // falls over cell id i in SuperposedGrid. CurrentPoints[i].size() tell us
369 // how many points fall over cell id i.
370 std::vector<std::vector<vtkIdType>> CurrentPoints;
371 // Min and Max point ids stored in a cell of SuperposedGrid
372 std::vector<vtkIdType> MinPointIds;
373 // The index of the first point for the current
374 // direction. Note we integrate streamlines both forward and
375 // backward.
377 // The previous integration direction.
379
380 // queue of streamlines to be processed
382
383private:
385 void operator=(const vtkEvenlySpacedStreamlines2D&) = delete;
386};
387
388#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
Definition: vtkDataArray.h:159
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 vtkInterpolatedVelocityField (IN...
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.
Definition: vtkExecutive.h:76
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:140
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
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:149
represent and manipulate 3D points
Definition: vtkPoints.h:143
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:195
Streamline generator.
@ point
Definition: vtkX3D.h:242
@ points
Definition: vtkX3D.h:452
@ direction
Definition: vtkX3D.h:266
@ type
Definition: vtkX3D.h:522
int vtkIdType
Definition: vtkType.h:332