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:
151  ~vtkMultiObjectMassProperties() override;
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
175  void TraverseAndMark(
176  vtkPolyData* output, vtkIdType* objectIds, vtkDataArray* valid, unsigned char* orient);
177 
178 private:
180  void operator=(const vtkMultiObjectMassProperties&) = delete;
181 };
182 
183 #endif
double GetTotalArea()
Return the summed area of all objects.
compute volume and area of objects in a polygonal mesh
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkIdType GetNumberOfObjects()
Return the number of objects identified.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:338
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
double GetTotalVolume()
Return the summed volume of all objects.
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
dynamic, self-adjusting array of unsigned char
vtkTypeBool GetAllValid()
Return whether all objects are valid or not.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.