An example layout.
#if (!defined LIBSBML_HAS_PACKAGE_LAYOUT)
#error "This example requires libSBML to be built with the layout extension."
#endif
int main(int argc, char** argv)
{
model->
setId(
"TestModel");
compartment->
setId(
"Compartment_1");
species1->
setId(
"Species_1");
species2->
setId(
"Species_2");
reaction1->
setId(
"Reaction_1");
reference1->
setId(
"SpeciesReference_1");
reference2->
setId(
"SpeciesReference_2");
reaction2->
setId(
"Reaction_2");
reference3->
setId(
"SpeciesReference_3");
reference4->
setId(
"SpeciesReference_4");
layout->
setId(
"Layout_1");
compartmentGlyph->
setId(
"CompartmentGlyph_1");
speciesGlyph1->
setId(
"SpeciesGlyph_1");
textGlyph1->
setId(
"TextGlyph_01");
speciesGlyph2->
setId(
"SpeciesGlyph_2");
textGlyph2->
setId(
"TextGlyph_02");
reactionGlyph1->
setId(
"ReactionGlyph_1");
Point p(&layoutns, 165, 105);
p =
Point(&layoutns, 165, 115);
reactionGlyph2->
setId(
"ReactionGlyph_1");
p =
Point(&layoutns, 235, 105);
p =
Point(&layoutns, 235, 115);
speciesReferenceGlyph1->
setId(
"SpeciesReferenceGlyph_1");
Curve* speciesReferenceCurve1 = speciesReferenceGlyph1->
getCurve();
p =
Point(&layoutns, 165, 105);
p =
Point(&layoutns, 165, 90);
p =
Point(&layoutns, 165, 90);
p =
Point(&layoutns, 195, 60);
speciesReferenceGlyph2->
setId(
"SpeciesReferenceGlyph_2");
Curve* speciesReferenceCurve2 = speciesReferenceGlyph2->
getCurve();
p =
Point(&layoutns, 165, 115);
p =
Point(&layoutns, 165, 130);
p =
Point(&layoutns, 165, 130);
p =
Point(&layoutns, 195, 160);
speciesReferenceGlyph3->
setId(
"SpeciesReferenceGlyph_3");
Curve* speciesReferenceCurve3 = speciesReferenceGlyph3->
getCurve();
p =
Point(&layoutns, 235, 115);
p =
Point(&layoutns, 235, 130);
p =
Point(&layoutns, 235, 130);
p =
Point(&layoutns, 205, 160);
speciesReferenceGlyph4->
setId(
"SpeciesReferenceGlyph_4");
Curve* speciesReferenceCurve4 = speciesReferenceGlyph4->
getCurve();
p =
Point(&layoutns, 235, 105);
p =
Point(&layoutns, 235, 90);
p =
Point(&layoutns, 235, 90);
p =
Point(&layoutns, 205, 60);
writeSBML(document,
"layout_example1_L2.xml");
delete document;
}