ParaView
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 "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
32 #include "vtkUnstructuredGridAlgorithm.h"
33 
34 class vtkDataSet;
35 class vtkIdList;
36 class vtkInformation;
37 class vtkInformationVector;
38 class vtkDataSetAttributes;
39 class vtkMultiProcessController;
40 
41 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
42 {
43 public:
44  vtkTypeMacro(vtkIntegrateAttributes, vtkUnstructuredGridAlgorithm);
45  void PrintSelf(ostream& os, vtkIndent indent);
46  static vtkIntegrateAttributes* New();
47 
48  void SetController(vtkMultiProcessController* controller);
49 
50 protected:
53 
54  vtkMultiProcessController* Controller;
55 
56  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
57  vtkInformationVector* outputVector);
58 
59  // Create a default executive.
60  virtual vtkExecutive* CreateDefaultExecutive();
61 
62  virtual int FillInputPortInformation(int, vtkInformation*);
63 
64  int CompareIntegrationDimension(vtkDataSet* output, int dim);
66 
67  // The length, area or volume of the data set. Computed by Execute;
68  double Sum;
69  // ToCompute the location of the output point.
70  double SumCenter[3];
71 
72  void IntegratePolyLine(
73  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
74  void IntegratePolygon(
75  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
76  void IntegrateTriangleStrip(
77  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
78  void IntegrateTriangle(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
79  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id);
80  void IntegrateTetrahedron(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
81  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id);
82  void IntegratePixel(
83  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
84  void IntegrateVoxel(
85  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
86  void IntegrateGeneral1DCell(
87  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
88  void IntegrateGeneral2DCell(
89  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
90  void IntegrateGeneral3DCell(
91  vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId, vtkIdList* cellPtIds);
92  void IntegrateSatelliteData(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda);
93  void ZeroAttributes(vtkDataSetAttributes* outda);
94  int PieceNodeMinToNode0(vtkUnstructuredGrid* data);
95  void SendPiece(vtkUnstructuredGrid* src);
96  void ReceivePiece(vtkUnstructuredGrid* mergeTo, int fromId);
97 
98 private:
99  vtkIntegrateAttributes(const vtkIntegrateAttributes&) VTK_DELETE_FUNCTION;
100  void operator=(const vtkIntegrateAttributes&) VTK_DELETE_FUNCTION;
101 
102  class vtkFieldList;
103  vtkFieldList* CellFieldList;
104  vtkFieldList* PointFieldList;
105  int FieldListIndex;
106 
107  void AllocateAttributes(vtkFieldList& fieldList, vtkDataSetAttributes* outda);
108  void ExecuteBlock(vtkDataSet* input, vtkUnstructuredGrid* output, int fieldset_index,
109  vtkFieldList& pdList, vtkFieldList& cdList);
110 
111  void IntegrateData1(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
112  double k, vtkFieldList& fieldlist, int fieldlist_index);
113  void IntegrateData2(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
114  vtkIdType pt2Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
115  void IntegrateData3(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
116  vtkIdType pt2Id, vtkIdType pt3Id, double k, vtkFieldList& fieldlist, int fieldlist_index);
117  void IntegrateData4(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda, vtkIdType pt1Id,
118  vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double k, vtkFieldList& fieldlist,
119  int fieldlist_index);
120 
121 public:
123  {
124  IntegrateAttrInfo = 2000,
125  IntegrateAttrData
126  };
127 };
128 
129 #endif
vtkMultiProcessController * Controller
Integrates lines, surfaces and volume.