1
/* $Id: mtspace.h,v 1.4 2004/03/28 03:06:39 haceaton Exp $ */
6
* PCB, interactive printed circuit board design
7
* Copyright (C) 1994,1995,1996 Thomas Nau
8
* Copyright (C) 1998,1999,2000,2001 harry eaton
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
* Contact addresses for paper mail and Email:
25
* harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA
26
* haceaton@aplcomm.jhuapl.edu
30
/* this file, mtspace.h, was written and is
31
* Copyright (c) 2001 C. Scott Ananian.
34
/* prototypes for "empty space" routines (needed for via-space tracking
38
#ifndef __MTSPACE_INCLUDED__
39
#define __MTSPACE_INCLUDED__
40
/* mtspace data structures are built on r-trees. */
43
#include "vector.h" /* for vector_t in mtspace_query_rect prototype */
45
typedef struct mtspace mtspace_t;
46
typedef enum { FIXED, ODD, EVEN } mtspace_type_t;
48
/* create an "empty space" representation with a shrunken boundry */
49
mtspace_t * mtspace_create(const BoxType *bounds, BDimension keepaway);
50
/* destroy an "empty space" representation. */
51
void mtspace_destroy(mtspace_t **mtspacep);
55
/* add a space-filler to the empty space representation. The given box
56
* should *not* be bloated; it should be "true". The feature will fill
57
* *at least* a radius of keepaway around it; if the mtspace 'keepaway'
58
* parameter is larger than the specified keepaway, than that is used
60
void mtspace_add(mtspace_t *mtspace,
61
const BoxType *box, mtspace_type_t which, BDimension
63
/* remove a space-filler from the empty space representation. The given box
64
* should *not* be bloated; it should be "true". The feature will fill
65
* *at least* a radius of keepaway around it; if the mtspace 'keepaway'
66
* parameter is larger than the specified keepaway, than that is used
68
void mtspace_remove(mtspace_t *mtspace,
69
const BoxType *box, mtspace_type_t which,
73
/* returns all empty spaces in 'region' which may hold a feature with the
74
* mtspace feature_radius with the specified minimum keepaway. Completely
75
* empty regions are appended to the free_space_vec vector; regions which
76
* are filled by objects generated by the previous pass are appended to the
77
* lo_conflict_space_vec vector, and regions which are filled by objects
78
* generated during *this* pass are appended to the hi_conflict_space_vec
79
* vector. The current pass identity is given by 'is_odd'. Regions which
80
* are filled by fixed objects are not returned at all. */
81
void mtspace_query_rect(mtspace_t *mtspace, const BoxType *region,
82
BDimension radius, BDimension keepaway,
83
vector_t *free_space_vec,
84
vector_t *lo_conflict_space_vec,
85
vector_t *hi_conflict_space_vec,
88
#endif /* ! __MTSPACE_INCLUDED__ */