VTK
vtkIntegrateAttributes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkIntegrateAttributes.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 =========================================================================*/
31 #ifndef vtkIntegrateAttributes_h
32 #define vtkIntegrateAttributes_h
33 
34 #include "vtkFiltersParallelModule.h" // For export macro
36 
37 class vtkDataSet;
38 class vtkIdList;
39 class vtkInformation;
43 
44 class VTKFILTERSPARALLEL_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
45 {
46 public:
47  static vtkIntegrateAttributes* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
56  void SetController(vtkMultiProcessController* controller);
57  vtkGetObjectMacro(Controller, vtkMultiProcessController);
59 
61 
65  vtkSetMacro(DivideAllCellDataByVolume, bool);
66  vtkGetMacro(DivideAllCellDataByVolume, bool);
68 
69 protected:
71  ~vtkIntegrateAttributes() override;
72 
74 
75  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
76  vtkInformationVector* outputVector) override;
77 
78  // Create a default executive.
80 
81  int FillInputPortInformation(int, vtkInformation*) override;
82 
83  int CompareIntegrationDimension(vtkDataSet* output, int dim);
85 
86  // The length, area or volume of the data set. Computed by Execute;
87  double Sum;
88  // ToCompute the location of the output point.
89  double SumCenter[3];
90 
92 
93  void IntegratePolyLine(
94  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
95  void IntegratePolygon(
96  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
97  void IntegrateTriangleStrip(
98  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
99  void IntegrateTriangle(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
100  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id);
101  void IntegrateTetrahedron(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
102  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id);
103  void IntegratePixel(
104  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
105  void IntegrateVoxel(
106  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
107  void IntegrateGeneral1DCell(
108  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
109  void IntegrateGeneral2DCell(
110  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
111  void IntegrateGeneral3DCell(
112  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
113  void IntegrateSatelliteData(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda);
114  void ZeroAttributes(vtkDataSetAttributes* outda);
115  int PieceNodeMinToNode0(vtkUnstructuredGrid* data);
116  void SendPiece(vtkUnstructuredGrid* src);
117  void ReceivePiece(vtkUnstructuredGrid* mergeTo, int fromId);
118 
119  // This function assumes the data is in the format of the output of this filter with one
120  // point/cell having the value computed as its only tuple. It divides each value by sum,
121  // skipping the last data array if requested (so the volume doesn't get divided by itself
122  // and set to 1).
123  static void DivideDataArraysByConstant(
124  vtkDataSetAttributes* data, bool skipLastArray, double sum);
125 
126 private:
128  void operator=(const vtkIntegrateAttributes&) = delete;
129 
130  class vtkFieldList;
131  vtkFieldList* CellFieldList;
132  vtkFieldList* PointFieldList;
133  int FieldListIndex;
134 
135  void AllocateAttributes(vtkFieldList& fieldList, vtkDataSetAttributes* outda);
136  void ExecuteBlock(vtkDataSet* input, vtkUnstructuredGrid* output, int fieldset_index,
137  vtkFieldList& pdList, vtkFieldList& cdList);
138 
139  void IntegrateData1(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
140  double k, vtkFieldList& fieldlist, int fieldlist_index);
141  void IntegrateData2(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
142  vtkIdType pt2Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
143  void IntegrateData3(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
144  vtkIdType pt2Id, vtkIdType pt3Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
145  void IntegrateData4(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
146  vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double k, vtkFieldList& fieldlist,
147  int fieldlist_index);
148 
149 public:
151  {
152  IntegrateAttrInfo = 2000,
153  IntegrateAttrData
154  };
155 };
156 
157 #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:62
static vtkUnstructuredGridAlgorithm * New()
int vtkIdType
Definition: vtkType.h:347
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:49
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:39
list of point or cell ids
Definition: vtkIdList.h:36
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.