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
vtkMultiObjectMassProperties::TotalArea
double TotalArea
Definition: vtkMultiObjectMassProperties.h:165
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkMultiObjectMassProperties::ObjectVolumes
vtkDoubleArray * ObjectVolumes
Definition: vtkMultiObjectMassProperties.h:172
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkMultiObjectMassProperties::AllValid
vtkTypeBool AllValid
Definition: vtkMultiObjectMassProperties.h:163
vtkMultiObjectMassProperties
compute volume and area of objects in a polygonal mesh
Definition: vtkMultiObjectMassProperties.h:99
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
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:136
vtkMultiObjectMassProperties::TotalVolume
double TotalVolume
Definition: vtkMultiObjectMassProperties.h:164
vtkMultiObjectMassProperties::CellNeighbors
vtkIdList * CellNeighbors
Definition: vtkMultiObjectMassProperties.h:175
vtkMultiObjectMassProperties::Wave2
vtkIdList * Wave2
Definition: vtkMultiObjectMassProperties.h:177
vtkMultiObjectMassProperties::ObjectAreas
vtkDoubleArray * ObjectAreas
Definition: vtkMultiObjectMassProperties.h:173
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:168
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMultiObjectMassProperties::GetTotalArea
double GetTotalArea()
Return the summed area of all objects.
Definition: vtkMultiObjectMassProperties.h:150
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkMultiObjectMassProperties::ObjectValidity
vtkUnsignedCharArray * ObjectValidity
Definition: vtkMultiObjectMassProperties.h:171
vtkMultiObjectMassProperties::Wave
vtkIdList * Wave
Definition: vtkMultiObjectMassProperties.h:176
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkMultiObjectMassProperties::GetNumberOfObjects
vtkIdType GetNumberOfObjects()
Return the number of objects identified.
Definition: vtkMultiObjectMassProperties.h:129
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkMultiObjectMassProperties::ObjectIds
vtkIdTypeArray * ObjectIds
Definition: vtkMultiObjectMassProperties.h:169
vtkMultiObjectMassProperties::SkipValidityCheck
vtkTypeBool SkipValidityCheck
Definition: vtkMultiObjectMassProperties.h:162
vtkMultiObjectMassProperties::GetTotalVolume
double GetTotalVolume()
Return the summed volume of all objects.
Definition: vtkMultiObjectMassProperties.h:143
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:41