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:
166  ~vtkMultiObjectMassProperties() override;
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
192  void TraverseAndMark(
193  vtkPolyData* output, vtkIdType* objectIds, vtkDataArray* valid, unsigned char* orient);
194 
195 private:
197  void operator=(const vtkMultiObjectMassProperties&) = delete;
198 };
199 
200 #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:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
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:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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.