| 1 | /* $Id$ $Revision$ */ |
| 2 | /* vim:set shiftwidth=4 ts=8: */ |
| 3 | |
| 4 | /************************************************************************* |
| 5 | * Copyright (c) 2011 AT&T Intellectual Property |
| 6 | * All rights reserved. This program and the accompanying materials |
| 7 | * are made available under the terms of the Eclipse Public License v1.0 |
| 8 | * which accompanies this distribution, and is available at |
| 9 | * http://www.eclipse.org/legal/epl-v10.html |
| 10 | * |
| 11 | * Contributors: See CVS logs. Details at http://www.graphviz.org/ |
| 12 | *************************************************************************/ |
| 13 | |
| 14 | |
| 15 | |
| 16 | #ifndef ADJUST_H |
| 17 | #define ADJUST_H |
| 18 | |
| 19 | #ifdef __cplusplus |
| 20 | extern "C" { |
| 21 | #endif |
| 22 | |
| 23 | #include "geom.h" |
| 24 | #include "SparseMatrix.h" |
| 25 | |
| 26 | #define DFLT_MARGIN 4 /* 4 points */ |
| 27 | |
| 28 | typedef enum { |
| 29 | AM_NONE, AM_VOR, |
| 30 | AM_SCALE, AM_NSCALE, AM_SCALEXY, AM_PUSH, AM_PUSHPULL, |
| 31 | AM_ORTHO, AM_ORTHO_YX, AM_ORTHOXY, AM_ORTHOYX, |
| 32 | AM_PORTHO, AM_PORTHO_YX, AM_PORTHOXY, AM_PORTHOYX, AM_COMPRESS, |
| 33 | AM_VPSC, AM_IPSEP, AM_PRISM |
| 34 | } adjust_mode; |
| 35 | |
| 36 | typedef struct { |
| 37 | adjust_mode mode; |
| 38 | char *print; |
| 39 | int value; |
| 40 | double scaling; |
| 41 | } adjust_data; |
| 42 | |
| 43 | typedef struct { |
| 44 | float x, y; |
| 45 | boolean doAdd; /* if true, x and y are in points */ |
| 46 | } expand_t; |
| 47 | |
| 48 | extern expand_t sepFactor(graph_t * G); |
| 49 | extern expand_t esepFactor(graph_t * G); |
| 50 | extern int adjustNodes(graph_t * G); |
| 51 | extern int normalize(graph_t * g); |
| 52 | extern int removeOverlapAs(graph_t*, char*); |
| 53 | extern int removeOverlapWith(graph_t*, adjust_data*); |
| 54 | extern int cAdjust(graph_t *, int); |
| 55 | extern int scAdjust(graph_t *, int); |
| 56 | extern adjust_data *graphAdjustMode(graph_t *G, adjust_data*, char* dflt); |
| 57 | extern double *getSizes(Agraph_t * g, pointf pad, int *n_elabels, int **elabels); |
| 58 | extern SparseMatrix makeMatrix(Agraph_t* g, int dim, SparseMatrix *D); |
| 59 | |
| 60 | #ifdef __cplusplus |
| 61 | } |
| 62 | #endif |
| 63 | #endif |
| 64 | |