VTK  9.1.0
vtkVectorFieldTopology.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVectorFieldTopology.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=========================================================================*/
27#ifndef vtkVectorFieldTopology_h
28#define vtkVectorFieldTopology_h
29
30#include "vtkFiltersFlowPathsModule.h" // For export macro
32#include "vtkStreamTracer.h" // for vtkStreamSurface::CELL_LENGTH_UNIT
33
35class vtkImageData;
36class vtkPolyData;
39
40class VTKFILTERSFLOWPATHS_EXPORT vtkVectorFieldTopology : public vtkPolyDataAlgorithm
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
48
54 vtkSetMacro(IntegrationStepUnit, int);
55 vtkGetMacro(IntegrationStepUnit, int);
57
59
62 vtkSetMacro(MaxNumSteps, int);
63 vtkGetMacro(MaxNumSteps, int);
65
67
71 vtkSetMacro(IntegrationStepSize, double);
72 vtkGetMacro(IntegrationStepSize, double);
74
76
80 vtkSetMacro(SeparatrixDistance, double);
81 vtkGetMacro(SeparatrixDistance, double);
83
85
88 vtkSetMacro(UseIterativeSeeding, bool);
89 vtkGetMacro(UseIterativeSeeding, bool);
91
93
96 vtkSetMacro(ComputeSurfaces, bool);
97 vtkGetMacro(ComputeSurfaces, bool);
99
101
104 vtkSetMacro(ExcludeBoundary, bool);
105 vtkGetMacro(ExcludeBoundary, bool);
107
109
112 vtkSetMacro(UseBoundarySwitchPoints, bool);
113 vtkGetMacro(UseBoundarySwitchPoints, bool);
115
117
126 vtkSetMacro(VectorAngleThreshold, double);
127 vtkGetMacro(VectorAngleThreshold, double);
129
131
134 vtkSetMacro(OffsetAwayFromBoundary, double);
135 vtkGetMacro(OffsetAwayFromBoundary, double);
137
144 void SetInterpolatorType(int interpType);
145
150
155
156protected:
159
160 int FillInputPortInformation(int port, vtkInformation* info) override;
161 int FillOutputPortInformation(int port, vtkInformation* info) override;
163
164private:
166 void operator=(const vtkVectorFieldTopology&) = delete;
167
171 int Validate();
172
180 int ImageDataPrepare(vtkDataSet* dataSetInput, vtkUnstructuredGrid* tridataset);
181
189 int UnstructuredGridPrepare(vtkDataSet* dataSetInput, vtkUnstructuredGrid* tridataset);
190
196 int RemoveBoundary(vtkSmartPointer<vtkUnstructuredGrid> tridataset);
197
205 int ComputeCriticalPoints2D(
207
215 int ComputeCriticalPoints3D(
217
228 static void InterpolateVector(
229 double x0, double x1, double x, const double v0[3], const double v1[3], double v[3]);
230
237 int ComputeBoundarySwitchPoints(
238 vtkPolyData* boundarySwitchPoints, vtkUnstructuredGrid* tridataset);
239
255 int ComputeSeparatricesBoundarySwitchPoints(vtkPolyData* boundarySwitchPoints,
256 vtkPolyData* separatrices, vtkDataSet* dataset, vtkPoints* interestPoints,
257 int integrationStepUnit, double dist, int maxNumSteps);
258
276 int ComputeSeparatricesBoundarySwitchLines(vtkPolyData* boundarySwitchLines,
277 vtkPolyData* separatrices, vtkDataSet* dataset, int integrationStepUnit, double dist,
278 int maxNumSteps, bool computeSurfaces, bool useIterativeSeeding);
279
298 int ComputeSeparatrices(vtkPolyData* criticalPoints, vtkPolyData* separatrices,
299 vtkPolyData* surfaces, vtkDataSet* dataset, vtkPoints* interestPoints, int integrationStepUnit,
300 double dist, double stepSize, int maxNumSteps, bool computeSurfaces, bool useIterativeSeeding);
301
318 int ComputeSurface(int numberOfSeparatingSurfaces, bool isBackward, double normal[3],
319 double zeroPos[3], vtkPolyData* streamSurfaces, vtkDataSet* dataset, int integrationStepUnit,
320 double dist, double stepSize, int maxNumSteps, bool useIterativeSeeding);
321
326 enum CriticalType2D
327 {
328 DEGENERATE_2D = -1,
329 SINK_2D = 0,
330 SADDLE_2D = 1,
331 SOURCE_2D = 2,
332 CENTER_2D = 3
333 };
334
339 enum CriticalTypeDetailed2D
340 {
341 // DEGENERATE2D = -1,
342 ATTRACTING_NODE_2D = 0,
343 ATTRACTING_FOCUS_2D = 1,
344 NODE_SADDLE_2D = 2,
345 REPELLING_NODE_2D = 3,
346 REPELLING_FOCUS_2D = 4,
347 CENTER_DETAILED_2D = 5
348 };
349
354 enum CriticalType3D
355 {
356 DEGENERATE_3D = -1,
357 SINK_3D = 0,
358 SADDLE_1_3D = 1,
359 SADDLE_2_3D = 2,
360 SOURCE_3D = 3,
361 CENTER_3D = 4
362 };
363
368 enum CriticalTypeDetailed3D
369 {
370 ATTRACTING_NODE_3D = 0,
371 ATTRACTING_FOCUS_3D = 1,
372 NODE_SADDLE_1_3D = 2,
373 FOCUS_SADDLE_1_3D = 3,
374 NODE_SADDLE_2_3D = 4,
375 FOCUS_SADDLE_2_3D = 5,
376 REPELLING_NODE_3D = 6,
377 REPELLING_FOCUS_3D = 7,
378 CENTER_DETAILED_3D = 8
379 };
380
388 static int Classify2D(int countComplex, int countPos, int countNeg);
389
398 static int ClassifyDetailed2D(int countComplex, int countPos, int countNeg);
399
408 static int Classify3D(int countComplex, int countPos, int countNeg);
409
419 static int ClassifyDetailed3D(int countComplex, int countPos, int countNeg);
420
424 int MaxNumSteps = 100;
425
429 double IntegrationStepSize = 1;
430
434 double SeparatrixDistance = 1;
435
439 bool UseIterativeSeeding = false;
440
444 bool ComputeSurfaces = false;
445
449 const char* NameOfVectorArray;
450
455 bool ExcludeBoundary = false;
456
460 int Dimension = 2;
461
469 int IntegrationStepUnit = vtkStreamTracer::CELL_LENGTH_UNIT;
470
477 bool UseBoundarySwitchPoints = false;
478
484
493 double VectorAngleThreshold = 1;
494
502 double OffsetAwayFromBoundary = 1e-3;
503
504 vtkNew<vtkStreamSurface> StreamSurface;
505};
506#endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
A general filter for gradient estimation.
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.
Allocate and hold a VTK object.
Definition: vtkNew.h:165
represent and manipulate 3D points
Definition: vtkPoints.h:143
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
Hold a reference to a vtkObjectBase instance.
Advect a stream surface in a vector field.
@ INTERPOLATOR_WITH_DATASET_POINT_LOCATOR
dataset represents arbitrary combinations of all possible cell types
Extract the topological skeleton as output datasets.
void SetInterpolatorTypeToCellLocator()
Set the velocity field interpolator type to the one involving a cell locator.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkVectorFieldTopology * New()
void SetInterpolatorTypeToDataSetPointLocator()
Set the velocity field interpolator type to the one involving a dataset point locator.
~vtkVectorFieldTopology() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInterpolatorType(int interpType)
Set the type of the velocity field interpolator to determine whether vtkInterpolatedVelocityField (IN...
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.