File: vtkLinearCellExtrusionFilter.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,449 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   vtkLinearCellExtrusionFilter
 * @brief   extrude polygonal data to create 3D cells from 2D cells
 *
 * vtkLinearCellExtrusionFilter is a modeling filter. It takes polygonal data as
 * input and generates an unstructured grid data on output. The input dataset is swept
 * according to the input cell data array value along the cell normal and creates
 * new 3D primitives.
 * Triangles will become Wedges, Quads will become Hexahedrons,
 * and Polygons will become Polyhedrons.
 * This filter currently takes into account only polys and discard vertices, lines and strips.
 * Unlike the vtkLinearExtrusionFilter, this filter is designed to extrude each cell independently
 * using its normal and its scalar value.
 *
 * @sa
 * vtkLinearExtrusionFilter
 */

#ifndef vtkLinearCellExtrusionFilter_h
#define vtkLinearCellExtrusionFilter_h

#include "vtkFiltersModelingModule.h"   // For export macro
#include "vtkIncrementalPointLocator.h" // For vtkIncrementalPointLocator
#include "vtkPolyDataAlgorithm.h"
#include "vtkSmartPointer.h" // For smart pointer

VTK_ABI_NAMESPACE_BEGIN
class VTKFILTERSMODELING_EXPORT vtkLinearCellExtrusionFilter : public vtkPolyDataAlgorithm
{
public:
  vtkTypeMacro(vtkLinearCellExtrusionFilter, vtkPolyDataAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;
  static vtkLinearCellExtrusionFilter* New();

  ///@{
  /**
   * Specify the scale factor applied on the cell value during extrusion.
   * Default is 1.0
   */
  vtkSetMacro(ScaleFactor, double);
  vtkGetMacro(ScaleFactor, double);
  ///@}

  ///@{
  /**
   * Specify if the algorithm should use the specified vector instead of cell normals.
   * Default is false
   */
  vtkSetMacro(UseUserVector, bool);
  vtkGetMacro(UseUserVector, bool);
  vtkBooleanMacro(UseUserVector, bool);
  ///@}

  ///@{
  /**
   * Specify the scale factor applied on the cell value during extrusion.
   */
  vtkSetVector3Macro(UserVector, double);
  vtkGetVector3Macro(UserVector, double);
  ///@}

  ///@{
  /**
   * Specify if the algorithm should merge duplicate points.
   * Default is false
   */
  vtkSetMacro(MergeDuplicatePoints, bool);
  vtkGetMacro(MergeDuplicatePoints, bool);
  vtkBooleanMacro(MergeDuplicatePoints, bool);
  ///@}

  ///@{
  /**
   * Specify a spatial locator for merging points.
   * By default, an instance of vtkMergePoints is used.
   */
  vtkGetSmartPointerMacro(Locator, vtkIncrementalPointLocator);
  vtkSetSmartPointerMacro(Locator, vtkIncrementalPointLocator);
  ///@}

  /**
   * Create default locator. Used to create one when none is specified. The
   * locator is used to merge coincident points.
   */
  void CreateDefaultLocator();

protected:
  vtkLinearCellExtrusionFilter();
  ~vtkLinearCellExtrusionFilter() override = default;

  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;

  int FillOutputPortInformation(int port, vtkInformation* info) override;

  double ScaleFactor = 1.0;
  double UserVector[3] = { 0.0, 0.0, 1.0 };
  bool UseUserVector = false;
  bool MergeDuplicatePoints = false;
  vtkSmartPointer<vtkIncrementalPointLocator> Locator;

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

VTK_ABI_NAMESPACE_END
#endif