VTK  9.2.6
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=========================================================================*/
62#ifndef vtkMassProperties_h
63#define vtkMassProperties_h
64
65#include "vtkFiltersCoreModule.h" // For export macro
67
68class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
69{
70public:
75
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
82 double GetVolume()
83 {
84 this->Update();
85 return this->Volume;
86 }
87
97 {
98 this->Update();
99 return this->VolumeProjected;
100 }
101
105 double GetVolumeX()
106 {
107 this->Update();
108 return this->VolumeX;
109 }
110 double GetVolumeY()
111 {
112 this->Update();
113 return this->VolumeY;
114 }
115 double GetVolumeZ()
116 {
117 this->Update();
118 return this->VolumeZ;
119 }
120
125 double GetKx()
126 {
127 this->Update();
128 return this->Kx;
129 }
130 double GetKy()
131 {
132 this->Update();
133 return this->Ky;
134 }
135 double GetKz()
136 {
137 this->Update();
138 return this->Kz;
139 }
140
145 {
146 this->Update();
147 return this->SurfaceArea;
148 }
149
154 {
155 this->Update();
156 return this->MinCellArea;
157 }
158
163 {
164 this->Update();
165 return this->MaxCellArea;
166 }
167
174 {
175 this->Update();
176 return this->NormalizedShapeIndex;
177 }
178
179protected:
182
184 vtkInformationVector* outputVector) override;
185
189 double Volume;
190 double VolumeProjected; // == Projected area of triangles * average z values
191 double VolumeX;
192 double VolumeY;
193 double VolumeZ;
194 double Kx;
195 double Ky;
196 double Kz;
198
199private:
200 vtkMassProperties(const vtkMassProperties&) = delete;
201 void operator=(const vtkMassProperties&) = delete;
202};
203
204#endif
virtual void Update()
Bring this algorithm's outputs up-to-date.
a simple class to control print indentation
Definition: vtkIndent.h:119
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.