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 =========================================================================*/
43 #ifndef vtkMassProperties_h
44 #define vtkMassProperties_h
45 
46 #include "vtkFiltersCoreModule.h" // For export macro
47 #include "vtkPolyDataAlgorithm.h"
48 
49 class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
50 {
51 public:
55  static vtkMassProperties* New();
56 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  double GetVolume()
64  {
65  this->Update();
66  return this->Volume;
67  }
68 
78  {
79  this->Update();
80  return this->VolumeProjected;
81  }
82 
86  double GetVolumeX()
87  {
88  this->Update();
89  return this->VolumeX;
90  }
91  double GetVolumeY()
92  {
93  this->Update();
94  return this->VolumeY;
95  }
96  double GetVolumeZ()
97  {
98  this->Update();
99  return this->VolumeZ;
100  }
101 
106  double GetKx()
107  {
108  this->Update();
109  return this->Kx;
110  }
111  double GetKy()
112  {
113  this->Update();
114  return this->Ky;
115  }
116  double GetKz()
117  {
118  this->Update();
119  return this->Kz;
120  }
121 
125  double GetSurfaceArea()
126  {
127  this->Update();
128  return this->SurfaceArea;
129  }
130 
134  double GetMinCellArea()
135  {
136  this->Update();
137  return this->MinCellArea;
138  }
139 
143  double GetMaxCellArea()
144  {
145  this->Update();
146  return this->MaxCellArea;
147  }
148 
155  {
156  this->Update();
157  return this->NormalizedShapeIndex;
158  }
159 
160 protected:
162  ~vtkMassProperties() override;
163 
164  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
165  vtkInformationVector* outputVector) override;
166 
167  double SurfaceArea;
168  double MinCellArea;
169  double MaxCellArea;
170  double Volume;
171  double VolumeProjected; // == Projected area of triangles * average z values
172  double VolumeX;
173  double VolumeY;
174  double VolumeZ;
175  double Kx;
176  double Ky;
177  double Kz;
179 
180 private:
181  vtkMassProperties(const vtkMassProperties&) = delete;
182  void operator=(const vtkMassProperties&) = delete;
183 };
184 
185 #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:39
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.