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

Method HandleProxyCollection

Remoting/ServerManager/vtkSMStateLoader.cxx:399–437  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

397
398//---------------------------------------------------------------------------
399int vtkSMStateLoader::HandleProxyCollection(vtkPVXMLElement* collectionElement)
400{
401 const char* groupName = collectionElement->GetAttribute("name");
402 if (!groupName)
403 {
404 vtkErrorMacro("Required attribute name is missing.");
405 return 0;
406 }
407 unsigned int numElems = collectionElement->GetNumberOfNestedElements();
408 for (unsigned int i = 0; i < numElems; i++)
409 {
410 vtkPVXMLElement* currentElement = collectionElement->GetNestedElement(i);
411 if (currentElement->GetName() && strcmp(currentElement->GetName(), "Item") == 0)
412 {
413 int id;
414 if (!currentElement->GetScalarAttribute("id", &id))
415 {
416 vtkErrorMacro("Could not read id for Item. Skipping.");
417 continue;
418 }
419
420 vtkSMProxy* proxy = this->ProxyLocator->LocateProxy(id);
421 if (!proxy)
422 {
423 continue;
424 }
425 const char* name = currentElement->GetAttribute("name");
426 if (!name)
427 {
428 vtkErrorMacro("Attribute: name is missing. Cannot register proxy "
429 "with the proxy manager.");
430 proxy->Delete();
431 continue;
432 }
433 }
434 }
435
436 return 1;
437}
438
439//---------------------------------------------------------------------------
440void vtkSMStateLoader::HandleCustomProxyDefinitions(vtkPVXMLElement* element)

Callers 1

LoadStateInternalMethod · 0.95

Calls 6

GetNestedElementMethod · 0.80
GetScalarAttributeMethod · 0.80
LocateProxyMethod · 0.80
GetNameMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected