MCPcopy Create free account
hub / github.com/Kitware/ParaView / Pull

Method Pull

Remoting/ServerManager/vtkSIDataArrayProperty.cxx:29–122  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

27}
28//----------------------------------------------------------------------------
29bool 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++)

Callers

nothing calls this directly

Calls 10

GetArgumentMethod · 0.80
set_typeMethod · 0.80
GetCommandMethod · 0.45
GetVTKObjectMethod · 0.45
ProcessMessageMethod · 0.45
AddExtensionMethod · 0.45
set_nameMethod · 0.45
mutable_valueMethod · 0.45
GetNumberOfComponentsMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected