VTK  9.2.6
vtkFitToHeightMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFitToHeightMapFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
85 #ifndef vtkFitToHeightMapFilter_h
86 #define vtkFitToHeightMapFilter_h
87 
88 #include "vtkFiltersModelingModule.h" // For export macro
89 #include "vtkPolyDataAlgorithm.h"
90 
91 class vtkImageData;
92 
93 class VTKFILTERSMODELING_EXPORT vtkFitToHeightMapFilter : public vtkPolyDataAlgorithm
94 {
95 public:
97 
102  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
112 
114 
119 
121 
127 
128  // Strategies to fit the polydata.
130  {
131  POINT_PROJECTION = 0,
132  POINT_MINIMUM_HEIGHT = 1,
133  POINT_MAXIMUM_HEIGHT = 2,
134  POINT_AVERAGE_HEIGHT = 3,
135  CELL_MINIMUM_HEIGHT = 4,
136  CELL_MAXIMUM_HEIGHT = 5,
137  CELL_AVERAGE_HEIGHT = 6,
138  };
139 
141 
153  vtkSetMacro(FittingStrategy, int);
154  vtkGetMacro(FittingStrategy, int);
155  void SetFittingStrategyToPointProjection() { this->SetFittingStrategy(POINT_PROJECTION); }
156  void SetFittingStrategyToPointMinimumHeight() { this->SetFittingStrategy(POINT_MINIMUM_HEIGHT); }
157  void SetFittingStrategyToPointMaximumHeight() { this->SetFittingStrategy(POINT_MAXIMUM_HEIGHT); }
158  void SetFittingStrategyToAverageHeight() { this->SetFittingStrategy(POINT_AVERAGE_HEIGHT); }
159  void SetFittingStrategyToCellMinimumHeight() { this->SetFittingStrategy(CELL_MINIMUM_HEIGHT); }
160  void SetFittingStrategyToCellMaximumHeight() { this->SetFittingStrategy(CELL_MAXIMUM_HEIGHT); }
161  void SetFittingStrategyToCellAverageHeight() { this->SetFittingStrategy(CELL_AVERAGE_HEIGHT); }
163 
165 
171  vtkSetMacro(UseHeightMapOffset, vtkTypeBool);
172  vtkGetMacro(UseHeightMapOffset, vtkTypeBool);
173  vtkBooleanMacro(UseHeightMapOffset, vtkTypeBool);
175 
176 protected:
179 
182 
185  double Offset;
186 
187  void AdjustPoints(vtkPolyData* output, vtkIdType numCells, vtkPoints* newPts);
189  vtkPolyData* output, vtkIdType numCells, double* cellHts, vtkPoints* inPts, vtkPoints* newPts);
190 
191 private:
193  void operator=(const vtkFitToHeightMapFilter&) = delete;
194 };
195 
196 #endif
Proxy object to connect input/output ports.
adjust polydata to fit image height map
void SetFittingStrategyToPointProjection()
Specify a strategy for fitting, or projecting, the polydata to the height field.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkImageData * GetHeightMap()
Get a pointer to the height map.
void SetFittingStrategyToCellMinimumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
~vtkFitToHeightMapFilter() override
void SetFittingStrategyToCellAverageHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void AdjustPoints(vtkPolyData *output, vtkIdType numCells, vtkPoints *newPts)
void SetFittingStrategyToCellMaximumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
static vtkFitToHeightMapFilter * New()
Standard methods for construction, type and printing.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type and printing.
void SetHeightMapConnection(vtkAlgorithmOutput *algOutput)
Specify the pipeline connection to the height map.
void SetFittingStrategyToPointMinimumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void AdjustCells(vtkPolyData *output, vtkIdType numCells, double *cellHts, vtkPoints *inPts, vtkPoints *newPts)
vtkImageData * GetHeightMap(vtkInformationVector *sourceInfo)
Get a pointer to the height map.
void SetHeightMapData(vtkImageData *idata)
Set the height map for the filter.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetFittingStrategyToPointMaximumHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
void SetFittingStrategyToAverageHeight()
Specify a strategy for fitting, or projecting, the polydata to the height field.
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:149
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332