1 /**
2 * \brief Remove overlaps function
3 *
4 * Authors:
5 * Tim Dwyer <tgdwyer@gmail.com>
6 *
7 * Copyright (C) 2005 Authors
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef SEEN_REMOVEOVERLAP_VARIABLE_H
13 #define SEEN_REMOVEOVERLAP_VARIABLE_H
15 #include <vector>
16 #include <iostream>
17 class Block;
18 class Constraint;
20 class Variable
21 {
22 friend std::ostream& operator <<(std::ostream &os, const Variable &v);
23 public:
24 static const unsigned int _TOSTRINGBUFFSIZE=20;
25 const int id; // useful in log files
26 double desiredPosition;
27 const double weight;
28 double offset;
29 Block *block;
30 bool visited;
31 std::vector<Constraint*> in;
32 std::vector<Constraint*> out;
33 char *toString();
34 inline Variable(const int id, const double desiredPos, const double weight)
35 : id(id)
36 , desiredPosition(desiredPos)
37 , weight(weight)
38 , offset(0)
39 , visited(false)
40 {
41 }
42 double position() const;
43 ~Variable(void){
44 in.clear();
45 out.clear();
46 }
47 };
48 #endif // SEEN_REMOVEOVERLAP_VARIABLE_H