Debian Codegraph @

lib/mingle/edge_bundling.h

raw
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 <sparse/SparseMatrix.h>
14 #include <vector>
15
16 struct pedge {
17 double wgt; /* weight, telling how many original edges this edge represent. If this edge consists of multiple sections of different weights then this is a lower bound. This only applied for agglomerative bundling */
18 int npoints;/* number of poly points */
19 int len;/* length of arra x. len >= npoints */
20 int dim;/* dim >= 2. Point i is stored from x[i*dim]*/
21 double edge_length;
22 std::vector<double> x; ///< coordinates of the npoints poly points. Dimension dim*npoints
23 std::vector<double> wgts;/* number of original edges each section represnet. Dimension npoint - 1. This only applied for agglomerative bundling Null for other methods */
24 };
25
26 std::vector<pedge> edge_bundling(SparseMatrix A, int dim,
27 const std::vector<double> &x, int maxit_outer,
28 double K, int method, int nneighbor,
29 int compatibility_method, int max_recursion,
30 double angle_param, double angle);
31 void pedge_delete(pedge &e);
32 void pedge_wgts_realloc(pedge &e, int n);
33 void pedge_export_gv(FILE *fp, int ne, const std::vector<pedge> &edges);
34 enum {METHOD_NONE = -1, METHOD_FD, METHOD_INK_AGGLOMERATE, METHOD_INK};
35 enum {COMPATIBILITY_DIST = 0, COMPATIBILITY_FULL};
36 pedge pedge_wgt_new(int np, int dim, double *x, double wgt);
37 void pedge_double(pedge &e);