VTK
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 =========================================================================*/
92 #ifndef vtkMultiObjectMassProperties_h
93 #define vtkMultiObjectMassProperties_h
94 
95 #include "vtkFiltersCoreModule.h" // For export macro
96 #include "vtkPolyDataAlgorithm.h"
97 
98 class vtkDoubleArray;
100 class vtkIdTypeArray;
101 
102 class VTKFILTERSCORE_EXPORT vtkMultiObjectMassProperties : public vtkPolyDataAlgorithm
103 {
104 public:
106 
111  void PrintSelf(ostream& os, vtkIndent indent) override;
113 
115 
121  vtkSetMacro(SkipValidityCheck,vtkTypeBool);
122  vtkGetMacro(SkipValidityCheck,vtkTypeBool);
123  vtkBooleanMacro(SkipValidityCheck,vtkTypeBool);
125 
133  {return this->NumberOfObjects;}
134 
140  {return this->AllValid;}
141 
146  double GetTotalVolume()
147  {return this->TotalVolume;}
148 
153  double GetTotalArea()
154  {return this->TotalArea;}
155 
156 protected:
158  ~vtkMultiObjectMassProperties() override;
159 
160  int RequestData(vtkInformation* request,
161  vtkInformationVector** inputVector,
162  vtkInformationVector* outputVector) override;
163 
164  // Data members supporting API
167  double TotalVolume;
168  double TotalArea;
169 
170  // Internal data members supporting algorithm execution
171  vtkIdType NumberOfObjects; //number of objects identified
172  vtkIdTypeArray *ObjectIds; //for each input polygon, the object id that the polygon is in
173 
174  vtkUnsignedCharArray *ObjectValidity; //is it a valid object?
175  vtkDoubleArray *ObjectVolumes; //what is the object volume (if valid)?
176  vtkDoubleArray *ObjectAreas; //what is the total object area?
177 
178  vtkIdList *CellNeighbors; //avoid repetitive new/delete
179  vtkIdList *Wave; //processing wave
181 
182  // Connected traversal to identify objects
183  void TraverseAndMark (vtkPolyData *output, vtkIdType *objectIds,
184  vtkDataArray *valid, unsigned char *orient);
185 
186 private:
188  void operator=(const vtkMultiObjectMassProperties&) = delete;
189 };
190 
191 #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:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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:39
list of point or cell ids
Definition: vtkIdList.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
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.