Adaptagrams
viscluster.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
23 */
24 
27 
28 #ifndef AVOID_CLUSTER_H
29 #define AVOID_CLUSTER_H
30 
31 #include <list>
32 
33 #include "libavoid/geometry.h"
34 #include "libavoid/dllexport.h"
35 
36 namespace Avoid {
37 
38 class Router;
39 class ClusterRef;
40 typedef std::list<ClusterRef *> ClusterRefList;
41 
42 
55 class AVOID_EXPORT ClusterRef
56 {
57  public:
86  ClusterRef(Router *router, Polygon& poly, const unsigned int id = 0);
87 
88 // To prevent C++ objects from being destroyed in garbage collected languages
89 // when the libraries are called from SWIG, we hide the declarations of the
90 // destructors and prevent generation of default destructors.
91 #ifndef SWIG
92  ~ClusterRef();
94 #endif
95  void setNewPoly(Polygon& poly);
105  unsigned int id(void) const;
109  ReferencingPolygon& polygon(void);
113  Polygon& rectangularPolygon(void);
116  Router *router(void) const;
117 
118  void makeActive(void);
119  void makeInactive(void);
120 
121  private:
122  Router *m_router;
123  unsigned int m_id;
124  ReferencingPolygon m_polygon;
125  Polygon m_rectangular_polygon;
126  bool m_active;
127  ClusterRefList::iterator m_clusterrefs_pos;
128 };
129 
130 
131 }
132 
133 
134 #endif
135 
136 
The ClusterRef class represents a cluster object.
Definition: viscluster.h:55
A dynamic Polygon, to which points can be easily added and removed.
Definition: geomtypes.h:207
A Polygon which just references its points from other Polygons.
Definition: geomtypes.h:336
libavoid: Object-avoiding orthogonal and polyline connector routing library.
Definition: actioninfo.cpp:33
The Router class represents a libavoid router instance.
Definition: router.h:386