viscluster.h
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 
25 
26 #ifndef AVOID_CLUSTER_H
27 #define AVOID_CLUSTER_H
28 
29 #include <list>
30 
31 #include "libavoid/geometry.h"
32 
33 
34 namespace Avoid {
35 
36 class Router;
37 class ClusterRef;
38 typedef std::list<ClusterRef *> ClusterRefList;
39 
40 
41 class ClusterRef
42 {
43  public:
44  ClusterRef(Router *router, unsigned int id, Polygon& poly);
45  ~ClusterRef();
46  void setNewPoly(Polygon& poly);
47  unsigned int id(void);
48  ReferencingPolygon& polygon(void);
49  Polygon& rectangularPolygon(void);
50  Router *router(void);
51  void makeActive(void);
52  void makeInactive(void);
53 
54  private:
55  Router *m_router;
56  unsigned int m_id;
57  ReferencingPolygon m_polygon;
58  Polygon m_rectangular_polygon;
59  bool m_active;
60  ClusterRefList::iterator m_clusterrefs_pos;
61 };
62 
63 
64 }
65 
66 
67 #endif
68 
69