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 =========================================================================*/
52 #ifndef vtkMassProperties_h
53 #define vtkMassProperties_h
54 
55 #include "vtkFiltersCoreModule.h" // For export macro
56 #include "vtkPolyDataAlgorithm.h"
57 
58 class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
59 {
60 public:
65 
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
72  double GetVolume()
73  {
74  this->Update();
75  return this->Volume;
76  }
77 
87  {
88  this->Update();
89  return this->VolumeProjected;
90  }
91 
95  double GetVolumeX()
96  {
97  this->Update();
98  return this->VolumeX;
99  }
100  double GetVolumeY()
101  {
102  this->Update();
103  return this->VolumeY;
104  }
105  double GetVolumeZ()
106  {
107  this->Update();
108  return this->VolumeZ;
109  }
110 
115  double GetKx()
116  {
117  this->Update();
118  return this->Kx;
119  }
120  double GetKy()
121  {
122  this->Update();
123  return this->Ky;
124  }
125  double GetKz()
126  {
127  this->Update();
128  return this->Kz;
129  }
130 
134  double GetSurfaceArea()
135  {
136  this->Update();
137  return this->SurfaceArea;
138  }
139 
143  double GetMinCellArea()
144  {
145  this->Update();
146  return this->MinCellArea;
147  }
148 
152  double GetMaxCellArea()
153  {
154  this->Update();
155  return this->MaxCellArea;
156  }
157 
164  {
165  this->Update();
166  return this->NormalizedShapeIndex;
167  }
168 
169 protected:
171  ~vtkMassProperties() override;
172 
173  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
174  vtkInformationVector* outputVector) override;
175 
176  double SurfaceArea;
177  double MinCellArea;
178  double MaxCellArea;
179  double Volume;
180  double VolumeProjected; // == Projected area of triangles * average z values
181  double VolumeX;
182  double VolumeY;
183  double VolumeZ;
184  double Kx;
185  double Ky;
186  double Kz;
188 
189 private:
190  vtkMassProperties(const vtkMassProperties&) = delete;
191  void operator=(const vtkMassProperties&) = delete;
192 };
193 
194 #endif
virtual void Update()
Bring this algorithm's outputs up-to-date.
a simple class to control print indentation
Definition: vtkIndent.h:49
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.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
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.