1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkPointSetStreamer
* @brief stream points as buckets
*
* vtkPointSetStreamer is a filter that sorts points into buckets and it returns the points
* included in the chosen bucket. The bucket is chosen by setting the BucketId. The purpose
* of this class is to allow streaming of points. The bucket size is determined by the
* NumberOfPointsPerBucket.
*
* The typical usage is to call this filter the first time to perform the sorting and get the points
* in the first bucket and then to call it again to get the points in the remaining buckets. The
* sorting is performed only the first time, assuming that the dataset or NumberOfPointsPerBucket
* don't change. The number of buckets can be obtained by calling GetNumberOfBuckets.
*
* @sa vtkPointSetToOctreeImageFilter vtkStaticPointLocator
*/
#ifndef vtkPointSetStreamer_h
#define vtkPointSetStreamer_h
#include "vtkFiltersGeometryPreviewModule.h" // For export macro
#include "vtkPolyDataAlgorithm.h"
VTK_ABI_NAMESPACE_BEGIN
class vtkStaticPointLocator;
class VTKFILTERSGEOMETRYPREVIEW_EXPORT vtkPointSetStreamer : public vtkPolyDataAlgorithm
{
public:
vtkTypeMacro(vtkPointSetStreamer, vtkPolyDataAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;
static vtkPointSetStreamer* New();
///@{
/**
* Set/Get the average number of points in each bucket.
* This data member is used to determine the number of buckets.
*
* The default is 1.
*/
vtkSetClampMacro(NumberOfPointsPerBucket, int, 1, VTK_INT_MAX);
vtkGetMacro(NumberOfPointsPerBucket, int);
///@}
///@{
/**
* Set/Get the bucket id to stream.
* This data member is used to determine the number of buckets.
*
* The default is 0.
*/
vtkSetClampMacro(BucketId, vtkIdType, 0, VTK_ID_MAX);
vtkGetMacro(BucketId, vtkIdType);
///@}
/**
* Get the number of buckets.
*
* Note: This method must be called after the first pass.
*/
vtkGetMacro(NumberOfBuckets, vtkIdType);
///@{
/**
* Set/Get if a cell array of vertices will be created.
*
* The default is on.
*/
vtkSetMacro(CreateVerticesCellArray, bool);
vtkGetMacro(CreateVerticesCellArray, bool);
vtkBooleanMacro(CreateVerticesCellArray, bool);
///@}
protected:
vtkPointSetStreamer();
~vtkPointSetStreamer() override;
int FillInputPortInformation(int port, vtkInformation* info) override;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
private:
vtkPointSetStreamer(const vtkPointSetStreamer&) = delete;
void operator=(const vtkPointSetStreamer&) = delete;
int NumberOfPointsPerBucket = 1;
vtkIdType BucketId = 0;
vtkIdType NumberOfBuckets = 0;
bool CreateVerticesCellArray = true;
vtkNew<vtkStaticPointLocator> PointLocator;
};
VTK_ABI_NAMESPACE_END
#endif // vtkPointSetStreamer_h
|