GME  13
AutoRouterBox.h
Go to the documentation of this file.
00001 // AutoRouterBox.h : Declaration of the CAutoRouterBox
00002 
00003 #pragma once
00004 #include "../resource.h"       // main symbols
00005 
00006 
00007 
00008 #include "ArHelper.h"
00009 
00010 #define ED_MAXCOORD             100000
00011 #define ED_MINCOORD             0
00012 #define ED_SMALLGAP             15
00013 
00014 class CAutoRouterPort;
00015 class CAutoRouterGraph;
00016 class CAutoRouterEdgeList;
00017 class CAutoRouterPath;
00018 
00019 #include "AutoRouterPort.h"
00020 #include "AutoRouterGraph.h"
00021 
00022 #include <vector>
00023 typedef std::vector<CAutoRouterPort*> CAutoRouterPortList;
00024 
00025 // CAutoRouterBox
00026 
00027 class CAutoRouterBox : public CObject
00028 {
00029 public:
00030         CAutoRouterBox();
00031 
00032 private:
00033         void CalculateSelfPoints();
00034         void DeleteAllPorts();
00035 
00036 public:
00037         CAutoRouterGraph* GetOwner(void) const;
00038         bool HasOwner(void) const;
00039         void SetOwner(CAutoRouterGraph* graph);
00040 
00041         CAutoRouterPort* CreatePort(void) const;
00042         bool HasNoPort(void) const;
00043         long GetPortCount(void) const;
00044         bool IsAtomic(void) const;
00045         void AddPort(CAutoRouterPort* port);
00046         void DeletePort(CAutoRouterPort* port);
00047         const CAutoRouterPortList& GetPortList(void) const;
00048 
00049         CRect GetRect(void) const;
00050         bool IsRectEmpty(void) const;
00051         void SetRect(const CRect& r);
00052         void SetRectByPoint(const CPoint& point);
00053         void ShiftBy(const CPoint& offset);
00054         CPoint* GetSelfPoints(void) const;
00055 
00056         bool IsBoxAt(const CPoint& point, long nearness) const;
00057         bool IsBoxClip(const CRect& r) const;
00058         bool IsBoxIn(const CRect& r) const;
00059 
00060         void Destroy(void);
00061 
00062 private:
00063         CRect rect;
00064         CPoint selfpoints[4];
00065         bool atomic;
00066 
00067         CAutoRouterPortList ports;
00068         CAutoRouterGraph* owner;
00069 
00070 // --- Debug
00071 
00072 #ifdef _DEBUG
00073 public:
00074         virtual void AssertValid() const;
00075         void AssertValidPort(CAutoRouterPort* port) const;
00076 #endif
00077 };