VTK  9.2.6
vtkMultiObjectMassProperties.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMultiObjectMassProperties.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=========================================================================*/
91#ifndef vtkMultiObjectMassProperties_h
92#define vtkMultiObjectMassProperties_h
93
94#include "vtkFiltersCoreModule.h" // For export macro
96
97class vtkDoubleArray;
99class vtkIdTypeArray;
100
101class VTKFILTERSCORE_EXPORT vtkMultiObjectMassProperties : public vtkPolyDataAlgorithm
102{
103public:
105
110 void PrintSelf(ostream& os, vtkIndent indent) override;
112
114
120 vtkSetMacro(SkipValidityCheck, vtkTypeBool);
121 vtkGetMacro(SkipValidityCheck, vtkTypeBool);
122 vtkBooleanMacro(SkipValidityCheck, vtkTypeBool);
124
126
131 vtkSetStdStringFromCharMacro(ObjectIdsArrayName);
132 vtkGetCharFromStdStringMacro(ObjectIdsArrayName);
134
141 vtkIdType GetNumberOfObjects() { return this->NumberOfObjects; }
142
147 vtkTypeBool GetAllValid() { return this->AllValid; }
148
153 double GetTotalVolume() { return this->TotalVolume; }
154
159 double GetTotalArea() { return this->TotalArea; }
160
161protected:
164
166 vtkInformationVector* outputVector) override;
167
168 // Data members supporting API
172 double TotalArea;
173
174 // Internal data members supporting algorithm execution
175 vtkIdType NumberOfObjects; // number of objects identified
176 vtkIdTypeArray* ObjectIds; // for each input polygon, the object id that the polygon is in
177 std::string ObjectIdsArrayName; // the array name of ObjectIds.
178
179 vtkUnsignedCharArray* ObjectValidity; // is it a valid object?
180 vtkDoubleArray* ObjectVolumes; // what is the object volume (if valid)?
181 vtkDoubleArray* ObjectAreas; // what is the total object area?
182 vtkDoubleArray* ObjectCentroids; // what is the object centroid
183
184 vtkIdList* CellNeighbors; // avoid repetitive new/delete
185 vtkIdList* Wave; // processing wave
187
188 // Connected traversal to identify objects
190 vtkPolyData* output, vtkIdType* objectIds, vtkDataArray* valid, unsigned char* orient);
191
192private:
194 void operator=(const vtkMultiObjectMassProperties&) = delete;
195};
196
197#endif
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:31
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:34
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
Definition vtkPolyData.h:85
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:69
int vtkIdType
Definition vtkType.h:332