----------------------------------------------------------------------------
| 30 | } |
| 31 | //---------------------------------------------------------------------------- |
| 32 | bool vtkSIArraySelectionProperty::Pull(vtkSMMessage* msgToFill) |
| 33 | { |
| 34 | if (!this->InformationOnly) |
| 35 | { |
| 36 | return false; |
| 37 | } |
| 38 | if (!this->GetCommand()) // Hold the arraName |
| 39 | { |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | // Create property and add it to the message |
| 44 | ProxyState_Property* prop = msgToFill->AddExtension(ProxyState::property); |
| 45 | prop->set_name(this->GetXMLName()); |
| 46 | Variant* result = prop->mutable_value(); |
| 47 | result->set_type(Variant::STRING); |
| 48 | |
| 49 | // Get the ID for the reader. |
| 50 | vtkObjectBase* reader = this->GetVTKObject(); |
| 51 | if (reader != nullptr) |
| 52 | { |
| 53 | std::ostringstream aname; |
| 54 | aname << "GetNumberOf" << this->Command << "Arrays" << ends; |
| 55 | |
| 56 | // Get the number of arrays. |
| 57 | vtkClientServerStream stream; |
| 58 | stream << vtkClientServerStream::Invoke << reader << aname.str().c_str() |
| 59 | << vtkClientServerStream::End; |
| 60 | |
| 61 | this->ProcessMessage(stream); |
| 62 | stream.Reset(); |
| 63 | int numArrays = 0; |
| 64 | if (!this->GetLastResult().GetArgument(0, 0, &numArrays)) |
| 65 | { |
| 66 | vtkErrorMacro("Error getting number of arrays from reader."); |
| 67 | } |
| 68 | |
| 69 | // For each array, get its name and status. |
| 70 | for (int i = 0; i < numArrays; ++i) |
| 71 | { |
| 72 | std::ostringstream naname; |
| 73 | naname << "Get" << this->Command << "ArrayName" << ends; |
| 74 | |
| 75 | // Get the array name. |
| 76 | stream << vtkClientServerStream::Invoke << reader << naname.str().c_str() << i |
| 77 | << vtkClientServerStream::End; |
| 78 | if (!this->ProcessMessage(stream)) |
| 79 | { |
| 80 | break; |
| 81 | } |
| 82 | stream.Reset(); |
| 83 | const char* pname; |
| 84 | if (!this->GetLastResult().GetArgument(0, 0, &pname)) |
| 85 | { |
| 86 | vtkErrorMacro("Error getting array name from reader."); |
| 87 | break; |
| 88 | } |
| 89 | if (!pname) |
nothing calls this directly
no test coverage detected