libSBNW
 All Classes Namespaces Files Functions Variables Typedefs Macros Modules Pages
Functions
All C Methods

Functions

_GraphfabExport char * gf_getLastError ()
 Gets the last error. More...
 
_GraphfabExport void gf_clearError ()
 Clears the last error.
 
_GraphfabExport const char * gf_renderTikZ (gf_layoutInfo *l)
 Render the model as a TikZ image. More...
 
_GraphfabExport int gf_renderTikZFile (gf_layoutInfo *l, const char *filename)
 Render the model as a TikZ image. More...
 
_GraphfabExport void gf_doLayoutAlgorithm (fr_options opt, gf_layoutInfo *l)
 Run the autolayout (Fruchterman-Reingold) algorithm on a given layout structure. More...
 
_GraphfabExport void gf_doLayoutAlgorithm2 (fr_options opt, gf_network *n, gf_canvas *c)
 Run the autolayout (Fruchterman-Reingold) algorithm on a a network and optional canvas. More...
 
_GraphfabExport void gf_getLayoutOptDefaults (fr_options *opt)
 Generate default values for the layout options. More...
 
_GraphfabExport void gf_layout_setStiffness (fr_options *opt, double k)
 Set the stiffness for the FR algorithm. More...
 
_GraphfabExport void gf_freeSBMLModel (gf_SBMLModel *lo)
 Destructor for gf_SBMLModel. More...
 
_GraphfabExport gf_SBMLModelgf_loadSBMLbuf (const char *buf)
 Load SBML from memory buffer. Struct contains a pointer to the document. More...
 
_GraphfabExport gf_SBMLModelgf_loadSBMLfile (const char *file)
 Load SBML from memory buffer. Struct contains a pointer to the document. More...
 
_GraphfabExport void gf_freeLayoutInfo (gf_layoutInfo *l)
 Call to clean up an instance of gf_layoutInfo when it is no longer needed. More...
 
_GraphfabExport void gf_freeLayoutInfoHierarch (gf_layoutInfo *l)
 Call to clean up an instance of gf_layoutInfo and all contained data structures. More...
 
_GraphfabExport void gf_freeModelAndLayout (gf_SBMLModel *mod, gf_layoutInfo *l)
 Call to clean up an instance of gf_layoutInfo and gf_SBMLModel when they are no longer needed. More...
 
_GraphfabExport gf_layoutInfogf_processLayout (gf_SBMLModel *lo)
 Process the layout info from a document. The layout info holds the network (nodes, reactions, etc.), canvas, and SBML content. More...
 
_GraphfabExport gf_layoutInfogf_loadSBMLIntoLayoutEngine (const char *buf, gf_SBMLModel *r)
 Load SBML document from memory buffer and process. More...
 
_GraphfabExport void gf_setModelNamespace (gf_layoutInfo *l, unsigned long level, unsigned long version)
 Set the level and version of the SBML. More...
 
_GraphfabExport gf_network gf_getNetwork (gf_layoutInfo *l)
 Get the network associated with the model. More...
 
_GraphfabExport gf_networkgf_getNetworkp (gf_layoutInfo *l)
 Get the network associated with the model. More...
 
_GraphfabExport void gf_clearNetwork (gf_network *n)
 Clear the network - does not deallocate. More...
 
_GraphfabExport void gf_releaseNetwork (gf_network *n)
 Release the network. More...
 
_GraphfabExport char * gf_nw_getID (gf_network *n)
 Get the id, user frees memory. More...
 
_GraphfabExport size_t gf_nw_getNumNodes (const gf_network *n)
 Get the number of nodes. More...
 
_GraphfabExport size_t gf_nw_getNumRxns (const gf_network *n)
 Get the number of reactions. More...
 
_GraphfabExport size_t gf_nw_getNumComps (const gf_network *n)
 Get the number of compartments. More...
 
_GraphfabExport gf_node gf_nw_getNode (gf_network *n, size_t i)
 Get the node at index i. More...
 
_GraphfabExport gf_nodegf_nw_getNodep (gf_network *n, size_t i)
 Get the node at index i. More...
 
_GraphfabExport gf_reaction gf_nw_getRxn (gf_network *n, size_t i)
 Get the node at index i. More...
 
_GraphfabExport gf_reactiongf_nw_getRxnp (gf_network *n, size_t i)
 Get the node at index i. More...
 
_GraphfabExport void gf_nw_removeRxn (gf_network *n, gf_reaction *r)
 Remove the given reaction. More...
 
_GraphfabExport gf_compartment gf_nw_getCompartment (gf_network *n, size_t i)
 Get the compartment at index i. More...
 
_GraphfabExport gf_compartmentgf_nw_getCompartmentp (gf_network *n, size_t i)
 Get the node at index i. More...
 
_GraphfabExport void gf_nw_rebuildCurves (gf_network *n)
 Rebuild the curves. More...
 
