VTK
|
Find the center of mass of a set of points. More...
#include <vtkCenterOfMass.h>
Public Types | |
typedef vtkPointSetAlgorithm | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkCenterOfMass * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetCenter (double, double, double) |
virtual void | SetCenter (double[3]) |
virtual double * | GetCenter () |
virtual void | GetCenter (double &, double &, double &) |
virtual void | GetCenter (double[3]) |
virtual void | SetUseScalarsAsWeights (bool) |
virtual bool | GetUseScalarsAsWeights () |
Static Public Member Functions | |
static vtkCenterOfMass * | New () |
static int | IsTypeOf (const char *type) |
static vtkCenterOfMass * | SafeDownCast (vtkObjectBase *o) |
static void | ComputeCenterOfMass (vtkPoints *input, vtkDataArray *scalars, double center[3]) |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkCenterOfMass () | |
int | RequestData (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) |
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.
Definition at line 39 of file vtkCenterOfMass.h.
Reimplemented from vtkPointSetAlgorithm.
Definition at line 43 of file vtkCenterOfMass.h.
vtkCenterOfMass::vtkCenterOfMass | ( | ) | [protected] |
static vtkCenterOfMass* vtkCenterOfMass::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkPointSetAlgorithm.
static int vtkCenterOfMass::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkPointSetAlgorithm.
virtual int vtkCenterOfMass::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkPointSetAlgorithm.
static vtkCenterOfMass* vtkCenterOfMass::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkPointSetAlgorithm.
virtual vtkObjectBase* vtkCenterOfMass::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkPointSetAlgorithm.
vtkCenterOfMass* vtkCenterOfMass::NewInstance | ( | ) | const |
Reimplemented from vtkPointSetAlgorithm.
void vtkCenterOfMass::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkPointSetAlgorithm.
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 * | , |
vtkInformationVector ** | , | ||
vtkInformationVector * | |||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkPointSetAlgorithm.