VTK
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 =========================================================================*/
75 #ifndef vtkPointDensityFilter_h
76 #define vtkPointDensityFilter_h
77 
78 #include "vtkFiltersPointsModule.h" // For export macro
79 #include "vtkImageAlgorithm.h"
80 
81 #define VTK_DENSITY_ESTIMATE_FIXED_RADIUS 0
82 #define VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS 1
83 
84 #define VTK_DENSITY_FORM_VOLUME_NORM 0
85 #define VTK_DENSITY_FORM_NPTS 1
86 
88 
89 class VTKFILTERSPOINTS_EXPORT vtkPointDensityFilter : public vtkImageAlgorithm
90 {
91 public:
93 
99  void PrintSelf(ostream& os, vtkIndent indent);
101 
103 
109  void SetSampleDimensions(int i, int j, int k);
110  void SetSampleDimensions(int dim[3]);
111  vtkGetVectorMacro(SampleDimensions,int,3);
113 
115 
121  vtkSetVector6Macro(ModelBounds,double);
122  vtkGetVectorMacro(ModelBounds,double,6);
124 
126 
132  vtkSetClampMacro(AdjustDistance,double,-1.0,1.0);
133  vtkGetMacro(AdjustDistance,double);
135 
137 
142  vtkSetClampMacro(DensityEstimate,int, VTK_DENSITY_ESTIMATE_FIXED_RADIUS,
144  vtkGetMacro(DensityEstimate,int);
146  {this->SetDensityEstimate(VTK_DENSITY_ESTIMATE_FIXED_RADIUS);}
148  {this->SetDensityEstimate(VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS);}
151 
153 
158  vtkSetClampMacro(DensityForm,int, VTK_DENSITY_FORM_VOLUME_NORM,
160  vtkGetMacro(DensityForm,int);
162  {this->SetDensityForm(VTK_DENSITY_FORM_VOLUME_NORM);}
164  {this->SetDensityForm(VTK_DENSITY_FORM_NPTS);}
165  const char *GetDensityFormAsString();
167 
169 
174  vtkSetClampMacro(Radius,double,0.0,VTK_DOUBLE_MAX);
175  vtkGetMacro(Radius,double);
177 
179 
186  vtkSetClampMacro(RelativeRadius,double,0.0,VTK_DOUBLE_MAX);
187  vtkGetMacro(RelativeRadius,double);
189 
191 
195  vtkSetMacro(ScalarWeighting,bool);
196  vtkGetMacro(ScalarWeighting,bool);
197  vtkBooleanMacro(ScalarWeighting,bool);
199 
201 
207  vtkGetObjectMacro(Locator,vtkAbstractPointLocator);
209 
210 protected:
213 
214  int SampleDimensions[3]; // dimensions of volume over which to estimate density
215  double ModelBounds[6]; // bounding box of splatting dimensions
216  double AdjustDistance; // how much to pad the model bounds if automatically computed
217  double Origin[3], Spacing[3]; // output geometry
218  int DensityEstimate; // how to compute the density
219  int DensityForm; // how to represent density value
220  double RelativeRadius; // Radius factor for estimating density
221  double Radius; // Actually radius used
222  bool ScalarWeighting; // Are point densities weighted or not?
223  vtkAbstractPointLocator *Locator; //accelerate point searches
224 
232 
234  vtkInformation *outInfo);
235 
236 private:
237  vtkPointDensityFilter(const vtkPointDensityFilter&) VTK_DELETE_FUNCTION;
238  void operator=(const vtkPointDensityFilter&) VTK_DELETE_FUNCTION;
239 };
240 
241 #endif
VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS
#define VTK_DENSITY_ESTIMATE_RELATIVE_RADIUS
Definition: vtkPointDensityFilter.h:82
vtkPointDensityFilter::ComputeModelBounds
void ComputeModelBounds(vtkDataSet *input, vtkImageData *output, vtkInformation *outInfo)
vtkPointDensityFilter::~vtkPointDensityFilter
~vtkPointDensityFilter()
vtkPointDensityFilter::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called in response to a REQUEST_DATA request from the executive.
vtkPointDensityFilter::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Set / get the dimensions of the sampling volume.
VTK_DENSITY_FORM_VOLUME_NORM
#define VTK_DENSITY_FORM_VOLUME_NORM
Definition: vtkPointDensityFilter.h:84
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkPointDensityFilter::DensityForm
int DensityForm
Definition: vtkPointDensityFilter.h:219
VTK_DENSITY_FORM_NPTS
#define VTK_DENSITY_FORM_NPTS
Definition: vtkPointDensityFilter.h:85
vtkImageAlgorithm.h
vtkPointDensityFilter::SetLocator
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
VTK_DENSITY_ESTIMATE_FIXED_RADIUS
#define VTK_DENSITY_ESTIMATE_FIXED_RADIUS
Definition: vtkPointDensityFilter.h:81
vtkPointDensityFilter::Radius
double Radius
Definition: vtkPointDensityFilter.h:221
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:41
vtkPointDensityFilter::Locator
vtkAbstractPointLocator * Locator
Definition: vtkPointDensityFilter.h:223
vtkPointDensityFilter::DensityEstimate
int DensityEstimate
Definition: vtkPointDensityFilter.h:218
vtkPointDensityFilter::SetDensityEstimateToFixedRadius
void SetDensityEstimateToFixedRadius()
Definition: vtkPointDensityFilter.h:145
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkPointDensityFilter::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkPointDensityFilter::GetDensityEstimateAsString
const char * GetDensityEstimateAsString()
vtkPointDensityFilter
produce density field from input point cloud
Definition: vtkPointDensityFilter.h:90
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPointDensityFilter::RelativeRadius
double RelativeRadius
Definition: vtkPointDensityFilter.h:220
vtkPointDensityFilter::ScalarWeighting
bool ScalarWeighting
Definition: vtkPointDensityFilter.h:222
vtkPointDensityFilter::SetDensityEstimateToRelativeRadius
void SetDensityEstimateToRelativeRadius()
Definition: vtkPointDensityFilter.h:147
vtkPointDensityFilter::SetDensityFormToNumberOfPoints
void SetDensityFormToNumberOfPoints()
Definition: vtkPointDensityFilter.h:163
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPointDensityFilter::AdjustDistance
double AdjustDistance
Definition: vtkPointDensityFilter.h:216
vtkPointDensityFilter::SetDensityFormToVolumeNormalized
void SetDensityFormToVolumeNormalized()
Definition: vtkPointDensityFilter.h:161
vtkAbstractPointLocator
abstract class to quickly locate points in 3-space
Definition: vtkAbstractPointLocator.h:42
vtkPointDensityFilter::GetDensityFormAsString
const char * GetDensityFormAsString()
vtkPointDensityFilter::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkPointDensityFilter::New
static vtkPointDensityFilter * New()
Standard methods for instantiating, obtaining type information, and printing information.
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163
vtkPointDensityFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkPointDensityFilter::SetSampleDimensions
void SetSampleDimensions(int dim[3])
vtkPointDensityFilter::vtkPointDensityFilter
vtkPointDensityFilter()