_GraphfabExport void gf_nw_recenterJunctions (gf_network *n)
 Recenter reaction junctions. More...
 
_GraphfabExport gf_node gf_nw_newNode (gf_network *nw, const char *id, const char *name, gf_compartment *compartment)
 Add a new node to the network. More...
 
_GraphfabExport gf_nodegf_nw_newNodep (gf_network *nw, const char *id, const char *name, gf_compartment *compartment)
 Add a new node to the network. More...
 
_GraphfabExport int gf_nw_removeNode (gf_network *nw, gf_node *node)
 Remove a node from the network. More...
 
_GraphfabExport int gf_nw_isLayoutSpecified (gf_network *nw)
 Did the SBML model include layout? More...
 
_GraphfabExport void gf_node_setCompartment (gf_node *n, gf_compartment *c)
 Add a node to a compartment. More...
 
_GraphfabExport void gf_clearNode (gf_node *n)
 Clear the node - does not deallocate. More...
 
_GraphfabExport void gf_releaseNode (const gf_node *n)
 Release the node. More...
 
_GraphfabExport int gf_node_isLocked (gf_node *n)
 Is the node locked? More...
 
_GraphfabExport void gf_node_lock (gf_node *n)
 Lock the node. More...
 
_GraphfabExport void gf_node_unlock (gf_node *n)
 Unlock the node. More...
 
_GraphfabExport int gf_node_alias (gf_node *n, gf_network *m)
 Alias the node. More...
 
_GraphfabExport int gf_node_isAliased (gf_node *n)
 Is the node aliased? More...
 
_GraphfabExport gf_point gf_node_getCentroid (gf_node *n)
 Get the centroid of the node. More...
 
_GraphfabExport void gf_node_getCentroidXY (gf_node *n, double *x, double *y)
 Get the centroid of the node. More...
 
_GraphfabExport void gf_node_setCentroid (gf_node *n, gf_point p)
 Set the centroid of the node. More...
 
_GraphfabExport double gf_node_getWidth (gf_node *n)
 Get the width of the node. More...
 
_GraphfabExport void gf_node_setWidth (gf_node *n, double width)
 Set the width of the node. More...
 
_GraphfabExport double gf_node_getHeight (gf_node *n)
 Get the height of the node. More...
 
_GraphfabExport void gf_node_setHeight (gf_node *n, double height)
 Set the height of the node. More...
 
_GraphfabExport char * gf_node_getID (gf_node *n)
 Get the id, user frees memory. More...
 
_GraphfabExport const char * gf_node_getName (gf_node *n)
 Get the name. More...
 
_GraphfabExport int gf_node_getConnectedReactions (gf_node *n, gf_network *m, unsigned int *num, gf_reaction **rxns)
 Get a list of all reactions connected to the node. More...
 
_GraphfabExport int gf_node_getAttachedCurves (gf_node *n, gf_network *m, unsigned int *num, gf_curve **curves)
 Get a list of all curves connected to the node. More...
 
_GraphfabExport void gf_releaseRxn (const gf_reaction *r)
 Release the reaction. More...
 
_GraphfabExport char * gf_reaction_getID (gf_reaction *r)
 Get the id, user frees memory. More...
 
_GraphfabExport gf_point gf_reaction_getCentroid (gf_reaction *r)
 Get the centroid of the reaction. More...
 
_GraphfabExport void gf_reaction_setCentroid (gf_reaction *r, gf_point p)
 Set the centroid of the reaction. More...
 
_GraphfabExport size_t gf_reaction_getNumSpec (const gf_reaction *r)
 Get the number of species in the reaction. More...
 
_GraphfabExport int gf_reaction_hasSpec (const gf_reaction *r, const gf_node *n)
 Return true if the reaction has the given species. More...
 
_GraphfabExport gf_specRole gf_reaction_getSpecRole (const gf_reaction *r, size_t i)
 Get the role for spec i. More...
 
_GraphfabExport const char * gf_roleToStr (gf_specRole role)
 Convert role to string. More...
 
_GraphfabExport gf_specRole gf_strToRole (const char *str)
 Convert string to role. More...
 
_GraphfabExport size_t gf_reaction_specGeti (const gf_reaction *r, size_t i)
 Get the index of the species in the network. More...
 
_GraphfabExport size_t gf_reaction_getNumCurves (const gf_reaction *r)
 Get the number of curves in the reaction. More...
 
_GraphfabExport gf_curve gf_reaction_getCurve (const gf_reaction *r, size_t i)
 Get the curve i. More...
 
_GraphfabExport gf_curvegf_reaction_getCurvep (const gf_reaction *r, size_t i)
 Get the curve i. More...
 
_GraphfabExport void gf_reaction_recenter (gf_reaction *r)
 Recenter reaction centroid. More...
 
_GraphfabExport void gf_reaction_recalcCurveCPs (gf_reaction *r)
 Recalculate the curve CPs, don't recenter. More...
 
