VTK  9.3.1
vtkFitToHeightMapFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
54 #ifndef vtkFitToHeightMapFilter_h
55 #define vtkFitToHeightMapFilter_h
56 
57 #include "vtkFiltersModelingModule.h" // For export macro
58 #include "vtkPolyDataAlgorithm.h"
59 
60 VTK_ABI_NAMESPACE_BEGIN
61 class vtkImageData;
62 
63 class VTKFILTERSMODELING_EXPORT vtkFitToHeightMapFilter : public vtkPolyDataAlgorithm
64 {
65 public:
67 
70  static vtkFitToHeightMapFilter* New();
72  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
81  void SetHeightMapData(vtkImageData* idata);
82 
84 
87  void SetHeightMapConnection(vtkAlgorithmOutput* algOutput);
89 
91 
94  vtkImageData* GetHeightMap();
95  vtkImageData* GetHeightMap(vtkInformationVector* sourceInfo);
97 
98  // Strategies to fit the polydata.
100  {
101  POINT_PROJECTION = 0,
102  POINT_MINIMUM_HEIGHT = 1,
103  POINT_MAXIMUM_HEIGHT = 2,
104  POINT_AVERAGE_HEIGHT = 3,
105  CELL_MINIMUM_HEIGHT = 4,
106  CELL_MAXIMUM_HEIGHT = 5,
107  CELL_AVERAGE_HEIGHT = 6,
108  };
109 
111 
123  vtkSetMacro(FittingStrategy, int);
124  vtkGetMacro(FittingStrategy, int);
125  void SetFittingStrategyToPointProjection() { this->SetFittingStrategy(POINT_PROJECTION); }
126  void SetFittingStrategyToPointMinimumHeight() { this->SetFittingStrategy(POINT_MINIMUM_HEIGHT); }
127  void SetFittingStrategyToPointMaximumHeight() { this->SetFittingStrategy(POINT_MAXIMUM_HEIGHT); }
128  void SetFittingStrategyToAverageHeight() { this->SetFittingStrategy(POINT_AVERAGE_HEIGHT); }
129  void SetFittingStrategyToCellMinimumHeight() { this->SetFittingStrategy(CELL_MINIMUM_HEIGHT); }
130  void SetFittingStrategyToCellMaximumHeight() { this->SetFittingStrategy(CELL_MAXIMUM_HEIGHT); }
131  void SetFittingStrategyToCellAverageHeight() { this->SetFittingStrategy(CELL_AVERAGE_HEIGHT); }
133 
135 
141  vtkSetMacro(UseHeightMapOffset, vtkTypeBool);
142  vtkGetMacro(UseHeightMapOffset, vtkTypeBool);
143  vtkBooleanMacro(UseHeightMapOffset, vtkTypeBool);
145 
146 protected:
148  ~vtkFitToHeightMapFilter() override;
149 
151  int FillInputPortInformation(int, vtkInformation*) override;
152 
155  double Offset;
156 
157  void AdjustPoints(vtkPolyData* output, vtkIdType numCells, vtkPoints* newPts);
158  void AdjustCells(
159  vtkPolyData* output, vtkIdType numCells, double* cellHts, vtkPoints* inPts, vtkPoints* newPts);
160 
161 private:
163  void operator=(const vtkFitToHeightMapFilter&) = delete;
164 };
165 
166 VTK_ABI_NAMESPACE_END
167 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Proxy object to connect input/output ports.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
void SetFittingStrategyToCellMaximumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void SetFittingStrategyToCellAverageHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void SetFittingStrategyToPointMaximumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
Superclass for algorithms that produce only polydata as output.
void SetFittingStrategyToPointMinimumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
void SetFittingStrategyToAverageHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void SetFittingStrategyToPointProjection()
Specify a strategy for fitting, or projecting, the polydata to the height field.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
adjust polydata to fit image height map
represent and manipulate 3D points
Definition: vtkPoints.h:28
void SetFittingStrategyToCellMinimumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.