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

Method LoadState

Remoting/ServerManager/vtkSMStateLoader.cxx:510–548  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

508
509//---------------------------------------------------------------------------
510int vtkSMStateLoader::LoadState(vtkPVXMLElement* elem, bool keepOriginalId)
511{
512 this->Internal->KeepOriginalId = keepOriginalId;
513 if (!elem)
514 {
515 vtkErrorMacro("Cannot load state from (null) root element.");
516 return 0;
517 }
518
519 vtkSMSessionProxyManager* pxm = this->GetSessionProxyManager();
520 if (pxm == nullptr)
521 {
522 vtkErrorMacro("Cannot load state without a ProxyManager");
523 return 0;
524 }
525
526 if (!this->ProxyLocator)
527 {
528 vtkErrorMacro("Please set the locator correctly.");
529 return 0;
530 }
531
532 this->ProxyLocator->SetDeserializer(this);
533 int ret = this->LoadStateInternal(elem);
534 this->ProxyLocator->SetDeserializer(nullptr);
535
536 // BUG #10650. When animation scene time ranges are read from the state, they
537 // often override those that the timekeeper painstakingly computed. Here we
538 // explicitly trigger the timekeeper so that the scene re-determines the
539 // ranges, unless they are locked of course.
540 vtkSMProxy* timekeeper = pxm->GetProxy("timekeeper", "TimeKeeper");
541 if (timekeeper)
542 {
543 timekeeper->GetProperty("TimeRange")->Modified();
544 timekeeper->GetProperty("TimestepValues")->Modified();
545 }
546
547 return ret;
548}
549
550//---------------------------------------------------------------------------
551int vtkSMStateLoader::LoadStateInternal(vtkPVXMLElement* parent)

Callers

nothing calls this directly

Calls 5

LoadStateInternalMethod · 0.95
GetProxyMethod · 0.45
ModifiedMethod · 0.45
GetPropertyMethod · 0.45

Tested by

no test coverage detected