Simple example of using the SBML graphical layout specification, in both Level 2 and Level 3.
#include <iostream>
#include <string>
#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
int main(int argc, char** argv){
if (argc != 2)
{
cout << endl << "Usage: addLayout input-filename"
<< endl << endl;
return 2;
}
{
}
else
{
{
}
{
}
layout->
setId(
"Layout_1");
}
}
Include all SBML types of layout extension in a single header file.
SBMLDocument_t * readSBML(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: Dimensions.h:71
static const std::string & getXmlnsL3V1V1()
Returns the XML namespace URI of the SBML Level 3 package implemented by this libSBML extension.
Definition: LayoutExtension.cpp:103
static const std::string & getXmlnsL2()
Returns the XML namespace URI of the SBML Level 2 version of the package implemented by this libSBML ...
Definition: LayoutExtension.cpp:109
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Layout.
Definition: Layout.cpp:454
void setDimensions(const Dimensions *dimensions)
Sets the dimensions of the layout.
Definition: Layout.cpp:520
Definition: LayoutModelPlugin.h:68
Layout * createLayout()
Creates a new layout object and adds it to the list of layout objects and returns it.
Definition: LayoutModelPlugin.cpp:476
Definition: SBMLDocument.h:351
unsigned int getNumErrors() const
Returns the number of errors or warnings encountered during parsing, consistency checking,...
Definition: SBMLDocument.cpp:1169
void printErrors(std::ostream &stream=std::cerr) const
Prints all the errors or warnings encountered trying to parse, check, or translate this SBML document...
Definition: SBMLDocument.cpp:1192
const Model * getModel() const
Returns the Model object stored in this SBMLDocument.
Definition: SBMLDocument.cpp:350
int enablePackage(const std::string &pkgURI, const std::string &pkgPrefix, bool flag)
Enables or disables the given SBML Level 3 package on this object.
Definition: SBase.cpp:3651
unsigned int getVersion() const
Returns the Version within the SBML Level of the SBMLDocument object containing this object.
Definition: SBase.cpp:3142
SBasePlugin * getPlugin(const std::string &package)
Returns a plug-in object (extension interface) for an SBML Level 3 package extension with the given p...
Definition: SBase.cpp:3530
unsigned int getLevel() const
Returns the SBML Level of the SBMLDocument object containing this object.
Definition: SBase.cpp:3127