VTK
vtkCenterOfMass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCenterOfMass.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef __vtkCenterOfMass_h
31 #define __vtkCenterOfMass_h
32 
33 #include "vtkPointSetAlgorithm.h"
34 
35 class vtkPoints;
36 class vtkDataArray;
37 
39 {
40 public:
41  static vtkCenterOfMass *New();
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
47  vtkSetVector3Macro(Center,double);
48  vtkGetVector3Macro(Center,double);
50 
52 
53  vtkSetMacro(UseScalarsAsWeights, bool);
54  vtkGetMacro(UseScalarsAsWeights, bool);
56 
58 
65  static void ComputeCenterOfMass(
66  vtkPoints* input, vtkDataArray *scalars, double center[3]);
68 
69 protected:
71 
72  int RequestData(vtkInformation* request,
73  vtkInformationVector** inputVector,
74  vtkInformationVector* outputVector );
75 
76 private:
77 
78  vtkCenterOfMass(const vtkCenterOfMass&); // Not implemented.
79  void operator=(const vtkCenterOfMass&); // Not implemented.
80 
81  bool UseScalarsAsWeights;
82  double Center[3];
83 };
84 
85 #endif