Salome HOME
Fix opencv build
[tools/sat_salome.git] / products / patches / paraview.0018-spns-26351-autoconvert.patch
1 --- ParaView.orig/Remoting/ServerManager/vtkSMInputArrayDomain.cxx      2021-09-09 08:57:14.769827497 +0200
2 +++ ParaView/Remoting/ServerManager/vtkSMInputArrayDomain.cxx   2021-09-07 13:23:51.029276211 +0200
3 @@ -144,26 +144,15 @@
4      *acceptable_as_type = attribute_type;
5    }
6  
7 -  if (required_type == ANY)
8 +  if (required_type == ANY_EXCEPT_FIELD && attribute_type == FIELD)
9    {
10 -    return attribute_type == POINT || attribute_type == CELL || attribute_type == FIELD ||
11 -      attribute_type == EDGE || attribute_type == VERTEX || attribute_type == ROW;
12 +    return false;
13    }
14  
15 -  if (required_type == ANY_EXCEPT_FIELD)
16 +  if (required_type == ANY || required_type == ANY_EXCEPT_FIELD)
17    {
18 -    // Try out all attribute types except field data sequentially.
19 -    int attribute_types_to_try[] = { vtkDataObject::POINT, vtkDataObject::CELL,
20 -      vtkDataObject::VERTEX, vtkDataObject::EDGE, vtkDataObject::ROW, -1 };
21 -    for (int cc = 0; attribute_types_to_try[cc] != -1; ++cc)
22 -    {
23 -      if (vtkSMInputArrayDomain::IsAttributeTypeAcceptable(
24 -            attribute_types_to_try[cc], attribute_type, acceptable_as_type))
25 -      {
26 -        return true;
27 -      }
28 -    }
29 -    return false;
30 +    return attribute_type == POINT || attribute_type == CELL || attribute_type == FIELD ||
31 +      attribute_type == EDGE || attribute_type == VERTEX || attribute_type == ROW;
32    }
33  
34    switch (attribute_type)