예제 #1
0
 public void DrawNewGraph(DrawingCanvas dc, int neibour, Graph newSubGraph)
 {
     myDrawingCanvas = dc;
     mySubGraph      = newSubGraph;
     myCirco         = new CircleLayout(neibour, myRadius);
     //初始化所有布局点
     myCirco.LayoutInit(mySubGraph);
     //进入退火循环
     //myCirco.Float(mySubGraph);
     //绘制网络图
     DrawGraph();
 }
예제 #2
0
        private static ILayout ChooseLayout(GraphLayoutType s)
        {
            EdgeDrawer ed = new EdgeDrawer();

            gd.EdgeDrawer = ed;
            ed.Color      = Color.Red;
            VertexDrawer vd = new VertexDrawer();

            gd.VertexDrawer = vd;
            vd.Shape        = VertexDrawer.VertexShape.Disk;
            ILayout fr = new FruchtermanReingoldLayout();

            switch (s)
            {
            case GraphLayoutType.Fruchterman_Reingold:
                fr = new FruchtermanReingoldLayout();
                break;

            case GraphLayoutType.Random:
                fr = new RandomLayout();
                break;

            case GraphLayoutType.Circle:
                fr = new CircleLayout();
                break;

            case GraphLayoutType.Kamada_Kawaii:
                fr = new KamadaKawaiiLayout();
                break;

            case GraphLayoutType.Grid:
                fr = new GridLayout();
                break;

            case GraphLayoutType.Sugiyama:
                SugiyamaEdgeDrawer eds = new SugiyamaEdgeDrawer();
                gd.EdgeDrawer = eds;
                eds.Color     = Color.Red;
                SugiyamaVertexDrawer vds = new SugiyamaVertexDrawer();
                gd.VertexDrawer = vds;
                vds.Shape       = VertexDrawer.VertexShape.Sphere;
                fr = new SugiyamaLayout();
                break;
            }
            return(fr);
        }
예제 #3
0
        static void Main(string[] args)
        {
            using (SqlConnection con = new SqlConnection("Data Source=DESKTOP-UK96O0N;Initial Catalog=miRNA_final;Integrated Security=True"))
                IGraph g = reader.GetGraph();
            CircleLayout cl = new CircleLayout();
            //FruchtermanReingoldLayout pl = new FruchtermanReingoldLayout();
            //HarelKorenFastMultiscaleLayout hl = new HarelKorenFastMultiscaleLayout();
            LayoutContext lc = new LayoutContext(new Rectangle(0, 0, 1600, 900));

            cl.LayOutGraph(g, lc);
            using (StreamWriter sw = new StreamWriter("tableau.txt"))
            {
                sw.Write("ID\tRelation\tRelType\tNE\tX\tY\tY'\tNEType\tMeSH\tSent\n");

                foreach (var edge in g.Edges)
                {
                    sw.Write("{0}\t{4}\t{5}\t{1}\t{2}\t{3}\t{3}\tmiRNA\t{6}\t{7}\n", edge.ID, edge.Vertex1.Name,
                             edge.Vertex1.Location.X, edge.Vertex1.Location.Y, edge.Name, edge.Tag, "", edge.GetValue(MiRNADataReader.SENTENCE));
                    sw.Write("{0}\t{4}\t{5}\t{1}\t{2}\t{3}\t{3}\tCancer\t{6}\t{7}\n", edge.ID, edge.Vertex2.Name,
                             edge.Vertex2.Location.X, edge.Vertex2.Location.Y, edge.Name, edge.Tag, edge.Vertex2.GetValue(MiRNADataReader.MeSH), edge.GetValue(MiRNADataReader.SENTENCE));
                }
            }
        }
예제 #4
0
    public override void OnInspectorGUI()
    {
        CircleLayout _target = target as CircleLayout;

        if (GUILayout.Button("Fill Trans Arr By Sibling"))
        {
            _target.fillTransArrBySibling();
        }
        DrawDefaultInspector();
        if (GUILayout.Button("Set Circle"))
        {
            _target.setCircle();
        }
        EditorGUILayout.BeginHorizontal();
        childScale = EditorGUILayout.Vector3Field("Child Scale", childScale);
        if (GUILayout.Button("Set"))
        {
            _target.setChildScale(childScale);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        childRotation = EditorGUILayout.Vector3Field("Child Rotation", childRotation);
        if (GUILayout.Button("Set"))
        {
            _target.setChildRotation(childRotation);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        childWorldRotation = EditorGUILayout.Vector3Field("Child World Rotation", childWorldRotation);
        if (GUILayout.Button("Set"))
        {
            _target.setChildWorldRotation(childWorldRotation);
        }
        EditorGUILayout.EndHorizontal();
    }
예제 #5
0
 public GraphDataBase(int iNum, int iRadius)
 {
     graph = new Graph();
     circo = new CircleLayout(iNum, iRadius);
 }
예제 #6
0
 private static ILayout ChooseLayout(GraphLayoutType s)
 {
     EdgeDrawer ed = new EdgeDrawer();
     gd.EdgeDrawer = ed;
     ed.Color = Color.Red;
     VertexDrawer vd = new VertexDrawer();
     gd.VertexDrawer = vd;
     vd.Shape = VertexDrawer.VertexShape.Disk;
     ILayout fr = new FruchtermanReingoldLayout();
     switch (s)
     {
         case GraphLayoutType.Fruchterman_Reingold:
             fr = new FruchtermanReingoldLayout();
             break;
         case GraphLayoutType.Random:
             fr = new RandomLayout();
             break;
         case GraphLayoutType.Circle:
             fr = new CircleLayout();
             break;
         case GraphLayoutType.Kamada_Kawaii:
             fr = new KamadaKawaiiLayout();
             break;
         case GraphLayoutType.Grid:
             fr = new GridLayout();
             break;
         case GraphLayoutType.Sugiyama:
             SugiyamaEdgeDrawer eds = new SugiyamaEdgeDrawer();
             gd.EdgeDrawer = eds;
             eds.Color = Color.Red;
             SugiyamaVertexDrawer vds = new SugiyamaVertexDrawer();
             gd.VertexDrawer = vds;
             vds.Shape = VertexDrawer.VertexShape.Sphere;
             fr = new SugiyamaLayout();
             break;
     }
     return fr;
 }