Adaptagrams
debughandler.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) 2014 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 
25 // @file debughandler.h
26 // @brief Contains the interface for the DebugHandler class.
27 
28 #ifndef AVOID_DEBUGHANDLER_H
29 #define AVOID_DEBUGHANDLER_H
30 
31 #include "libavoid/assertions.h"
32 #include "libavoid/dllexport.h"
33 
34 // Add -DDEBUGHANDLER to compile in debug handler with optimisations enabled.
35 #ifndef NDEBUG
36  #define DEBUGHANDLER
37 #endif
38 
39 namespace Avoid {
40 
41 // @brief You can subclass DebugHandler and register an instance with Router
42 // to recieve debugging information.
43 //
44 // @note This is currently intended for internal use.
45 //
46 class AVOID_EXPORT DebugHandler
47 {
48  public:
49  DebugHandler()
50  {
51  }
52 
53  virtual ~DebugHandler()
54  {
55  }
56 
57  // @brief The obstacles being routed around.
58  //
59  virtual void updateObstacleBoxes(std::vector<Avoid::Box> obstacles)
60  {
61  COLA_UNUSED(obstacles);
62  }
63 
64  // @brief An updated connector route. Optionally the ends of a just
65  // updated segment within the route between the indexes index1
66  // and index2.
67  //
68  virtual void updateConnectorRoute(ConnRef *conn, int index1, int index2)
69  {
70  COLA_UNUSED(conn);
71  COLA_UNUSED(index1);
72  COLA_UNUSED(index2);
73  }
74 
75  // @brief The current endpoints that a path is being searched for
76  // between src and tar
77  //
78  virtual void beginningSearchWithEndpoints(VertInf *src, VertInf *tar)
79  {
80  COLA_UNUSED(src);
81  COLA_UNUSED(tar);
82  }
83 
84  // @brief The current search path.
85  //
86  virtual void updateCurrentSearchPath(Avoid::PolyLine currentPath)
87  {
88  COLA_UNUSED(currentPath);
89  }
90 
91  // @brief The current hyperedge endpoints for hyperedge rerouting
92  //
93  virtual void beginningHyperedgeReroutingWithEndpoints(std::set<VertInf *> endpoints)
94  {
95  COLA_UNUSED(endpoints);
96  }
97 
98 
99  // @brief The Minimum Terminal Spanning Tree for hyperedge rerouting
100  // is being grown with the edge between vertices u and v.
101  //
102  // @param shouldWait Boolean indicating the forest is being grown
103  // with this edge, or otherwise being immediately
104  // repopulated after pruning.
105  //
106  virtual void mtstGrowForestWithEdge(Avoid::VertInf *u, Avoid::VertInf *v, bool shouldWait)
107  {
108  COLA_UNUSED(u);
109  COLA_UNUSED(v);
110  COLA_UNUSED(shouldWait);
111  }
112 
113  // @brief The Minimum Terminal Spanning Tree for hyperedge rerouting
114  // is potentiall bridged by the edge between vertices u and v.
115  //
116  virtual void mtstPotentialBridgingEdge(Avoid::VertInf *u, Avoid::VertInf *v)
117  {
118  COLA_UNUSED(u);
119  COLA_UNUSED(v);
120  }
121 
122  // @brief The Minimum Terminal Spanning Tree for hyperedge rerouting
123  // is being finalised with the edge between vertices u and v.
124  //
125  // @param isBridge Boolean indicating whether edge was a bridge.
126  //
127  virtual void mtstCommitToEdge(Avoid::VertInf *u, Avoid::VertInf *v, bool isBridge)
128  {
129  COLA_UNUSED(u);
130  COLA_UNUSED(v);
131  COLA_UNUSED(isBridge);
132  }
133 };
134 
135 
136 }
137 
138 #endif
A dynamic Polygon, to which points can be easily added and removed.
Definition: geomtypes.h:207
libavoid: Object-avoiding orthogonal and polyline connector routing library.
Definition: actioninfo.cpp:33