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 =========================================================================*/
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 
130  {return this->NumberOfObjects;}
131 
137  {return this->AllValid;}
138 
143  double GetTotalVolume()
144  {return this->TotalVolume;}
145 
150  double GetTotalArea()
151  {return this->TotalArea;}
152 
153 protected:
155  ~vtkMultiObjectMassProperties() override;
156 
157  int RequestData(vtkInformation* request,
158  vtkInformationVector** inputVector,
159  vtkInformationVector* outputVector) override;
160 
161  // Data members supporting API
164  double TotalVolume;
165  double TotalArea;
166 
167  // Internal data members supporting algorithm execution
168  vtkIdType NumberOfObjects; //number of objects identified
169  vtkIdTypeArray *ObjectIds; //for each input polygon, the object id that the polygon is in
170 
171  vtkUnsignedCharArray *ObjectValidity; //is it a valid object?
172  vtkDoubleArray *ObjectVolumes; //what is the object volume (if valid)?
173  vtkDoubleArray *ObjectAreas; //what is the total object area?
174 
175  vtkIdList *CellNeighbors; //avoid repetitive new/delete
176  vtkIdList *Wave; //processing wave
178 
179  // Connected traversal to identify objects
180  void TraverseAndMark (vtkPolyData *output, vtkIdType *objectIds,
181  vtkDataArray *valid, unsigned char *orient);
182 
183 private:
185  void operator=(const vtkMultiObjectMassProperties&) = delete;
186 };
187 
188 #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:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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:48
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.