summaryrefslogtreecommitdiffstats
path: root/src/removeoverlap/variable.h
diff options
context:
space:
mode:
authorTim Dwyer <tgdwyer@gmail.com>2006-05-10 07:13:45 +0000
committertgdwyer <tgdwyer@users.sourceforge.net>2006-05-10 07:13:45 +0000
commit0623102c16ecbf5ade1a7ef195659826a6f92548 (patch)
treec5d847af5fbb9733a406251c3575bc912da0ab17 /src/removeoverlap/variable.h
parentpatch 1484602 by Niko Kiirala (diff)
downloadinkscape-0623102c16ecbf5ade1a7ef195659826a6f92548.tar.gz
inkscape-0623102c16ecbf5ade1a7ef195659826a6f92548.zip
Apparently a problem was reported with one of the test cases.
I can't reproduce the problem, however solve_VPSC code in inkscape was getting quite out of date with that in www.sf.net/projects/adaptagrams. I've updated the code, which may fix the problem, or at least if it's reported again then I'll know it's still an issue. (bzr r803)
Diffstat (limited to 'src/removeoverlap/variable.h')
-rw-r--r--src/removeoverlap/variable.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/removeoverlap/variable.h b/src/removeoverlap/variable.h
index e682dd7df..86e16737e 100644
--- a/src/removeoverlap/variable.h
+++ b/src/removeoverlap/variable.h
@@ -1,14 +1,12 @@
/**
- * \brief Remove overlaps function
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
*
* Copyright (C) 2005 Authors
*
- * Released under GNU GPL. Read the file 'COPYING' for more information.
+ * Released under GNU LGPL. Read the file 'COPYING' for more information.
*/
-
#ifndef SEEN_REMOVEOVERLAP_VARIABLE_H
#define SEEN_REMOVEOVERLAP_VARIABLE_H
@@ -16,30 +14,35 @@
#include <iostream>
class Block;
class Constraint;
+#include "block.h"
+typedef std::vector<Constraint*> Constraints;
class Variable
{
friend std::ostream& operator <<(std::ostream &os, const Variable &v);
public:
- static const unsigned int _TOSTRINGBUFFSIZE=20;
const int id; // useful in log files
double desiredPosition;
const double weight;
double offset;
Block *block;
bool visited;
- std::vector<Constraint*> in;
- std::vector<Constraint*> out;
+ Constraints in;
+ Constraints out;
char *toString();
inline Variable(const int id, const double desiredPos, const double weight)
: id(id)
, desiredPosition(desiredPos)
, weight(weight)
, offset(0)
+ , block(NULL)
, visited(false)
{
}
- double position() const;
+ inline double Variable::position() const {
+ return block->posn+offset;
+ }
+ //double position() const;
~Variable(void){
in.clear();
out.clear();