VTK  9.3.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 
37 VTK_ABI_NAMESPACE_BEGIN
38 class VTKFILTERSCORE_EXPORT vtkMassProperties : public vtkPolyDataAlgorithm
39 {
40 public:
44  static vtkMassProperties* New();
45 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  double GetVolume()
53  {
54  this->Update();
55  return this->Volume;
56  }
57 
67  {
68  this->Update();
69  return this->VolumeProjected;
70  }
71 
75  double GetVolumeX()
76  {
77  this->Update();
78  return this->VolumeX;
79  }
80  double GetVolumeY()
81  {
82  this->Update();
83  return this->VolumeY;
84  }
85  double GetVolumeZ()
86  {
87  this->Update();
88  return this->VolumeZ;
89  }
90 
95  double GetKx()
96  {
97  this->Update();
98  return this->Kx;
99  }
100  double GetKy()
101  {
102  this->Update();
103  return this->Ky;
104  }
105  double GetKz()
106  {
107  this->Update();
108  return this->Kz;
109  }
110 
114  double GetSurfaceArea()
115  {
116  this->Update();
117  return this->SurfaceArea;
118  }
119 
123  double GetMinCellArea()
124  {
125  this->Update();
126  return this->MinCellArea;
127  }
128 
132  double GetMaxCellArea()
133  {
134  this->Update();
135  return this->MaxCellArea;
136  }
137 
144  {
145  this->Update();
146  return this->NormalizedShapeIndex;
147  }
148 
149 protected:
151  ~vtkMassProperties() override;
152 
153  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
154  vtkInformationVector* outputVector) override;
155 
156  double SurfaceArea;
157  double MinCellArea;
158  double MaxCellArea;
159  double Volume;
160  double VolumeProjected; // == Projected area of triangles * average z values
161  double VolumeX;
162  double VolumeY;
163  double VolumeZ;
164  double Kx;
165  double Ky;
166  double Kz;
168 
169 private:
170  vtkMassProperties(const vtkMassProperties&) = delete;
171  void operator=(const vtkMassProperties&) = delete;
172 };
173 
174 VTK_ABI_NAMESPACE_END
175 #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
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.