VTK  9.5.20250927
vtkMultiObjectMassProperties.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
82#ifndef vtkMultiObjectMassProperties_h
83#define vtkMultiObjectMassProperties_h
84
85#include "vtkFiltersCoreModule.h" // For export macro
87#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
88
89VTK_ABI_NAMESPACE_BEGIN
90class vtkDoubleArray;
92class vtkIdTypeArray;
93
96{
97public:
99
104 void PrintSelf(ostream& os, vtkIndent indent) override;
106
108
114 vtkSetMacro(SkipValidityCheck, vtkTypeBool);
115 vtkGetMacro(SkipValidityCheck, vtkTypeBool);
116 vtkBooleanMacro(SkipValidityCheck, vtkTypeBool);
118
120
125 vtkSetStdStringFromCharMacro(ObjectIdsArrayName);
126 vtkGetCharFromStdStringMacro(ObjectIdsArrayName);
128
135 vtkIdType GetNumberOfObjects() { return this->NumberOfObjects; }
136
141 vtkTypeBool GetAllValid() { return this->AllValid; }
142
147 double GetTotalVolume() { return this->TotalVolume; }
148
153 double GetTotalArea() { return this->TotalArea; }
154
155protected:
158
160 vtkInformationVector* outputVector) override;
161
162 // Data members supporting API
166 double TotalArea;
167
168 // Internal data members supporting algorithm execution
169 vtkIdType NumberOfObjects; // number of objects identified
170 vtkIdTypeArray* ObjectIds; // for each input polygon, the object id that the polygon is in
171 std::string ObjectIdsArrayName; // the array name of ObjectIds.
172
173 vtkUnsignedCharArray* ObjectValidity; // is it a valid object?
174 vtkDoubleArray* ObjectVolumes; // what is the object volume (if valid)?
175 vtkDoubleArray* ObjectAreas; // what is the total object area?
176 vtkDoubleArray* ObjectCentroids; // what is the object centroid
177
178 vtkIdList* CellNeighbors; // avoid repetitive new/delete
179 vtkIdList* Wave; // processing wave
181
182 // Connected traversal to identify objects
184 vtkPolyData* output, vtkIdType* objectIds, vtkDataArray* valid, unsigned char* orient);
185
186private:
188 void operator=(const vtkMultiObjectMassProperties&) = delete;
189};
190
191VTK_ABI_NAMESPACE_END
192#endif
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:133
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
compute volume and area of objects in a polygonal mesh
vtkSetStdStringFromCharMacro(ObjectIdsArrayName)
Set/Get the name of the ObjectIds array.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
~vtkMultiObjectMassProperties() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type and printing.
vtkGetCharFromStdStringMacro(ObjectIdsArrayName)
Set/Get the name of the ObjectIds array.
void TraverseAndMark(vtkPolyData *output, vtkIdType *objectIds, vtkDataArray *valid, unsigned char *orient)
double GetTotalArea()
Return the summed area of all objects.
vtkIdType GetNumberOfObjects()
Return the number of objects identified.
double GetTotalVolume()
Return the summed volume of all objects.
static vtkMultiObjectMassProperties * New()
Standard methods for construction, type and printing.
vtkTypeBool GetAllValid()
Return whether all objects are valid or not.
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:334
#define VTK_MARSHALAUTO