VTK  9.0.1
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 =========================================================================*/
28 #ifndef vtkIntegrateAttributes_h
29 #define vtkIntegrateAttributes_h
30 
31 #include "vtkFiltersParallelModule.h" // For export macro
33 
34 class vtkDataSet;
35 class vtkIdList;
36 class vtkInformation;
40 
41 class VTKFILTERSPARALLEL_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
54  vtkGetObjectMacro(Controller, vtkMultiProcessController);
56 
58 
62  vtkSetMacro(DivideAllCellDataByVolume, bool);
63  vtkGetMacro(DivideAllCellDataByVolume, bool);
65 
66 protected:
69 
71 
72  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
73  vtkInformationVector* outputVector) override;
74 
75  // Create a default executive.
77 
79 
80  int CompareIntegrationDimension(vtkDataSet* output, int dim);
82 
83  // The length, area or volume of the data set. Computed by Execute;
84  double Sum;
85  // ToCompute the location of the output point.
86  double SumCenter[3];
87 
89 
91  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
93  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
95  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
97  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id);
99  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id);
101  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
103  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
105  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
107  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
109  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
114  void ReceivePiece(vtkUnstructuredGrid* mergeTo, int fromId);
115 
116  // This function assumes the data is in the format of the output of this filter with one
117  // point/cell having the value computed as its only tuple. It divides each value by sum,
118  // skipping the last data array if requested (so the volume doesn't get divided by itself
119  // and set to 1).
121  vtkDataSetAttributes* data, bool skipLastArray, double sum);
122 
123 private:
125  void operator=(const vtkIntegrateAttributes&) = delete;
126 
127  class vtkFieldList;
128  vtkFieldList* CellFieldList;
129  vtkFieldList* PointFieldList;
130  int FieldListIndex;
131 
132  void AllocateAttributes(vtkFieldList& fieldList, vtkDataSetAttributes* outda);
133  void ExecuteBlock(vtkDataSet* input, vtkUnstructuredGrid* output, int fieldset_index,
134  vtkFieldList& pdList, vtkFieldList& cdList);
135 
136  void IntegrateData1(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
137  double k, vtkFieldList& fieldlist, int fieldlist_index);
138  void IntegrateData2(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
139  vtkIdType pt2Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
140  void IntegrateData3(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
141  vtkIdType pt2Id, vtkIdType pt3Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
142  void IntegrateData4(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
143  vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double k, vtkFieldList& fieldlist,
144  int fieldlist_index);
145 
146 public:
148  {
149  IntegrateAttrInfo = 2000,
150  IntegrateAttrData
151  };
152 };
153 
154 #endif
vtkIntegrateAttributes::IntegratePixel
void IntegratePixel(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkIntegrateAttributes::IntegratePolygon
void IntegratePolygon(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkIntegrateAttributes::SetController
void SetController(vtkMultiProcessController *controller)
Get/Set the parallel controller to use.
vtkIntegrateAttributes::ReceivePiece
void ReceivePiece(vtkUnstructuredGrid *mergeTo, int fromId)
vtkIntegrateAttributes::IntegrateGeneral1DCell
void IntegrateGeneral1DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkIntegrateAttributes::IntegrateTetrahedron
void IntegrateTetrahedron(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id)
vtkIntegrateAttributes::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:54
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkIntegrateAttributes::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkIntegrateAttributes::SendPiece
void SendPiece(vtkUnstructuredGrid *src)
vtkIntegrateAttributes::vtkIntegrateAttributes
vtkIntegrateAttributes()
vtkIntegrateAttributes
Integrates lines, surfaces and volume.
Definition: vtkIntegrateAttributes.h:42
vtkIntegrateAttributes::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIntegrateAttributes::CommunicationIds
CommunicationIds
Definition: vtkIntegrateAttributes.h:148
vtkIntegrateAttributes::IntegratePolyLine
void IntegratePolyLine(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkIntegrateAttributes::IntegrationDimension
int IntegrationDimension
Definition: vtkIntegrateAttributes.h:81
vtkIntegrateAttributes::DivideDataArraysByConstant
static void DivideDataArraysByConstant(vtkDataSetAttributes *data, bool skipLastArray, double sum)
vtkIntegrateAttributes::IntegrateGeneral2DCell
void IntegrateGeneral2DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:47
vtkIntegrateAttributes::Controller
vtkMultiProcessController * Controller
Definition: vtkIntegrateAttributes.h:70
vtkIntegrateAttributes::PieceNodeMinToNode0
int PieceNodeMinToNode0(vtkUnstructuredGrid *data)
vtkIntegrateAttributes::IntegrateGeneral3DCell
void IntegrateGeneral3DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkIntegrateAttributes::DivideAllCellDataByVolume
bool DivideAllCellDataByVolume
Definition: vtkIntegrateAttributes.h:88
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:76
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkIntegrateAttributes::IntegrateTriangleStrip
void IntegrateTriangleStrip(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:31
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkIntegrateAttributes::~vtkIntegrateAttributes
~vtkIntegrateAttributes() override
vtkIntegrateAttributes::CompareIntegrationDimension
int CompareIntegrationDimension(vtkDataSet *output, int dim)
vtkUnstructuredGridAlgorithm.h
vtkIntegrateAttributes::IntegrateSatelliteData
void IntegrateSatelliteData(vtkDataSetAttributes *inda, vtkDataSetAttributes *outda)
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:41
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:93
vtkIntegrateAttributes::ZeroAttributes
void ZeroAttributes(vtkDataSetAttributes *outda)
vtkIntegrateAttributes::CreateDefaultExecutive
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
vtkIntegrateAttributes::IntegrateTriangle
void IntegrateTriangle(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id)
vtkIntegrateAttributes::New
static vtkIntegrateAttributes * New()
vtkIntegrateAttributes::Sum
double Sum
Definition: vtkIntegrateAttributes.h:84
vtkIntegrateAttributes::IntegrateVoxel
void IntegrateVoxel(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdList *cellPtIds)