forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkParallelVectors.h
116 lines (94 loc) · 3.64 KB
/
vtkParallelVectors.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*=========================================================================
Program: Visualization Toolkit
Module: vtkParallelVectors.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 vtkParallelVectors
* @brief Compute polylines corresponding to locations where two vector fields
* are parallel
*
* vtkParallelVectors accepts a 3D dataset with two nodal 3-vector fields and
* generates polylines along the paths where the vector fields are parallel.
* This filter is an implementation of the concepts outlined in the following
* article:
*
* R. Peikert and M. Roth, "The "Parallel Vectors" operator-a vector field
* visualization primitive," Proceedings Visualization '99 (Cat. No.99CB37067),
* San Francisco, CA, USA, 1999, pp. 263-532.
*
* @sa
* vtkVortexCore
*/
#ifndef vtkParallelVectors_h
#define vtkParallelVectors_h
#include "vtkFiltersFlowPathsModule.h" // For export macro
#include "vtkPolyDataAlgorithm.h"
#include "vtkNew.h" // for vtkNew
namespace detail
{
template <typename VArrayType, typename WArrayType>
class CollectValidCellSurfacePointsFunctor;
}
class VTKFILTERSFLOWPATHS_EXPORT vtkParallelVectors : public vtkPolyDataAlgorithm
{
template <typename, typename>
friend class detail::CollectValidCellSurfacePointsFunctor;
public:
static vtkParallelVectors* New();
vtkTypeMacro(vtkParallelVectors, vtkPolyDataAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;
///@{
/**
* Set/Get the name of first vector field.
*/
vtkSetStringMacro(FirstVectorFieldName);
vtkGetStringMacro(FirstVectorFieldName);
///@}
///@{
/**
* Set/Get the name of second vector field.
*/
vtkSetStringMacro(SecondVectorFieldName);
vtkGetStringMacro(SecondVectorFieldName);
///@}
protected:
vtkParallelVectors();
~vtkParallelVectors() override;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
int FillInputPortInformation(int, vtkInformation*) override;
/**
* Prefilter should resize the CriteriaArrays, initialize them and set their names.
*/
virtual void Prefilter(vtkInformation*, vtkInformationVector**, vtkInformationVector*) {}
virtual void Postfilter(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
virtual bool AcceptSurfaceTriangle(const vtkIdType surfaceSimplexIndices[3]);
/**
* Computes additional criteria to determine if a point should be added to a vortex core.
* Criteria are returned in the criteria parameter.
*
* @note criterionArrayValues has the size of the number of the CriteriaArrays.
*/
virtual bool ComputeAdditionalCriteria(const vtkIdType surfaceSimplexIndices[3], double s,
double t, std::vector<double>& criterionArrayValues);
/**
* Contains the name of the first vector field to compare.
*/
char* FirstVectorFieldName;
/**
* Contains the name of the second vector field to compare.
*/
char* SecondVectorFieldName;
// The arrays are used to store additional criteria related arrays with 1 component.
// The size of this vector should be resized inside Prefilter.
std::vector<vtkSmartPointer<vtkDoubleArray>> CriteriaArrays;
private:
vtkParallelVectors(const vtkParallelVectors&) = delete;
void operator=(const vtkParallelVectors&) = delete;
};
#endif