Beispiel #1
0
/**
 * @return the SBML object corresponding to next XMLToken in the
 * XMLInputStream or NULL if the token was not recognized.
 */
SBase*
ListOfLineSegments::createObject (XMLInputStream& stream)
{
  const std::string& name   = stream.peek().getName();
  SBase*        object = 0;


  if (name == "curveSegment")
  {
    std::string type = "LineSegment";
    XMLTriple triple("type","http://www.w3.org/2001/XMLSchema-instance","xsi");

    if (!stream.peek().getAttributes().readInto(triple, type))
    {
      //std::cout << "[DEBUG] ListOfLineSegments::createObject () : Failed to read xsi:type" << std::endl;
      return object;
    }

    //std::cout << "[DEBUG] ListOfLineSegments::createObject () : type " << type << std::endl;
    LAYOUT_CREATE_NS(layoutns,this->getSBMLNamespaces());
    if(type=="LineSegment")
    {
      object = new LineSegment(layoutns);
    }
    else if(type=="CubicBezier")
    {
      object = new CubicBezier(layoutns);
    }
  }
  
  if(object) appendAndOwn(object);

  return object;
}
/**
 * @return the SBML object corresponding to next XMLToken in the
 * XMLInputStream or NULL if the token was not recognized.
 */
SBase*
ListOfSpeciesReferenceGlyphs::createObject (XMLInputStream& stream)
{
  const std::string& name   = stream.peek().getName();
  SBase*        object = 0;


  if (name == "speciesReferenceGlyph")
  {
    object = new SpeciesReferenceGlyph();
    appendAndOwn(object);
//    mItems.push_back(object);
  }

  return object;
}
Beispiel #3
0
/** @cond doxygenLibsbmlInternal */
SBase*
ListOfLineSegments::createObject (XMLInputStream& stream)
{
  const std::string& name   = stream.peek().getName();
  SBase*        object = 0;


  if (name == "curveSegment")
  {
    std::string type = "LineSegment";
    XMLTriple triple("type","http://www.w3.org/2001/XMLSchema-instance","xsi");

    if (!stream.peek().getAttributes().readInto(triple, type))
    {
      //std::cout << "[DEBUG] ListOfLineSegments::createObject () : 
      //              Failed to read xsi:type" << std::endl;
      getErrorLog()->logPackageError("layout", 
                     LayoutXsiTypeAllowedLocations,
                     getPackageVersion(), getLevel(), getVersion(), "", getLine(), getColumn());

      return object;
    }

    //std::cout << "[DEBUG] ListOfLineSegments::createObject () : type " 
    //          << type << std::endl;
    
    LAYOUT_CREATE_NS(layoutns,this->getSBMLNamespaces());
    if(type=="LineSegment")
    {
      object = new LineSegment(layoutns);
    }
    else if(type=="CubicBezier")
    {
      object = new CubicBezier(layoutns);
    }
    else
    {
      getErrorLog()->logPackageError("layout", LayoutXsiTypeSyntax,
                     getPackageVersion(), getLevel(), getVersion(), "", getLine(), getColumn());
    }
    delete layoutns;
  }
  
  if(object) appendAndOwn(object);

  return object;
}
/** @cond doxygenLibsbmlInternal */
SBase*
ListOfReferenceGlyphs::createObject (XMLInputStream& stream)
{
  const std::string& name   = stream.peek().getName();
  SBase*             object = NULL;


  if (name == "referenceGlyph")
  {
    LAYOUT_CREATE_NS(layoutns,this->getSBMLNamespaces());
    object = new ReferenceGlyph(layoutns);
    appendAndOwn(object);
    delete layoutns;
  }

  return object;
}
/** @cond doxygenLibsbmlInternal */
SBase*
ListOfSpeciesReferenceGlyphs::createObject (XMLInputStream& stream)
{
  const std::string& name   = stream.peek().getName();
  SBase*        object = 0;


  if (name == "speciesReferenceGlyph")
  {
    LAYOUT_CREATE_NS(layoutns,this->getSBMLNamespaces());
    object = new SpeciesReferenceGlyph(layoutns);
    appendAndOwn(object);
//    mItems.push_back(object);
  }

  return object;
}