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=========================================================================*/
59#ifndef vtkMassProperties_h
60#define vtkMassProperties_h
61
62#include "vtkFiltersCoreModule.h" // For export macro
64
65class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
66{
67public:
72
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
79 double GetVolume()
80 {
81 this->Update();
82 return this->Volume;
83 }
84
94 {
95 this->Update();
96 return this->VolumeProjected;
97 }
98
102 double GetVolumeX()
103 {
104 this->Update();
105 return this->VolumeX;
106 }
107 double GetVolumeY()
108 {
109 this->Update();
110 return this->VolumeY;
111 }
112 double GetVolumeZ()
113 {
114 this->Update();
115 return this->VolumeZ;
116 }
117
122 double GetKx()
123 {
124 this->Update();
125 return this->Kx;
126 }
127 double GetKy()
128 {
129 this->Update();
130 return this->Ky;
131 }
132 double GetKz()
133 {
134 this->Update();
135 return this->Kz;
136 }
137
142 {
143 this->Update();
144 return this->SurfaceArea;
145 }
146
151 {
152 this->Update();
153 return this->MinCellArea;
154 }
155
160 {
161 this->Update();
162 return this->MaxCellArea;
163 }
164
171 {
172 this->Update();
173 return this->NormalizedShapeIndex;
174 }
175
176protected:
179
181 vtkInformationVector* outputVector) override;
182
186 double Volume;
187 double VolumeProjected; // == Projected area of triangles * average z values
188 double VolumeX;
189 double VolumeY;
190 double VolumeZ;
191 double Kx;
192 double Ky;
193 double Kz;
195
196private:
197 vtkMassProperties(const vtkMassProperties&) = delete;
198 void operator=(const vtkMassProperties&) = delete;
199};
200
201#endif
virtual void Update()
Bring this algorithm's outputs up-to-date.
a simple class to control print indentation
Definition: vtkIndent.h:113
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.