Code

Translations. French translation minor update.
[inkscape.git] / src / libcola / defs.h
1 /* $Id: defs.h,v 1.5 2005/10/18 18:42:59 ellson Exp $ $Revision: 1.5 $ */
2 /* vim:set shiftwidth=4 ts=8: */
4 /**********************************************************
5 *      This software is part of the graphviz package      *
6 *                http://www.graphviz.org/                 *
7 *                                                         *
8 *            Copyright (c) 1994-2004 AT&T Corp.           *
9 *                and is licensed under the                *
10 *            Common Public License, Version 1.0           *
11 *                      by AT&T Corp.                      *
12 *                                                         *
13 *        Information and Software Systems Research        *
14 *              AT&T Research, Florham Park NJ             *
15 **********************************************************/
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 #ifndef _DEFS_H_
22 #define _DEFS_H_
24 #include "neato.h"
26 #ifdef __cplusplus
27     enum Style { regular, invisible };
28     struct vtx_data {
29         int nedges;
30         int *edges;
31         float *ewgts;
32         Style *styles;
33         float *edists; /* directed dist reflecting the direction of the edge */
34     };
36     struct cluster_data {
37         int nvars;         /* total count of vars in clusters */
38         int nclusters;     /* number of clusters */
39         int *clustersizes; /* number of vars in each cluster */
40         int **clusters;    /* list of var indices for constituents of each c */
41         int ntoplevel;     /* number of nodes not in any cluster */
42         int *toplevel;     /* array of nodes not in any cluster */
43         boxf *bb;          /* bounding box of each cluster */
44     };
46     typedef int DistType;       /* must be signed!! */
48     inline double max(double x, double y) {
49         if (x >= y)
50             return x;
51         else
52             return y;
53     } inline double min(double x, double y) {
54         if (x <= y)
55             return x;
56         else
57             return y;
58     }
60     inline int max(int x, int y) {
61         if (x >= y)
62             return x;
63         else
64             return y;
65     }
67     inline int min(int x, int y) {
68         if (x <= y)
69             return x;
70         else
71             return y;
72     }
74     struct Point {
75         double x;
76         double y;
77         int operator==(Point other) {
78             return x == other.x && y == other.y;
79     }};
80 #else
81 #undef inline
82 #define inline
83 #define NOTUSED(var)      (void) var
85 #include <macros.h>
86     extern void *gmalloc(size_t);
87 #define DIGCOLA 1
89 #ifdef USE_STYLES
90     typedef enum { regular, invisible } Style;
91 #endif
92     typedef struct {
93         int nedges;             /* no. of neighbors, including self */
94         int *edges;             /* edges[0..(nedges-1)] are neighbors; edges[0] is self */
95         float *ewgts;           /* preferred edge lengths */
96         float *eweights;        /* edge weights */
97         node_t *np;             /* original node */
98 #ifdef USE_STYLES
99         Style *styles;
100 #endif
101 #ifdef DIGCOLA
102         float *edists; /* directed dist reflecting the direction of the edge */
103 #endif
104     } vtx_data;
106     typedef struct cluster_data {
107         int nvars;         /* total count of vars in clusters */
108         int nclusters;     /* number of clusters */
109         int *clustersizes; /* number of vars in each cluster */
110         int **clusters;    /* list of var indices for constituents of each c */
111         int ntoplevel;     /* number of nodes not in any cluster */
112         int *toplevel;     /* array of nodes not in any cluster */
113         boxf *bb;          /* bounding box of each cluster */
114     } cluster_data;
117     typedef int DistType;       /* must be signed!! */
119 #ifdef UNUSED
120     typedef struct {
121         double x;
122         double y;
123     } Point;
124 #endif
126 #endif
128 #endif
130 #ifdef __cplusplus
132 #endif