shape.h
Go to the documentation of this file.
1 /*
2  * vim: ts=4 sw=4 et tw=0 wm=0
3  *
4  * libavoid - Fast, Incremental, Object-avoiding Line Router
5  *
6  * Copyright (C) 2004-2008 Monash University
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  * See the file LICENSE.LGPL distributed with the library.
13  *
14  * Licensees holding a valid commercial license may use this file in
15  * accordance with the commercial license agreement provided with the
16  * library.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21  *
22  * Author(s): Michael Wybrow <mjwybrow@users.sourceforge.net>
23 */
24 
27 
28 
29 #ifndef AVOID_SHAPE_H
30 #define AVOID_SHAPE_H
31 
32 #include <list>
33 #include <set>
34 
35 #include <cstdio>
36 
37 #include "libavoid/geometry.h"
38 #include "libavoid/obstacle.h"
39 
40 
41 namespace Avoid {
42 
43 class VertInf;
44 class Router;
45 class ShapeRef;
46 class ConnEnd;
47 class ShapeConnectionPin;
48 typedef std::list<ShapeRef *> ShapeRefList;
49 
53 {
64 };
65 
66 
76 class ShapeRef : public Obstacle
77 {
78  public:
102  ShapeRef(Router *router, Polygon& poly, const unsigned int id = 0);
107  virtual ~ShapeRef();
108 
111  const Polygon& polygon(void) const;
112 
121 
122  void boundingBox(BBox& bbox) const;
123 
124  private:
125  friend class Router;
126  friend class ConnEnd;
127  friend class ShapeConnectionPin;
128 
129  void outputCode(FILE *fp) const;
130  Point position(void) const;
131  void moveAttachedConns(const Polygon& newPoly);
132  void assignPinVisibilityTo(const unsigned int pinClassId,
133  VertInf *dummyConnectionVert);
134 };
135 
136 
137 }
138 
139 
140 #endif
141 
142