libSBNW
 All Classes Namespaces Files Functions Variables Typedefs Macros Modules Pages
fr.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_FR_H_
37 #define __GRAPHFAB_LAYOUT_FR_H_
38 
39 //== INCLUDES ========================================================================
40 
42 #include "graphfab/layout/canvas.h"
44 #include "graphfab/sbml/layout.h"
45 
46 //-- C code --
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 typedef struct __fr_options {
56  int boundary;
58  int mag;
62  Real baryx, baryy;
64  int autobary;
69 } fr_options;
70 
76 _GraphfabExport void gf_doLayoutAlgorithm(fr_options opt, gf_layoutInfo* l);
77 
85 _GraphfabExport void gf_doLayoutAlgorithm2(fr_options opt, gf_network* n, gf_canvas* c);
86 
91 _GraphfabExport void gf_getLayoutOptDefaults(fr_options* opt);
92 
98 _GraphfabExport void gf_layout_setStiffness(fr_options* opt, double k);
99 
100 #ifdef __cplusplus
101 }//extern "C"
102 #endif
103 
104 //-- C++ code --
105 #ifdef __cplusplus
106 
107 // #include <string>
108 
109 #include <iostream>
110 
111 namespace Graphfab {
112 
114  void FruchtermanReingold(fr_options opt, Network& net, Canvas* can, gf_layoutInfo* l);
115 
116 }
117 
118 #endif
119 
120 #endif
int mag
Use magnetism? (forces bridge reactions)
Definition: fr.h:58
SAGITTARIUS_REAL Real
Make Real visible to C. Consider letting Real lie in top namespace.
Definition: SagittariusCommon.h:136
_GraphfabExport void gf_layout_setStiffness(fr_options *opt, double k)
Set the stiffness for the FR algorithm.
Definition: fr.cpp:65
_GraphfabExport void gf_doLayoutAlgorithm(fr_options opt, gf_layoutInfo *l)
Run the autolayout (Fruchterman-Reingold) algorithm on a given layout structure.
Definition: fr.cpp:69
int enable_comps
Enable compartment force calc?
Definition: fr.h:66
Definition: SagittariusCommon.cpp:38
Canvas for drawing diagram, dimensions.
Definition: fr.h:52
_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:84
The network model.
First file included.
Real k
Algorithm constant.
Definition: fr.h:54
Definition: layout.h:75
int boundary
Constrain to boundary?
Definition: fr.h:56
int autobary
Should the barycenter be set automatically from layout info?
Definition: fr.h:64
Definition: layout.h:51
_GraphfabExport void gf_getLayoutOptDefaults(fr_options *opt)
Generate default values for the layout options.
Definition: fr.cpp:54
SBML layout interface in C.
Real baryx
Center of gravitational force.
Definition: fr.h:62
int prerandomize
Randomize node positions before doing layout algo (library code DOES NOT call srand for reproducibili...
Definition: fr.h:68
Definition: layout.h:71
Real grav
Amount of gravity.
Definition: fr.h:60