2
* vim: ts=4 sw=4 et tw=0 wm=0
4
* libavoid - Fast, Incremental, Object-avoiding Line Router
5
* Copyright (C) 2004-2006 Michael Wybrow <mjwybrow@users.sourceforge.net>
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#ifndef AVOID_REGION_H
24
#define AVOID_REGION_H
27
#include "libavoid/geomtypes.h"
33
typedef std::list<int> ShapeList;
40
Region(double x1, double y1, double x2, double y2);
42
bool overlapCheck(BBox& bbox, unsigned int& p);
43
void getBBox(BBox& bb);
48
void initialSplit(BBox& bbox, unsigned int pos, unsigned int& shapeId);
51
static void pairHor(Region *l, Region *r);
52
static void pairVer(Region *a, Region *b);
53
static void addShape(ShapeRef *shape);
54
static void removeShape(ShapeRef *shape);
55
static Region *getTopLeftRegion(void);
65
Region *split(double pos, unsigned int dir);
66
void merge(unsigned int dir);
67
void mergeRegion(Region *src);
68
Region *findRegion(double pos, unsigned int dir,
69
const bool forMerge = false);
70
Region *splitDir(double pos, unsigned int dir, bool first = false);
71
void mergeDir(unsigned int dir, bool first = false);
72
void copyAttributes(Region *src);
73
void mergeAttributes(Region *src);
74
bool safeToMerge(unsigned int dir);
75
bool unsafeToMerge(unsigned int dir);