removed second declaration of Verbose in general.h as second declarations confuse VS.
#include "render.h"
#include "tlayout.h"
#include "gvc.h"
+#include "fdp.h"
/* neato_extra_args:
* Handle special neato arguments.
{
switch (*arg++) {
case 'g' :
- fdp_parms.useGrid = 0;
+ fdp_parms->useGrid = 0;
break;
case 'O' :
- fdp_parms.useNew = 0;
+ fdp_parms->useNew = 0;
break;
case 'n' :
- if (setInt (&fdp_parms.numIters, arg)) return 1;
+ if (setInt (&fdp_parms->numIters, arg)) return 1;
break;
case 'U' :
- if (setInt (&fdp_parms.unscaled, arg)) return 1;
+ if (setInt (&fdp_parms->unscaled, arg)) return 1;
break;
case 'C' :
- if (setDouble (&fdp_parms.C, arg)) return 1;
+ if (setDouble (&fdp_parms->C, arg)) return 1;
break;
case 'T' :
if (*arg == '*') {
- if (setDouble (&fdp_parms.Tfact, arg+1)) return 1;
+ if (setDouble (&fdp_parms->Tfact, arg+1)) return 1;
}
else {
- if (setDouble (&fdp_parms.T0, arg)) return 1;
+ if (setDouble (&fdp_parms->T0, arg)) return 1;
}
break;
default :
#define EXTERN
#include "types.h"
#include "globals.h"
+#include "fdp.h"
/* Default layout values, possibly set via command line; -1 indicates unset */
-fdpParms_t fdp_parms = {
+static fdpParms_t fdpParms = {
1, /* useGrid */
1, /* useNew */
-1, /* numIters */
-1.0, /* T0 */
};
+struct fdpParms_s* fdp_parms = &fdpParms;
EXTERN char *Gvimagepath; /* Per-graph path of files allowed in image attributes (also ps libs) */
EXTERN unsigned char Verbose;
- EXTERN boolean Reduce;
+ EXTERN unsigned char Reduce;
EXTERN int MemTest;
EXTERN char *HTTPServerEnVar;
EXTERN char *Output_file_name;
EXTERN int Show_cnt;
EXTERN char** Show_boxes; /* emit code for correct box coordinates */
EXTERN int CL_type; /* NONE, LOCAL, GLOBAL */
- EXTERN boolean Concentrate; /* if parallel edges should be merged */
+ EXTERN unsigned char Concentrate; /* if parallel edges should be merged */
EXTERN double Epsilon; /* defined in input_graph */
EXTERN int MaxIter;
EXTERN int Ndim;
EXTERN int Y_invert; /* invert y in dot & plain output */
EXTERN int GvExitOnUsage; /* gvParseArgs() should exit on usage or error */
- EXTERN attrsym_t
+ EXTERN Agsym_t
*G_activepencolor, *G_activefillcolor,
*G_selectedpencolor, *G_selectedfillcolor,
*G_visitedpencolor, *G_visitedfillcolor,
*G_deletedpencolor, *G_deletedfillcolor,
*G_ordering, *G_peripheries, *G_penwidth,
*G_gradientangle, *G_margin;
- EXTERN attrsym_t
+ EXTERN Agsym_t
*N_height, *N_width, *N_shape, *N_color, *N_fillcolor,
*N_activepencolor, *N_activefillcolor,
*N_selectedpencolor, *N_selectedfillcolor,
*N_skew, *N_distortion, *N_fixed, *N_imagescale, *N_layer,
*N_group, *N_comment, *N_vertices, *N_z,
*N_penwidth, *N_gradientangle;
- EXTERN attrsym_t
+ EXTERN Agsym_t
*E_weight, *E_minlen, *E_color, *E_fillcolor,
*E_activepencolor, *E_activefillcolor,
*E_selectedpencolor, *E_selectedfillcolor,
*E_tailclip, *E_headclip,
*E_penwidth;
- extern fdpParms_t fdp_parms;
+ extern struct fdpParms_s* fdp_parms;
#undef external
#undef EXTERN
#define agcanonStr(s) agcanonical(s)
#endif
-
- typedef struct {
- int useGrid; /* use grid for speed up */
- int useNew; /* encode x-K into attractive force */
- int numIters; /* actual iterations in layout */
- int unscaled; /* % of iterations used in pass 1 */
- double C; /* Repulsion factor in xLayout */
- double Tfact; /* scale temp from default expression */
- double K; /* spring constant; ideal distance */
- double T0; /* initial temperature */
- } fdpParms_t;
-
typedef struct {
int flags;
} gvlayout_features_t;
extern "C" {
#endif
+struct fdpParms_s {
+ int useGrid; /* use grid for speed up */
+ int useNew; /* encode x-K into attractive force */
+ int numIters; /* actual iterations in layout */
+ int unscaled; /* % of iterations used in pass 1 */
+ double C; /* Repulsion factor in xLayout */
+ double Tfact; /* scale temp from default expression */
+ double K; /* spring constant; ideal distance */
+ double T0; /* initial temperature */
+};
+typedef struct fdpParms_s fdpParms_t;
+
extern void fdp_layout(Agraph_t * g);
extern void fdp_nodesize(node_t *, boolean);
extern void fdp_init_graph(Agraph_t * g);
agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //node custom data
#endif /* WITH_CGRAPH */
ED_factor(e) = late_double(e, E_weight, 1.0, 0.0);
- ED_dist(e) = late_double(e, E_len, fdp_parms.K, 0.0);
+ ED_dist(e) = late_double(e, E_len, fdp_parms->K, 0.0);
common_init_edge(e);
}
#include "tlayout.h"
#include "globals.h"
-#define D_useGrid (fdp_parms.useGrid)
-#define D_useNew (fdp_parms.useNew)
-#define D_numIters (fdp_parms.numIters)
-#define D_unscaled (fdp_parms.unscaled)
-#define D_C (fdp_parms.C)
-#define D_Tfact (fdp_parms.Tfact)
-#define D_K (fdp_parms.K)
-#define D_T0 (fdp_parms.T0)
+#define D_useGrid (fdp_parms->useGrid)
+#define D_useNew (fdp_parms->useNew)
+#define D_numIters (fdp_parms->numIters)
+#define D_unscaled (fdp_parms->unscaled)
+#define D_C (fdp_parms->C)
+#define D_Tfact (fdp_parms->Tfact)
+#define D_K (fdp_parms->K)
+#define D_T0 (fdp_parms->T0)
/* Actual parameters used; initialized using fdp_parms, then possibly
* updated with graph-specific values.
* In particular, note that Verbose is declared but undefined.
*/
#ifndef STANDALONE
+#include <cgraph.h>
+#include <globals.h>
#include <logic.h>
#include <arith.h>
#include <memory.h>
#define POINTS(inch) 72*(inch)
typedef unsigned int boolean;
+extern unsigned char Verbose;
#else /* STANDALONE */
#define MALLOC gmalloc
extern double _statistics[10];
#endif
-extern unsigned char Verbose;
extern int irand(int n);
extern real drand(void);