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 
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);
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:
164 
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkFitToHeightMapFilter::SetFittingStrategyToCellMinimumHeight
void SetFittingStrategyToCellMinimumHeight()
Definition: vtkFitToHeightMapFilter.h:141
vtkFitToHeightMapFilter
adjust polydata to fit image height map
Definition: vtkFitToHeightMapFilter.h:72
vtkFitToHeightMapFilter::~vtkFitToHeightMapFilter
~vtkFitToHeightMapFilter() override
vtkFitToHeightMapFilter::AdjustPoints
void AdjustPoints(vtkPolyData *output, vtkIdType numCells, vtkPoints *newPts)
vtkFitToHeightMapFilter::vtkFitToHeightMapFilter
vtkFitToHeightMapFilter()
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkFitToHeightMapFilter::UseHeightMapOffset
vtkTypeBool UseHeightMapOffset
Definition: vtkFitToHeightMapFilter.h:169
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkFitToHeightMapFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkFitToHeightMapFilter::SetHeightMapData
void SetHeightMapData(vtkImageData *idata)
Set the height map for the filter.
vtkFitToHeightMapFilter::SetFittingStrategyToCellMaximumHeight
void SetFittingStrategyToCellMaximumHeight()
Definition: vtkFitToHeightMapFilter.h:143
vtkFitToHeightMapFilter::AdjustCells
void AdjustCells(vtkPolyData *output, vtkIdType numCells, double *cellHts, vtkPoints *inPts, vtkPoints *newPts)
vtkFitToHeightMapFilter::SetFittingStrategyToPointMaximumHeight
void SetFittingStrategyToPointMaximumHeight()
Definition: vtkFitToHeightMapFilter.h:137
vtkFitToHeightMapFilter::FittingStrategy
int FittingStrategy
Definition: vtkFitToHeightMapFilter.h:168
vtkPolyDataAlgorithm.h
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkFitToHeightMapFilter::SetHeightMapConnection
void SetHeightMapConnection(vtkAlgorithmOutput *algOutput)
Specify the pipeline connection to the height map.
vtkFitToHeightMapFilter::GetHeightMap
vtkImageData * GetHeightMap(vtkInformationVector *sourceInfo)
vtkFitToHeightMapFilter::SetFittingStrategyToCellAverageHeight
void SetFittingStrategyToCellAverageHeight()
Definition: vtkFitToHeightMapFilter.h:145
vtkFitToHeightMapFilter::New
static vtkFitToHeightMapFilter * New()
Standard methods for construction, type and printing.
vtkFitToHeightMapFilter::SetFittingStrategyToPointMinimumHeight
void SetFittingStrategyToPointMinimumHeight()
Definition: vtkFitToHeightMapFilter.h:135
vtkFitToHeightMapFilter::SetFittingStrategyToAverageHeight
void SetFittingStrategyToAverageHeight()
Definition: vtkFitToHeightMapFilter.h:139
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkFitToHeightMapFilter::FittingStrategy
FittingStrategy
Definition: vtkFitToHeightMapFilter.h:108
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:40
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkFitToHeightMapFilter::SetFittingStrategyToPointProjection
void SetFittingStrategyToPointProjection()
Definition: vtkFitToHeightMapFilter.h:133
vtkFitToHeightMapFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkFitToHeightMapFilter::GetHeightMap
vtkImageData * GetHeightMap()
Get a pointer to the height map.
vtkFitToHeightMapFilter::Offset
double Offset
Definition: vtkFitToHeightMapFilter.h:170
vtkFitToHeightMapFilter::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:45