summaryrefslogtreecommitdiffstats
path: root/src/libvpsc
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-03-23 17:59:12 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-03-23 17:59:12 +0000
commit3a4bbd50a7b0f06b8bb126db2af10782d91eda28 (patch)
treee003d927e77d9d97fc5ff9eef82771937a6bc7a8 /src/libvpsc
parentfix Windows build for newer gcc/libs (diff)
downloadinkscape-3a4bbd50a7b0f06b8bb126db2af10782d91eda28.tar.gz
inkscape-3a4bbd50a7b0f06b8bb126db2af10782d91eda28.zip
remove files that interface through C with libvpsc, we are using C++ so...
(bzr r13191)
Diffstat (limited to 'src/libvpsc')
-rw-r--r--src/libvpsc/CMakeLists.txt2
-rw-r--r--src/libvpsc/Makefile_insert2
-rw-r--r--src/libvpsc/csolve_VPSC.cpp128
-rw-r--r--src/libvpsc/csolve_VPSC.h72
4 files changed, 0 insertions, 204 deletions
diff --git a/src/libvpsc/CMakeLists.txt b/src/libvpsc/CMakeLists.txt
index 4099900b5..aa693670c 100644
--- a/src/libvpsc/CMakeLists.txt
+++ b/src/libvpsc/CMakeLists.txt
@@ -3,7 +3,6 @@ set(libvpsc_SRC
block.cpp
blocks.cpp
constraint.cpp
- csolve_VPSC.cpp
generate-constraints.cpp
remove_rectangle_overlap.cpp
solve_VPSC.cpp
@@ -16,7 +15,6 @@ set(libvpsc_SRC
block.h
blocks.h
constraint.h
- csolve_VPSC.h
generate-constraints.h
pairingheap/PairingHeap.h
pairingheap/dsexceptions.h
diff --git a/src/libvpsc/Makefile_insert b/src/libvpsc/Makefile_insert
index 4af86324e..cb05be6c0 100644
--- a/src/libvpsc/Makefile_insert
+++ b/src/libvpsc/Makefile_insert
@@ -11,7 +11,6 @@ libvpsc_libvpsc_a_SOURCES = libvpsc/block.cpp\
libvpsc/pairingheap/PairingHeap.cpp\
libvpsc/remove_rectangle_overlap.cpp\
libvpsc/solve_VPSC.cpp\
- libvpsc/csolve_VPSC.cpp\
libvpsc/variable.cpp\
libvpsc/block.h\
libvpsc/blocks.h\
@@ -21,5 +20,4 @@ libvpsc_libvpsc_a_SOURCES = libvpsc/block.cpp\
libvpsc/pairingheap/dsexceptions.h\
libvpsc/remove_rectangle_overlap.h\
libvpsc/solve_VPSC.h\
- libvpsc/csolve_VPSC.h\
libvpsc/variable.h
diff --git a/src/libvpsc/csolve_VPSC.cpp b/src/libvpsc/csolve_VPSC.cpp
deleted file mode 100644
index 60e88a50b..000000000
--- a/src/libvpsc/csolve_VPSC.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Bridge for C programs to access solve_VPSC (which is in C++).
- *
- * Authors:
- * Tim Dwyer <tgdwyer@gmail.com>
- *
- * Copyright (C) 2005 Authors
- *
- * Released under GNU LGPL. Read the file 'COPYING' for more information.
- */
-#include <glib.h>
-#include <iostream>
-#include <cassert>
-#include <cstdlib>
-#include "variable.h"
-#include "constraint.h"
-#include "generate-constraints.h"
-#include "solve_VPSC.h"
-#include "csolve_VPSC.h"
-using namespace vpsc;
-extern "C" {
-Variable* newVariable(int id, double desiredPos, double weight) {
- return new Variable(id,desiredPos,weight);
-}
-Constraint* newConstraint(Variable* left, Variable* right, double gap) {
- return new Constraint(left,right,gap);
-}
-Solver* newSolver(int n, Variable* vs[], int m, Constraint* cs[]) {
- return new Solver(n,vs,m,cs);
-}
-Solver* newIncSolver(int n, Variable* vs[], int m, Constraint* cs[]) {
- return (Solver*)new vpsc::IncSolver(n,vs,m,cs);
-}
-
-int genXConstraints(int n, boxf* bb, Variable** vs, Constraint*** cs,int transitiveClosure) {
- Rectangle* rs[n];
- for(int i=0;i<n;i++) {
- rs[i]=new Rectangle(bb[i].LL.x,bb[i].UR.x,bb[i].LL.y,bb[i].UR.y);
- }
- int m = generateXConstraints(n,rs,vs,*cs,transitiveClosure);
- for(int i=0;i<n;i++) {
- delete rs[i];
- }
- return m;
-}
-int genYConstraints(int n, boxf* bb, Variable** vs, Constraint*** cs) {
- g_assert(n > 0);
- Rectangle* rs[n];
- for(int i=0;i<n;i++) {
- rs[i]=new Rectangle(bb[i].LL.x,bb[i].UR.x,bb[i].LL.y,bb[i].UR.y);
- }
- int m = generateYConstraints(n,rs,vs,*cs);
- for(int i=0;i<n;i++) {
- delete rs[i];
- }
- return m;
-}
-
-Constraint** newConstraints(int m) {
- return new Constraint*[m];
-}
-void deleteConstraints(int m, Constraint **cs) {
- for(int i=0;i<m;i++) {
- delete cs[i];
- }
- delete [] cs;
-}
-void deleteConstraint(Constraint* c) {
- delete c;
-}
-void deleteVariable(Variable* v) {
- delete v;
-}
-void satisfyVPSC(Solver* vpsc) {
- try {
- vpsc->satisfy();
- } catch(const char *e) {
- std::cerr << e << std::endl;
- exit(1);
- }
-}
-int getSplitCnt(IncSolver *vpsc) {
- return vpsc->splitCnt;
-}
-void deleteVPSC(Solver *vpsc) {
- assert(vpsc!=NULL);
- delete vpsc;
-}
-void solveVPSC(Solver* vpsc) {
- vpsc->solve();
-}
-void splitIncVPSC(IncSolver* vpsc) {
- vpsc->splitBlocks();
-}
-void setVariableDesiredPos(Variable *v, double desiredPos) {
- v->desiredPosition = desiredPos;
-}
-double getVariablePos(Variable *v) {
- return v->position();
-}
-void remapInConstraints(Variable *u, Variable *v, double dgap) {
- for(Constraints::iterator i=u->in.begin();i!=u->in.end();i++) {
- Constraint* c=*i;
- c->right=v;
- c->gap+=dgap;
- v->in.push_back(c);
- }
- u->in.clear();
-}
-void remapOutConstraints(Variable *u, Variable *v, double dgap) {
- for(Constraints::iterator i=u->out.begin();i!=u->out.end();i++) {
- Constraint* c=*i;
- c->left=v;
- c->gap+=dgap;
- v->out.push_back(c);
- }
- u->out.clear();
-}
-int getLeftVarID(Constraint *c) {
- return c->left->id;
-}
-int getRightVarID(Constraint *c){
- return c->right->id;
-}
-double getSeparation(Constraint *c){
- return c->gap;
-}
-}
diff --git a/src/libvpsc/csolve_VPSC.h b/src/libvpsc/csolve_VPSC.h
deleted file mode 100644
index edfd16657..000000000
--- a/src/libvpsc/csolve_VPSC.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file
- * Bridge for C programs to access solve_VPSC (which is in C++).
- */
-/*
- * Authors:
- * Tim Dwyer <tgdwyer@gmail.com>
- *
- * Copyright (C) 2005 Authors
- *
- * Released under GNU LGPL. Read the file 'COPYING' for more information.
- */
-#ifndef CSOLVE_VPSC_H_
-#define CSOLVE_VPSC_H_
-#ifdef __cplusplus
-namespace vpsc
-{
- class Variable;
- class Constraint;
- class Solver;
- class IncSolver;
-}
-/* TODO 'using' should never be in a .h file. We need a different approach here. */
-using vpsc::Variable;
-using vpsc::Constraint;
-using vpsc::Solver;
-using vpsc::IncSolver;
-extern "C" {
-#else
-typedef struct Variable Variable;
-typedef struct Constraint Constraint;
-typedef struct Solver Solver;
-typedef struct IncSolver IncSolver;
-#endif
-
-Variable* newVariable(int id, double desiredPos, double weight);
-void setVariableDesiredPos(Variable *, double desiredPos);
-double getVariablePos(Variable*);
-
-Constraint* newConstraint(Variable* left, Variable* right, double gap);
-
-Solver* newSolver(int n, Variable* vs[], int m, Constraint* cs[]);
-void deleteSolver(Solver*);
-void deleteConstraint(Constraint*);
-void deleteVariable(Variable*);
-Constraint** newConstraints(int m);
-void deleteConstraints(int m,Constraint**);
-void remapInConstraints(Variable *u, Variable *v, double dgap);
-void remapOutConstraints(Variable *u, Variable *v, double dgap);
-int getLeftVarID(Constraint *c);
-int getRightVarID(Constraint *c);
-double getSeparation(Constraint *c);
-
-#ifndef HAVE_POINTF_S
-typedef struct pointf_s { double x, y; } pointf;
-typedef struct { pointf LL, UR; } boxf;
-#endif
-int genXConstraints(int n, boxf[], Variable** vs, Constraint*** cs,
- int transitiveClosure);
-int genYConstraints(int n, boxf[], Variable** vs, Constraint*** cs);
-
-void satisfyVPSC(Solver*);
-void deleteVPSC(Solver*);
-void solveVPSC(Solver*);
-void splitIncVPSC(IncSolver*);
-Solver* newIncSolver(int n, Variable* vs[], int m, Constraint* cs[]);
-void splitIncSolver(IncSolver*);
-int getSplitCnt(IncSolver *vpsc);
-#ifdef __cplusplus
-}
-#endif
-#endif /* CSOLVE_VPSC_H_ */