VTK
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 =========================================================================*/
63 #ifndef vtkFitToHeightMapFilter_h
64 #define vtkFitToHeightMapFilter_h
65 
66 #include "vtkFiltersModelingModule.h" // For export macro
67 #include "vtkPolyDataAlgorithm.h"
68 
69 class vtkImageData;
70 
71 class VTKFILTERSMODELING_EXPORT vtkFitToHeightMapFilter : public vtkPolyDataAlgorithm
72 {
73 public:
75 
78  static vtkFitToHeightMapFilter *New();
80  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
89  void SetHeightMapData(vtkImageData *idata);
90 
92 
95  void SetHeightMapConnection(vtkAlgorithmOutput* algOutput);
97 
99 
102  vtkImageData *GetHeightMap();
103  vtkImageData *GetHeightMap(vtkInformationVector *sourceInfo);
105 
106  // Strategies to fit the polydata.
108  {
109  POINT_PROJECTION=0,
110  POINT_MINIMUM_HEIGHT=1,
111  POINT_MAXIMUM_HEIGHT=2,
112  POINT_AVERAGE_HEIGHT=3,
113  CELL_MINIMUM_HEIGHT=4,
114  CELL_MAXIMUM_HEIGHT=5,
115  CELL_AVERAGE_HEIGHT=6,
116  };
117 
119 
131  vtkSetMacro(FittingStrategy,int);
132  vtkGetMacro(FittingStrategy,int);
134  { this->SetFittingStrategy(POINT_PROJECTION); }
136  { this->SetFittingStrategy(POINT_MINIMUM_HEIGHT); }
138  { this->SetFittingStrategy(POINT_MAXIMUM_HEIGHT); }
140  { this->SetFittingStrategy(POINT_AVERAGE_HEIGHT); }
142  { this->SetFittingStrategy(CELL_MINIMUM_HEIGHT); }
144  { this->SetFittingStrategy(CELL_MAXIMUM_HEIGHT); }
146  { this->SetFittingStrategy(CELL_AVERAGE_HEIGHT); }
148 
150 
156  vtkSetMacro(UseHeightMapOffset,vtkTypeBool);
157  vtkGetMacro(UseHeightMapOffset,vtkTypeBool);
158  vtkBooleanMacro(UseHeightMapOffset,vtkTypeBool);
160 
161 protected:
163  ~vtkFitToHeightMapFilter() override;
164 
166  int FillInputPortInformation(int, vtkInformation *) override;
167 
170  double Offset;
171 
172  void AdjustPoints(vtkPolyData *output, vtkIdType numCells, vtkPoints *newPts);
173  void AdjustCells(vtkPolyData *output, vtkIdType numCells, double *cellHts,
174  vtkPoints *inPts, vtkPoints *newPts);
175 
176 private:
178  void operator=(const vtkFitToHeightMapFilter&) = delete;
179 };
180 
181 #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:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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:45
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.