File: vtkHyperTreeGridAxisReflection.h

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 205,916 kB
  • sloc: cpp: 2,336,565; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 178; javascript: 165; objc: 153; tcl: 59
file content (109 lines) | stat: -rw-r--r-- 3,053 bytes parent folder | download | duplicates (7)
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
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
 * @class   vtkHyperTreeGridAxisReflection
 * @brief   Reflect a hyper tree grid
 *
 *
 * This filter reflect the cells of a hyper tree grid with respect to
 * one of the planes parallel to the bounding box of the data set.
 *
 * @sa
 * vtkHyperTreeGrid vtkHyperTreeGridAlgorithm vtkReflectionFilter
 *
 * @par Thanks:
 * This class was written by Philippe Pebay based on a idea of Guenole
 * Harel and Jacques-Bernard Lekien, 2016
 * This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
 */

#ifndef vtkHyperTreeGridAxisReflection_h
#define vtkHyperTreeGridAxisReflection_h

#include "vtkFiltersHyperTreeModule.h" // For export macro
#include "vtkHyperTreeGridAlgorithm.h"

VTK_ABI_NAMESPACE_BEGIN
class vtkHyperTreeGrid;

class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridAxisReflection : public vtkHyperTreeGridAlgorithm
{
public:
  static vtkHyperTreeGridAxisReflection* New();
  vtkTypeMacro(vtkHyperTreeGridAxisReflection, vtkHyperTreeGridAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  /**
   * Specify unique identifiers of available reflection planes.
   */
  enum AxisReflectionPlane
  {
    USE_X_MIN = 0,
    USE_Y_MIN = 1,
    USE_Z_MIN = 2,
    USE_X_MAX = 3,
    USE_Y_MAX = 4,
    USE_Z_MAX = 5,
    USE_X = 6,
    USE_Y = 7,
    USE_Z = 8
  };

  ///@{
  /**
   * Set the normal of the plane to use as mirror.
   */
  vtkSetClampMacro(Plane, int, 0, 8);
  vtkGetMacro(Plane, int);
  void SetPlaneToX() { this->SetPlane(USE_X); }
  void SetPlaneToY() { this->SetPlane(USE_Y); }
  void SetPlaneToZ() { this->SetPlane(USE_Z); }
  void SetPlaneToXMin() { this->SetPlane(USE_X_MIN); }
  void SetPlaneToYMin() { this->SetPlane(USE_Y_MIN); }
  void SetPlaneToZMin() { this->SetPlane(USE_Z_MIN); }
  void SetPlaneToXMax() { this->SetPlane(USE_X_MAX); }
  void SetPlaneToYMax() { this->SetPlane(USE_Y_MAX); }
  void SetPlaneToZMax() { this->SetPlane(USE_Z_MAX); }
  ///@}

  ///@{
  /**
   * If the reflection plane is set to X, Y or Z, this variable
   * is use to set the position of the plane.
   */
  vtkSetMacro(Center, double);
  vtkGetMacro(Center, double);
  ///@}

protected:
  vtkHyperTreeGridAxisReflection();
  ~vtkHyperTreeGridAxisReflection() override;

  /**
   * For this algorithm the output is a vtkHyperTreeGrid instance
   */
  int FillOutputPortInformation(int, vtkInformation*) override;

  /**
   * Main routine to extract cells based on reflectioned value
   */
  int ProcessTrees(vtkHyperTreeGrid*, vtkDataObject*) override;

  /**
   * Required type of plane reflection
   */
  int Plane;

  /**
   * Position of the plane relative to given axis
   * Only used if the reflection plane is X, Y or Z
   */
  double Center;

private:
  vtkHyperTreeGridAxisReflection(const vtkHyperTreeGridAxisReflection&) = delete;
  void operator=(const vtkHyperTreeGridAxisReflection&) = delete;
};

VTK_ABI_NAMESPACE_END
#endif /* vtkHyperTreeGridAxisReflection */