libSBML C++ API  5.20.2
convertLayout.cpp

Converts SBML Layout and Render datra from SBML Level 2 to Level 3 and vice versa.

/**
* @file convertLayout.cpp
* @brief Converts SBML Layout and Render Information from L2 to L3 and vice versa
* @author Frank Bergmann
*
* This example implements two ways of converting the Layout / Render information
* contained in the SBML file.
*
* method 1: Is implemented in the LayoutConverter class, it navigates through
* all classes of the Layout / Render extension and sets their element
* namespace to the new one.
*
* method 2: Is implemented in the SimpleLayoutConverter class. This class makes
* use of the new functionality of the elements reporting the namespace
* of the parent document when possible.
*
* <!--------------------------------------------------------------------------
* This sample program is distributed under a different license than the rest
* of libSBML. This program uses the open-source MIT license, as follows:
*
* Copyright (c) 2013-2018 by the California Institute of Technology
* (California, USA), the European Bioinformatics Institute (EMBL-EBI, UK)
* and the University of Heidelberg (Germany), with support from the National
* Institutes of Health (USA) under grant R01GM070923. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Neither the name of the California Institute of Technology (Caltech), nor
* of the European Bioinformatics Institute (EMBL-EBI), nor of the University
* of Heidelberg, nor the names of any contributors, may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* ------------------------------------------------------------------------ -->
*/
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <stdlib.h>
#include "sbml/SBMLTypes.h"
#ifdef LIBSBML_HAS_PACKAGE_RENDER
#endif
#if (!defined LIBSBML_HAS_PACKAGE_LAYOUT)
#error "This example requires libSBML to be built with the layout extension."
#endif
using namespace std;
LIBSBML_CPP_NAMESPACE_USE
class LayoutConverter
{
public:
LayoutConverter(SBMLDocument *doc) {
_doc = doc;
}
LayoutConverter(const char* filename) {
_doc = readSBMLFromFile(filename);
}
~LayoutConverter(){
delete _doc;
}
SBMLDocument* getDocument() const { return _doc; }
void convertLayout()
{
if (_doc == NULL || _doc->getModel() == NULL)
return;
// if layout is not used bail
if (_doc->getPlugin("layout") == NULL)
return;
if (_doc->getLevel() == 3)
convertLayoutToL2();
else
convertLayoutToL3();
}
void convertLayoutToL2()
{
if (_doc == NULL || _doc->getModel() == NULL)
return;
layoutNsUri = "http://projects.eml.org/bcb/sbml/level2";
layoutNs = new LayoutPkgNamespaces(2, 1);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
foundRenderElements = false;
renderNsUri = "http://projects.eml.org/bcb/sbml/render/level2";
renderNs = new RenderPkgNamespaces(2, 1);
#endif
= (LayoutModelPlugin*)_doc->getModel()->getPlugin("layout");
if (plugin == NULL)
return;
prop.addOption("strict", false);
prop.addOption("setLevelAndVersion", true);
prop.addOption("ignorePackages", true);
if (_doc->convert(prop) != LIBSBML_OPERATION_SUCCESS)
{
cout << "Conversion failed!" << endl;
_doc->printErrors();
exit(2);
}
plugin->setElementNamespace(layoutNsUri);
SBMLDocumentPlugin *docPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("layout");
if (docPlugin != NULL)
docPlugin->setElementNamespace(layoutNsUri);
updateNs(plugin->getListOfLayouts());
_doc->getSBMLNamespaces()->removePackageNamespace(3, 1, "layout", 1);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
SBMLDocumentPlugin *rdocPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("render");
if (rdocPlugin!= NULL)
rdocPlugin->setElementNamespace(renderNsUri);
_doc->getSBMLNamespaces()->removePackageNamespace(3, 1, "render", 1);
#endif
}
void convertLayoutToL3()
{
if (_doc == NULL || _doc->getModel() == NULL)
return;
layoutNsUri = "http://www.sbml.org/sbml/level3/version1/layout/version1";
layoutNs = new LayoutPkgNamespaces(3, 1, 1);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
foundRenderElements = false;
renderNsUri = "http://www.sbml.org/sbml/level3/version1/render/version1";
renderNs = new RenderPkgNamespaces(3, 1, 1);
#endif
= (LayoutModelPlugin*)_doc->getModel()->getPlugin("layout");
if (plugin == NULL)
return;
prop.addOption("strict", false);
prop.addOption("setLevelAndVersion", true);
prop.addOption("ignorePackages", true);
if (_doc->convert(prop) != LIBSBML_OPERATION_SUCCESS)
{
cout << "Conversion failed!" << endl;
_doc->printErrors();
exit(2);
}
plugin->setElementNamespace(layoutNsUri);
SBMLDocumentPlugin *docPlugin
= (SBMLDocumentPlugin*)_doc->getPlugin("layout");
if (docPlugin != NULL)
docPlugin->setElementNamespace(layoutNsUri);
updateNs(plugin->getListOfLayouts());
_doc->getSBMLNamespaces()->addPackageNamespace("layout", 1);
_doc->setPackageRequired("layout", false);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
if (!foundRenderElements)
return;
SBMLDocumentPlugin *rdocPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("render");
if (rdocPlugin != NULL)
{
rdocPlugin->setElementNamespace(renderNsUri);
_doc->getSBMLNamespaces()->addPackageNamespace("render", 1);
}
else
{
_doc->enablePackage(renderNsUri, "render", true);
}
_doc->setPackageRequired("render", false);
#endif
}
void updateNs(ListOfLayouts *list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((Layout*)(list->get(i)));
#ifdef LIBSBML_HAS_PACKAGE_RENDER
= (RenderListOfLayoutsPlugin*)list->getPlugin("render");
if (lolPlugin != NULL)
{
updateNs(lolPlugin->getListOfGlobalRenderInformation());
lolPlugin->setElementNamespace(renderNsUri);
}
#endif
}
#ifdef LIBSBML_HAS_PACKAGE_RENDER
void updateNs(ListOfGlobalRenderInformation *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((GlobalRenderInformation*)(list->get(i)));
}
void updateNs(ListOfLocalRenderInformation *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((LocalRenderInformation*)(list->get(i)));
}
void updateNs(GlobalRenderInformation *info)
{
foundRenderElements = true;
info->setSBMLNamespaces(renderNs);
updateNs(info->getListOfColorDefinitions());
updateNs(info->getListOfGradientDefinitions());
updateNs(info->getListOfLineEndings());
updateNs(info->getListOfStyles());
}
void updateNs(LocalRenderInformation *info)
{
foundRenderElements = true;
info->setSBMLNamespaces(renderNs);
updateNs(info->getListOfColorDefinitions());
updateNs(info->getListOfGradientDefinitions());
updateNs(info->getListOfLineEndings());
updateNs(info->getListOfStyles());
}
void updateNs(ListOfColorDefinitions *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((ColorDefinition*)(list->get(i)));
}
void updateNs(ColorDefinition *color)
{
color->setSBMLNamespaces(renderNs);
}
void updateNs(ListOfGradientDefinitions *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
{
GradientBase* current = list->get(i);
updateNs((LinearGradient*)(current));
else
updateNs((RadialGradient*)(current));
}
}
void updateNs(GradientBase *gradient)
{
gradient->setSBMLNamespaces(renderNs);
updateNs(gradient->getListOfGradientStops());
}
void updateNs(ListOfGradientStops *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((GradientStop*)(list->get(i)));
}
void updateNs(GradientStop *stop)
{
stop->setSBMLNamespaces(renderNs);
}
void updateNs(ListOfLineEndings *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((LineEnding*)(list->get(i)));
}
void updateNs(LineEnding *line)
{
line->setSBMLNamespaces(renderNs);
updateNs(line->getBoundingBox());
updateNs(line->getGroup());
}
void updateNs(ListOfGlobalStyles *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((GlobalStyle*)(list->get(i)));
}
void updateNs(GlobalStyle *style)
{
style->setSBMLNamespaces(renderNs);
updateNs(style->getGroup());
}
void updateNs(LocalStyle *style)
{
style->setSBMLNamespaces(renderNs);
updateNs(style->getGroup());
}
void updateNs(RenderGroup *group)
{
group->setSBMLNamespaces(renderNs);
updateNs(group->getListOfElements());
}
void updateNs(ListOfDrawables *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
{
Transformation2D* current = list->get(i);
switch(current->getTypeCode())
{
updateNs((RenderCurve*)(current));
break;
updateNs((Ellipse*)(current));
break;
updateNs((RenderGroup*)(current));
break;
updateNs((Image*)(current));
break;
updateNs((Polygon*)(current));
break;
updateNs((Rectangle*)(current));
break;
updateNs((Text*)(current));
break;
}
}
}
void updateNs(RenderCurve *curve)
{
curve->setSBMLNamespaces(renderNs);
updateNs(curve->getListOfElements());
}
void updateNs(Transformation2D *element)
{
element->setSBMLNamespaces(renderNs);
}
void updateNs(Polygon *element)
{
element->setSBMLNamespaces(renderNs);
updateNs(element->getListOfElements());
}
void updateNs(ListOfCurveElements *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((RenderPoint*)(list->get(i)));
}
void updateNs(RenderPoint *element)
{
element->setSBMLNamespaces(renderNs);
}
void updateNs(ListOfLocalStyles *list)
{
list->setSBMLNamespaces(renderNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((LocalStyle*)(list->get(i)));
}
#endif
void updateNs(ListOfGraphicalObjects *list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((GraphicalObject*)(list->get(i)));
}
void updateNs(ListOfSpeciesGlyphs*list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((SpeciesGlyph*)(list->get(i)));
}
void updateNs(ListOfCompartmentGlyphs*list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((CompartmentGlyph*)(list->get(i)));
}
void updateNs(ListOfLineSegments *list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
{
LineSegment* current = (LineSegment*)(list->get(i));
updateNs((CubicBezier*)current);
else
updateNs(current);
}
}
void updateNs(ListOfReactionGlyphs*list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((ReactionGlyph*)(list->get(i)));
}
void updateNs(ListOfSpeciesReferenceGlyphs *list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((SpeciesReferenceGlyph*)(list->get(i)));
}
void updateNs(ListOfTextGlyphs* list)
{
list->setSBMLNamespaces(layoutNs);
for (unsigned int i = 0; i < list->size(); i++)
updateNs((TextGlyph*)(list->get(i)));
}
void updateNs(CubicBezier *cubic)
{
cubic->setSBMLNamespaces(layoutNs);
updateNs((LineSegment*)(cubic));
updateNs(cubic->getBasePoint1());
updateNs(cubic->getBasePoint2());
}
void updateNs(LineSegment *segment)
{
segment->setSBMLNamespaces(layoutNs);
updateNs(segment->getStart());
updateNs(segment->getEnd());
}
void updateNs(SpeciesGlyph *glyph)
{
glyph->setSBMLNamespaces(layoutNs);
updateNs((GraphicalObject*) glyph);
}
void updateNs(SpeciesReferenceGlyph *glyph)
{
glyph->setSBMLNamespaces(layoutNs);
updateNs((Curve*)glyph->getCurve());
updateNs((GraphicalObject*) glyph);
}
void updateNs(TextGlyph *glyph)
{
glyph->setSBMLNamespaces(layoutNs);
updateNs((GraphicalObject*) glyph);
}
void updateNs(CompartmentGlyph *glyph)
{
glyph->setSBMLNamespaces(layoutNs);
updateNs((GraphicalObject*) glyph);
}
void updateNs(ReactionGlyph *glyph)
{
glyph->setSBMLNamespaces(layoutNs);
updateNs((GraphicalObject*) glyph);
updateNs(glyph->getListOfSpeciesReferenceGlyphs());
updateNs(glyph->getCurve());
}
void updateNs(Curve *curve)
{
curve->setSBMLNamespaces(layoutNs);
updateNs(curve->getListOfCurveSegments());
}
void updateNs(GraphicalObject *glyph)
{
glyph->setSBMLNamespaces(layoutNs);
updateNs(glyph->getBoundingBox());
}
void updateNs(BoundingBox *box)
{
box->setSBMLNamespaces(layoutNs);
updateNs(box->getDimensions());
updateNs(box->getPosition());
}
void updateNs(Dimensions *dim)
{
dim->setSBMLNamespaces(layoutNs);
}
void updateNs(Point *point)
{
point->setSBMLNamespaces(layoutNs);
}
void updateNs(Layout *layout)
{
layout->setSBMLNamespaces(layoutNs);
updateNs(layout->getDimensions());
updateNs(layout->getListOfCompartmentGlyphs());
updateNs(layout->getListOfReactionGlyphs());
updateNs(layout->getListOfSpeciesGlyphs());
updateNs(layout->getListOfTextGlyphs());
#ifdef LIBSBML_HAS_PACKAGE_RENDER
RenderLayoutPlugin* layoutPlugin
= (RenderLayoutPlugin*)layout->getPlugin("render");
if (layoutPlugin != NULL)
{
updateNs(layoutPlugin->getListOfLocalRenderInformation());
layoutPlugin->setElementNamespace(renderNsUri);
}
#endif
}
protected:
SBMLDocument* _doc;
#ifdef LIBSBML_HAS_PACKAGE_RENDER
string renderNsUri;
SBMLNamespaces *renderNs;
bool foundRenderElements;
#endif
string layoutNsUri;
SBMLNamespaces *layoutNs;
};
class SimpleLayoutConverter
{
public:
SimpleLayoutConverter(SBMLDocument *doc) {
_doc = doc;
}
SimpleLayoutConverter(const char* filename) {
_doc = readSBMLFromFile(filename);
}
~SimpleLayoutConverter(){
delete _doc;
}
SBMLDocument* getDocument() const { return _doc; }
void convertLayout()
{
if (_doc == NULL || _doc->getModel() == NULL)
return;
// if layout is not used bail
if (_doc->getPlugin("layout") == NULL)
return;
if (_doc->getLevel() == 3)
convertLayoutToL2();
else
convertLayoutToL3();
}
void convertLayoutToL2()
{
if (_doc == NULL || _doc->getModel() == NULL)
return;
layoutNsUri = "http://projects.eml.org/bcb/sbml/level2";
layoutNs = new LayoutPkgNamespaces(2, 1);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
renderNsUri = "http://projects.eml.org/bcb/sbml/render/level2";
renderNs = new RenderPkgNamespaces(2, 1);
#endif
= (LayoutModelPlugin*)_doc->getModel()->getPlugin("layout");
if (plugin == NULL)
return;
prop.addOption("strict", false);
prop.addOption("setLevelAndVersion", true);
prop.addOption("ignorePackages", true);
if (_doc->convert(prop) != LIBSBML_OPERATION_SUCCESS)
{
cout << "Conversion failed!" << endl;
_doc->printErrors();
exit(2);
}
SBMLDocumentPlugin *docPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("layout");
if (docPlugin != NULL)
docPlugin->setElementNamespace(layoutNsUri);
_doc->getSBMLNamespaces()->removePackageNamespace(3, 1, "layout", 1);
_doc->getSBMLNamespaces()->addPackageNamespace("layout", 1);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
SBMLDocumentPlugin *rdocPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("render");
if (rdocPlugin!= NULL)
rdocPlugin->setElementNamespace(renderNsUri);
_doc->getSBMLNamespaces()->removePackageNamespace(3, 1, "render", 1);
_doc->getSBMLNamespaces()->addPackageNamespace("render", 1);
#endif
}
void convertLayoutToL3()
{
if (_doc == NULL || _doc->getModel() == NULL)
return;
layoutNsUri = "http://www.sbml.org/sbml/level3/version1/layout/version1";
layoutNs = new LayoutPkgNamespaces(3, 1, 1);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
renderNsUri = "http://www.sbml.org/sbml/level3/version1/render/version1";
renderNs = new RenderPkgNamespaces(3, 1, 1);
#endif
LayoutModelPlugin* plugin = (LayoutModelPlugin*)_doc->getModel()->getPlugin("layout");
if (plugin == NULL)
return;
prop.addOption("strict", false);
prop.addOption("setLevelAndVersion", true);
prop.addOption("ignorePackages", true);
if (_doc->convert(prop) != LIBSBML_OPERATION_SUCCESS)
{
cout << "Conversion failed!" << endl;
_doc->printErrors();
exit(2);
}
//plugin->setElementNamespace(layoutNsUri);
SBMLDocumentPlugin *docPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("layout");
if (docPlugin != NULL)
docPlugin->setElementNamespace(layoutNsUri);
_doc->getSBMLNamespaces()->addPackageNamespace("layout", 1);
_doc->setPackageRequired("layout", false);
#ifdef LIBSBML_HAS_PACKAGE_RENDER
SBMLDocumentPlugin *rdocPlugin = (SBMLDocumentPlugin*)_doc->getPlugin("render");
if (rdocPlugin != NULL)
{
//rdocPlugin->setElementNamespace(renderNsUri);
_doc->getSBMLNamespaces()->addPackageNamespace("render", 1);
}
else
{
_doc->enablePackage(renderNsUri, "render", true);
}
_doc->setPackageRequired("render", false);
#endif
}
protected:
SBMLDocument* _doc;
#ifdef LIBSBML_HAS_PACKAGE_RENDER
string renderNsUri;
SBMLNamespaces *renderNs;
#endif
string layoutNsUri;
SBMLNamespaces *layoutNs;
};
int main(int argc,char** argv)
{
if (argc != 3)
{
cerr << "usage convertLayout <input> <output>" << endl << endl;
cerr << "This converter converts the SBML Layout ";
#ifdef LIBSBML_HAS_PACKAGE_RENDER
cerr << "and Render ";
#endif
cerr << "package information between SBML Level 2 and Level 3." << endl << endl;
exit(1);
}
// read document
// method 1: iterate through all elements
// LayoutConverter converter(argv[1]);
// method 2: set only the document namespaces
SimpleLayoutConverter converter(argv[1]);
// convert from L3 -> L2 or L2 -> L3
converter.convertLayout();
// write document to string
//char* sbml = writeSBMLToString(converter.getDocument());
// write document
writeSBML(converter.getDocument(),argv[2]);
}
Definition of ConversionProperties, the class encapsulating conversion configuration.
SBMLExtensionNamespaces< LayoutExtension > LayoutPkgNamespaces
Definition: LayoutExtension.h:422
@ SBML_LAYOUT_CUBICBEZIER
Definition: LayoutExtension.h:439
Include all SBML types of layout extension in a single header file.
@ SBML_RENDER_POLYGON
Definition: RenderExtension.h:367
@ SBML_RENDER_RECTANGLE
Definition: RenderExtension.h:369
@ SBML_RENDER_GROUP
Definition: RenderExtension.h:358
@ SBML_RENDER_ELLIPSE
Definition: RenderExtension.h:353
@ SBML_RENDER_IMAGE
Definition: RenderExtension.h:359
@ SBML_RENDER_CURVE
Definition: RenderExtension.h:372
@ SBML_RENDER_TEXT
Definition: RenderExtension.h:374
@ SBML_RENDER_LINEARGRADIENT
Definition: RenderExtension.h:361
SBMLExtensionNamespaces< RenderExtension > RenderPkgNamespaces
Definition: RenderExtension.h:337
Definition of RenderExtensionTypes.
Definition of SBMLDocumentPlugin, the derived class of SBasePlugin.
SBMLDocument_t * readSBMLFromFile(const char *filename)
Reads an SBML document from the given file.
Include all SBML types in a single header file.
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.
Definition: BoundingBox.h:64
const Point * getPosition() const
Returns the position of the BoundingBox as const reference to a Point object.
Definition: BoundingBox.cpp:398
const Dimensions * getDimensions() const
Returns the dimensions of the BoundingBox as const reference to a Dimensions object.
Definition: BoundingBox.cpp:409
Definition: ColorDefinition.h:93
Definition: CompartmentGlyph.h:60
Definition: ConversionProperties.h:84
virtual void addOption(const ConversionOption &option)
Adds a copy of the given option to this properties object.
Definition: ConversionProperties.cpp:232
Definition: CubicBezier.h:71
const Point * getBasePoint2() const
Returns the second base point of the curve (the one closer to the end point).
Definition: CubicBezier.cpp:437
const Point * getBasePoint1() const
Returns the first base point of the curve (the one closer to the starting point).
Definition: CubicBezier.cpp:387
Definition: Curve.h:217
const ListOfLineSegments * getListOfCurveSegments() const
Returns a reference to the ListOf object that holds all the curve segments.
Definition: Curve.cpp:275
Definition: Dimensions.h:71
Definition: Ellipse.h:81
Definition: GlobalRenderInformation.h:81
const ListOfGlobalStyles * getListOfStyles() const
Returns the ListOfGlobalStyles from this GlobalRenderInformation.
Definition: GlobalRenderInformation.cpp:188
Definition: GlobalStyle.h:82
Definition: GradientBase.h:114
virtual int getTypeCode() const
Returns the libSBML type code for this GradientBase object.
Definition: GradientBase.cpp:655
const ListOfGradientStops * getListOfGradientStops() const
Returns the ListOfGradientStops from this GradientBase.
Definition: GradientStop.h:92
Definition: GraphicalObject.h:75
BoundingBox * getBoundingBox()
Returns the bounding box for the GraphicalObject.
Definition: GraphicalObject.cpp:498
Definition: Image.h:86
Definition: Layout.h:789
const ListOfCompartmentGlyphs * getListOfCompartmentGlyphs() const
Returns the ListOf object that holds all compartment glyphs.
Definition: Layout.cpp:540
const ListOfGraphicalObjects * getListOfAdditionalGraphicalObjects() const
Returns the ListOf object that holds all additonal graphical objects.
Definition: Layout.cpp:580
const ListOfReactionGlyphs * getListOfReactionGlyphs() const
Returns the ListOf object that holds all reaction glyphs.
Definition: Layout.cpp:560
const ListOfTextGlyphs * getListOfTextGlyphs() const
Returns the ListOf object that holds all text glyphs.
Definition: Layout.cpp:570
const Dimensions * getDimensions() const
Returns the dimensions of the layout.
Definition: Layout.cpp:500
const ListOfSpeciesGlyphs * getListOfSpeciesGlyphs() const
Returns the ListOf object that holds all species glyphs.
Definition: Layout.cpp:550
Definition: LayoutModelPlugin.h:68
const ListOfLayouts * getListOfLayouts() const
Returns the ListOfLayouts object for this Model.
Definition: LayoutModelPlugin.cpp:366
Definition: LineEnding.h:89
const RenderGroup * getGroup() const
Returns the value of the "group" element of this LineEnding.
Definition: LineEnding.cpp:409
const BoundingBox * getBoundingBox() const
Returns the value of the "boundingBox" element of this LineEnding.
Definition: LineEnding.cpp:429
Definition: LineSegment.h:69
const Point * getStart() const
Returns the start point of the line.
Definition: LineSegment.cpp:307
const Point * getEnd() const
Returns the end point of the line.
Definition: LineSegment.cpp:354
virtual int getTypeCode() const
Returns the libSBML type code of this object instance.
Definition: LineSegment.cpp:623
Definition: LinearGradient.h:86
Definition: ListOfColorDefinitions.h:74
virtual ColorDefinition * get(unsigned int n)
Get a ColorDefinition from the ListOfColorDefinitions.
Definition: ListOfColorDefinitions.cpp:169
Definition: Layout.h:90
virtual CompartmentGlyph * get(unsigned int n)
Get a CompartmentGlyph from the ListOfCompartmentGlyphs.
Definition: Layout.cpp:2126
Definition: ListOfCurveElements.h:84
virtual RenderPoint * get(unsigned int n)
Get a RenderPoint from the ListOfCurveElements.
Definition: ListOfCurveElements.cpp:200
Definition: ListOfDrawables.h:92
virtual Transformation2D * get(unsigned int n)
Get a Transformation2D from the ListOfDrawables.
Definition: ListOfDrawables.cpp:137
Definition: ListOfGlobalRenderInformation.h:79
virtual GlobalRenderInformation * get(unsigned int n)
Get a GlobalRenderInformation from the ListOfGlobalRenderInformation.
Definition: ListOfGlobalRenderInformation.cpp:457
Definition: ListOfGlobalStyles.h:78
virtual GlobalStyle * get(unsigned int n)
Get a GlobalStyle from the ListOfGlobalStyles.
Definition: ListOfGlobalStyles.cpp:159
Definition: ListOfGradientDefinitions.h:81
virtual GradientBase * get(unsigned int n)
Get a GradientBase from the ListOfGradientDefinitions.
Definition: ListOfGradientDefinitions.cpp:179
Definition: ListOfGradientStops.h:92
virtual GradientStop * get(unsigned int n)
Get a GradientStop from the ListOfGradientStops.
Definition: ListOfGradientStops.cpp:180
Definition: GraphicalObject.h:487
virtual GraphicalObject * get(unsigned int n)
Get a GraphicalObject from the ListOfGraphicalObjects.
Definition: GraphicalObject.cpp:1138
unsigned int size() const
Returns number of items in this ListOf list.
Definition: ListOf.cpp:380
Definition: Layout.h:1582
virtual Layout * get(unsigned int n)
Get a Layout from the ListOfLayouts.
Definition: Layout.cpp:1944
Definition: ListOfLineEndings.h:80
virtual LineEnding * get(unsigned int n)
Get a LineEnding from the ListOfLineEndings.
Definition: ListOfLineEndings.cpp:171
Definition: Curve.h:94
virtual LineSegment * get(unsigned int n)
Get a LineSegment from the ListOfLineSegments.
Definition: Curve.cpp:237
Definition: ListOfLocalRenderInformation.h:81
virtual LocalRenderInformation * get(unsigned int n)
Get a LocalRenderInformation from the ListOfLocalRenderInformation.
Definition: ListOfLocalRenderInformation.cpp:454
Definition: ListOfLocalStyles.h:79
virtual LocalStyle * get(unsigned int n)
Get a LocalStyle from the ListOfLocalStyles.
Definition: ListOfLocalStyles.cpp:159
Definition: Layout.h:445
virtual ReactionGlyph * get(unsigned int n)
Get a ReactionGlyph from the ListOfReactionGlyphs.
Definition: Layout.cpp:2450
Definition: Layout.h:268
virtual SpeciesGlyph * get(unsigned int n)
Get a SpeciesGlyph from the ListOfSpeciesGlyphs.
Definition: Layout.cpp:2278
Definition: ReactionGlyph.h:88
virtual SpeciesReferenceGlyph * get(unsigned int n)
Get a SpeciesReferenceGlyph from the ListOfSpeciesReferenceGlyphs.
Definition: ReactionGlyph.cpp:909
Definition: Layout.h:622
virtual TextGlyph * get(unsigned int n)
Get a TextGlyph from the ListOfTextGlyphs.
Definition: Layout.cpp:2599
Definition: LocalRenderInformation.h:72
const ListOfLocalStyles * getListOfStyles() const
Returns the ListOfLocalStyles from this LocalRenderInformation.
Definition: LocalRenderInformation.cpp:191
Definition: LocalStyle.h:82
Definition: Point.h:65
Definition: Polygon.h:83
const ListOfCurveElements * getListOfElements() const
Returns the ListOfCurveElements from this Polygon.
Definition: Polygon.cpp:330
Definition: RadialGradient.h:89
Definition: ReactionGlyph.h:255
const ListOfSpeciesReferenceGlyphs * getListOfSpeciesReferenceGlyphs() const
Returns the ListOf object that hold the species reference glyphs.
Definition: ReactionGlyph.cpp:353
const Curve * getCurve() const
Returns the curve object for the reaction glyph.
Definition: ReactionGlyph.cpp:452
Definition: Rectangle.h:78
Definition: RenderCurve.h:89
const ListOfCurveElements * getListOfElements() const
Returns the ListOfCurveElements from this RenderCurve.
Definition: RenderCurve.cpp:335
Definition: RenderGroup.h:86
const ListOfDrawables * getListOfElements() const
Returns the ListOfDrawables from this RenderGroup.
Definition: RenderGroup.cpp:975
const ListOfGradientDefinitions * getListOfGradientDefinitions() const
Returns the ListOfGradientDefinitions from this RenderInformationBase.
const ListOfColorDefinitions * getListOfColorDefinitions() const
Returns the ListOfColorDefinitions from this RenderInformationBase.
const ListOfLineEndings * getListOfLineEndings() const
Returns the ListOfLineEndings from this RenderInformationBase.
Definition: RenderLayoutPlugin.h:67
ListOfLocalRenderInformation * getListOfLocalRenderInformation()
Returns a pointer to the list object that contains local render information.
Definition: RenderLayoutPlugin.cpp:334
Definition: RenderListOfLayoutsPlugin.h:67
ListOfGlobalRenderInformation * getListOfGlobalRenderInformation()
Returns a pointer to the list object that contains local render information.
Definition: RenderListOfLayoutsPlugin.cpp:597
Definition: RenderPoint.h:83
Definition: SBMLDocument.h:349
Definition: SBMLDocumentPlugin.h:85
Definition: SBMLNamespaces.h:145
SBasePlugin * getPlugin(const std::string &package)
Returns a plug-in object (extension interface) for an SBML Level&#160;3 package extension with the given p...
Definition: SBase.cpp:3530
int setElementNamespace(const std::string &uri)
Sets the XML namespace to which this object belongs.
Definition: SBasePlugin.cpp:246
Definition: SpeciesGlyph.h:65
Definition: SpeciesReferenceGlyph.h:71
Curve * getCurve()
Returns the curve object for the species reference glyph.
Definition: SpeciesReferenceGlyph.cpp:370
const RenderGroup * getGroup() const
Returns the value of the "group" element of this Style.
Definition: Style.cpp:542
Definition: TextGlyph.h:65
Definition: Text.h:84
Definition: Transformation2D.h:91
virtual int getTypeCode() const
Returns the libSBML type code for this Transformation2D object.
Definition: Transformation2D.cpp:377
@ LIBSBML_OPERATION_SUCCESS
Definition: operationReturnValues.h:61