MCPcopy Create free account
hub / github.com/MITK/MITK / LoadBehavior

Method LoadBehavior

Modules/Core/src/Interactions/mitkStateMachineContainer.cpp:59–74  ·  view source on GitHub ↗

* @brief Loads the xml file filename and generates the necessary instances. **/

Source from the content-addressed store, hash-verified

57 * @brief Loads the xml file filename and generates the necessary instances.
58 **/
59bool mitk::StateMachineContainer::LoadBehavior(const std::string &fileName, const us::Module *module)
60{
61 if (module == nullptr)
62 {
63 module = us::GetModuleContext()->GetModule();
64 }
65 us::ModuleResource resource = module->GetResource("Interactions/" + fileName);
66 if (!resource.IsValid())
67 {
68 mitkThrow() << ("Resource not valid. State machine pattern not found:" + fileName);
69 }
70 us::ModuleResourceStream stream(resource);
71 this->SetStream(&stream);
72 m_Filename = fileName;
73 return this->Parse() && !m_errors;
74}
75
76mitk::StateMachineState::Pointer mitk::StateMachineContainer::GetStartState() const
77{

Callers 2

LoadStateMachineMethod · 0.80

Calls 6

GetModuleContextFunction · 0.85
GetResourceMethod · 0.80
GetModuleMethod · 0.45
IsValidMethod · 0.45
SetStreamMethod · 0.45
ParseMethod · 0.45

Tested by 1