~ubuntu-branches/ubuntu/precise/pcb/precise

« back to all changes in this revision

Viewing changes to src/mtspace.h

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-02-20 13:14:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050220131400-pfz66g5vhx0azl8f
Tags: 1.99j+20050127-2
* Improved package description: (closes: #295405)
* Fixed dependency: tk84 -> tk8.4 (closes: #295404)
* Updated README.debian (closes: #269578)
* Applied patch to src/djopt.c to allow compilation with gcc-4.0
  (closes: #294319), thanks to Andreas Jochens for the patch.
* Prevent example files from being compressed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: mtspace.h,v 1.4 2004/03/28 03:06:39 haceaton Exp $ */
 
2
 
 
3
/*
 
4
 *                            COPYRIGHT
 
5
 *
 
6
 *  PCB, interactive printed circuit board design
 
7
 *  Copyright (C) 1994,1995,1996 Thomas Nau
 
8
 *  Copyright (C) 1998,1999,2000,2001 harry eaton
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 *
 
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.
 
23
 *
 
24
 *  Contact addresses for paper mail and Email:
 
25
 *  harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA
 
26
 *  haceaton@aplcomm.jhuapl.edu
 
27
 *
 
28
 */
 
29
 
 
30
/* this file, mtspace.h, was written and is
 
31
 * Copyright (c) 2001 C. Scott Ananian.
 
32
 */
 
33
 
 
34
/* prototypes for "empty space" routines (needed for via-space tracking
 
35
 * in the auto-router.
 
36
 */
 
37
 
 
38
#ifndef __MTSPACE_INCLUDED__
 
39
#define __MTSPACE_INCLUDED__
 
40
/* mtspace data structures are built on r-trees. */
 
41
 
 
42
#include "global.h"
 
43
#include "vector.h" /* for vector_t in mtspace_query_rect prototype */
 
44
 
 
45
typedef struct mtspace mtspace_t;
 
46
typedef enum { FIXED, ODD, EVEN } mtspace_type_t;
 
47
 
 
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);
 
52
 
 
53
/* -- mutation -- */
 
54
 
 
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
 
59
 * instead. */
 
60
void mtspace_add(mtspace_t *mtspace,
 
61
                 const BoxType *box, mtspace_type_t which, BDimension
 
62
                 keepaway);
 
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
 
67
 * instead. */
 
68
void mtspace_remove(mtspace_t *mtspace,
 
69
                    const BoxType *box, mtspace_type_t which,
 
70
                    BDimension keepaway);
 
71
 
 
72
 
 
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,
 
86
                        Boolean is_odd);
 
87
 
 
88
#endif /* ! __MTSPACE_INCLUDED__ */