VTK
dox/Filters/Core/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 "vtkFiltersCoreModule.h" // For export macro
00034 #include "vtkPointSetAlgorithm.h"
00035 
00036 class vtkPoints;
00037 class vtkDataArray;
00038 
00039 class VTKFILTERSCORE_EXPORT vtkCenterOfMass : public vtkPointSetAlgorithm
00040 {
00041 public:
00042   static vtkCenterOfMass *New();
00043   vtkTypeMacro(vtkCenterOfMass,vtkPointSetAlgorithm);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00047 
00048   vtkSetVector3Macro(Center,double);
00049   vtkGetVector3Macro(Center,double);
00051 
00053 
00054   vtkSetMacro(UseScalarsAsWeights, bool);
00055   vtkGetMacro(UseScalarsAsWeights, bool);
00057 
00059 
00066   static void ComputeCenterOfMass(
00067     vtkPoints* input, vtkDataArray *scalars, double center[3]);
00069 
00070 protected:
00071   vtkCenterOfMass();
00072 
00073   int RequestData(vtkInformation* request,
00074                   vtkInformationVector** inputVector,
00075                   vtkInformationVector* outputVector );
00076 
00077 private:
00078 
00079   vtkCenterOfMass(const vtkCenterOfMass&);  // Not implemented.
00080   void operator=(const vtkCenterOfMass&);  // Not implemented.
00081 
00082   bool UseScalarsAsWeights;
00083   double Center[3];
00084 };
00085 
00086 #endif