public QueryGraph GetLogicQueryGraph() { QueryGraph qg = new QueryGraph(); //create nodes foreach (ViewerQueryNode vqn in m_ViewerQueryGraph.NodesList) { ISubgraphMatchCell c = vqn.ToCell(); qg.AddCell(c); m_Viewer2LogicDic.Add(vqn.ID, c.CellID); m_Logic2ViewerDic.Add(c.CellID, vqn.ID); } //create edges foreach (ViewerQueryNode vqn in m_ViewerQueryGraph.NodesList) { ISubgraphMatchCell c1 = qg.LoadCell(m_Viewer2LogicDic[vqn.ID]); foreach (int id in vqn.OutLinkList) { ISubgraphMatchCell c2 = qg.LoadCell(m_Viewer2LogicDic[id]); c1.TargetCellSet.Add(c2.CellID); c2.SourceCellSet.Add(c1.CellID); } } return qg; }