VTK
dox/Graphics/vtkCenterOfMass.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCenterOfMass.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00030 #ifndef __vtkCenterOfMass_h
00031 #define __vtkCenterOfMass_h
00032 
00033 #include "vtkPointSetAlgorithm.h"
00034 
00035 class vtkPoints;
00036 class vtkDataArray;
00037 
00038 class VTK_GRAPHICS_EXPORT vtkCenterOfMass : public vtkPointSetAlgorithm
00039 {
00040 public:
00041   static vtkCenterOfMass *New();
00042   vtkTypeMacro(vtkCenterOfMass,vtkPointSetAlgorithm);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00046 
00047   vtkSetVector3Macro(Center,double);
00048   vtkGetVector3Macro(Center,double);
00050 
00052 
00053   vtkSetMacro(UseScalarsAsWeights, bool);
00054   vtkGetMacro(UseScalarsAsWeights, bool);
00056 
00058 
00065   static void ComputeCenterOfMass(
00066     vtkPoints* input, vtkDataArray *scalars, double center[3]);
00068 
00069 protected:
00070   vtkCenterOfMass();
00071 
00072   int RequestData(vtkInformation* request,
00073                   vtkInformationVector** inputVector,
00074                   vtkInformationVector* outputVector );
00075 
00076 private:
00077 
00078   vtkCenterOfMass(const vtkCenterOfMass&);  // Not implemented.
00079   void operator=(const vtkCenterOfMass&);  // Not implemented.
00080 
00081   bool UseScalarsAsWeights;
00082   double Center[3];
00083 };
00084 
00085 #endif