VTK  9.3.1
vtkIntegrateAttributes.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkIntegrateAttributes_h
20 #define vtkIntegrateAttributes_h
21 
22 #include "vtkFiltersParallelModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkDataSet;
27 class vtkIdList;
28 class vtkInformation;
32 
33 class VTKFILTERSPARALLEL_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
34 {
35 public:
36  static vtkIntegrateAttributes* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
45  void SetController(vtkMultiProcessController* controller);
46  vtkGetObjectMacro(Controller, vtkMultiProcessController);
48 
50 
54  vtkSetMacro(DivideAllCellDataByVolume, bool);
55  vtkGetMacro(DivideAllCellDataByVolume, bool);
57 
58 protected:
60  ~vtkIntegrateAttributes() override;
61 
63 
64  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
65  vtkInformationVector* outputVector) override;
66 
67  // Create a default executive.
69 
70  int FillInputPortInformation(int, vtkInformation*) override;
71 
72  int CompareIntegrationDimension(vtkDataSet* output, int dim);
74 
75  // The length, area or volume of the data set. Computed by Execute;
76  double Sum;
77  // ToCompute the location of the output point.
78  double SumCenter[3];
79 
81 
82  void IntegratePolyLine(
83  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
84  void IntegratePolygon(
85  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
86  void IntegrateTriangleStrip(
87  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
88  void IntegrateTriangle(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
89  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id);
90  void IntegrateTetrahedron(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
91  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id);
92  void IntegratePixel(
93  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
94  void IntegrateVoxel(
95  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
96  void IntegrateGeneral1DCell(
97  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
98  void IntegrateGeneral2DCell(
99  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
100  void IntegrateGeneral3DCell(
101  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
102  void IntegrateSatelliteData(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda);
103  void ZeroAttributes(vtkDataSetAttributes* outda);
104  int PieceNodeMinToNode0(vtkUnstructuredGrid* data);
105  void SendPiece(vtkUnstructuredGrid* src);
106  void ReceivePiece(vtkUnstructuredGrid* mergeTo, int fromId);
107 
108  // This function assumes the data is in the format of the output of this filter with one
109  // point/cell having the value computed as its only tuple. It divides each value by sum,
110  // skipping the last data array if requested (so the volume doesn't get divided by itself
111  // and set to 1).
112  static void DivideDataArraysByConstant(
113  vtkDataSetAttributes* data, bool skipLastArray, double sum);
114 
115 private:
117  void operator=(const vtkIntegrateAttributes&) = delete;
118 
119  class vtkFieldList;
120  vtkFieldList* CellFieldList;
121  vtkFieldList* PointFieldList;
122  int FieldListIndex;
123 
124  void AllocateAttributes(vtkFieldList& fieldList, vtkDataSetAttributes* outda);
125  void ExecuteBlock(vtkDataSet* input, vtkUnstructuredGrid* output, int fieldset_index,
126  vtkFieldList& pdList, vtkFieldList& cdList);
127 
128  void IntegrateData1(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
129  double k, vtkFieldList& fieldlist, int fieldlist_index);
130  void IntegrateData2(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
131  vtkIdType pt2Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
132  void IntegrateData3(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
133  vtkIdType pt2Id, vtkIdType pt3Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
134  void IntegrateData4(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
135  vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double k, vtkFieldList& fieldlist,
136  int fieldlist_index);
137 
138 public:
140  {
141  IntegrateAttrInfo = 2000,
142  IntegrateAttrData
143  };
144 };
145 
146 VTK_ABI_NAMESPACE_END
147 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkMultiProcessController * Controller
virtual vtkExecutive * CreateDefaultExecutive()
Create a default executive.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
static vtkUnstructuredGridAlgorithm * New()
int vtkIdType
Definition: vtkType.h:315
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:38
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
dataset represents arbitrary combinations of all possible cell types
represent and manipulate attribute data in a dataset
Superclass for algorithms that produce only unstructured grid as output.
Integrates lines, surfaces and volume.
Store zero or more vtkInformation instances.
Multiprocessing communication superclass.