* @brief Loads the xml file filename and generates the necessary instances. **/
| 57 | * @brief Loads the xml file filename and generates the necessary instances. |
| 58 | **/ |
| 59 | bool 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 | |
| 76 | mitk::StateMachineState::Pointer mitk::StateMachineContainer::GetStartState() const |
| 77 | { |