libsbml-draw
fr.h
Go to the documentation of this file.
1 /* MIT License
2  */
3 
4 //== FILEDOC =========================================================================
5 
10 //== BEGINNING OF CODE ===============================================================
11 
12 #ifndef __SBNW_LAYOUT_FR_H_
13 #define __SBNW_LAYOUT_FR_H_
14 
15 //== INCLUDES ========================================================================
16 
17 #include "SagittariusCore.h"
18 #include "canvas.h"
19 #include "network.h"
20 #include "layout.h"
21 
22 //-- C code --
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
37 typedef struct __fr_options {
43  Real baryx, baryy;
45  int autobary;
48 } fr_options;
49 
58 _GraphfabExport void gf_doLayoutAlgorithm(fr_options opt, gf_layoutInfo* l);
59 
67 _GraphfabExport void gf_doLayoutAlgorithm2(fr_options opt, gf_network* n, gf_canvas* c);
68 
73 _GraphfabExport void gf_getLayoutOptDefaults(fr_options* opt);
74 
80 _GraphfabExport void gf_layout_setStiffness(fr_options* opt, double k);
81 
82 #ifdef __cplusplus
83 }//extern "C"
84 #endif
85 
86 //-- C++ code --
87 #ifdef __cplusplus
88 
89 // #include <string>
90 
91 #include <iostream>
92 
93 namespace LibsbmlDraw {
94 
96  void FruchtermanReingold(fr_options opt, Network& net, Canvas* can, gf_layoutInfo* l);
97 
98 }
99 
100 #endif
101 
102 #endif
Real padding
Padding on compartments.
Definition: fr.h:47
SAGITTARIUS_REAL Real
Make Real visible to C. Consider letting Real lie in top namespace.
Definition: SagittariusCommon.h:112
_GraphfabExport void gf_layout_setStiffness(fr_options *opt, double k)
Set the stiffness for the FR algorithm.
Definition: fr.cpp:38
struct __fr_options fr_options
Options passed to the Fruchterman-Reingold algorithm.
_GraphfabExport void gf_doLayoutAlgorithm(fr_options opt, gf_layoutInfo *l)
Run the autolayout (Fruchterman-Reingold) algorithm on a given layout structure.
Definition: fr.cpp:42
Canvas for drawing diagram, dimensions.
Options passed to the Fruchterman-Reingold algorithm.
Definition: fr.h:37
_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.
Definition: fr.cpp:53
The network model.
First file included.
Real k
Stiffness - distance between points.
Definition: fr.h:39
Type which holds layout info.
Definition: layout.h:114
int autobary
Should the barycenter be set automatically from layout info? Uses dimensions of the canvas.
Definition: fr.h:45
A reaction network.
Definition: layout.h:37
_GraphfabExport void gf_getLayoutOptDefaults(fr_options *opt)
Generate default values for the layout options.
Definition: fr.cpp:30
SBML layout interface in C.
Real baryx
Center of gravitational force.
Definition: fr.h:43
Drawing canvas.
Definition: layout.h:100
Real grav
Strength of gravity (must be greater than 5 to have an effect)
Definition: fr.h:41