index 71713ae414ac61552d5d0b7012b2c1269160eaa5..a313e3bb497b4ccfd690b8cb582bdd1b85d2149c 100644 (file)
--- a/src/libavoid/connector.h
+++ b/src/libavoid/connector.h
* vim: ts=4 sw=4 et tw=0 wm=0
*
* libavoid - Fast, Incremental, Object-avoiding Line Router
- * Copyright (C) 2004-2005 Michael Wybrow <mjwybrow@users.sourceforge.net>
+ * Copyright (C) 2004-2006 Michael Wybrow <mjwybrow@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#ifndef AVOID_CONNECTOR_H
#define AVOID_CONNECTOR_H
+#include "libavoid/router.h"
#include "libavoid/geometry.h"
#include "libavoid/shape.h"
#include <list>
namespace Avoid {
-class ConnRef;
-typedef std::list<ConnRef *> ConnRefList;
+static const int ConnType_PolyLine = 1;
+static const int ConnType_Orthogonal = 2;
class ConnRef
{
public:
- ConnRef(const unsigned int id);
- ConnRef(const unsigned int id, const Point& src, const Point& dst);
+ ConnRef(Router *router, const unsigned int id);
+ ConnRef(Router *router, const unsigned int id,
+ const Point& src, const Point& dst);
~ConnRef();
+ void setType(unsigned int type);
PolyLine& route(void);
bool needsReroute(void);
- void moveRoute(const int& diff_x, const int& diff_y);
void freeRoute(void);
void calcRouteDist(void);
void updateEndPoint(const unsigned int type, const Point& point);
+ void setEndPointId(const unsigned int type, const unsigned int id);
+ unsigned int getSrcShapeId(void);
+ unsigned int getDstShapeId(void);
void makeActive(void);
void makeInactive(void);
void lateSetup(const Point& src, const Point& dst);
+ unsigned int id(void);
VertInf *src(void);
VertInf *dst(void);
void removeFromGraph(void);
void handleInvalid(void);
int generatePath(Point p0, Point p1);
void makePathInvalid(void);
+ Router *router(void);
+ void setHateCrossings(bool value);
+ bool doesHateCrossings(void);
+
+ friend void Router::attachedShapes(IntList &shapes,
+ const unsigned int shapeId, const unsigned int type);
+ friend void Router::attachedConns(IntList &conns,
+ const unsigned int shapeId, const unsigned int type);
+ friend void Router::markConnectors(ShapeRef *shape);
- friend void markConnectors(ShapeRef *shape);
-
private:
+ Router *_router;
unsigned int _id;
+ unsigned int _type;
+ unsigned int _srcId, _dstId;
bool _needs_reroute_flag;
bool _false_path;
bool _active;
bool _initialised;
void (*_callback)(void *);
void *_connector;
+ bool _hateCrossings;
};
-extern ConnRefList connRefs;
-
-extern void callbackAllInvalidConnectors(void);
-
}