_GraphfabExport void gf_releaseCurve (const gf_curve *c)
 Release the curve. More...
 
_GraphfabExport gf_specRole gf_curve_getRole (gf_curve *c)
 Get the id, user frees memory. More...
 
_GraphfabExport gf_curveCP gf_getCurveCPs (const gf_curve *c)
 Get the CPs for the curve. More...
 
_GraphfabExport int gf_curve_hasArrowhead (const gf_curve *c)
 Returns true if the given curve should be drawn with an arrowhead. More...
 
_GraphfabExport int gf_curve_getArrowheadVerts (const gf_curve *c, unsigned int *n, gf_point **v)
 Get the vertices for the curve's arrowhead. More...
 
_GraphfabExport void gf_releaseCompartment (const gf_compartment *c)
 Release the comp. More...
 
_GraphfabExport char * gf_compartment_getID (gf_compartment *c)
 Get the id, user frees memory. More...
 
_GraphfabExport gf_point gf_compartment_getMinCorner (gf_compartment *c)
 Get the "upper left" corner. More...
 
_GraphfabExport void gf_compartment_setMinCorner (gf_compartment *c, gf_point p)
 Set the "upper left" corner. More...
 
_GraphfabExport gf_point gf_compartment_getMaxCorner (gf_compartment *c)
 Get the "lower right" corner. More...
 
_GraphfabExport void gf_compartment_setMaxCorner (gf_compartment *c, gf_point p)
 Set the "lower right" corner. More...
 
_GraphfabExport double gf_compartment_getWidth (gf_compartment *c)
 Get the width of the compartment. More...
 
_GraphfabExport double gf_compartment_getHeight (gf_compartment *c)
 Get the height of the compartment. More...
 
_GraphfabExport size_t gf_compartment_getNumElt (gf_compartment *c)
 Get the number of species in the compartment. More...
 
_GraphfabExport void gf_fit_to_window (gf_layoutInfo *l, double left, double top, double right, double bottom)
 Fit to the specified window. More...
 
_GraphfabExport gf_transformgf_tf_fitToWindow (gf_layoutInfo *l, double left, double top, double right, double bottom)
 Fit to the specified window (do not apply transform) More...
 
_GraphfabExport CPoint gf_tf_apply_to_point (gf_transform *tf, CPoint p)
 Apply transform to point. More...
 
_GraphfabExport gf_point gf_tf_getScale (gf_transform *tf)
 Get the scale of the transform. More...
 
_GraphfabExport gf_point gf_tf_getDisplacement (gf_transform *tf)
 Get the displacement of the transform. More...
 
_GraphfabExport gf_point gf_tf_getPostDisplacement (gf_transform *tf)
 Get the displacement of the transform. More...
 
_GraphfabExport void gf_dump_transform (gf_transform *tf)
 Dump transform. More...
 
_GraphfabExport void gf_release_transform (gf_transform *tf)
 Release transform. More...
 
_GraphfabExport gf_canvas gf_getCanvas (gf_layoutInfo *l)
 Get the canvas associated with the model. More...
 
_GraphfabExport gf_canvasgf_getCanvasp (gf_layoutInfo *l)
 Get the canvas associated with the model. More...
 
_GraphfabExport void gf_clearCanvas (gf_canvas *c)
 Get the canvas associated with the model. More...
 
_GraphfabExport void gf_releaseCanvas (gf_canvas *c)
 Release the canvas. More...
 
_GraphfabExport unsigned int gf_canvGetWidth (gf_canvas *c)
 Get the width of the canvas. More...
 
_GraphfabExport unsigned int gf_canvGetHeight (gf_canvas *c)
 Get the height of the canvas. More...
 
_GraphfabExport void gf_canvSetWidth (gf_canvas *c, unsigned long width)
 Set the width of the canvas. More...
 
_GraphfabExport void gf_canvSetHeight (gf_canvas *c, unsigned long height)
 Set the height of the canvas. More...
 
_GraphfabExport void gf_getNodeCentroid (gf_layoutInfo *l, const char *id, CPoint *p)
 Get the centroid of a node. More...
 
_GraphfabExport void gf_aliasNodebyDegree (gf_layoutInfo *l, const int minDegree)
 Create node aliases by node degree. More...
 
_GraphfabExport void gf_randomizeLayout (gf_layoutInfo *m)
 Randomize node positions. More...
 
_GraphfabExport void gf_randomizeLayout2 (gf_network *n, gf_canvas *c)
 Randomize node positions for a given network & canvas. More...
 
_GraphfabExport int gf_writeSBMLwithLayout (const char *filename, gf_SBMLModel *m, gf_layoutInfo *l)
 Write an SBML file, including layout. More...
 
