----------------------------------------------------------------------------
| 27 | } |
| 28 | //---------------------------------------------------------------------------- |
| 29 | bool vtkSIDataArrayProperty::Pull(vtkSMMessage* msgToFill) |
| 30 | { |
| 31 | if (!this->InformationOnly) |
| 32 | { |
| 33 | return false; |
| 34 | } |
| 35 | |
| 36 | if (!this->GetCommand()) |
| 37 | { |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | // Invoke property's method on the root node of the server |
| 42 | vtkClientServerStream str; |
| 43 | str << vtkClientServerStream::Invoke << this->GetVTKObject() << this->GetCommand() |
| 44 | << vtkClientServerStream::End; |
| 45 | |
| 46 | this->ProcessMessage(str); |
| 47 | |
| 48 | // Get the result |
| 49 | vtkAbstractArray* abstractArray = nullptr; |
| 50 | if (!this->GetLastResult().GetArgument(0, 0, (vtkObjectBase**)&abstractArray)) |
| 51 | { |
| 52 | vtkErrorMacro("Error getting return value of command: " << this->GetCommand()); |
| 53 | return false; |
| 54 | } |
| 55 | vtkStringArray* stringArray = vtkStringArray::SafeDownCast(abstractArray); |
| 56 | vtkDataArray* dataArray = vtkDataArray::SafeDownCast(abstractArray); |
| 57 | |
| 58 | // Create property and add it to the message |
| 59 | ProxyState_Property* prop = msgToFill->AddExtension(ProxyState::property); |
| 60 | prop->set_name(this->GetXMLName()); |
| 61 | Variant* var = prop->mutable_value(); |
| 62 | |
| 63 | // If no values, then just return OK with an empty content |
| 64 | if (!dataArray && !stringArray) |
| 65 | { |
| 66 | return true; |
| 67 | } |
| 68 | |
| 69 | // Need to fill the property content with the proper type |
| 70 | // Right now only those types are supported |
| 71 | // - vtkDoubleArray |
| 72 | // - vtkIntArray |
| 73 | // - vtkIdTypeArray |
| 74 | // - vtkStringArray |
| 75 | vtkIdType numValues = abstractArray->GetNumberOfComponents() * abstractArray->GetNumberOfTuples(); |
| 76 | if (dataArray) |
| 77 | { |
| 78 | vtkDoubleArray* dataDouble = nullptr; |
| 79 | vtkIntArray* dataInt = nullptr; |
| 80 | vtkIdTypeArray* dataIdType = nullptr; |
| 81 | switch (dataArray->GetDataType()) |
| 82 | { |
| 83 | case VTK_DOUBLE: |
| 84 | var->set_type(Variant::FLOAT64); |
| 85 | dataDouble = vtkDoubleArray::SafeDownCast(dataArray); |
| 86 | for (vtkIdType cc = 0; cc < numValues; cc++) |
nothing calls this directly
no test coverage detected