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