/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/plugin/neato_layout/gvlayout_neato_layout.c

Go to the documentation of this file.
00001 /* $Id: gvlayout_neato_layout.c,v 1.9 2006/06/26 20:39:06 ellson Exp $ $Revision: 1.9 $ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /**********************************************************
00005 *      This software is part of the graphviz package      *
00006 *                http://www.graphviz.org/                 *
00007 *                                                         *
00008 *            Copyright (c) 1994-2004 AT&T Corp.           *
00009 *                and is licensed under the                *
00010 *            Common Public License, Version 1.0           *
00011 *                      by AT&T Corp.                      *
00012 *                                                         *
00013 *        Information and Software Systems Research        *
00014 *              AT&T Research, Florham Park NJ             *
00015 **********************************************************/
00016 
00017 /*
00018  *  neato layout plugin
00019  *
00020  */
00021 
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026 
00027 #include <stdio.h>
00028 
00029 #include "gvplugin_layout.h"
00030 
00031 /* FIXME - globals.h is needed for Nop */
00032 #include "globals.h"
00033 
00034 typedef enum { LAYOUT_NEATO,
00035                 LAYOUT_FDP,
00036                 LAYOUT_TWOPI,
00037                 LAYOUT_CIRCO,
00038                 LAYOUT_NOP1,
00039                 LAYOUT_NOP2,
00040         } layout_type;
00041 
00042 extern void neato_layout(graph_t * g);
00043 extern void fdp_layout(graph_t * g);
00044 extern void twopi_layout(graph_t * g);
00045 extern void circo_layout(graph_t * g);
00046 
00047 extern void neato_cleanup(graph_t * g);
00048 extern void fdp_cleanup(graph_t * g);
00049 extern void twopi_cleanup(graph_t * g);
00050 extern void circo_cleanup(graph_t * g);
00051 
00052 static void nop1_layout(graph_t * g)
00053 {
00054     Nop = 1;
00055     neato_layout(g);
00056 }
00057 
00058 static void nop2_layout(graph_t * g)
00059 {
00060     Nop = 2;
00061     neato_layout(g);
00062 }
00063 
00064 gvlayout_engine_t neatogen_engine = {
00065     neato_layout,
00066     neato_cleanup,
00067 };
00068 
00069 gvlayout_engine_t fdpgen_engine = {
00070     fdp_layout,
00071     fdp_cleanup,
00072 };
00073 
00074 gvlayout_engine_t twopigen_engine = {
00075     twopi_layout,
00076     twopi_cleanup,
00077 };
00078 
00079 gvlayout_engine_t circogen_engine = {
00080     circo_layout,
00081     circo_cleanup,
00082 };
00083 
00084 gvlayout_engine_t nop1gen_engine = {
00085     nop1_layout,
00086     neato_cleanup,
00087 };
00088 
00089 gvlayout_engine_t nop2gen_engine = {
00090     nop2_layout,
00091     neato_cleanup,
00092 };
00093 
00094 gvlayout_features_t neatogen_features = {
00095         0,
00096 };
00097 
00098 gvplugin_installed_t gvlayout_neato_types[] = {
00099     {LAYOUT_NEATO, "neato", 0, &neatogen_engine, &neatogen_features},
00100     {LAYOUT_FDP, "fdp", 0, &fdpgen_engine, &neatogen_features},
00101     {LAYOUT_TWOPI, "twopi", 0, &twopigen_engine, &neatogen_features},
00102     {LAYOUT_CIRCO, "circo", 0, &circogen_engine, &neatogen_features},
00103     {LAYOUT_NOP1, "nop", 0, &nop1gen_engine, &neatogen_features},
00104     {LAYOUT_NOP1, "nop1", 0, &nop1gen_engine, &neatogen_features},
00105     {LAYOUT_NOP1, "nop2", 0, &nop2gen_engine, &neatogen_features},
00106     {0, NULL, 0, NULL, NULL}
00107 };

Generated on Mon Mar 31 19:03:28 2008 for Graphviz by  doxygen 1.5.1