VTK  9.0.3
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 
80  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
90 
92 
97 
99 
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);
133  void SetFittingStrategyToPointProjection() { this->SetFittingStrategy(POINT_PROJECTION); }
134  void SetFittingStrategyToPointMinimumHeight() { this->SetFittingStrategy(POINT_MINIMUM_HEIGHT); }
135  void SetFittingStrategyToPointMaximumHeight() { this->SetFittingStrategy(POINT_MAXIMUM_HEIGHT); }
136  void SetFittingStrategyToAverageHeight() { this->SetFittingStrategy(POINT_AVERAGE_HEIGHT); }
137  void SetFittingStrategyToCellMinimumHeight() { this->SetFittingStrategy(CELL_MINIMUM_HEIGHT); }
138  void SetFittingStrategyToCellMaximumHeight() { this->SetFittingStrategy(CELL_MAXIMUM_HEIGHT); }
139  void SetFittingStrategyToCellAverageHeight() { this->SetFittingStrategy(CELL_AVERAGE_HEIGHT); }
141 
143 
149  vtkSetMacro(UseHeightMapOffset, vtkTypeBool);
150  vtkGetMacro(UseHeightMapOffset, vtkTypeBool);
151  vtkBooleanMacro(UseHeightMapOffset, vtkTypeBool);
153 
154 protected:
157 
160 
163  double Offset;
164 
165  void AdjustPoints(vtkPolyData* output, vtkIdType numCells, vtkPoints* newPts);
167  vtkPolyData* output, vtkIdType numCells, double* cellHts, vtkPoints* inPts, vtkPoints* newPts);
168 
169 private:
171  void operator=(const vtkFitToHeightMapFilter&) = delete;
172 };
173 
174 #endif
Proxy object to connect input/output ports.
adjust polydata to fit image height map
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkImageData * GetHeightMap()
Get a pointer to the height map.
~vtkFitToHeightMapFilter() override
void AdjustPoints(vtkPolyData *output, vtkIdType numCells, vtkPoints *newPts)
static vtkFitToHeightMapFilter * New()
Standard methods for construction, type and printing.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetHeightMapConnection(vtkAlgorithmOutput *algOutput)
Specify the pipeline connection to the height map.
void AdjustCells(vtkPolyData *output, vtkIdType numCells, double *cellHts, vtkPoints *inPts, vtkPoints *newPts)
vtkImageData * GetHeightMap(vtkInformationVector *sourceInfo)
void SetHeightMapData(vtkImageData *idata)
Set the height map for the filter.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:34
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:338