Code

Node tool: snap while scaling a selection of nodes. Consider this as experimental...
[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 class vpsc::Variable;
15 class vpsc::Constraint;
16 class vpsc::Solver;
17 class vpsc::IncSolver;
18 using namespace vpsc;
19 extern "C" {
20 #else
21 typedef struct Variable Variable;
22 typedef struct Constraint Constraint;
23 typedef struct Solver Solver;
24 typedef struct IncSolver IncSolver;
25 #endif
26 Variable* newVariable(int id, double desiredPos, double weight);
27 void setVariableDesiredPos(Variable *, double desiredPos);
28 double getVariablePos(Variable*);
30 Constraint* newConstraint(Variable* left, Variable* right, double gap);
32 Solver* newSolver(int n, Variable* vs[], int m, Constraint* cs[]);
33 void deleteSolver(Solver*);
34 void deleteConstraint(Constraint*);
35 void deleteVariable(Variable*);
36 Constraint** newConstraints(int m);
37 void deleteConstraints(int m,Constraint**);
38 void remapInConstraints(Variable *u, Variable *v, double dgap);
39 void remapOutConstraints(Variable *u, Variable *v, double dgap);
40 int getLeftVarID(Constraint *c);
41 int getRightVarID(Constraint *c);
42 double getSeparation(Constraint *c);
44 #ifndef HAVE_POINTF_S
45 typedef struct pointf_s { double x, y; } pointf;
46 typedef struct { pointf LL, UR; } boxf;
47 #endif
48 int genXConstraints(int n, boxf[], Variable** vs, Constraint*** cs,
49                 int transitiveClosure);
50 int genYConstraints(int n, boxf[], Variable** vs, Constraint*** cs);
52 void satisfyVPSC(Solver*);
53 void solveVPSC(Solver*);
54 Solver* newIncSolver(int n, Variable* vs[], int m, Constraint* cs[]);
55 void splitIncSolver(IncSolver*);
56 int getSplitCnt(IncSolver *vpsc);
57 #ifdef __cplusplus
58 }
59 #endif
60 #endif /* _CSOLVE_VPSC_H_ */