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 =========================================================================*/
40 #ifndef vtkMassProperties_h
41 #define vtkMassProperties_h
42 
43 #include "vtkFiltersCoreModule.h" // For export macro
44 #include "vtkPolyDataAlgorithm.h"
45 
46 class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
47 {
48 public:
52  static vtkMassProperties *New();
53 
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
60  double GetVolume() {this->Update(); return this->Volume;}
61 
70  double GetVolumeProjected() {this->Update(); return this->VolumeProjected;}
71 
75  double GetVolumeX() {this->Update(); return this->VolumeX;}
76  double GetVolumeY() {this->Update(); return this->VolumeY;}
77  double GetVolumeZ() {this->Update(); return this->VolumeZ;}
78 
83  double GetKx() {this->Update(); return this->Kx;}
84  double GetKy() {this->Update(); return this->Ky;}
85  double GetKz() {this->Update(); return this->Kz;}
86 
90  double GetSurfaceArea() {this->Update(); return this->SurfaceArea;}
91 
95  double GetMinCellArea() {this->Update(); return this->MinCellArea;}
96 
100  double GetMaxCellArea() {this->Update(); return this->MaxCellArea;}
101 
108  {this->Update(); return this->NormalizedShapeIndex;}
109 
110 protected:
112  ~vtkMassProperties() override;
113 
114  int RequestData(vtkInformation* request,
115  vtkInformationVector** inputVector,
116  vtkInformationVector* outputVector) override;
117 
118  double SurfaceArea;
119  double MinCellArea;
120  double MaxCellArea;
121  double Volume;
122  double VolumeProjected; // == Projected area of triangles * average z values
123  double VolumeX;
124  double VolumeY;
125  double VolumeZ;
126  double Kx;
127  double Ky;
128  double Kz;
130 
131 private:
132  vtkMassProperties(const vtkMassProperties&) = delete;
133  void operator=(const vtkMassProperties&) = delete;
134 };
135 
136 #endif
double GetMaxCellArea()
Compute and return the max cell area.
double GetMinCellArea()
Compute and return the min cell area.
Store vtkAlgorithm input/output information.
double GetVolume()
Compute and return the volume.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
double GetNormalizedShapeIndex()
Compute and return the normalized shape index.
double GetVolumeProjected()
Compute and return the projected volume.
double GetKx()
Compute and return the weighting factors for the maximum unit normal component (MUNC).
double GetSurfaceArea()
Compute and return the area.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
double GetVolumeX()
Compute and return the volume projected on to each axis aligned plane.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void Update()
Bring this algorithm's outputs up-to-date.
Store zero or more vtkInformation instances.
estimate volume, area, shape index of triangle mesh
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.