_GraphfabExport int gf_writeSBML (const char *filename, gf_SBMLModel *m)
 Write an SBML file (does not include layout. More...
 
_GraphfabExport const char * gf_getSBMLwithLayoutStr (gf_SBMLModel *m, gf_layoutInfo *l)
 String version of writeSBMLwithLayout. More...
 
_GraphfabExport const char * gf_getCurrentLibraryVersion (void)
 Returns the current version of the library. More...
 
_GraphfabExport void gf_free (void *x)
 Frees the memory block at x. More...
 
_GraphfabExport gf_point gf_computeCubicBezierPoint (gf_curveCP *c, Real t)
 Compute a point on the parametric curve. More...
 
_GraphfabExport gf_pointgf_computeCubicBezierLineIntersec (gf_curveCP *c, gf_point *line_start, gf_point *line_end)
 Compute the intersection between a cubic Bezier and a line. More...
 
_GraphfabExport int gf_arrowheadStyleGetNumVerts (int style)
 Get the number of vertices in the arrowhead polygon. More...
 
_GraphfabExport gf_point gf_arrowheadStyleGetVert (int style, int n)
 Get the nth vertex of the arrow polygon. More...
 
_GraphfabExport int gf_arrowheadStyleIsFilled (int style)
 Is the given style filled? More...
 
_GraphfabExport unsigned long gf_arrowheadNumStyles ()
 Get the number of arrowhead styles. More...
 
_GraphfabExport void gf_arrowheadSetStyle (gf_specRole role, int style)
 Set the arrowhead style for a specific role type. More...
 
_GraphfabExport int gf_arrowheadGetStyle (gf_specRole role)
 Get the style for the role type. More...
 
_GraphfabExport void gf_strfree (char *str)
 Free a C string (char*) More...
 

Detailed Description

Function Documentation

_GraphfabExport void gf_aliasNodebyDegree ( gf_layoutInfo l,
const int  minDegree 
)

Create node aliases by node degree.

Parameters
[in]lThe layout info; contains the network that holds the list of nodes and reactions necessary for aliasing
[in]minDegreeThe minimum node degree; Nodes that are of the minimum degree or higher will be aliased
_GraphfabExport int gf_arrowheadGetStyle ( gf_specRole  role)

Get the style for the role type.

Parameters
[in]roleRole type
_GraphfabExport unsigned long gf_arrowheadNumStyles ( )

Get the number of arrowhead styles.

Returns
The number of arrowhead styles
_GraphfabExport void gf_arrowheadSetStyle ( gf_specRole  role,
int  style 
)

Set the arrowhead style for a specific role type.

Parameters
[in]roleRole type
[in]styleArrowhead style number
_GraphfabExport int gf_arrowheadStyleGetNumVerts ( int  style)

Get the number of vertices in the arrowhead polygon.

Parameters
[in]styleArrowhead style number
Returns
The arrowhead polygon vertex count
_GraphfabExport gf_point gf_arrowheadStyleGetVert ( int  style,
int  n 
)

Get the nth vertex of the arrow polygon.

Parameters
[in]styleArrowhead style number
[in]nThe vertex index
Returns
The nth vertex of the polygon
_GraphfabExport int gf_arrowheadStyleIsFilled ( int  style)

Is the given style filled?

Parameters
[in]styleArrowhead style number
Returns
Nonzero if the arrow polygon should be filled
_GraphfabExport unsigned int gf_canvGetHeight ( gf_canvas c)

Get the height of the canvas.

Parameters
[in]cThe canvas
_GraphfabExport unsigned int gf_canvGetWidth ( gf_canvas c)

Get the width of the canvas.

Parameters
[in]cThe canvas
_GraphfabExport void gf_canvSetHeight ( gf_canvas c,
unsigned long  height 
)

Set the height of the canvas.

Parameters
[in]cThe canvas
[in]heightThe height
_GraphfabExport void gf_canvSetWidth ( gf_canvas c,
unsigned long  width 
)

Set the width of the canvas.

Parameters
[in]cThe canvas
[out]widthThe width
_GraphfabExport void gf_clearCanvas ( gf_canvas c)

Get the canvas associated with the model.

Parameters
[in]lThe layout info
_GraphfabExport void gf_clearNetwork ( gf_network n)

Clear the network - does not deallocate.

Parameters
[in]nNetwork
_GraphfabExport void gf_clearNode ( gf_node n)

Clear the node - does not deallocate.

Parameters
[in]nNode
_GraphfabExport double gf_compartment_getHeight ( gf_compartment c)

Get the height of the compartment.

Parameters
[in]cCompartment
_GraphfabExport char* gf_compartment_getID ( gf_compartment c)

Get the id, user frees memory.

Parameters
[in]cCompartment
_GraphfabExport gf_point gf_compartment_getMaxCorner ( gf_compartment c)

Get the "lower right" corner.

Parameters
[in]cCompartment
_GraphfabExport gf_point gf_compartment_getMinCorner ( gf_compartment c)

Get the "upper left" corner.

Parameters
[in]cCompartment
_GraphfabExport size_t gf_compartment_getNumElt ( gf_compartment c)

Get the number of species in the compartment.

Parameters
[in]cCompartment
_GraphfabExport double gf_compartment_getWidth ( gf_compartment c)

Get the width of the compartment.

Parameters
[in]cCompartment
_GraphfabExport void gf_compartment_setMaxCorner ( gf_compartment c,
gf_point  p 
)

Set the "lower right" corner.

Parameters
[in]cCompartment
[in]pCorner
_GraphfabExport void gf_compartment_setMinCorner ( gf_compartment c,
gf_point  p 
)

Set the "upper left" corner.

Parameters
[in]cCompartment
[in]pCorner
_GraphfabExport gf_point* gf_computeCubicBezierLineIntersec ( gf_curveCP c,
gf_point line_start,
gf_point line_end 
)

Compute the intersection between a cubic Bezier and a line.

Parameters
[in]cCubic Bezier control points
[in]line_startThe start of the line
[in]line_endThe end of the line
Returns
An array of intersection points with a 0, 0 sentinel
_GraphfabExport gf_point gf_computeCubicBezierPoint ( gf_curveCP c,
Real  t 
)

Compute a point on the parametric curve.

Parameters
[in]cCubic Bezier control points
[in]tCubic Bezier parameter
_GraphfabExport int gf_curve_getArrowheadVerts ( const gf_curve c,
unsigned int *  n,
gf_point **  v 
)

Get the vertices for the curve's arrowhead.

Parameters
[in]cCurve
[out]nNumber of arrowhead verts
[out]vThe vertices (new arrow, callee owns)
_GraphfabExport gf_specRole gf_curve_getRole ( gf_curve c)

Get the id, user frees memory.

Parameters
[in]cCurve Get the role of the species with the given curve
[in]cCurve
Returns
The index of the matching species in the reaction
_GraphfabExport int gf_curve_hasArrowhead ( const gf_curve c)

Returns true if the given curve should be drawn with an arrowhead.

Parameters
[in]cCurve
_GraphfabExport void gf_doLayoutAlgorithm ( fr_options  opt,
gf_layoutInfo l 
)

Run the autolayout (Fruchterman-Reingold) algorithm on a given layout structure.

Parameters
[in]optThe options controlling the layout algorithm
in/out]l The layout info
_GraphfabExport void gf_doLayoutAlgorithm2 ( fr_options  opt,
gf_network n,
gf_canvas c 
)

