VTK  9.2.6
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=========================================================================*/
76
77#ifndef vtkPointDensityFilter_h
78#define vtkPointDensityFilter_h
79
80#include "vtkFiltersPointsModule.h" // For export macro
81#include "vtkImageAlgorithm.h"
82
83#define VTK_DENSITY_ESTIMATE_FIXED_RADIUS 0
84#define VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS 1
85
86#define VTK_DENSITY_FORM_VOLUME_NORM 0
87#define VTK_DENSITY_FORM_NPTS 1
88
90
91class VTKFILTERSPOINTS_EXPORT vtkPointDensityFilter : public vtkImageAlgorithm
92{
93public:
95
101 void PrintSelf(ostream& os, vtkIndent indent) override;
103
105
111 void SetSampleDimensions(int i, int j, int k);
112 void SetSampleDimensions(int dim[3]);
113 vtkGetVectorMacro(SampleDimensions, int, 3);
115
117
123 vtkSetVector6Macro(ModelBounds, double);
124 vtkGetVectorMacro(ModelBounds, double, 6);
126
128
134 vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
135 vtkGetMacro(AdjustDistance, double);
137
139
144 vtkSetClampMacro(
146 vtkGetMacro(DensityEstimate, int);
157
159
165 vtkGetMacro(DensityForm, int);
170
172
177 vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
178 vtkGetMacro(Radius, double);
180
182
189 vtkSetClampMacro(RelativeRadius, double, 0.0, VTK_DOUBLE_MAX);
190 vtkGetMacro(RelativeRadius, double);
192
194
198 vtkSetMacro(ScalarWeighting, bool);
199 vtkGetMacro(ScalarWeighting, bool);
200 vtkBooleanMacro(ScalarWeighting, bool);
202
204
211 vtkSetMacro(ComputeGradient, bool);
212 vtkGetMacro(ComputeGradient, bool);
213 vtkBooleanMacro(ComputeGradient, bool);
215
217
223 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
225
233 {
234 ZERO = 0,
236 };
237
238protected:
241
242 int SampleDimensions[3]; // dimensions of volume over which to estimate density
243 double ModelBounds[6]; // bounding box of splatting dimensions
244 double AdjustDistance; // how much to pad the model bounds if automatically computed
245 double Origin[3], Spacing[3]; // output geometry
246 int DensityEstimate; // how to compute the density
247 int DensityForm; // how to represent density value
248 double RelativeRadius; // Radius factor for estimating density
249 double Radius; // Actually radius used
250 bool ScalarWeighting; // Are point densities weighted or not?
251 bool ComputeGradient; // Compute the gradient vector and magnitude
252 vtkAbstractPointLocator* Locator; // accelerate point searches
253
254 int FillInputPortInformation(int port, vtkInformation* info) override;
257
259
260private:
262 void operator=(const vtkPointDensityFilter&) = delete;
263};
264
265#endif
abstract class to quickly locate points in 3-space
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
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.
virtual void SetDensityForm(int)
Specify the form by which the density is expressed.
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.
virtual void SetDensityEstimate(int)
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.
#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