| 1 |
/** |
| 2 |
* \brief Bridge for C programs to access solve_VPSC (which is in C++) |
| 3 |
* |
| 4 |
* Authors: |
| 5 |
* Tim Dwyer <[email protected]> |
| 6 |
* |
| 7 |
* Copyright (C) 2005 Authors |
| 8 |
* |
| 9 |
* This version is released under the CPL (Common Public License) with |
| 10 |
* the Graphviz distribution. |
| 11 |
* A version is also available under the LGPL as part of the Adaptagrams |
| 12 |
* project: https://github.com/mjwybrow/adaptagrams. |
| 13 |
* If you make improvements or bug fixes to this code it would be much |
| 14 |
* appreciated if you could also contribute those changes back to the |
| 15 |
* Adaptagrams repository. |
| 16 |
*/ |
| 17 |
#pragma once |
| 18 |
|
| 19 |
#include <stdbool.h> |
| 20 |
|
| 21 |
#ifdef __cplusplus |
| 22 |
extern "C" { |
| 23 |
#endif |
| 24 |
typedef struct Variable Variable; |
| 25 |
Variable* newVariable(int id, double desiredPos, double weight); |
| 26 |
void setVariableDesiredPos(Variable *, double desiredPos); |
| 27 |
double getVariablePos(const Variable*); |
| 28 |
|
| 29 |
typedef struct Constraint Constraint; |
| 30 |
Constraint* newConstraint(Variable* left, Variable* right, double gap); |
| 31 |
|
| 32 |
typedef struct VPSC VPSC; |
| 33 |
void deleteVPSC(VPSC*); |
| 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 |
|
| 41 |
#ifndef HAVE_POINTF_S |
| 42 |
typedef struct pointf_s { double x, y; } pointf; |
| 43 |
typedef struct { pointf LL, UR; } boxf; |
| 44 |
#endif |
| 45 |
int genXConstraints(int n, boxf[], Variable** vs, Constraint*** cs, |
| 46 |
bool transitiveClosure); |
| 47 |
int genYConstraints(int n, boxf[], Variable** vs, Constraint*** cs); |
| 48 |
|
| 49 |
void satisfyVPSC(VPSC*); |
| 50 |
void solveVPSC(VPSC*); |
| 51 |
typedef struct IncVPSC IncVPSC; |
| 52 |
VPSC* newIncVPSC(int n, Variable* vs[], int m, Constraint* cs[]); |
| 53 |
#ifdef __cplusplus |
| 54 |
} |
| 55 |
#endif |