Code

added fix from Dale Harvey to expand incomplete JIDs specified in user
[inkscape.git] / src / removeoverlap / blocks.h
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_BLOCKS_H
13 #define SEEN_REMOVEOVERLAP_BLOCKS_H
15 #ifdef RECTANGLE_OVERLAP_LOGGING
16 #define LOGFILE "cRectangleOverlap.log"
17 #endif
19 #include <set>
20 #include <list>
22 class Block;
23 class Variable;
24 class Constraint;
25 /**
26  * A block structure defined over the variables such that each block contains
27  * 1 or more variables, with the invariant that all constraints inside a block
28  * are satisfied by keeping the variables fixed relative to one another
29  */
30 class Blocks : public std::set<Block*>
31 {
32 public:
33         Blocks(Variable *vs[], const int n);
34         ~Blocks(void);
35         void mergeLeft(Block *r);
36         void mergeRight(Block *l);
37         void split(Block *b, Block *&l, Block *&r, Constraint *c);
38         std::list<Variable*> *totalOrder();
39         void cleanup();
40         double cost();
41 private:
42         void dfsVisit(Variable *v, std::list<Variable*> *order);
43         void removeBlock(Block *doomed);
44         Variable **vs;
45         int nvs;
46 };
48 extern long blockTimeCtr;
49 #endif // SEEN_REMOVEOVERLAP_BLOCKS_H