Пример #1
0
 public QueryResult(ViewerQueryGraph vqg, List<Match> matches)
 {
     InitializeComponent();
     InitializeFormLayout();
     m_Drawer = new SubgraphViewerDrawer(this.CreateGraphics());
     m_ViewerResult = new ViewerResult(m_Drawer, matches, vqg);
 }
        public ViewerResultGraph(int id, ISubGraphViewerDrawer drawer, Point leftTop, ViewerQueryGraph vqg, Match m)
        {
            m_AllNodes = new Dictionary<int, ViewerResultNode>();
            m_ID = id;
            m_Drawer = drawer;
            m_Region = new Rectangle(leftTop, new Size(vqg.Region.Width, vqg.Region.Height));

            Construct(vqg, m);
            Transfer(leftTop, vqg);
            GetAllEdges();
        }
Пример #3
0
 public Query()
 {
     InitializeComponent();
     IntializeFormLayout();
     m_GraphDrawer = new SubgraphViewerDrawer(this.CreateGraphics());
     SubgraphViewerDrawer toolBoxDrawer = new SubgraphViewerDrawer(panel_left.CreateGraphics());
     m_ViewerGraph = new ViewerQueryGraph(m_GraphDrawer);
     m_ToolBox = new ToolBox(toolBoxDrawer);
     m_IndexLoaded = false;
     textBoxSetLabel.Text = m_SetLabelHint;
     textBoxMaxMatchNum.Text = "1024";
     //m_ViewerGraph = SampleQueryGraph();
 }
 private void ConstructAllResultGraph(ISubGraphViewerDrawer drawer, List<Match> matches, ViewerQueryGraph vqg)
 {
     int width = ViewerConfig.QueryResultWidth;
     int margin = ViewerConfig.QueryResultMargin;
     Rectangle queryRegion = vqg.Region;
     int col = (width - margin) / (queryRegion.Width + margin);
     int count = matches.Count;
     int row = count / col;
     int index = 0;
     Point rowStartLocation = new Point();
     for (int i = 0; i < row; ++i)
     {
         rowStartLocation.X = margin;
         rowStartLocation.Y = margin + i * (queryRegion.Height + margin);
         for (int j = 0; j < col; ++j)
         {
             Point myLocation = new Point();
             myLocation.X = rowStartLocation.X + j * (queryRegion.Width + margin);
             myLocation.Y = rowStartLocation.Y;
             ViewerResultGraph vrg = new ViewerResultGraph(index, drawer, myLocation, vqg, matches[index]);
             index += 1;
             m_AllResultGraph.Add(vrg);
         }
     }
     //last row
     rowStartLocation.X = margin;
     rowStartLocation.Y = margin + row * (queryRegion.Height + margin);
     int left = count % col;
     for (int j = 0; j < left; ++j)
     {
         Point myLocation = new Point();
         myLocation.X = rowStartLocation.X + j * (queryRegion.Width + margin);
         myLocation.Y = rowStartLocation.Y;
         ViewerResultGraph vrg = new ViewerResultGraph(index, drawer, myLocation, vqg, matches[index]);
         index += 1;
         m_AllResultGraph.Add(vrg);
     }
 }
 private void Construct(ViewerQueryGraph vqg, Match m)
 {
     ViewerGraphToLogicQueryTransfer transfer = vqg.Transfer;
     Dictionary<long, long> dicMatch = new Dictionary<long, long>();
     foreach (NodePair np in m.PartialMatch)
     {
         dicMatch.Add(np.node1, np.node2);
     }
     foreach (ViewerQueryNode vqn in vqg.NodesList)
     {
         ViewerResultNode vrn = new ViewerResultNode(vqn, dicMatch[transfer.GetLogicIDByViewerID(vqn.ID)]);
         m_AllNodes.Add(vrn.ID, vrn);
     }
 }
 private void Transfer(Point leftTop, ViewerQueryGraph vqg)
 {
     Point transferV = new Point();
     transferV.X = leftTop.X - vqg.Region.X;
     transferV.Y = leftTop.Y - vqg.Region.Y;
     foreach (ViewerResultNode vrn in m_AllNodes.Values)
     {
         vrn.Transfer(transferV);
     }
 }
 public ViewerResult(ISubGraphViewerDrawer drawer, List<Match> matches, ViewerQueryGraph vqg)
 {
     m_AllResultGraph = new List<ViewerResultGraph>();
     ConstructAllResultGraph(drawer, matches, vqg);
 }
 public ViewerGraphToLogicQueryTransfer(ViewerQueryGraph vqg)
 {
     m_ViewerQueryGraph = vqg;
     m_Logic2ViewerDic = new Dictionary<long, int>();
     m_Viewer2LogicDic = new Dictionary<int, long>();
 }
Пример #9
0
 private ViewerQueryGraph SampleQueryGraph()
 {
     ViewerQueryGraph vqg = new ViewerQueryGraph(new SubgraphViewerDrawer(this.CreateGraphics()));
     Point p1 = new Point(150, 150);
     Point p2 = new Point(120,270);
     Point p3 = new Point(180, 270);
     vqg.AddNode(p1);
     vqg.AddNode(p2);
     vqg.AddNode(p3);
     vqg.SetLabel(1, "1");
     vqg.SetLabel(2, "1");
     vqg.SetLabel(3, "1");
     vqg.AddEdge(1, 2);
     vqg.AddEdge(1, 3);
     UpdateLabelList();
     return vqg;
 }
Пример #10
0
 private void Clear()
 {
     m_ViewerGraph = new ViewerQueryGraph(m_GraphDrawer);
     textBoxMaxMatchNum.Text = "1024";
     listBoxLabelList.Items.Clear();
     textBoxSetLabel.Text = m_SetLabelHint;
 }