Run the autolayout (Fruchterman-Reingold) algorithm on a a network and optional canvas.

Can be used when full layout struct is not available

Parameters
[in]optThe options controlling the layout algorithm
in/out]n The network
[in]cThe canvas (may be NULL)
_GraphfabExport void gf_dump_transform ( gf_transform tf)

Dump transform.

Parameters
[in]tfTransform
_GraphfabExport void gf_fit_to_window ( gf_layoutInfo l,
double  left,
double  top,
double  right,
double  bottom 
)

Fit to the specified window.

Parameters
[in]lLayout
[in]leftLeft edge of screen (other args similar)
_GraphfabExport void gf_free ( void *  x)

Frees the memory block at x.

Note
For strings (char*), use gf_strfree
_GraphfabExport void gf_freeLayoutInfo ( gf_layoutInfo l)

Call to clean up an instance of gf_layoutInfo when it is no longer needed.

Parameters
[in]lThe layout info; Entire layout is freed
_GraphfabExport void gf_freeLayoutInfoHierarch ( gf_layoutInfo l)

Call to clean up an instance of gf_layoutInfo and all contained data structures.

Parameters
[in]lThe layout info; Entire layout is freed
_GraphfabExport void gf_freeModelAndLayout ( gf_SBMLModel mod,
gf_layoutInfo l 
)

Call to clean up an instance of gf_layoutInfo and gf_SBMLModel when they are no longer needed.

Parameters
[in]modThe SBML model
[in]lThe layout info; Entire layout is freed
_GraphfabExport void gf_freeSBMLModel ( gf_SBMLModel lo)

Destructor for gf_SBMLModel.

Parameters
[in]loThe SBML model; all memory used by the model is freed
_GraphfabExport gf_canvas gf_getCanvas ( gf_layoutInfo l)

Get the canvas associated with the model.

Parameters
[in]lThe layout info
_GraphfabExport gf_canvas* gf_getCanvasp ( gf_layoutInfo l)

Get the canvas associated with the model.

Parameters
[in]lThe layout info
_GraphfabExport const char* gf_getCurrentLibraryVersion ( void  )

Returns the current version of the library.

Returns
Static string
_GraphfabExport gf_curveCP gf_getCurveCPs ( const gf_curve c)

Get the CPs for the curve.

Parameters
[in]cCurve
_GraphfabExport char* gf_getLastError ( )

Gets the last error.

Returns
The error message (owned by callee)
_GraphfabExport void gf_getLayoutOptDefaults ( fr_options opt)

Generate default values for the layout options.

Parameters
[out]lThe layout info in which to store the options
_GraphfabExport gf_network gf_getNetwork ( gf_layoutInfo l)

Get the network associated with the model.

Parameters
[in]lThe layout info; contains the network
_GraphfabExport gf_network* gf_getNetworkp ( gf_layoutInfo l)

Get the network associated with the model.

Parameters
[in]lThe layout info; contains the network
Returns
A pointer to the network
_GraphfabExport void gf_getNodeCentroid ( gf_layoutInfo l,
const char *  id,
CPoint p 
)

Get the centroid of a node.

Parameters
[in]lThe layout info; contains the network that holds the list of nodes and their centroids
[in]idThe node id; used to find the correct node in the layout
[in]pThe point; used to store the coordinates of the node centroid
_GraphfabExport const char* gf_getSBMLwithLayoutStr ( gf_SBMLModel m,
gf_layoutInfo l 
)

String version of writeSBMLwithLayout.

Parameters
[in]mThe SBML model; required since this tool only handles layout
[in]lThe layout info; the SBML in string form is written to the layout
Returns
Raw SBML as UTF-8 string (owned by callee)
_GraphfabExport void gf_layout_setStiffness ( fr_options opt,
double  k 
)

Set the stiffness for the FR algorithm.

Parameters
[out]optThe layout info in which to store the stiffness
[in]kThe stiffness
_GraphfabExport gf_SBMLModel* gf_loadSBMLbuf ( const char *  buf)

Load SBML from memory buffer. Struct contains a pointer to the document.

Parameters
[in]bufThe buffer containing the SBML file
[out]rThe SBML model; the model that contains the SBML info from the buffer
_GraphfabExport gf_SBMLModel* gf_loadSBMLfile ( const char *  file)

Load SBML from memory buffer. Struct contains a pointer to the document.

Parameters
[in]bufThe buffer containing the SBML file
[out]rThe SBML model; the model that contains the SBML info from the buffer
_GraphfabExport gf_layoutInfo* gf_loadSBMLIntoLayoutEngine ( const char *  buf,
gf_SBMLModel r 
)

Load SBML document from memory buffer and process.

Parameters
[in]bufThe buffer containing the SBML file; used to create the SBML model
[in]rA pointer to an empty SBML model; the model will be created from the buffer and used to build the layout
[out]lThe layout info; pointer to the layout info generated from SBML is returned
_GraphfabExport int gf_node_alias ( gf_node n,
gf_network m 
)

Alias the node.

Parameters
[in]nThe node to alias
_GraphfabExport int gf_node_getAttachedCurves ( gf_node n,
gf_network m,
unsigned int *  num,
gf_curve **  curves 
)

Get a list of all curves connected to the node.

Parameters
[in]nNode
[out]numThe number of curves
[out]rxnsThe curve array (callee must free with gf_free)
Returns
Reserved
_GraphfabExport gf_point gf_node_getCentroid ( gf_node n)

Get the centroid of the node.

Parameters
[in]nNode
_GraphfabExport void gf_node_getCentroidXY ( gf_node n,
double *  x,
double *  y 
)

Get the centroid of the node.

Parameters
[in]nNode
[out]xX coord of centroid
[out]yY coord of centroid
_GraphfabExport int gf_node_getConnectedReactions ( gf_node n,
gf_network m,
unsigned int *  num,
gf_reaction **  rxns 
)

Get a list of all reactions connected to the node.

Parameters
[in]nNode
[out]numThe number of reactions
[out]rxnsThe reaction array (callee must free with gf_free)
Returns
Reserved
_GraphfabExport double gf_node_getHeight ( gf_node n)

Get the height of the node.

Parameters
[in]nNode
_GraphfabExport char* gf_node_getID ( gf_node n)

Get the id, user frees memory.

Parameters
[in]nNode
_GraphfabExport const char* gf_node_getName ( gf_node n)

Get the name.

Parameters
[in]nNode
_GraphfabExport double gf_node_getWidth ( gf_node n)

Get the width of the node.

Parameters
[in]nNode
_GraphfabExport int gf_node_isAliased ( gf_node n)

Is the node aliased?

Parameters
[in]nNode
_GraphfabExport int gf_node_isLocked ( gf_node n)

Is the node locked?

Parameters
[in]nNode
_GraphfabExport void gf_node_lock ( gf_node n)

Lock the node.

Parameters
[in]nNode
_GraphfabExport void gf_node_setCentroid ( gf_node n,
gf_point  p 
)

Set the centroid of the node.

Parameters
[in]nNode
_GraphfabExport void gf_node_setCompartment ( gf_node n,
gf_compartment c 
)

Add a node to a compartment.

Parameters
[in]cCompartment
[in]nNode
_GraphfabExport void gf_node_setHeight ( gf_node n,
double  height 
)

Set the height of the node.

Parameters
[in]nNode
_GraphfabExport void gf_node_setWidth ( gf_node n,
double  width 
)

Set the width of the node.

Parameters
[in]nNode
_GraphfabExport void gf_node_unlock ( gf_node n)

Unlock the node.

Parameters
[in]nNode
_GraphfabExport gf_compartment gf_nw_getCompartment ( gf_network n,
size_t  i 
)

Get the compartment at index i.

Parameters
[in]nNetwork
[in]iNode index
_GraphfabExport gf_compartment* gf_nw_getCompartmentp ( gf_network n,
size_t  i 
)

Get the node at index i.

Parameters
[in]nNetwork
[in]iNode index
_GraphfabExport char* gf_nw_getID ( gf_network n)

Get the id, user frees memory.

Parameters
[in]nNetwork
_GraphfabExport gf_node gf_nw_getNode ( gf_network n,
size_t  i 
)

Get the node at index i.

Parameters
[in]nNetwork
[in]iNode index
_GraphfabExport gf_node* gf_nw_getNodep ( gf_network n,
size_t  i 
)

Get the node at index i.

Parameters
[in]nNetwork
[in]iNode index
Returns
A pointer to the node
_GraphfabExport size_t gf_nw_getNumComps ( const gf_network n)

Get the number of compartments.

Parameters
[in]nNetwork
_GraphfabExport size_t gf_nw_getNumNodes ( const gf_network n)

Get the number of nodes.

Parameters
[in]nNetwork
_GraphfabExport size_t gf_nw_getNumRxns ( const gf_network n)

Get the number of reactions.

Parameters
[in]nNetwork
_GraphfabExport gf_reaction gf_nw_getRxn ( gf_network n,
size_t  i 
)

Get the node at index i.

Parameters
[in]nNetwork
[in]iNode index
_GraphfabExport gf_reaction* gf_nw_getRxnp ( gf_network n,
size_t  i 
)

Get the node at index i.

Parameters
[in]nNetwork
[in]iNode index
_GraphfabExport int gf_nw_isLayoutSpecified ( gf_network nw)

Did the SBML model include layout?

Returns
1 for yes, 0 for no
Parameters
[in]nNetwork
_GraphfabExport gf_node gf_nw_newNode ( gf_network nw,
const char *  id,
const char *  name,
gf_compartment compartment 
)

Add a new node to the network.

Parameters
[in]nwNetwork
[in]idThe node's requested ID (or null to determine it automatically)
[in]nameThe node's name
[in]compartmentThe compartment to place the node in (may be NULL for no compartment)
_GraphfabExport gf_node* gf_nw_newNodep ( gf_network nw,
const char *  id,
const char *  name,
gf_compartment compartment 
)

Add a new node to the network.

Parameters
[in]nwNetwork
[in]idThe node's requested ID (or null to determine it automatically)
[in]nameThe node's name
[in]compartmentThe compartment to place the node in (may be NULL for no compartment)
_GraphfabExport void gf_nw_rebuildCurves ( gf_network n)

Rebuild the curves.

Parameters
[in]nNetwork
_GraphfabExport void gf_nw_recenterJunctions ( gf_network n)

Recenter reaction junctions.

Parameters
[in]nNetwork
_GraphfabExport int gf_nw_removeNode ( gf_network nw,
gf_node node 
)

Remove a node from the network.

Parameters
[in]nNetwork
_GraphfabExport void gf_nw_removeRxn ( gf_network n,
gf_reaction r 
)

Remove the given reaction.

Parameters
[in]nNetwork
[in]iNode index
_GraphfabExport gf_layoutInfo* gf_processLayout ( gf_SBMLModel lo)

Process the layout info from a document. The layout info holds the network (nodes, reactions, etc.), canvas, and SBML content.

Parameters
[in]loThe SBML model; the layout info is generated from the SBML model
[out]lThe layout info; pointer to the layout info generated from SBML model is returned
_GraphfabExport void gf_randomizeLayout ( gf_layoutInfo m)

Randomize node positions.

Parameters
[in]mThe layout info; contains the network of nodes and reactions, the coordinates of which will be randomized
_GraphfabExport void gf_randomizeLayout2 ( gf_network n,
gf_canvas c 
)

Randomize node positions for a given network & canvas.

Parameters
[in]nNetwork
[in]cCanvas
_GraphfabExport gf_point gf_reaction_getCentroid ( gf_reaction r)

Get the centroid of the reaction.

Parameters
[in]rReaction
_GraphfabExport gf_curve gf_reaction_getCurve ( const gf_reaction r,
size_t  i 
)

Get the curve i.

Parameters
[in]rReaction
_GraphfabExport gf_curve* gf_reaction_getCurvep ( const gf_reaction r,
size_t  i 
)

Get the curve i.

Parameters
[in]rReaction
_GraphfabExport char* gf_reaction_getID ( gf_reaction r)

Get the id, user frees memory.

Parameters
[in]rReaction
_GraphfabExport size_t gf_reaction_getNumCurves ( const gf_reaction r)

Get the number of curves in the reaction.

Parameters
[in]rReaction
_GraphfabExport size_t gf_reaction_getNumSpec ( const gf_reaction r)

Get the number of species in the reaction.

Parameters
[in]rReaction
_GraphfabExport gf_specRole gf_reaction_getSpecRole ( const gf_reaction r,
size_t  i 
)

Get the role for spec i.

Parameters
[in]rReaction
_GraphfabExport int gf_reaction_hasSpec ( const gf_reaction r,
const gf_node n 
)

Return true if the reaction has the given species.

Parameters
[in]rReaction
_GraphfabExport void gf_reaction_recalcCurveCPs ( gf_reaction r)

Recalculate the curve CPs, don't recenter.

Parameters
[in]nReaction
_GraphfabExport void gf_reaction_recenter ( gf_reaction r)

Recenter reaction centroid.

Parameters
[in]nReaction
_GraphfabExport void gf_reaction_setCentroid ( gf_reaction r,
gf_point  p 
)

Set the centroid of the reaction.

Parameters
[in]rReaction
_GraphfabExport size_t gf_reaction_specGeti ( const gf_reaction r,
size_t  i 
)

Get the index of the species in the network.

Parameters
[in]rReaction
_GraphfabExport void gf_release_transform ( gf_transform tf)

Release transform.

Parameters
[in]tfTransform
_GraphfabExport void gf_releaseCanvas ( gf_canvas c)

Release the canvas.

Parameters
[in]cThe canvas
_GraphfabExport void gf_releaseCompartment ( const gf_compartment c)

Release the comp.

Parameters
[in]cComp
_GraphfabExport void gf_releaseCurve ( const gf_curve c)

Release the curve.

Parameters
[in]cCurve
_GraphfabExport void gf_releaseNetwork ( gf_network n)

Release the network.

Parameters
[in]nNetwork
_GraphfabExport void gf_releaseNode ( const gf_node n)

Release the node.

Parameters
[in]nNode
_GraphfabExport void gf_releaseRxn ( const gf_reaction r)

Release the reaction.

Parameters
[in]rReaction
_GraphfabExport const char* gf_renderTikZ ( gf_layoutInfo l)

Render the model as a TikZ image.

Parameters
[in]lThe model/layout infor
_GraphfabExport int gf_renderTikZFile ( gf_layoutInfo l,
const char *  filename 
)

Render the model as a TikZ image.

Parameters
[in]lThe model/layout infor
_GraphfabExport const char* gf_roleToStr ( gf_specRole  role)

Convert role to string.

Parameters
[in]roleRole
Returns
Static string indicating the role
_GraphfabExport void gf_setModelNamespace ( gf_layoutInfo l,
unsigned long  level,
unsigned long  version 
)

Set the level and version of the SBML.

Parameters
[out]lThe SBML model with layout info
[in]levelThe SBML level
[in]versionThe SBML version
_GraphfabExport void gf_strfree ( char *  str)

Free a C string (char*)

Parameters
[in]strThe string to free
_GraphfabExport gf_specRole gf_strToRole ( const char *  str)

Convert string to role.

Parameters
[in]strString returned from gf_roleToStr
Returns
Role
_GraphfabExport CPoint gf_tf_apply_to_point ( gf_transform tf,
CPoint  p 
)

Apply transform to point.

Parameters
[in]tfTransform
[in]pPoint
_GraphfabExport gf_transform* gf_tf_fitToWindow ( gf_layoutInfo l,
double  left,
double  top,
double  right,
double  bottom 
)

Fit to the specified window (do not apply transform)

Parameters
[in]lLayout
[in]leftLeft edge of screen (other args similar)
Returns
The new transform (not applied)
_GraphfabExport gf_point gf_tf_getDisplacement ( gf_transform tf)

Get the displacement of the transform.

Parameters
[in]tfTransform
_GraphfabExport gf_point gf_tf_getPostDisplacement ( gf_transform tf)

Get the displacement of the transform.

Parameters
[in]tfTransform
Returns
The displacement with the transform applied
_GraphfabExport gf_point gf_tf_getScale ( gf_transform tf)

Get the scale of the transform.

Parameters
[in]tfTransform
_GraphfabExport int gf_writeSBML ( const char *  filename,
gf_SBMLModel m 
)

Write an SBML file (does not include layout.

Returns
0 for success
Parameters
[in]filenameThe output file
[in]mThe SBML model; required since this tool only handles layout
_GraphfabExport int gf_writeSBMLwithLayout ( const char *  filename,
gf_SBMLModel m,
gf_layoutInfo l 
)

Write an SBML file, including layout.

Returns
0 for success
Parameters
[in]filenameThe output file
[in]mThe SBML model; required since this tool only handles layout
[in]lThe layout info; replaces any currently existing SBML layout in the model in the generated file