-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblockgroup.h
83 lines (50 loc) · 1.67 KB
/
blockgroup.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef BLOCKGROUP_H
#define BLOCKGROUP_H
#include <set>
#include <iostream>
#include <vector>
#include <string>
#include <climits>
#include "object.h"
using std::set;
using std::pair;
using std::vector;
using std::string;
class BlockGroup : public Object {
public:
bool oriented;
bool sub;
set<pair<int, int>> pairs;
int n;
pair<int, int> bottomleft;
pair<int, int> topright;
pair<int, int> boundingbox;
const pair<int, int> NIL = {INT_MIN, INT_MIN};
BlockGroup(bool orientation, bool subtractive, vector<pair<int, int>> v, Color c);
BlockGroup(bool orientation, bool subtractive, vector<pair<int, int>> v);
void updateBounds();
// Utility Functions
bool contains(pair<int, int> p);
void add(pair<int, int> p);
void remove(pair<int, int> p);
void reset(vector<pair<int, int>>& p);
BlockGroup clone();
// General Functions
void rotate(int x);
void move(pair<int, int> p);
void invmov(pair<int, int> p);
void normalize();
void removeRegion(BlockGroup x);
void addRegion(BlockGroup x);
string to_string();
void disp();
// Region testing
bool containsbb(BlockGroup b);
bool directoverlay(BlockGroup b);
vector<pair<int, int>> fixedoverlay(BlockGroup b);
vector<vector<pair<int, int>>> overlay(BlockGroup b);
// Now for the real thing
bool dfsUtil(BlockGroup region, vector<BlockGroup>& v, int index);
bool solve(vector<BlockGroup> v);
};
#endif