-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplete_arrays.patch
More file actions
77 lines (74 loc) · 2.74 KB
/
complete_arrays.patch
File metadata and controls
77 lines (74 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff --git a/ParaViewCore/ClientServerCore/Core/vtkCompleteArrays.cxx b/ParaViewCore/ClientServerCore/Core/vtkCompleteArrays.cxx
index bd9aa0927e3cbd2807f58efa460e74c61c918a83..73007fe92a15eb18e4fb2dbc5ccf7c907832039f 100644
--- a/ParaViewCore/ClientServerCore/Core/vtkCompleteArrays.cxx
+++ b/ParaViewCore/ClientServerCore/Core/vtkCompleteArrays.cxx
@@ -26,6 +26,7 @@
#include "vtkPVArrayInformation.h"
#include "vtkPointData.h"
#include "vtkPointSet.h"
+#include "vtkRectilinearGrid.h"
#include "vtkTable.h"
// this doesn't directly use vtkPVDataSetAttributesInformation since
@@ -296,8 +297,7 @@ int vtkCompleteArrays::RequestData(
vtkDeserialize(css, 0, outputDS->GetPointData());
vtkDeserialize(css, 1, outputDS->GetCellData());
- vtkPointSet* ps = vtkPointSet::SafeDownCast(outputDS);
- if (ps)
+ if (vtkPointSet* ps = vtkPointSet::SafeDownCast(outputDS))
{
vtkNew<vtkPoints> pts;
int dataType;
@@ -307,6 +307,39 @@ int vtkCompleteArrays::RequestData(
}
ps->SetPoints(pts.Get());
}
+ else if (auto rg = vtkRectilinearGrid::SafeDownCast(outputDS))
+ {
+ rg->SetXCoordinates(nullptr);
+ rg->SetYCoordinates(nullptr);
+ rg->SetZCoordinates(nullptr);
+
+ int dataType;
+ if (css.GetArgument(2, 0, &dataType) && dataType != VTK_VOID)
+ {
+ if (auto array = vtkAbstractArray::CreateArray(dataType))
+ {
+ rg->SetXCoordinates(vtkDataArray::SafeDownCast(array));
+ array->FastDelete();
+ }
+ }
+
+ if (css.GetArgument(2, 1, &dataType) && dataType != VTK_VOID)
+ {
+ if (auto array = vtkAbstractArray::CreateArray(dataType))
+ {
+ rg->SetYCoordinates(vtkDataArray::SafeDownCast(array));
+ array->FastDelete();
+ }
+ }
+ if (css.GetArgument(2, 2, &dataType) && dataType != VTK_VOID)
+ {
+ if (auto array = vtkAbstractArray::CreateArray(dataType))
+ {
+ rg->SetZCoordinates(vtkDataArray::SafeDownCast(array));
+ array->FastDelete();
+ }
+ }
+ }
}
else if (myProcId == infoProc)
{
@@ -319,6 +352,14 @@ int vtkCompleteArrays::RequestData(
css << vtkClientServerStream::Reply << ps->GetPoints()->GetDataType()
<< vtkClientServerStream::End;
}
+ else if (auto rg = vtkRectilinearGrid::SafeDownCast(inputDS))
+ {
+ css << vtkClientServerStream::Reply
+ << (rg->GetXCoordinates() ? rg->GetXCoordinates()->GetDataType() : VTK_VOID)
+ << (rg->GetYCoordinates() ? rg->GetYCoordinates()->GetDataType() : VTK_VOID)
+ << (rg->GetZCoordinates() ? rg->GetZCoordinates()->GetDataType() : VTK_VOID)
+ << vtkClientServerStream::End;
+ }
size_t length;
const unsigned char* data;