VTK  9.0.1
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 =========================================================================*/
89 #ifndef vtkMultiObjectMassProperties_h
90 #define vtkMultiObjectMassProperties_h
91 
92 #include "vtkFiltersCoreModule.h" // For export macro
93 #include "vtkPolyDataAlgorithm.h"
94 
95 class vtkDoubleArray;
97 class vtkIdTypeArray;
98 
99 class VTKFILTERSCORE_EXPORT vtkMultiObjectMassProperties : public vtkPolyDataAlgorithm
100 {
101 public:
103 
108  void PrintSelf(ostream& os, vtkIndent indent) override;
110 
112 
118  vtkSetMacro(SkipValidityCheck, vtkTypeBool);
119  vtkGetMacro(SkipValidityCheck, vtkTypeBool);
120  vtkBooleanMacro(SkipValidityCheck, vtkTypeBool);
122 
129  vtkIdType GetNumberOfObjects() { return this->NumberOfObjects; }
130 
135  vtkTypeBool GetAllValid() { return this->AllValid; }
136 
141  double GetTotalVolume() { return this->TotalVolume; }
142 
147  double GetTotalArea() { return this->TotalArea; }
148 
149 protected:
152 
153  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
154  vtkInformationVector* outputVector) override;
155 
156  // Data members supporting API
159  double TotalVolume;
160  double TotalArea;
161 
162  // Internal data members supporting algorithm execution
163  vtkIdType NumberOfObjects; // number of objects identified
164  vtkIdTypeArray* ObjectIds; // for each input polygon, the object id that the polygon is in
165 
166  vtkUnsignedCharArray* ObjectValidity; // is it a valid object?
167  vtkDoubleArray* ObjectVolumes; // what is the object volume (if valid)?
168  vtkDoubleArray* ObjectAreas; // what is the total object area?
169 
170  vtkIdList* CellNeighbors; // avoid repetitive new/delete
171  vtkIdList* Wave; // processing wave
173 
174  // Connected traversal to identify objects
176  vtkPolyData* output, vtkIdType* objectIds, vtkDataArray* valid, unsigned char* orient);
177 
178 private:
180  void operator=(const vtkMultiObjectMassProperties&) = delete;
181 };
182 
183 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
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
static vtkMultiObjectMassProperties * New()
Standard methods for construction, type and printing.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
~vtkMultiObjectMassProperties() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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.
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:338