VTK  9.3.0
vtkMassProperties.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
40 #ifndef vtkMassProperties_h
41 #define vtkMassProperties_h
42 
43 #include "vtkFiltersCoreModule.h" // For export macro
44 #include "vtkPolyDataAlgorithm.h"
45 
46 VTK_ABI_NAMESPACE_BEGIN
47 class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
48 {
49 public:
54 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
61  double GetVolume()
62  {
63  this->Update();
64  return this->Volume;
65  }
66 
76  {
77  this->Update();
78  return this->VolumeProjected;
79  }
80 
84  double GetVolumeX()
85  {
86  this->Update();
87  return this->VolumeX;
88  }
89  double GetVolumeY()
90  {
91  this->Update();
92  return this->VolumeY;
93  }
94  double GetVolumeZ()
95  {
96  this->Update();
97  return this->VolumeZ;
98  }
99 
104  double GetKx()
105  {
106  this->Update();
107  return this->Kx;
108  }
109  double GetKy()
110  {
111  this->Update();
112  return this->Ky;
113  }
114  double GetKz()
115  {
116  this->Update();
117  return this->Kz;
118  }
119 
123  double GetSurfaceArea()
124  {
125  this->Update();
126  return this->SurfaceArea;
127  }
128 
132  double GetMinCellArea()
133  {
134  this->Update();
135  return this->MinCellArea;
136  }
137 
141  double GetMaxCellArea()
142  {
143  this->Update();
144  return this->MaxCellArea;
145  }
146 
153  {
154  this->Update();
155  return this->NormalizedShapeIndex;
156  }
157 
158 protected:
160  ~vtkMassProperties() override;
161 
162  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
163  vtkInformationVector* outputVector) override;
164 
165  double SurfaceArea;
166  double MinCellArea;
167  double MaxCellArea;
168  double Volume;
169  double VolumeProjected; // == Projected area of triangles * average z values
170  double VolumeX;
171  double VolumeY;
172  double VolumeZ;
173  double Kx;
174  double Ky;
175  double Kz;
177 
178 private:
179  vtkMassProperties(const vtkMassProperties&) = delete;
180  void operator=(const vtkMassProperties&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #endif
virtual void Update()
Bring this algorithm's outputs up-to-date.
a simple class to control print indentation
Definition: vtkIndent.h:38
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.