VTK  9.7.1
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
31 #ifndef vtkMassProperties_h
32 #define vtkMassProperties_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMassProperties : public vtkPolyDataAlgorithm
40 {
41 public:
45  static vtkMassProperties* New();
46 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  double GetVolume()
54  {
55  this->Update();
56  return this->Volume;
57  }
58 
68  {
69  this->Update();
70  return this->VolumeProjected;
71  }
72 
76  double GetVolumeX()
77  {
78  this->Update();
79  return this->VolumeX;
80  }
81  double GetVolumeY()
82  {
83  this->Update();
84  return this->VolumeY;
85  }
86  double GetVolumeZ()
87  {
88  this->Update();
89  return this->VolumeZ;
90  }
91 
96  double GetKx()
97  {
98  this->Update();
99  return this->Kx;
100  }
101  double GetKy()
102  {
103  this->Update();
104  return this->Ky;
105  }
106  double GetKz()
107  {
108  this->Update();
109  return this->Kz;
110  }
111 
115  double GetSurfaceArea()
116  {
117  this->Update();
118  return this->SurfaceArea;
119  }
120 
124  double GetMinCellArea()
125  {
126  this->Update();
127  return this->MinCellArea;
128  }
129 
133  double GetMaxCellArea()
134  {
135  this->Update();
136  return this->MaxCellArea;
137  }
138 
145  {
146  this->Update();
147  return this->NormalizedShapeIndex;
148  }
149 
150 protected:
152  ~vtkMassProperties() override;
153 
154  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
155  vtkInformationVector* outputVector) override;
156 
157  double SurfaceArea;
158  double MinCellArea;
159  double MaxCellArea;
160  double Volume;
161  double VolumeProjected; // == Projected area of triangles * average z values
162  double VolumeX;
163  double VolumeY;
164  double VolumeZ;
165  double Kx;
166  double Ky;
167  double Kz;
169 
170 private:
171  vtkMassProperties(const vtkMassProperties&) = delete;
172  void operator=(const vtkMassProperties&) = delete;
173 };
174 
175 VTK_ABI_NAMESPACE_END
176 #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:28
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
virtual bool Update()
Bring this algorithm's outputs up-to-date.
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.