vtkRedistributePolyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkRedistributePolyData.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Los Alamos National Laboratory
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
26 #ifndef vtkRedistributePolyData_h
27 #define vtkRedistributePolyData_h
28 
29 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" // needed for export macro
30 #include "vtkPolyDataAlgorithm.h"
31 
32 //*******************************************************************
33 class vtkDataArray;
37 
39  : public vtkPolyDataAlgorithm
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  static vtkRedistributePolyData* New();
46 
50  virtual void SetController(vtkMultiProcessController*);
51  vtkGetObjectMacro(Controller, vtkMultiProcessController);
52 
53  vtkGetMacro(ColorProc, int);
54  vtkSetMacro(ColorProc, int);
55  void SetColorProc() { this->ColorProc = 1; };
56 
58 
62  virtual void SetPassThrough(int){};
63  virtual int GetPassThrough() { return 0; };
64  vtkBooleanMacro(PassThrough, int);
66 
67 protected:
70 
71  enum
72  {
73  CELL_ID_TAG = 10,
74  POINT_COORDS_TAG = 20,
75  NUM_POINTS_TAG = 30,
76  NUM_CELLS_TAG = 40,
77  BOUNDS_TAG = 60,
78  CNT_SEND_TAG = 80,
79  CNT_REC_TAG = 90,
80  SEND_PROC_TAG = 100,
81  SEND_NUM_TAG = 110,
82  REC_PROC_TAG = 120,
83  REC_NUM_TAG = 130,
84  NUM_CURR_CELLS_TAG = 140,
85 
86  CELL_CNT_TAG = 150,
87  CELL_TAG = 160,
88  POINTS_SIZE_TAG = 170,
89  POINTS_TAG = 180
90  };
91 
93  {
94  public:
95  vtkCommSched();
96  ~vtkCommSched();
97 
98  int SendCount;
100  int* SendTo;
105 
108 
109  private:
110  vtkCommSched(const vtkCommSched&) = delete;
111  void operator=(const vtkCommSched&) = delete;
112  };
113 
114  virtual void MakeSchedule(vtkPolyData* input, vtkCommSched*);
115  void OrderSchedule(vtkCommSched*);
116 
117  void SendCellSizes(
119  void CopyCells(vtkIdType*, vtkPolyData*, vtkPolyData*, vtkIdType**);
120  void SendCells(
122  void ReceiveCells(
124 
125  void FindMemReq(vtkIdType*, vtkPolyData*, vtkIdType&, vtkIdType*);
126 
127  void AllocateCellDataArrays(vtkDataSetAttributes*, vtkIdType**, int, vtkIdType*);
128  void AllocatePointDataArrays(vtkDataSetAttributes*, vtkIdType*, int, vtkIdType);
129  void AllocateArrays(vtkDataArray*, vtkIdType);
130 
131  void CopyDataArrays(vtkDataSetAttributes*, vtkDataSetAttributes*, vtkIdType, vtkIdType*, int);
132 
133  void CopyCellBlockDataArrays(
135 
136  void CopyArrays(vtkDataArray*, vtkDataArray*, vtkIdType, vtkIdType*, int);
137 
138  void CopyBlockArrays(
140 
141  void SendDataArrays(
143 
144  void SendCellBlockDataArrays(
146 
147  void SendArrays(vtkDataArray*, vtkIdType, int, vtkIdType*, int);
148 
149  void SendBlockArrays(vtkDataArray*, vtkIdType, int, vtkIdType, int);
150 
151  void ReceiveDataArrays(vtkDataSetAttributes*, vtkIdType, int, vtkIdType*, int);
152 
153  void ReceiveArrays(vtkDataArray*, vtkIdType, int, vtkIdType*, int);
154 
155  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
156  vtkInformationVector* outputVector) override;
157 
158  // Do this as a proprocessing step.
159  void CompleteInputArrays(vtkPolyData* input);
160  void ReceiveInputArrays(vtkDataSetAttributes* attr, int recFrom);
161  void SendInputArrays(vtkDataSetAttributes* attr, int sendTo);
162  int DoubleCheckArrays(vtkPolyData* input);
163 
165 
166  int ColorProc; // Set to 1 to color data according to processor
167 
168 private:
170  void operator=(const vtkRedistributePolyData&) = delete;
171 };
172 
173 //****************************************************************
174 
175 #endif
redistribute poly cells from other processes (special version to color according to processor) ...
int vtkIdType
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static vtkPolyDataAlgorithm * New()
virtual void SetPassThrough(int)
These are here for ParaView compatibility.
#define VTKPVVTKEXTENSIONSFILTERSRENDERING_EXPORT
virtual void SetSocketController(vtkSocketController *)
These are here for ParaView compatibility.
virtual int GetPassThrough()
These are here for ParaView compatibility.
vtkMultiProcessController * Controller