/** * 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 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 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; }