VTK  9.1.0
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=========================================================================*/
49#ifndef vtkMassProperties_h
50#define vtkMassProperties_h
51
52#include "vtkFiltersCoreModule.h" // For export macro
54
55class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
56{
57public:
62
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
69 double GetVolume()
70 {
71 this->Update();
72 return this->Volume;
73 }
74
84 {
85 this->Update();
86 return this->VolumeProjected;
87 }
88
92 double GetVolumeX()
93 {
94 this->Update();
95 return this->VolumeX;
96 }
97 double GetVolumeY()
98 {
99 this->Update();
100 return this->VolumeY;
101 }
102 double GetVolumeZ()
103 {
104 this->Update();
105 return this->VolumeZ;
106 }
107
112 double GetKx()
113 {
114 this->Update();
115 return this->Kx;
116 }
117 double GetKy()
118 {
119 this->Update();
120 return this->Ky;
121 }
122 double GetKz()
123 {
124 this->Update();
125 return this->Kz;
126 }
127
132 {
133 this->Update();
134 return this->SurfaceArea;
135 }
136
141 {
142 this->Update();
143 return this->MinCellArea;
144 }
145
150 {
151 this->Update();
152 return this->MaxCellArea;
153 }
154
161 {
162 this->Update();
163 return this->NormalizedShapeIndex;
164 }
165
166protected:
169
171 vtkInformationVector* outputVector) override;
172
176 double Volume;
177 double VolumeProjected; // == Projected area of triangles * average z values
178 double VolumeX;
179 double VolumeY;
180 double VolumeZ;
181 double Kx;
182 double Ky;
183 double Kz;
185
186private:
187 vtkMassProperties(const vtkMassProperties&) = delete;
188 void operator=(const vtkMassProperties&) = delete;
189};
190
191#endif
virtual void Update()
Bring this algorithm's outputs up-to-date.
a simple class to control print indentation
Definition: vtkIndent.h:43
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.
static vtkMassProperties * New()
Constructs with initial values of zero.
double GetVolumeX()
Compute and return the volume projected on to each axis aligned plane.
double GetMinCellArea()
Compute and return the min cell area.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
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.