VTK  9.1.0
vtkPointDensityFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPointDensityFilter.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=========================================================================*/
80#ifndef vtkPointDensityFilter_h
81#define vtkPointDensityFilter_h
82
83#include "vtkFiltersPointsModule.h" // For export macro
84#include "vtkImageAlgorithm.h"
85
86#define VTK_DENSITY_ESTIMATE_FIXED_RADIUS 0
87#define VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS 1
88
89#define VTK_DENSITY_FORM_VOLUME_NORM 0
90#define VTK_DENSITY_FORM_NPTS 1
91
93
94class VTKFILTERSPOINTS_EXPORT vtkPointDensityFilter : public vtkImageAlgorithm
95{
96public:
98
104 void PrintSelf(ostream& os, vtkIndent indent) override;
106
108
114 void SetSampleDimensions(int i, int j, int k);
115 void SetSampleDimensions(int dim[3]);
116 vtkGetVectorMacro(SampleDimensions, int, 3);
118
120
126 vtkSetVector6Macro(ModelBounds, double);
127 vtkGetVectorMacro(ModelBounds, double, 6);
129
131
137 vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
138 vtkGetMacro(AdjustDistance, double);
140
142
147 vtkSetClampMacro(
149 vtkGetMacro(DensityEstimate, int);
151 {
152 this->SetDensityEstimate(VTK_DENSITY_ESTIMATE_FIXED_RADIUS);
153 }
155 {
156 this->SetDensityEstimate(VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS);
157 }
160
162
167 vtkSetClampMacro(DensityForm, int, VTK_DENSITY_FORM_VOLUME_NORM, VTK_DENSITY_FORM_NPTS);
168 vtkGetMacro(DensityForm, int);
173
175
180 vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
181 vtkGetMacro(Radius, double);
183
185
192 vtkSetClampMacro(RelativeRadius, double, 0.0, VTK_DOUBLE_MAX);
193 vtkGetMacro(RelativeRadius, double);
195
197
201 vtkSetMacro(ScalarWeighting, bool);
202 vtkGetMacro(ScalarWeighting, bool);
203 vtkBooleanMacro(ScalarWeighting, bool);
205
207
214 vtkSetMacro(ComputeGradient, bool);
215 vtkGetMacro(ComputeGradient, bool);
216 vtkBooleanMacro(ComputeGradient, bool);
218
220
226 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
228
236 {
237 ZERO = 0,
238 NON_ZERO = 1
239 };
240
241protected:
244
245 int SampleDimensions[3]; // dimensions of volume over which to estimate density
246 double ModelBounds[6]; // bounding box of splatting dimensions
247 double AdjustDistance; // how much to pad the model bounds if automatically computed
248 double Origin[3], Spacing[3]; // output geometry
249 int DensityEstimate; // how to compute the density
250 int DensityForm; // how to represent density value
251 double RelativeRadius; // Radius factor for estimating density
252 double Radius; // Actually radius used
253 bool ScalarWeighting; // Are point densities weighted or not?
254 bool ComputeGradient; // Compute the gradient vector and magnitude
255 vtkAbstractPointLocator* Locator; // accelerate point searches
256
260
262
263private:
265 void operator=(const vtkPointDensityFilter&) = delete;
266};
267
268#endif
abstract class to quickly locate points in 3-space
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
produce density field from input point cloud
void ComputeModelBounds(vtkDataSet *input, vtkImageData *output, vtkInformation *outInfo)
void SetDensityEstimateToFixedRadius()
Specify the method to estimate point density.
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetSampleDimensions(int dim[3])
Set / get the dimensions of the sampling volume.
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
void SetSampleDimensions(int i, int j, int k)
Set / get the dimensions of the sampling volume.
vtkAbstractPointLocator * Locator
void SetDensityFormToVolumeNormalized()
Specify the form by which the density is expressed.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
static vtkPointDensityFilter * New()
Standard methods for instantiating, obtaining type information, and printing information.
void SetDensityFormToNumberOfPoints()
Specify the form by which the density is expressed.
void SetDensityEstimateToRelativeRadius()
Specify the method to estimate point density.
const char * GetDensityFormAsString()
Specify the form by which the density is expressed.
~vtkPointDensityFilter() override
const char * GetDensityEstimateAsString()
Specify the method to estimate point density.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiating, obtaining type information, and printing information.
FunctionClass
This enum is used to classify the behavior of the function gradient.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
#define VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS
#define VTK_DENSITY_FORM_VOLUME_NORM
#define VTK_DENSITY_FORM_NPTS
#define VTK_DENSITY_ESTIMATE_FIXED_RADIUS
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165