File: vtkReflectionUtilities.h

package info (click to toggle)
vtk9 9.5.2%2Bdfsg4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 206,616 kB
  • sloc: cpp: 2,340,827; ansic: 327,116; python: 114,881; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; javascript: 1,261; makefile: 189; objc: 153; tcl: 59
file content (92 lines) | stat: -rw-r--r-- 3,994 bytes parent folder | download | duplicates (2)
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
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
 * @brief Reflection methods for Unstructured Grid
 *
 * This file defines a namespace providing functions used by vtkReflectionFilter and
 * vtkAxisAlignedReflectionFilter to process Unstructured Grids.
 */

#ifndef vtkReflectionUtilities_h
#define vtkReflectionUtilities_h

#include "vtkAlgorithm.h"        // for vtkAlgorithm class
#include "vtkUnstructuredGrid.h" // for vtkUnstructuredGrid class

VTK_ABI_NAMESPACE_BEGIN

namespace vtkReflectionUtilities
{

/**
 * method to determine which arrays from a field data can be reflected and store them in the
 * provided reflectableArrays. Only 3/6/9 component signed data array are considered reflectable.
 */
void FindReflectableArrays(
  vtkFieldData* fd, std::vector<std::pair<vtkIdType, int>>& reflectableArrays);

/**
 * If reflectAllInputArrays is true, calls FindReflectableArrays.
 * Otherwise, this function fills reflectableArrays with vectors, normals, and tensors.
 */
void FindAllReflectableArrays(std::vector<std::pair<vtkIdType, int>>& reflectableArrays,
  vtkDataSetAttributes* inData, bool reflectAllInputArrays);

/**
 * Reflect each component of the provided tuple according to the provided mirrorDir using the
 * provided nComp component.
 */
void ReflectTuple(double* tuple, int* mirrorDir, int nComp);

/**
 * Reflect the i-th tuple of each array in reflectableArrays.
 *
 * @param reflectableArrays Vector of all the arrays that need to be reflected and their
 * corresponding number of components.
 * @param inData DataSetAttribute in which to get the actual arrays from their ids.
 * @param outData DataSetAttribute in which to set the reflected arrays.
 * @param i Index of the tuple that needs to be reflected in the input array.
 * @param mirrorDir Mirror direction for 3-components arrays.
 * @param mirrorSymmetricTensorDir Mirror direction for 6-components arrays.
 * @param mirrorTensorDir Mirror direction for 9-components arrays.
 * @param id Index of the reflected tuple in the output array.
 */
void ReflectReflectableArrays(std::vector<std::pair<vtkIdType, int>>& reflectableArrays,
  vtkDataSetAttributes* inData, vtkDataSetAttributes* outData, vtkIdType i, int mirrorDir[3],
  int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9], vtkIdType id);

/**
 * Generate new, non-3D cell and return the generated cell id.
 *
 * @param input Input dataset to be reflected.
 * @param output Output unstructured grid that is the reflection of the input and the input itself
 * if copyInput is on.
 * @param cellId Id of the cell to be reflected.
 * @param numInputPoints Number of points in the input dataset.
 * @param copyInput @see vtkAxisAlignedReflectionFilter::CopyInput.
 */
vtkIdType ReflectNon3DCellInternal(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
  vtkIdType numInputPoints, bool copyInput);

/**
 * Generate the reflection of the input dataset as an unstructured grid.
 *
 * @param input Input dataset to be reflected.
 * @param output Output unstructured grid that is the reflection of the input and the input itself
 * if copyInput is on.
 * @param constant Offset depending on the chosen reflection plane.
 * @param mirrorDir Mirror direction for 3-components arrays.
 * @param mirrorSymmetricTensorDir Mirror direction for 6-components arrays.
 * @param mirrorTensorDir Mirror direction for 9-components arrays.
 * @param copyInput @see vtkAxisAlignedReflectionFilter::CopyInput.
 * @param reflectAllInputArrays @see vtkAxisAlignedReflectionFilter::ReflectAllInputArrays.
 * @param algorithm Algorithm object to CheckAbort during points and cells iterations.
 */
void ProcessUnstructuredGrid(vtkDataSet* input, vtkUnstructuredGrid* output, double constant[3],
  int mirrorDir[3], int mirrorSymmetricTensorDir[6], int mirrorTensorDir[9], bool copyInput,
  bool reflectAllInputArrays, vtkAlgorithm* algorithm);
}

VTK_ABI_NAMESPACE_END

#endif