~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/libvpsc/blocks.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \brief A block structure defined over the variables
 
3
 *
 
4
 * A block structure defined over the variables such that each block contains
 
5
 * 1 or more variables, with the invariant that all constraints inside a block
 
6
 * are satisfied by keeping the variables fixed relative to one another
 
7
 *
 
8
 * Authors:
 
9
 *   Tim Dwyer <tgdwyer@gmail.com>
 
10
 *
 
11
 * Copyright (C) 2005 Authors
 
12
 *
 
13
 * Released under GNU LGPL.  Read the file 'COPYING' for more information.
 
14
 */
 
15
 
 
16
#ifndef SEEN_REMOVEOVERLAP_BLOCKS_H
 
17
#define SEEN_REMOVEOVERLAP_BLOCKS_H
 
18
 
 
19
#ifdef RECTANGLE_OVERLAP_LOGGING
 
20
#define LOGFILE "cRectangleOverlap.log"
 
21
#endif
 
22
 
 
23
#include <set>
 
24
#include <list>
 
25
 
 
26
namespace vpsc {
 
27
class Block;
 
28
class Variable;
 
29
class Constraint;
 
30
/**
 
31
 * A block structure defined over the variables such that each block contains
 
32
 * 1 or more variables, with the invariant that all constraints inside a block
 
33
 * are satisfied by keeping the variables fixed relative to one another
 
34
 */
 
35
class Blocks : public std::set<Block*>
 
36
{
 
37
public:
 
38
        Blocks(const int n, Variable* const vs[]);
 
39
    virtual ~Blocks(void);
 
40
        void mergeLeft(Block *r);
 
41
        void mergeRight(Block *l);
 
42
        void split(Block *b, Block *&l, Block *&r, Constraint *c);
 
43
        std::list<Variable*> *totalOrder();
 
44
        void cleanup();
 
45
        double cost();
 
46
private:
 
47
        void dfsVisit(Variable *v, std::list<Variable*> *order);
 
48
        void removeBlock(Block *doomed);
 
49
        Variable* const *vs;
 
50
        int nvs;
 
51
};
 
52
 
 
53
extern long blockTimeCtr;
 
54
}
 
55
#endif // SEEN_REMOVEOVERLAP_BLOCKS_H