VTK  9.2.6
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 =========================================================================*/
94 #ifndef vtkMultiObjectMassProperties_h
95 #define vtkMultiObjectMassProperties_h
96 
97 #include "vtkFiltersCoreModule.h" // For export macro
98 #include "vtkPolyDataAlgorithm.h"
99 
100 class vtkDoubleArray;
102 class vtkIdTypeArray;
103 
104 class VTKFILTERSCORE_EXPORT vtkMultiObjectMassProperties : public vtkPolyDataAlgorithm
105 {
106 public:
108 
113  void PrintSelf(ostream& os, vtkIndent indent) override;
115 
117 
123  vtkSetMacro(SkipValidityCheck, vtkTypeBool);
124  vtkGetMacro(SkipValidityCheck, vtkTypeBool);
125  vtkBooleanMacro(SkipValidityCheck, vtkTypeBool);
127 
129 
134  vtkSetStdStringFromCharMacro(ObjectIdsArrayName);
135  vtkGetCharFromStdStringMacro(ObjectIdsArrayName);
137 
144  vtkIdType GetNumberOfObjects() { return this->NumberOfObjects; }
145 
150  vtkTypeBool GetAllValid() { return this->AllValid; }
151 
156  double GetTotalVolume() { return this->TotalVolume; }
157 
162  double GetTotalArea() { return this->TotalArea; }
163 
164 protected:
167 
168  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
169  vtkInformationVector* outputVector) override;
170 
171  // Data members supporting API
174  double TotalVolume;
175  double TotalArea;
176 
177  // Internal data members supporting algorithm execution
178  vtkIdType NumberOfObjects; // number of objects identified
179  vtkIdTypeArray* ObjectIds; // for each input polygon, the object id that the polygon is in
180  std::string ObjectIdsArrayName; // the array name of ObjectIds.
181 
182  vtkUnsignedCharArray* ObjectValidity; // is it a valid object?
183  vtkDoubleArray* ObjectVolumes; // what is the object volume (if valid)?
184  vtkDoubleArray* ObjectAreas; // what is the total object area?
185  vtkDoubleArray* ObjectCentroids; // what is the object centroid
186 
187  vtkIdList* CellNeighbors; // avoid repetitive new/delete
188  vtkIdList* Wave; // processing wave
190 
191  // Connected traversal to identify objects
193  vtkPolyData* output, vtkIdType* objectIds, vtkDataArray* valid, unsigned char* orient);
194 
195 private:
197  void operator=(const vtkMultiObjectMassProperties&) = delete;
198 };
199 
200 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:143
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
compute volume and area of objects in a polygonal mesh
vtkSetStdStringFromCharMacro(ObjectIdsArrayName)
Set/Get the name of the ObjectIds array.
static vtkMultiObjectMassProperties * New()
Standard methods for construction, type and printing.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
~vtkMultiObjectMassProperties() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type and printing.
vtkGetCharFromStdStringMacro(ObjectIdsArrayName)
Set/Get the name of the ObjectIds array.
void TraverseAndMark(vtkPolyData *output, vtkIdType *objectIds, vtkDataArray *valid, unsigned char *orient)
double GetTotalArea()
Return the summed area of all objects.
vtkIdType GetNumberOfObjects()
Return the number of objects identified.
double GetTotalVolume()
Return the summed volume of all objects.
vtkTypeBool GetAllValid()
Return whether all objects are valid or not.
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
dynamic, self-adjusting array of unsigned char
@ string
Definition: vtkX3D.h:496
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332