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 
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkPointSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPointSetAlgorithm.h:43
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkPointSetAlgorithm.h
vtkCenterOfMass
Find the center of mass of a set of points.
Definition: vtkCenterOfMass.h:40
vtkCenterOfMass::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkX3D::center
@ center
Definition: vtkX3D.h:230
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkFiltersCoreModule.h
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
VTKFILTERSCORE_EXPORT
#define VTKFILTERSCORE_EXPORT
Definition: vtkFiltersCoreModule.h:15
vtkCenterOfMass::ComputeCenterOfMass
static void ComputeCenterOfMass(vtkPoints *input, vtkDataArray *scalars, double center[3])
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCenterOfMass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkCenterOfMass::New
static vtkCenterOfMass * New()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkCenterOfMass::vtkCenterOfMass
vtkCenterOfMass()