VTK
vtkMassProperties.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMassProperties.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 =========================================================================*/
39 #ifndef vtkMassProperties_h
40 #define vtkMassProperties_h
41 
42 #include "vtkFiltersCoreModule.h" // For export macro
43 #include "vtkPolyDataAlgorithm.h"
44 
45 class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
46 {
47 public:
52 
54  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55 
59  double GetVolume() {this->Update(); return this->Volume;}
60 
69  double GetVolumeProjected() {this->Update(); return this->VolumeProjected;}
70 
74  double GetVolumeX() {this->Update(); return this->VolumeX;}
75  double GetVolumeY() {this->Update(); return this->VolumeY;}
76  double GetVolumeZ() {this->Update(); return this->VolumeZ;}
77 
82  double GetKx() {this->Update(); return this->Kx;}
83  double GetKy() {this->Update(); return this->Ky;}
84  double GetKz() {this->Update(); return this->Kz;}
85 
89  double GetSurfaceArea() {this->Update(); return this->SurfaceArea;}
90 
94  double GetMinCellArea() {this->Update(); return this->MinCellArea;}
95 
99  double GetMaxCellArea() {this->Update(); return this->MaxCellArea;}
100 
107  {this->Update(); return this->NormalizedShapeIndex;}
108 
109 protected:
111  ~vtkMassProperties() VTK_OVERRIDE;
112 
113  int RequestData(vtkInformation* request,
114  vtkInformationVector** inputVector,
115  vtkInformationVector* outputVector) VTK_OVERRIDE;
116 
117  double SurfaceArea;
118  double MinCellArea;
119  double MaxCellArea;
120  double Volume;
121  double VolumeProjected; // == Projected area of triangles * average z values
122  double VolumeX;
123  double VolumeY;
124  double VolumeZ;
125  double Kx;
126  double Ky;
127  double Kz;
128  double NormalizedShapeIndex;
129 
130 private:
131  vtkMassProperties(const vtkMassProperties&) VTK_DELETE_FUNCTION;
132  void operator=(const vtkMassProperties&) VTK_DELETE_FUNCTION;
133 };
134 
135 #endif
136 
137 
virtual void Update()
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
estimate volume, area, shape index of triangle mesh
double GetSurfaceArea()
Compute and return the area.
double GetVolumeProjected()
Compute and return the projected volume.
double GetNormalizedShapeIndex()
Compute and return the normalized shape index.
double GetVolumeX()
Compute and return the volume projected on to each axis aligned plane.
double GetMinCellArea()
Compute and return the min cell area.
static vtkMassProperties * New()
Constructs with initial values of zero.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double GetVolume()
Compute and return the volume.
~vtkMassProperties() override
double GetKx()
Compute and return the weighting factors for the maximum unit normal component (MUNC).
double GetMaxCellArea()
Compute and return the max cell area.
Superclass for algorithms that produce only polydata as output.