---------------------------------------------------------------------------
| 397 | |
| 398 | //--------------------------------------------------------------------------- |
| 399 | int 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 | //--------------------------------------------------------------------------- |
| 440 | void vtkSMStateLoader::HandleCustomProxyDefinitions(vtkPVXMLElement* element) |
no test coverage detected