VTK: Filters/Core/vtkCenterOfMass.h Source File

| VTK 9.3.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
28 #ifndef vtkCenterOfMass_h
29 #define vtkCenterOfMass_h
30
31 #include "vtkFiltersCoreModule.h" // For export macro
32 #include "vtkPointSetAlgorithm.h"
33
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkPoints;
36 class vtkDataArray;
37
38 class VTKFILTERSCORE_EXPORT vtkCenterOfMass : public vtkPointSetAlgorithm
39 {
40 public:
41 static vtkCenterOfMass* New();
42 vtkTypeMacro(vtkCenterOfMass, vtkPointSetAlgorithm);
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
46
49 vtkSetVector3Macro(Center, double);
50 vtkGetVector3Macro(Center, double);
52
54
57 vtkSetMacro(UseScalarsAsWeights, bool);
58 vtkGetMacro(UseScalarsAsWeights, bool);
60
70 static void ComputeCenterOfMass(vtkPoints* input, vtkDataArray* scalars, double center[3]);
71
72 protected:
73 vtkCenterOfMass();
74
75 int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
76 vtkInformationVector* outputVector) override;
77
78 private:
79 vtkCenterOfMass(const vtkCenterOfMass&) = delete;
80 void operator=(const vtkCenterOfMass&) = delete;
81
82 bool UseScalarsAsWeights;
83 double Center[3];
84 };
85
86 VTK_ABI_NAMESPACE_END
87 #endif
vtkCenterOfMass
Find the center of mass of a set of points.
Definition: vtkCenterOfMass.h:39
vtkCenterOfMass::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkCenterOfMass::New
static vtkCenterOfMass * New()
vtkCenterOfMass::ComputeCenterOfMass
static void ComputeCenterOfMass(vtkPoints *input, vtkDataArray *scalars, double center[3])
This function is called by RequestData.
vtkCenterOfMass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCenterOfMass::vtkCenterOfMass
vtkCenterOfMass()
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkPointSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPointSetAlgorithm.h:33
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkX3D::center
@ center
Definition: vtkX3D.h:230
vtkPointSetAlgorithm.h