Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# VisualDAG.h

Go to the documentation of this file.

    00001
    00040 #include <LEDA/window.h>
    00041
    00042 class SGMatchWnd
    00043 {
    00044 public:
    00045         struct Wnd : public leda_window
    00046         {
    00047                 SGMatchWnd* m_pParent;
    00048
    00049                 static void OnDraw(leda_window* pWnd);
    00050                 static void OnShowCoord(leda_window* pBaseWnd, double x, double y);
    00051
    00052                 Wnd(int w, int h, const char* label, SGMatchWnd* pParent) : leda_window(w, h, label)
    00053                 {
    00054                         m_pParent = pParent;
    00055                         set_redraw(Wnd::OnDraw);
    00056                         set_show_coord_handler(Wnd::OnShowCoord);
    00057                 }
    00058         };
    00059
    00060         struct SGInfo
    00061         {
    00062                 const SGPtr pSG;
    00063                 //const ShockGraph pSG;
    00064                 double delta_x;
    00065                 double delta_y;
    00066                 double reflex_y;
    00067
    00068                 // It clones p into pSG. i.e., it makes a copy of *p
    00069                 SGInfo(const ShockGraph* p, double dx, double dy, double ry) : pSG(*p)
    00070                 {
    00071                         delta_x = dx;
    00072                         delta_y = dy;
    00073                         reflex_y = ry;
    00074                 }
    00075                 //SGInfo() {} { pSG = NULL; }
    00076         };
    00077
    00078         friend struct Wnd;
    00079
    00080 protected:
    00081         SGInfo*         m_pSGInfo1;
    00082         SGInfo*         m_pSGInfo2;
    00083         DAGNodeMap      m_matchMap;
    00084         Wnd*            m_pWnd;
    00085         bool            m_bShowLabels;
    00086         bool            m_bShowNodeType;
    00087         int                     m_nShowColorLines; //<! 0=all lines. 1, 2, ... only given color
    00088         bool            m_bShowCoords;
    00089
    00090 public:
    00091         SGMatchWnd();
    00092         ~SGMatchWnd();
    00093         bool Create(const ShockGraph* pSG1, const ShockGraph* pSG2, bool bAsyncMode = true);
    00094         void DrawSG() const;
    00095         void DrawMatchingLines() const;
    00096         void SetMatchMap(const DAGNodeMap& matchMap);
    00097         bool DrawSkeleton(const SGInfo* si) const;
    00098         const SGInfo* GetSGInfo1() const { return m_pSGInfo1; }
    00099         const SGInfo* GetSGInfo2() const { return m_pSGInfo2; }
    00100 };
    00101
    00102 void ShowGraph(DAG& g);
    00103