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 "vtkFiltersCoreModule.h" // For export macro
34 #include "vtkPointSetAlgorithm.h"
35 
36 class vtkPoints;
37 class vtkDataArray;
38 
40 {
41 public:
42  static vtkCenterOfMass *New();
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
48  vtkSetVector3Macro(Center,double);
49  vtkGetVector3Macro(Center,double);
51 
53 
54  vtkSetMacro(UseScalarsAsWeights, bool);
55  vtkGetMacro(UseScalarsAsWeights, bool);
57 
59 
66  static void ComputeCenterOfMass(
67  vtkPoints* input, vtkDataArray *scalars, double center[3]);
69 
70 protected:
72 
73  int RequestData(vtkInformation* request,
74  vtkInformationVector** inputVector,
75  vtkInformationVector* outputVector );
76 
77 private:
78 
79  vtkCenterOfMass(const vtkCenterOfMass&); // Not implemented.
80  void operator=(const vtkCenterOfMass&); // Not implemented.
81 
82  bool UseScalarsAsWeights;
83  double Center[3];
84 };
85 
86 #endif
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Store vtkAlgorithm input/output information.
#define VTKFILTERSCORE_EXPORT
Find the center of mass of a set of points.
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
Superclass for algorithms that produce output of the same type as input.
static vtkPointSetAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:38