Ejemplo n.º 1
0
 void mitk::XML2EventParser::EndElement(const char *elementName)
 {
   std::string name(elementName);
   // At end of input section, all necessary infos are collected to created an interaction event.
   if (name == InteractionEventConst::xmlTagEventVariant())
   {
     InteractionEvent::Pointer event = EventFactory::CreateEvent(m_EventPropertyList);
     if (event.IsNotNull())
     {
       m_InteractionList.push_back(event);
     }
     else
     {
       MITK_WARN << "EventConfig: Unknown Event-Type in config. Entry skipped: " << name;
     }
   }
 }
Ejemplo n.º 2
0
void mitk::EventConfigXMLParser::EndElement(const char *elementName)
{
  const std::string name(elementName);
  // At end of input section, all necessary infos are collected to created an interaction event.
  if (name == InteractionEventConst::xmlTagEventVariant())
  {
    InteractionEvent::Pointer event = EventFactory::CreateEvent(d->m_EventPropertyList);
    if (event.IsNotNull())
    {
      d->m_CurrEventMapping.interactionEvent = event;
      d->InsertMapping(d->m_CurrEventMapping);
    }
    else
    {
      MITK_WARN << "EventConfig: Unknown Event-Type in config. Entry skipped: " << name;
    }
  }
}
Ejemplo n.º 3
0
mitk::EventConfig::EventConfig(const std::vector<PropertyList::Pointer> &configDescription)
: d(new EventConfigPrivate)
{
  std::vector<PropertyList::Pointer>::const_iterator it_end = configDescription.end();
  for (std::vector<PropertyList::Pointer>::const_iterator it = configDescription.begin(); it != it_end; ++it)
  {
    std::string typeVariant;
    (*it)->GetStringProperty(InteractionEventConst::xmlTagEventVariant().c_str(), typeVariant);
    if ( typeVariant != "" )
    {
      InteractionEvent::Pointer event = EventFactory::CreateEvent(*it);
      if (event.IsNotNull())
      {

        d->m_CurrEventMapping.interactionEvent = event;
        std::string eventVariant;
        (*it)->GetStringProperty(InteractionEventConst::xmlTagEventVariant().c_str(), eventVariant);
        d->m_CurrEventMapping.variantName = eventVariant;
        d->InsertMapping(d->m_CurrEventMapping);
      }
      else
      {
        MITK_WARN<< "EventConfig: Unknown Event-Type in config. When constructing from PropertyList.";
      }
    }
    else
    {
      (*it)->GetStringProperty(InteractionEventConst::xmlTagParam().c_str(), typeVariant);
      if ( typeVariant != "" )
      {
        std::string name, value;
        (*it)->GetStringProperty(InteractionEventConst::xmlParameterName().c_str(), name);
        (*it)->GetStringProperty(InteractionEventConst::xmlParameterValue().c_str(), value);
        d->m_PropertyList->SetStringProperty(name.c_str(), value.c_str());
      }
    }
  }
}