VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkCenterOfMass Class Reference

Find the center of mass of a set of points. More...

#include <vtkCenterOfMass.h>

Inherits vtkPointSetAlgorithm.

Public Types

typedef vtkPointSetAlgorithm Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkCenterOfMassNewInstance () 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 vtkCenterOfMassNew ()
 
static int IsTypeOf (const char *type)
 
static vtkCenterOfMassSafeDownCast (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)
 

Detailed Description

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.

Member Typedef Documentation

typedef vtkPointSetAlgorithm vtkCenterOfMass::Superclass

Definition at line 43 of file vtkCenterOfMass.h.

Constructor & Destructor Documentation

vtkCenterOfMass::vtkCenterOfMass ( )
protected

Member Function Documentation

static vtkCenterOfMass* vtkCenterOfMass::New ( )
static
static int vtkCenterOfMass::IsTypeOf ( const char *  type)
static
virtual int vtkCenterOfMass::IsA ( const char *  type)
virtual
static vtkCenterOfMass* vtkCenterOfMass::SafeDownCast ( vtkObjectBase *  o)
static
virtual vtkObjectBase* vtkCenterOfMass::NewInstanceInternal ( ) const
protectedvirtual
vtkCenterOfMass* vtkCenterOfMass::NewInstance ( ) const
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: