/**
 * Creates an XMLNode object from this.
 */
XMLNode ReactionGlyph::toXML() const
{
  XMLNamespaces xmlns = XMLNamespaces();
  XMLTriple triple = XMLTriple("reactionGlyph", "", "");
  XMLAttributes att = XMLAttributes();
  // add the SBase Ids
  addSBaseAttributes(*this,att);
  addGraphicalObjectAttributes(*this,att);
  if(this->isSetReactionId()) att.add("reaction",this->mReaction);
  XMLToken token = XMLToken(triple, att, xmlns); 
  XMLNode node(token);
  // add the notes and annotations
  if(this->mNotes) node.addChild(*this->mNotes);
  if(this->mAnnotation) node.addChild(*this->mAnnotation);
  if(this->mCurve.getNumCurveSegments()==0)
  {
    // write the bounding box
    node.addChild(this->mBoundingBox.toXML());
  }
  else
  {
    // add the curve
    node.addChild(this->mCurve.toXML());
  }
  // add the list of species reference glyphs
  if(this->mSpeciesReferenceGlyphs.size()>0)
  {
    node.addChild(this->mSpeciesReferenceGlyphs.toXML());
  }
  return node;
}
/**
 * Creates an XMLNode object from this.
 */
XMLNode ListOfSpeciesReferenceGlyphs::toXML() const
{
  XMLNamespaces xmlns = XMLNamespaces();
  XMLTriple triple = XMLTriple("listOfSpeciesReferenceGlyphs", "http://projects.eml.org/bcb/sbml/level2", "");
  XMLAttributes att = XMLAttributes();
  XMLToken token = XMLToken(triple, att, xmlns); 
  XMLNode node(token);
  // add the notes and annotations
  bool end=true;
  if(this->mNotes)
  {
      node.addChild(*this->mNotes);
      end=false;
  }
  if(this->mAnnotation)
  {
      node.addChild(*this->mAnnotation);
      end=false;
  }
  unsigned int i,iMax=this->size();
  const SpeciesReferenceGlyph* object=NULL;
  for(i=0;i<iMax;++i)
  {
    object=dynamic_cast<const SpeciesReferenceGlyph*>(this->get(i));
    assert(object);
    node.addChild(object->toXML());
  }
  if(end==true && iMax==0)
  {
    node.setEnd();
  }
  return node;
}
Beispiel #3
0
/**
 * Creates an XMLNode object from this.
 */
XMLNode Curve::toXML() const
{
  XMLNamespaces xmlns = XMLNamespaces();
  XMLTriple triple = XMLTriple("curve", "", "");
  XMLAttributes att = XMLAttributes();
  // add the SBase Ids
  addSBaseAttributes(*this,att);
  XMLToken token = XMLToken(triple, att, xmlns); 
  XMLNode node(token);
  // add the notes and annotations
  bool end=true;
  if(this->mNotes)
  {
      node.addChild(*this->mNotes);
      end=false;
  }
  if(this->mAnnotation)
  {
      node.addChild(*this->mAnnotation);
      end=false;
  }
  // add the list of line segments
  if(this->mCurveSegments.size()>0)
  {
      node.addChild(this->mCurveSegments.toXML());
      end=false;
  }
  if(end==true) node.setEnd();
  return node;
}
/**
 * Creates an XMLNode object from this.
 */
XMLNode GraphicalObject::toXML() const
{
    XMLNamespaces xmlns = XMLNamespaces();
    XMLTriple triple = XMLTriple("graphicalObject", "", "");
    XMLAttributes att = XMLAttributes();
    // add the SBase Ids
    addSBaseAttributes(*this,att);
    addGraphicalObjectAttributes(*this,att);
    XMLToken token = XMLToken(triple, att, xmlns);
    XMLNode node(token);
    // add the notes and annotations
    if(this->mNotes) node.addChild(*this->mNotes);
    if(this->mAnnotation) node.addChild(*this->mAnnotation);
    // write the bounding box
    node.addChild(this->mBoundingBox.toXML());
    return node;
}
/**
 * Creates an XMLNode object from this.
 */
XMLNode LineSegment::toXML() const
{
  XMLNamespaces xmlns = XMLNamespaces();
  XMLTriple triple = XMLTriple("curveSegment", "", "");
  XMLAttributes att = XMLAttributes();
  // add the SBase Ids
  addSBaseAttributes(*this,att);
  att.add("type","LineSegment","http://www.w3.org/2001/XMLSchema-instance","xsi");
  XMLToken token = XMLToken(triple, att, xmlns); 
  XMLNode node(token);
  // add the notes and annotations
  if(this->mNotes) node.addChild(*this->mNotes);
  if(this->mAnnotation) node.addChild(*this->mAnnotation);
  // add start point
  node.addChild(this->mStartPoint.toXML("start"));
  // add end point
  node.addChild(this->mEndPoint.toXML("end"));
  return node;
}
Beispiel #6
0
/**
 * Creates an XMLNode object from this.
 */
XMLNode TextGlyph::toXML() const
{
  XMLNamespaces xmlns = XMLNamespaces();
  XMLTriple triple = XMLTriple("textGlyph", "", "");
  XMLAttributes att = XMLAttributes();
  // add the SBase Ids
  addSBaseAttributes(*this,att);
  addGraphicalObjectAttributes(*this,att);
  if(this->isSetText()) att.add("text",this->mText);
  if(this->isSetGraphicalObjectId()) att.add("graphicalObject",this->mGraphicalObject);
  if(this->isSetOriginOfTextId()) att.add("originOfText",this->mOriginOfText);
  XMLToken token = XMLToken(triple, att, xmlns); 
  XMLNode node(token);
  // add the notes and annotations
  if(this->mNotes) node.addChild(*this->mNotes);
  if(this->mAnnotation) node.addChild(*this->mAnnotation);
  // write the bounding box
  node.addChild(this->mBoundingBox.toXML());
  return node;
}
Beispiel #7
0
/**
 * Creates an XMLNode object from this.
 */
XMLNode Point::toXML(const std::string& name) const
{
  XMLNamespaces xmlns = XMLNamespaces();
  XMLTriple triple = XMLTriple(name, "", "");
  XMLAttributes att = XMLAttributes();
  // add the SBase Ids
  addSBaseAttributes(*this,att);
  std::ostringstream os;
  os << this->mXOffset;
  att.add("x",os.str());
  os.str("");
  os << this->mYOffset;
  att.add("y",os.str());
  if(this->mZOffset!=0.0)
  {
    os.str("");
    os << this->mZOffset;
    att.add("z",os.str());
  }
  XMLToken token = XMLToken(triple, att, xmlns); 
  XMLNode node(token);
  // add the notes and annotations
  bool end=true;
  if(this->mNotes)
  {
      node.addChild(*this->mNotes);
      end=false;
  }
  if(this->mAnnotation)
  {
      node.addChild(*this->mAnnotation);
      end=false;
  }

  if(end==true) node.setEnd();
  return node;
}