/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/neatogen/defs.h

Go to the documentation of this file.
00001 /* $Id: defs.h,v 1.8 2007/07/25 19:25:54 erg Exp $ $Revision: 1.8 $ */
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 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 #ifndef _DEFS_H_
00022 #define _DEFS_H_
00023 
00024 #include "neato.h"
00025 
00026 #ifdef __cplusplus
00027     enum Style { regular, invisible };
00028     struct vtx_data {
00029         int nedges;
00030         int *edges;
00031         float *ewgts;
00032         Style *styles;
00033         float *edists; /* directed dist reflecting the direction of the edge */
00034     };
00035 
00036     typedef int DistType;       /* must be signed!! */
00037 
00038     inline double max(double x, double y) {
00039         if (x >= y)
00040             return x;
00041         else
00042             return y;
00043     } inline double min(double x, double y) {
00044         if (x <= y)
00045             return x;
00046         else
00047             return y;
00048     }
00049 
00050     inline int max(int x, int y) {
00051         if (x >= y)
00052             return x;
00053         else
00054             return y;
00055     }
00056 
00057     inline int min(int x, int y) {
00058         if (x <= y)
00059             return x;
00060         else
00061             return y;
00062     }
00063 
00064     struct Point {
00065         double x;
00066         double y;
00067         int operator==(Point other) {
00068             return x == other.x && y == other.y;
00069     }};
00070 #else
00071 #undef inline
00072 #define inline
00073 #define NOTUSED(var)      (void) var
00074 
00075 #include <macros.h>
00076 
00077 #ifdef USE_STYLES
00078     typedef enum { regular, invisible } Style;
00079 #endif
00080     typedef struct {
00081         int nedges;             /* no. of neighbors, including self */
00082         int *edges;             /* edges[0..(nedges-1)] are neighbors; edges[0] is self */
00083         float *ewgts;           /* preferred edge lengths */
00084         float *eweights;        /* edge weights */
00085         node_t *np;             /* original node */
00086 #ifdef USE_STYLES
00087         Style *styles;
00088 #endif
00089 #ifdef DIGCOLA
00090         float *edists; /* directed dist reflecting the direction of the edge */
00091 #endif
00092     } vtx_data;
00093 
00094 #ifdef DIGCOLA
00095 #ifdef IPSEPCOLA
00096     typedef struct cluster_data {
00097         int nvars;         /* total count of vars in clusters */
00098         int nclusters;     /* number of clusters */
00099         int *clustersizes; /* number of vars in each cluster */
00100         int **clusters;    /* list of var indices for constituents of each c */
00101         int ntoplevel;     /* number of nodes not in any cluster */
00102         int *toplevel;     /* array of nodes not in any cluster */
00103         boxf *bb;          /* bounding box of each cluster */
00104     } cluster_data;
00105 #endif
00106 #endif
00107 
00108     typedef int DistType;       /* must be signed!! */
00109 
00110 #ifdef UNUSED
00111     typedef struct {
00112         double x;
00113         double y;
00114     } Point;
00115 #endif
00116 
00117 #endif
00118 
00119 #endif
00120 
00121 #ifdef __cplusplus
00122 }
00123 #endif

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