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
vtkMultiObjectMassProperties::TotalArea
double TotalArea
Definition: vtkMultiObjectMassProperties.h:168
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkMultiObjectMassProperties::ObjectVolumes
vtkDoubleArray * ObjectVolumes
Definition: vtkMultiObjectMassProperties.h:175
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkMultiObjectMassProperties::AllValid
vtkTypeBool AllValid
Definition: vtkMultiObjectMassProperties.h:166
vtkMultiObjectMassProperties
compute volume and area of objects in a polygonal mesh
Definition: vtkMultiObjectMassProperties.h:102
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMultiObjectMassProperties::GetAllValid
vtkTypeBool GetAllValid()
Return whether all objects are valid or not.
Definition: vtkMultiObjectMassProperties.h:139
vtkMultiObjectMassProperties::TotalVolume
double TotalVolume
Definition: vtkMultiObjectMassProperties.h:167
vtkMultiObjectMassProperties::CellNeighbors
vtkIdList * CellNeighbors
Definition: vtkMultiObjectMassProperties.h:178
vtkMultiObjectMassProperties::Wave2
vtkIdList * Wave2
Definition: vtkMultiObjectMassProperties.h:180
vtkMultiObjectMassProperties::ObjectAreas
vtkDoubleArray * ObjectAreas
Definition: vtkMultiObjectMassProperties.h:176
vtkPolyDataAlgorithm.h
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkMultiObjectMassProperties::NumberOfObjects
vtkIdType NumberOfObjects
Definition: vtkMultiObjectMassProperties.h:171
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMultiObjectMassProperties::GetTotalArea
double GetTotalArea()
Return the summed area of all objects.
Definition: vtkMultiObjectMassProperties.h:153
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkMultiObjectMassProperties::ObjectValidity
vtkUnsignedCharArray * ObjectValidity
Definition: vtkMultiObjectMassProperties.h:174
vtkMultiObjectMassProperties::Wave
vtkIdList * Wave
Definition: vtkMultiObjectMassProperties.h:179
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkMultiObjectMassProperties::GetNumberOfObjects
vtkIdType GetNumberOfObjects()
Return the number of objects identified.
Definition: vtkMultiObjectMassProperties.h:132
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
vtkMultiObjectMassProperties::ObjectIds
vtkIdTypeArray * ObjectIds
Definition: vtkMultiObjectMassProperties.h:172
vtkMultiObjectMassProperties::SkipValidityCheck
vtkTypeBool SkipValidityCheck
Definition: vtkMultiObjectMassProperties.h:165
vtkMultiObjectMassProperties::GetTotalVolume
double GetTotalVolume()
Return the summed volume of all objects.
Definition: vtkMultiObjectMassProperties.h:146
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44