Code

Previously graph layout was done using the Kamada-Kawai layout algorithm
[inkscape.git] / src / libvpsc / csolve_VPSC.h
1 /**
2  * \brief Bridge for C programs to access solve_VPSC (which is in C++)
3  *
4  * Authors:
5  *   Tim Dwyer <tgdwyer@gmail.com>
6  *
7  * Copyright (C) 2005 Authors
8  *
9  * Released under GNU LGPL.  Read the file 'COPYING' for more information.
10  */
11 #ifndef _CSOLVE_VPSC_H_
12 #define _CSOLVE_VPSC_H_
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 typedef struct Variable Variable;
17 Variable* newVariable(int id, double desiredPos, double weight);
18 void setVariableDesiredPos(Variable *, double desiredPos);
19 double getVariablePos(Variable*);
21 typedef struct Constraint Constraint;
22 Constraint* newConstraint(Variable* left, Variable* right, double gap);
24 typedef struct VPSC VPSC;
25 VPSC* newVPSC(int n, Variable* vs[], int m, Constraint* cs[]);
26 void deleteVPSC(VPSC*);
27 void deleteConstraint(Constraint*);
28 void deleteVariable(Variable*);
29 Constraint** newConstraints(int m);
30 void deleteConstraints(int m,Constraint**);
31 void remapInConstraints(Variable *u, Variable *v, double dgap);
32 void remapOutConstraints(Variable *u, Variable *v, double dgap);
33 int getLeftVarID(Constraint *c);
34 int getRightVarID(Constraint *c);
35 double getSeparation(Constraint *c);
37 #ifndef HAVE_POINTF_S
38 typedef struct pointf_s { double x, y; } pointf;
39 typedef struct { pointf LL, UR; } boxf;
40 #endif
41 int genXConstraints(int n, boxf[], Variable** vs, Constraint*** cs,
42                 int transitiveClosure);
43 int genYConstraints(int n, boxf[], Variable** vs, Constraint*** cs);
45 void satisfyVPSC(VPSC*);
46 void solveVPSC(VPSC*);
47 typedef struct IncVPSC IncVPSC;
48 VPSC* newIncVPSC(int n, Variable* vs[], int m, Constraint* cs[]);
49 void splitIncVPSC(IncVPSC*);
50 int getSplitCnt(IncVPSC *vpsc);
51 #ifdef __cplusplus
52 }
53 #endif
54 #endif /* _CSOLVE_VPSC_H_ */