Find the center of mass of a set of points.
More...
#include <vtkCenterOfMass.h>
Inherits vtkPointSetAlgorithm.
Find the center of mass of a set of points.
vtkCenterOfMass finds the "center of mass" of a vtkPointSet (vtkPolyData or vtkUnstructuredGrid). Optionally, the user can specify to use the scalars as weights in the computation. If this option, UseScalarsAsWeights, is off, each point contributes equally in the calculation.
You must ensure Update() has been called before GetCenter will produce a valid value.
- Tests:
- vtkCenterOfMass (Tests)
Definition at line 39 of file vtkCenterOfMass.h.
vtkCenterOfMass::vtkCenterOfMass |
( |
| ) |
|
|
protected |
static int vtkCenterOfMass::IsTypeOf |
( |
const char * |
type | ) |
|
|
static |
virtual int vtkCenterOfMass::IsA |
( |
const char * |
type | ) |
|
|
virtual |
virtual vtkObjectBase* vtkCenterOfMass::NewInstanceInternal |
( |
| ) |
const |
|
protectedvirtual |
void vtkCenterOfMass::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
| |
virtual void vtkCenterOfMass::SetCenter |
( |
double |
, |
|
|
double |
, |
|
|
double |
|
|
) |
| |
|
virtual |
Get the output of the center of mass computation.
virtual void vtkCenterOfMass::SetCenter |
( |
double |
[3] | ) |
|
|
virtual |
Get the output of the center of mass computation.
virtual double* vtkCenterOfMass::GetCenter |
( |
| ) |
|
|
virtual |
Get the output of the center of mass computation.
virtual void vtkCenterOfMass::GetCenter |
( |
double & |
, |
|
|
double & |
, |
|
|
double & |
|
|
) |
| |
|
virtual |
Get the output of the center of mass computation.
virtual void vtkCenterOfMass::GetCenter |
( |
double |
[3] | ) |
|
|
virtual |
Get the output of the center of mass computation.
virtual void vtkCenterOfMass::SetUseScalarsAsWeights |
( |
bool |
| ) |
|
|
virtual |
Set a flag to determine if the points are weighted.
virtual bool vtkCenterOfMass::GetUseScalarsAsWeights |
( |
| ) |
|
|
virtual |
Set a flag to determine if the points are weighted.
static void vtkCenterOfMass::ComputeCenterOfMass |
( |
vtkPoints * |
input, |
|
|
vtkDataArray * |
scalars, |
|
|
double |
center[3] |
|
) |
| |
|
static |
This function is called by RequestData. It exists so that other classes may use this computation without constructing a vtkCenterOfMass object. The scalars can be set to NULL if all points are to be weighted equally. If scalars are used, it is the caller's responsibility to ensure that the number of scalars matches the number of points, and that the sum of the scalars is a positive value.
int vtkCenterOfMass::RequestData |
( |
vtkInformation * |
request, |
|
|
vtkInformationVector ** |
inputVector, |
|
|
vtkInformationVector * |
outputVector |
|
) |
| |
|
protected |
The documentation for this class was generated from the following file: