libSBNW
 All Classes Namespaces Files Functions Variables Typedefs Macros Modules Pages
layout.h
Go to the documentation of this file.
1 /*== SAGITTARIUS =====================================================================
2  * Copyright (c) 2012, Jesse K Medley
3  * All rights reserved.
4 
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of The University of Washington nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 //== FILEDOC =========================================================================
29 
34 //== BEGINNING OF CODE ===============================================================
35 
36 #ifndef __GRAPHFAB_LAYOUT_H_
37 #define __GRAPHFAB_LAYOUT_H_
38 
39 //== INCLUDES ========================================================================
40 
42 #include "graphfab/sbml/autolayoutSBML.h"
43 #include "graphfab/diag/error.h"
44 
45 //-- C methods --
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 typedef struct {
52  void* n;
53 } gf_network;
54 
55 typedef struct {
56  void* n;
57 } gf_node;
58 
59 typedef struct {
60  void* r;
61 } gf_reaction;
62 
63 typedef struct {
64  void* c;
65 } gf_curve;
66 
67 typedef struct {
68  void* c;
70 
71 typedef struct {
72  void* canv;
73 } gf_canvas;
74 
75 typedef struct {
77  void* net;
79  void* canv;
81  char* cont;
82 
83  // sbml opts
84  int level;
85  int version;
87 
88 //DEPRECATED: rename to gf_point
89 typedef struct {
90  Real x;
91  Real y;
92 } CPoint;
93 
94 typedef struct {
95  Real x;
96  Real y;
97 } gf_point;
98 
99 typedef struct {
100  void* tf;
101 } gf_transform;
102 
103 typedef struct {
112 } gf_curveCP;
113 
114 typedef enum {
115  GF_ROLE_SUBSTRATE,
116  GF_ROLE_PRODUCT,
117  GF_ROLE_SIDESUBSTRATE,
118  GF_ROLE_SIDEPRODUCT,
119  GF_ROLE_MODIFIER,
120  GF_ROLE_ACTIVATOR,
121  GF_ROLE_INHIBITOR
122 } gf_specRole;
123 
128 _GraphfabExport void gf_freeLayoutInfo(gf_layoutInfo* l);
129 
134 _GraphfabExport void gf_freeLayoutInfoHierarch(gf_layoutInfo* l);
135 
141 _GraphfabExport void gf_freeModelAndLayout(gf_SBMLModel* mod, gf_layoutInfo* l);
142 
143 // -- Input --
144 
150 _GraphfabExport gf_layoutInfo* gf_processLayout(gf_SBMLModel* lo);
151 
158 _GraphfabExport gf_layoutInfo* gf_loadSBMLIntoLayoutEngine(const char* buf, gf_SBMLModel* r);
159 
160 // -- Configuration --
161 
169 _GraphfabExport void gf_setModelNamespace(gf_layoutInfo* l, unsigned long level, unsigned long version);
170 
171 // -- Object API --
172 
173 // Network
174 
179 _GraphfabExport gf_network gf_getNetwork(gf_layoutInfo* l);
180 
186 _GraphfabExport gf_network* gf_getNetworkp(gf_layoutInfo* l);
187 
192 _GraphfabExport void gf_clearNetwork(gf_network* n);
193 
198 _GraphfabExport void gf_releaseNetwork(gf_network* n);
199 
204 _GraphfabExport char* gf_nw_getID(gf_network* n);
205 
210 _GraphfabExport size_t gf_nw_getNumNodes(const gf_network* n);
211 
216 _GraphfabExport size_t gf_nw_getNumRxns(const gf_network* n);
217 
222 _GraphfabExport size_t gf_nw_getNumComps(const gf_network* n);
223 
229 _GraphfabExport gf_node gf_nw_getNode(gf_network* n, size_t i);
230 
237 _GraphfabExport gf_node* gf_nw_getNodep(gf_network* n, size_t i);
238 
244 _GraphfabExport gf_reaction gf_nw_getRxn(gf_network* n, size_t i);
245 
251 _GraphfabExport gf_reaction* gf_nw_getRxnp(gf_network* n, size_t i);
252 
258 _GraphfabExport void gf_nw_removeRxn(gf_network* n, gf_reaction* r);
259 
265 _GraphfabExport gf_compartment gf_nw_getCompartment(gf_network* n, size_t i);
266 
272 _GraphfabExport gf_compartment* gf_nw_getCompartmentp(gf_network* n, size_t i);
273 
278 _GraphfabExport void gf_nw_rebuildCurves(gf_network* n);
279 
284 _GraphfabExport void gf_nw_recenterJunctions(gf_network* n);
285 
293 _GraphfabExport gf_node gf_nw_newNode(gf_network* nw, const char* id, const char* name, gf_compartment* compartment);
294 
302 _GraphfabExport gf_node* gf_nw_newNodep(gf_network* nw, const char* id, const char* name, gf_compartment* compartment);
303 
308 _GraphfabExport int gf_nw_removeNode(gf_network* nw, gf_node* node);
309 
315 _GraphfabExport int gf_nw_isLayoutSpecified(gf_network* nw);
316 
317 // Node
318 
324 _GraphfabExport void gf_node_setCompartment(gf_node* n, gf_compartment* c);
325 
330 _GraphfabExport void gf_clearNode(gf_node* n);
331 
336 _GraphfabExport void gf_releaseNode(const gf_node* n);
337 
342 _GraphfabExport int gf_node_isLocked(gf_node* n);
343 
348 _GraphfabExport void gf_node_lock(gf_node* n);
349 
354 _GraphfabExport void gf_node_unlock(gf_node* n);
355 
360 _GraphfabExport int gf_node_alias(gf_node* n, gf_network* m);
361 
366 _GraphfabExport int gf_node_isAliased(gf_node* n);
367 
372 _GraphfabExport gf_point gf_node_getCentroid(gf_node* n);
373 
380 _GraphfabExport void gf_node_getCentroidXY(gf_node* n, double* x, double* y);
381 
386 _GraphfabExport void gf_node_setCentroid(gf_node* n, gf_point p);
387 
392 _GraphfabExport double gf_node_getWidth(gf_node* n);
393 
398 _GraphfabExport void gf_node_setWidth(gf_node* n, double width);
399 
404 _GraphfabExport double gf_node_getHeight(gf_node* n);
405 
410 _GraphfabExport void gf_node_setHeight(gf_node* n, double height);
411 
416 _GraphfabExport char* gf_node_getID(gf_node* n);
417 
422 _GraphfabExport const char* gf_node_getName(gf_node* n);
423 
431 _GraphfabExport int gf_node_getConnectedReactions(gf_node* n, gf_network* m, unsigned int* num, gf_reaction** rxns);
432 
440 _GraphfabExport int gf_node_getAttachedCurves(gf_node* n, gf_network* m, unsigned int* num, gf_curve** curves);
441 
442 // Reaction
443 
448 _GraphfabExport void gf_releaseRxn(const gf_reaction* r);
449 
454 _GraphfabExport char* gf_reaction_getID(gf_reaction* r);
455 
460 _GraphfabExport gf_point gf_reaction_getCentroid(gf_reaction* r);
461 
466 _GraphfabExport void gf_reaction_setCentroid(gf_reaction* r, gf_point p);
467 
472 _GraphfabExport size_t gf_reaction_getNumSpec(const gf_reaction* r);
473 
478 _GraphfabExport int gf_reaction_hasSpec(const gf_reaction* r, const gf_node* n);
479 
484 _GraphfabExport gf_specRole gf_reaction_getSpecRole(const gf_reaction* r, size_t i);
485 
492 _GraphfabExport const char* gf_roleToStr(gf_specRole role);
493 
500 _GraphfabExport gf_specRole gf_strToRole(const char* str);
501 
506 _GraphfabExport size_t gf_reaction_specGeti(const gf_reaction* r, size_t i);
507 
512 _GraphfabExport size_t gf_reaction_getNumCurves(const gf_reaction* r);
513 
518 _GraphfabExport gf_curve gf_reaction_getCurve(const gf_reaction* r, size_t i);
519 
524 _GraphfabExport gf_curve* gf_reaction_getCurvep(const gf_reaction* r, size_t i);
525 
530 _GraphfabExport void gf_reaction_recenter(gf_reaction* r);
531 
536 _GraphfabExport void gf_reaction_recalcCurveCPs(gf_reaction* r);
537 
538 // Curve
539 
544 _GraphfabExport void gf_releaseCurve(const gf_curve* c);
545 
550 // _GraphfabExport char* gf_curve_getID(gf_curve* c);
551 
558 _GraphfabExport gf_specRole gf_curve_getRole(gf_curve* c);
559 
564 _GraphfabExport gf_curveCP gf_getCurveCPs(const gf_curve* c);
565 
570 _GraphfabExport int gf_curve_hasArrowhead(const gf_curve* c);
571 
572 
579 _GraphfabExport int gf_curve_getArrowheadVerts(const gf_curve* c, unsigned int* n, gf_point** v);
580 
581 // Comparment
582 
587 _GraphfabExport void gf_releaseCompartment(const gf_compartment* c);
588 
593 _GraphfabExport char* gf_compartment_getID(gf_compartment* c);
594 
600 
606 _GraphfabExport void gf_compartment_setMinCorner(gf_compartment* c, gf_point p);
607 
613 
619 _GraphfabExport void gf_compartment_setMaxCorner(gf_compartment* c, gf_point p);
620 
625 _GraphfabExport double gf_compartment_getWidth(gf_compartment* c);
626 
631 _GraphfabExport double gf_compartment_getHeight(gf_compartment* c);
632 
637 _GraphfabExport size_t gf_compartment_getNumElt(gf_compartment* c);
638 
639 // Transform
640 
646 _GraphfabExport void gf_fit_to_window(gf_layoutInfo* l, double left, double top, double right, double bottom);
647 
654 _GraphfabExport gf_transform* gf_tf_fitToWindow(gf_layoutInfo* l, double left, double top, double right, double bottom);
655 
661 _GraphfabExport CPoint gf_tf_apply_to_point(gf_transform* tf, CPoint p);
662 
667 _GraphfabExport gf_point gf_tf_getScale(gf_transform* tf);
668 
673 _GraphfabExport gf_point gf_tf_getDisplacement(gf_transform* tf);
674 
680 _GraphfabExport gf_point gf_tf_getPostDisplacement(gf_transform* tf);
681 
686 _GraphfabExport void gf_dump_transform(gf_transform* tf);
687 
692 _GraphfabExport void gf_release_transform(gf_transform* tf);
693 
694 // Canvas
695 
700 _GraphfabExport gf_canvas gf_getCanvas(gf_layoutInfo* l);
701 
706 _GraphfabExport gf_canvas* gf_getCanvasp(gf_layoutInfo* l);
707 
712 _GraphfabExport void gf_clearCanvas(gf_canvas* c);
713 
718 _GraphfabExport void gf_releaseCanvas(gf_canvas* c);
719 
724 _GraphfabExport unsigned int gf_canvGetWidth(gf_canvas* c);
725 
730 _GraphfabExport unsigned int gf_canvGetHeight(gf_canvas* c);
731 
737 _GraphfabExport void gf_canvSetWidth(gf_canvas* c, unsigned long width);
738 
744 _GraphfabExport void gf_canvSetHeight(gf_canvas* c, unsigned long height);
745 
746 // -- Queries --
747 
754 _GraphfabExport void gf_getNodeCentroid(gf_layoutInfo* l, const char* id, CPoint* p);
755 
756 // -- Configuration
757 
766 _GraphfabExport int gf_lockNodeId(gf_layoutInfo* l, const char* id);
767 
776 _GraphfabExport int gf_unlockNodeId(gf_layoutInfo* l, const char* id);
777 
786 _GraphfabExport int gf_aliasNodeId(gf_layoutInfo* l, const char* id);
787 
793 _GraphfabExport void gf_aliasNodebyDegree(gf_layoutInfo* l, const int minDegree);
794 
795 // -- Processing --
796 
801 _GraphfabExport void gf_randomizeLayout(gf_layoutInfo* m);
802 
808 _GraphfabExport void gf_randomizeLayout2(gf_network* n, gf_canvas* c);
809 
810 // -- Output --
811 
819 _GraphfabExport int gf_writeSBMLwithLayout(const char* filename, gf_SBMLModel* m, gf_layoutInfo* l);
820 
827 _GraphfabExport int gf_writeSBML(const char* filename, gf_SBMLModel* m);
828 
835 _GraphfabExport const char* gf_getSBMLwithLayoutStr(gf_SBMLModel* m, gf_layoutInfo* l);
836 
841 _GraphfabExport const char* gf_getCurrentLibraryVersion(void);
842 
847 _GraphfabExport void gf_free(void* x);
848 
854 _GraphfabExport gf_point gf_computeCubicBezierPoint(gf_curveCP* c, Real t);
855 
863 _GraphfabExport gf_point* gf_computeCubicBezierLineIntersec(gf_curveCP* c, gf_point* line_start, gf_point* line_end);
864 
870 _GraphfabExport int gf_arrowheadStyleGetNumVerts(int style);
871 
878 _GraphfabExport gf_point gf_arrowheadStyleGetVert(int style, int n);
879 
885 _GraphfabExport int gf_arrowheadStyleIsFilled(int style);
886 
891 _GraphfabExport unsigned long gf_arrowheadNumStyles();
892 
898 _GraphfabExport void gf_arrowheadSetStyle(gf_specRole role, int style);
899 
904 _GraphfabExport int gf_arrowheadGetStyle(gf_specRole role);
905 
906 #ifdef __cplusplus
907 }//extern "C"
908 #endif
909 
910 //-- C++ methods --
911 #ifdef __cplusplus
912 
913 
914 
915 #endif
916 
917 #endif
_GraphfabExport int gf_node_alias(gf_node *n, gf_network *m)
Alias the node.
Definition: layout.cpp:1104
_GraphfabExport char * gf_compartment_getID(gf_compartment *c)
Get the id, user frees memory.
Definition: layout.cpp:1498
_GraphfabExport gf_curve gf_reaction_getCurve(const gf_reaction *r, size_t i)
Get the curve i.
Definition: layout.cpp:1372
_GraphfabExport void gf_free(void *x)
Frees the memory block at x.
Definition: layout.cpp:1759
_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)
Definition: layout.cpp:1577
char * cont
SBML content.
Definition: layout.h:81
_GraphfabExport void gf_node_lock(gf_node *n)
Lock the node.
Definition: layout.cpp:1128
_GraphfabExport int gf_node_isLocked(gf_node *n)
Is the node locked?
Definition: layout.cpp:1121
_GraphfabExport gf_point gf_tf_getScale(gf_transform *tf)
Get the scale of the transform.
Definition: layout.cpp:1609
_GraphfabExport CPoint gf_tf_apply_to_point(gf_transform *tf, CPoint p)
Apply transform to point.
Definition: layout.cpp:1602
_GraphfabExport double gf_compartment_getHeight(gf_compartment *c)
Get the height of the compartment.
Definition: layout.cpp:1540
void * net
Network*.
Definition: layout.h:77
_GraphfabExport void gf_clearNode(gf_node *n)
Clear the node - does not deallocate.
Definition: layout.cpp:1068
_GraphfabExport int gf_nw_removeNode(gf_network *nw, gf_node *node)
Remove a node from the network.
Definition: layout.cpp:1026
_GraphfabExport gf_reaction * gf_nw_getRxnp(gf_network *n, size_t i)
Get the node at index i.
Definition: layout.cpp:928
_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.
Definition: layout.cpp:99
_GraphfabExport void gf_clearNetwork(gf_network *n)
Clear the network - does not deallocate.
Definition: layout.cpp:861
_GraphfabExport unsigned int gf_canvGetWidth(gf_canvas *c)
Get the width of the canvas.
Definition: layout.cpp:1665
_GraphfabExport int gf_aliasNodeId(gf_layoutInfo *l, const char *id)
Create node aliases.
SAGITTARIUS_REAL Real
Make Real visible to C. Consider letting Real lie in top namespace.
Definition: SagittariusCommon.h:136
_GraphfabExport int gf_arrowheadGetStyle(gf_specRole role)
Get the style for the role type.
Definition: layout.cpp:1828
_GraphfabExport size_t gf_reaction_getNumCurves(const gf_reaction *r)
Get the number of curves in the reaction.
Definition: layout.cpp:1360
Definition: layout.h:89
_GraphfabExport gf_specRole gf_reaction_getSpecRole(const gf_reaction *r, size_t i)
Get the role for spec i.
Definition: layout.cpp:1308
_GraphfabExport void gf_freeLayoutInfo(gf_layoutInfo *l)
Call to clean up an instance of gf_layoutInfo when it is no longer needed.
Definition: layout.cpp:54
_GraphfabExport gf_layoutInfo * gf_loadSBMLIntoLayoutEngine(const char *buf, gf_SBMLModel *r)
Load SBML document from memory buffer and process.
Definition: layout.cpp:748
_GraphfabExport void gf_canvSetHeight(gf_canvas *c, unsigned long height)
Set the height of the canvas.
Definition: layout.cpp:1686
_GraphfabExport double gf_node_getWidth(gf_node *n)
Get the width of the node.
Definition: layout.cpp:1158
_GraphfabExport void gf_node_unlock(gf_node *n)
Unlock the node.
Definition: layout.cpp:1135
_GraphfabExport const char * gf_roleToStr(gf_specRole role)
Convert role to string.
Definition: layout.cpp:1316
_GraphfabExport size_t gf_nw_getNumComps(const gf_network *n)
Get the number of compartments.
Definition: layout.cpp:893
_GraphfabExport void gf_node_getCentroidXY(gf_node *n, double *x, double *y)
Get the centroid of the node.
gf_point c1
Control 1.
Definition: layout.h:107
_GraphfabExport int gf_unlockNodeId(gf_layoutInfo *l, const char *id)
Unlock a node by id.
_GraphfabExport int gf_nw_isLayoutSpecified(gf_network *nw)
Did the SBML model include layout?
Definition: layout.cpp:1049
_GraphfabExport void gf_releaseCanvas(gf_canvas *c)
Release the canvas.
Definition: layout.cpp:1658
_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.
Definition: layout.cpp:977
_GraphfabExport void gf_setModelNamespace(gf_layoutInfo *l, unsigned long level, unsigned long version)
Set the level and version of the SBML.
Definition: layout.cpp:836
_GraphfabExport int gf_writeSBMLwithLayout(const char *filename, gf_SBMLModel *m, gf_layoutInfo *l)
Write an SBML file, including layout.
Definition: layout.cpp:1693
_GraphfabExport gf_point gf_arrowheadStyleGetVert(int style, int n)
Get the nth vertex of the arrow polygon.
Definition: layout.cpp:1791
_GraphfabExport const char * gf_getSBMLwithLayoutStr(gf_SBMLModel *m, gf_layoutInfo *l)
String version of writeSBMLwithLayout.
Definition: layout.cpp:1722
_GraphfabExport char * gf_nw_getID(gf_network *n)
Get the id, user frees memory.
Definition: layout.cpp:872
_GraphfabExport void gf_dump_transform(gf_transform *tf)
Dump transform.
Definition: layout.cpp:1630
_GraphfabExport int gf_writeSBML(const char *filename, gf_SBMLModel *m)
Write an SBML file (does not include layout.
Definition: layout.cpp:1712
_GraphfabExport gf_canvas gf_getCanvas(gf_layoutInfo *l)
Get the canvas associated with the model.
Definition: layout.cpp:1642
_GraphfabExport void gf_compartment_setMinCorner(gf_compartment *c, gf_point p)
Set the "upper left" corner.
Definition: layout.cpp:1512
_GraphfabExport int gf_curve_hasArrowhead(const gf_curve *c)
Returns true if the given curve should be drawn with an arrowhead.
Definition: layout.cpp:1463
_GraphfabExport gf_compartment gf_nw_getCompartment(gf_network *n, size_t i)
Get the compartment at index i.
Definition: layout.cpp:949
_GraphfabExport void gf_release_transform(gf_transform *tf)
Release transform.
Definition: layout.cpp:1636
_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.
Definition: layout.cpp:1197
_GraphfabExport const char * gf_getCurrentLibraryVersion(void)
Returns the current version of the library.
Definition: layout.cpp:1755
_GraphfabExport void gf_releaseNetwork(gf_network *n)
Release the network.
Definition: layout.cpp:865
_GraphfabExport size_t gf_nw_getNumNodes(const gf_network *n)
Get the number of nodes.
Definition: layout.cpp:879
Error information.
_GraphfabExport void gf_releaseCurve(const gf_curve *c)
Release the curve.
Definition: layout.cpp:1403
_GraphfabExport void gf_arrowheadSetStyle(gf_specRole role, int style)
Set the arrowhead style for a specific role type.
Definition: layout.cpp:1803
_GraphfabExport gf_point gf_tf_getPostDisplacement(gf_transform *tf)
Get the displacement of the transform.
Definition: layout.cpp:1622
_GraphfabExport void gf_node_setWidth(gf_node *n, double width)
Set the width of the node.
Definition: layout.cpp:1164
_GraphfabExport unsigned long gf_arrowheadNumStyles()
Get the number of arrowhead styles.
Definition: layout.cpp:1799
_GraphfabExport void gf_nw_rebuildCurves(gf_network *n)
Rebuild the curves.
Definition: layout.cpp:965
_GraphfabExport gf_network gf_getNetwork(gf_layoutInfo *l)
Get the network associated with the model.
Definition: layout.cpp:847
gf_point e
End.
Definition: layout.h:111
_GraphfabExport void gf_getNodeCentroid(gf_layoutInfo *l, const char *id, CPoint *p)
Get the centroid of a node.
Definition: layout.cpp:185
void * canv
Canvas*.
Definition: layout.h:79
_GraphfabExport size_t gf_compartment_getNumElt(gf_compartment *c)
Get the number of species in the compartment.
Definition: layout.cpp:1547
_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.
Definition: layout.cpp:1218
_GraphfabExport int gf_lockNodeId(gf_layoutInfo *l, const char *id)
Lock a node by id.
_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...
Definition: layout.cpp:76
_GraphfabExport gf_point gf_tf_getDisplacement(gf_transform *tf)
Get the displacement of the transform.
Definition: layout.cpp:1615
_GraphfabExport gf_curveCP gf_getCurveCPs(const gf_curve *c)
Get the CPs for the curve.
Definition: layout.cpp:1459
_GraphfabExport size_t gf_reaction_specGeti(const gf_reaction *r, size_t i)
Get the index of the species in the network.
Definition: layout.cpp:1352
_GraphfabExport int gf_arrowheadStyleIsFilled(int style)
Is the given style filled?
Definition: layout.cpp:1795
_GraphfabExport gf_network * gf_getNetworkp(gf_layoutInfo *l)
Get the network associated with the model.
Definition: layout.cpp:854
_GraphfabExport gf_specRole gf_strToRole(const char *str)
Convert string to role.
Definition: layout.cpp:1331
_GraphfabExport char * gf_reaction_getID(gf_reaction *r)
Get the id, user frees memory.
Definition: layout.cpp:1249
_GraphfabExport int gf_reaction_hasSpec(const gf_reaction *r, const gf_node *n)
Return true if the reaction has the given species.
Definition: layout.cpp:1283
_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.
Definition: layout.cpp:1019
_GraphfabExport void gf_canvSetWidth(gf_canvas *c, unsigned long width)
Set the width of the canvas.
Definition: layout.cpp:1672
_GraphfabExport gf_canvas * gf_getCanvasp(gf_layoutInfo *l)
Get the canvas associated with the model.
Definition: layout.cpp:1647
Definition: layout.h:63
_GraphfabExport void gf_reaction_recalcCurveCPs(gf_reaction *r)
Recalculate the curve CPs, don't recenter.
Definition: layout.cpp:1396
_GraphfabExport gf_node gf_nw_getNode(gf_network *n, size_t i)
Get the node at index i.
Definition: layout.cpp:900
First file included.
_GraphfabExport void gf_reaction_setCentroid(gf_reaction *r, gf_point p)
Set the centroid of the reaction.
Definition: layout.cpp:1268
_GraphfabExport void gf_clearCanvas(gf_canvas *c)
Get the canvas associated with the model.
Definition: layout.cpp:1654
_GraphfabExport void gf_node_setCentroid(gf_node *n, gf_point p)
Set the centroid of the node.
Definition: layout.cpp:1150
_GraphfabExport gf_reaction gf_nw_getRxn(gf_network *n, size_t i)
Get the node at index i.
Definition: layout.cpp:916
_GraphfabExport void gf_releaseNode(const gf_node *n)
Release the node.
Definition: layout.cpp:1072
_GraphfabExport gf_curve * gf_reaction_getCurvep(const gf_reaction *r, size_t i)
Get the curve i.
Definition: layout.cpp:1382
_GraphfabExport void gf_node_setCompartment(gf_node *n, gf_compartment *c)
Add a node to a compartment.
Definition: layout.cpp:1060
Definition: layout.h:75
_GraphfabExport void gf_compartment_setMaxCorner(gf_compartment *c, gf_point p)
Set the "lower right" corner.
Definition: layout.cpp:1526
_GraphfabExport void gf_reaction_recenter(gf_reaction *r)
Recenter reaction centroid.
Definition: layout.cpp:1389
_GraphfabExport void gf_releaseRxn(const gf_reaction *r)
Release the reaction.
Definition: layout.cpp:1241
_GraphfabExport gf_compartment * gf_nw_getCompartmentp(gf_network *n, size_t i)
Get the node at index i.
Definition: layout.cpp:957
_GraphfabExport const char * gf_node_getName(gf_node *n)
Get the name.
Definition: layout.cpp:1190
_GraphfabExport double gf_compartment_getWidth(gf_compartment *c)
Get the width of the compartment.
Definition: layout.cpp:1533
_GraphfabExport void gf_nw_recenterJunctions(gf_network *n)
Recenter reaction junctions.
Definition: layout.cpp:971
_GraphfabExport double gf_node_getHeight(gf_node *n)
Get the height of the node.
Definition: layout.cpp:1171
Definition: layout.h:55
_GraphfabExport gf_point gf_compartment_getMinCorner(gf_compartment *c)
Get the "upper left" corner.
Definition: layout.cpp:1505
_GraphfabExport char * gf_node_getID(gf_node *n)
Get the id, user frees memory.
Definition: layout.cpp:1183
Definition: layout.h:94
_GraphfabExport void gf_freeLayoutInfoHierarch(gf_layoutInfo *l)
Call to clean up an instance of gf_layoutInfo and all contained data structures.
Definition: layout.cpp:62
Definition: layout.h:67
_GraphfabExport unsigned int gf_canvGetHeight(gf_canvas *c)
Get the height of the canvas.
Definition: layout.cpp:1679
Definition: layout.h:51
Definition: layout.h:103
_GraphfabExport gf_point gf_node_getCentroid(gf_node *n)
Get the centroid of the node.
Definition: layout.cpp:1142
_GraphfabExport gf_specRole gf_curve_getRole(gf_curve *c)
Get the id, user frees memory.
Definition: layout.cpp:1436
C wrapper for SBMLDocument.
Definition: autolayoutSBML.h:49
_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.
Definition: layout.cpp:1768
_GraphfabExport int gf_curve_getArrowheadVerts(const gf_curve *c, unsigned int *n, gf_point **v)
Get the vertices for the curve's arrowhead.
Definition: layout.cpp:1470
_GraphfabExport gf_point gf_reaction_getCentroid(gf_reaction *r)
Get the centroid of the reaction.
Definition: layout.cpp:1258
_GraphfabExport void gf_fit_to_window(gf_layoutInfo *l, double left, double top, double right, double bottom)
Fit to the specified window.
Definition: layout.cpp:1554
gf_point c2
Control 2.
Definition: layout.h:109
_GraphfabExport gf_node * gf_nw_getNodep(gf_network *n, size_t i)
Get the node at index i.
Definition: layout.cpp:908
_GraphfabExport void gf_node_setHeight(gf_node *n, double height)
Set the height of the node.
Definition: layout.cpp:1177
Definition: layout.h:59
_GraphfabExport void gf_aliasNodebyDegree(gf_layoutInfo *l, const int minDegree)
Create node aliases by node degree.
Definition: layout.cpp:242
_GraphfabExport size_t gf_nw_getNumRxns(const gf_network *n)
Get the number of reactions.
Definition: layout.cpp:886
Definition: layout.h:99
_GraphfabExport void gf_releaseCompartment(const gf_compartment *c)
Release the comp.
Definition: layout.cpp:1491
_GraphfabExport gf_point gf_computeCubicBezierPoint(gf_curveCP *c, Real t)
Compute a point on the parametric curve.
Definition: layout.cpp:1763
_GraphfabExport void gf_randomizeLayout(gf_layoutInfo *m)
Randomize node positions.
Definition: layout.cpp:1734
_GraphfabExport void gf_nw_removeRxn(gf_network *n, gf_reaction *r)
Remove the given reaction.
Definition: layout.cpp:940
_GraphfabExport int gf_arrowheadStyleGetNumVerts(int style)
Get the number of vertices in the arrowhead polygon.
Definition: layout.cpp:1787
gf_point s
Start.
Definition: layout.h:105
_GraphfabExport int gf_node_isAliased(gf_node *n)
Is the node aliased?
Definition: layout.cpp:1114
_GraphfabExport size_t gf_reaction_getNumSpec(const gf_reaction *r)
Get the number of species in the reaction.
Definition: layout.cpp:1275
_GraphfabExport gf_point gf_compartment_getMaxCorner(gf_compartment *c)
Get the "lower right" corner.
Definition: layout.cpp:1519
Definition: layout.h:71
_GraphfabExport void gf_randomizeLayout2(gf_network *n, gf_canvas *c)
Randomize node positions for a given network & canvas.
Definition: layout.cpp:1743