VTK  9.6.1
vtkCenterOfMass.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
18
19#ifndef vtkCenterOfMass_h
20#define vtkCenterOfMass_h
21
22#include "vtkFiltersCoreModule.h" // For export macro
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkPoints;
28class vtkDataArray;
29
30class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkCenterOfMass : public vtkPointSetAlgorithm
31{
32public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
38
41 vtkSetVector3Macro(Center, double);
42 vtkGetVector3Macro(Center, double);
44
46
49 vtkSetMacro(UseScalarsAsWeights, bool);
50 vtkGetMacro(UseScalarsAsWeights, bool);
52
62 static void ComputeCenterOfMass(vtkPoints* input, vtkDataArray* scalars, double center[3]);
63
64protected:
66
67 int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
68 vtkInformationVector* outputVector) override;
69
70private:
71 vtkCenterOfMass(const vtkCenterOfMass&) = delete;
72 void operator=(const vtkCenterOfMass&) = delete;
73
74 bool UseScalarsAsWeights;
75 double Center[3];
76};
77
78VTK_ABI_NAMESPACE_END
79#endif
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
static void ComputeCenterOfMass(vtkPoints *input, vtkDataArray *scalars, double center[3])
This function is called by RequestData.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCenterOfMass * New()
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:30
#define vtkDataArray
#define VTK_MARSHALAUTO