---------------------------------------------------------------------------
| 60 | |
| 61 | //--------------------------------------------------------------------------- |
| 62 | bool vtkSIStringVectorProperty::Pull(vtkSMMessage* message) |
| 63 | { |
| 64 | if (!this->InformationOnly) |
| 65 | { |
| 66 | return this->Superclass::Pull(message); |
| 67 | } |
| 68 | |
| 69 | if (!this->GetCommand()) |
| 70 | { |
| 71 | // I would say that we should return false since an InformationOnly property |
| 72 | // as no meaning if no command is set, but for some legacy reason we just |
| 73 | // skip the processing if no command is provided. |
| 74 | return true; |
| 75 | } |
| 76 | |
| 77 | // Invoke property's method on the root node of the server |
| 78 | vtkClientServerStream str; |
| 79 | str << vtkClientServerStream::Invoke << this->GetVTKObject() << this->GetCommand() |
| 80 | << vtkClientServerStream::End; |
| 81 | |
| 82 | this->ProcessMessage(str); |
| 83 | |
| 84 | // Get the result |
| 85 | const vtkClientServerStream& res = this->GetLastResult(); |
| 86 | |
| 87 | int numMsgs = res.GetNumberOfMessages(); |
| 88 | if (numMsgs < 1) |
| 89 | { |
| 90 | return true; |
| 91 | } |
| 92 | |
| 93 | const int numArgs = res.GetNumberOfArguments(0); |
| 94 | if (numArgs < 1) |
| 95 | { |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | // now add the single 'value' to the message. |
| 100 | ProxyState_Property* prop = message->AddExtension(ProxyState::property); |
| 101 | prop->set_name(this->GetXMLName()); |
| 102 | Variant* var = prop->mutable_value(); |
| 103 | var->set_type(Variant_Type_STRING); |
| 104 | |
| 105 | for (int argIdx = 0; argIdx < numArgs; ++argIdx) |
| 106 | { |
| 107 | const char* arg = nullptr; |
| 108 | int retVal = res.GetArgument(0, argIdx, &arg); |
| 109 | if (retVal == 0) |
| 110 | { |
| 111 | // failed to parse as string. |
| 112 | return false; |
| 113 | } |
| 114 | |
| 115 | if (!arg) |
| 116 | { |
| 117 | var->add_txt(std::string()); |
| 118 | } |
| 119 | else |
nothing calls this directly
no test coverage detected