VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkCenterOfMass Class Reference

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

#include <vtkCenterOfMass.h>

Inheritance diagram for vtkCenterOfMass:
Inheritance graph
[legend]
Collaboration diagram for vtkCenterOfMass:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkPointSetAlgorithm Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetCenter (double, double, double)
virtual void SetCenter (double[3])
virtual doubleGetCenter ()
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 (vtkObject *o)
static void ComputeCenterOfMass (vtkPoints *input, vtkDataArray *scalars, double center[3])

Protected Member Functions

 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 38 of file vtkCenterOfMass.h.


Member Typedef Documentation

Reimplemented from vtkPointSetAlgorithm.

Definition at line 42 of file vtkCenterOfMass.h.


Constructor & Destructor Documentation

vtkCenterOfMass::vtkCenterOfMass ( ) [protected]

Member Function Documentation

static vtkCenterOfMass* vtkCenterOfMass::New ( ) [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkPointSetAlgorithm.

virtual const char* vtkCenterOfMass::GetClassName ( ) [virtual]

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 ( vtkObject o) [static]

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.


The documentation for this class was generated from the following file: