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 =========================================================================*/
66 #ifndef vtkFitToHeightMapFilter_h
67 #define vtkFitToHeightMapFilter_h
68 
69 #include "vtkFiltersModelingModule.h" // For export macro
70 #include "vtkPolyDataAlgorithm.h"
71 
72 class vtkImageData;
73 
74 class VTKFILTERSMODELING_EXPORT vtkFitToHeightMapFilter : public vtkPolyDataAlgorithm
75 {
76 public:
78 
81  static vtkFitToHeightMapFilter* New();
83  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
92  void SetHeightMapData(vtkImageData* idata);
93 
95 
98  void SetHeightMapConnection(vtkAlgorithmOutput* algOutput);
100 
102 
105  vtkImageData* GetHeightMap();
106  vtkImageData* GetHeightMap(vtkInformationVector* sourceInfo);
108 
109  // Strategies to fit the polydata.
111  {
112  POINT_PROJECTION = 0,
113  POINT_MINIMUM_HEIGHT = 1,
114  POINT_MAXIMUM_HEIGHT = 2,
115  POINT_AVERAGE_HEIGHT = 3,
116  CELL_MINIMUM_HEIGHT = 4,
117  CELL_MAXIMUM_HEIGHT = 5,
118  CELL_AVERAGE_HEIGHT = 6,
119  };
120 
122 
134  vtkSetMacro(FittingStrategy, int);
135  vtkGetMacro(FittingStrategy, int);
136  void SetFittingStrategyToPointProjection() { this->SetFittingStrategy(POINT_PROJECTION); }
137  void SetFittingStrategyToPointMinimumHeight() { this->SetFittingStrategy(POINT_MINIMUM_HEIGHT); }
138  void SetFittingStrategyToPointMaximumHeight() { this->SetFittingStrategy(POINT_MAXIMUM_HEIGHT); }
139  void SetFittingStrategyToAverageHeight() { this->SetFittingStrategy(POINT_AVERAGE_HEIGHT); }
140  void SetFittingStrategyToCellMinimumHeight() { this->SetFittingStrategy(CELL_MINIMUM_HEIGHT); }
141  void SetFittingStrategyToCellMaximumHeight() { this->SetFittingStrategy(CELL_MAXIMUM_HEIGHT); }
142  void SetFittingStrategyToCellAverageHeight() { this->SetFittingStrategy(CELL_AVERAGE_HEIGHT); }
144 
146 
152  vtkSetMacro(UseHeightMapOffset, vtkTypeBool);
153  vtkGetMacro(UseHeightMapOffset, vtkTypeBool);
154  vtkBooleanMacro(UseHeightMapOffset, vtkTypeBool);
156 
157 protected:
159  ~vtkFitToHeightMapFilter() override;
160 
162  int FillInputPortInformation(int, vtkInformation*) override;
163 
166  double Offset;
167 
168  void AdjustPoints(vtkPolyData* output, vtkIdType numCells, vtkPoints* newPts);
169  void AdjustCells(
170  vtkPolyData* output, vtkIdType numCells, double* cellHts, vtkPoints* inPts, vtkPoints* newPts);
171 
172 private:
174  void operator=(const vtkFitToHeightMapFilter&) = delete;
175 };
176 
177 #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:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
Proxy object to connect input/output ports.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
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:39
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.