public DCluster AddCluster(DCluster parent, string id) { if (parent == null) { Graph.LayoutAlgorithmSettings = new FastIncrementalLayoutSettings(); Graph.LayoutAlgorithmSettings.EdgeRoutingSettings.KeepOriginalSpline = true; var settings = Graph.LayoutAlgorithmSettings as FastIncrementalLayoutSettings; settings.AvoidOverlaps = true; settings.NodeSeparation = 30; settings.RouteEdges = true; } Subgraph cluster = new Subgraph(id == null ? GetNewNodeID() : id); Cluster geometryCluster = new Cluster() { GeometryParent = parent == null ? Graph.GeometryGraph : (GeometryObject)parent.GeometryNode }; cluster.GeometryNode = geometryCluster; geometryCluster.UserData = cluster; DCluster ret = new DCluster((DObject)parent ?? this, cluster); cluster.LabelText = null; SetNodeBoundaryCurve(Graph, cluster); if (parent == null) m_RootCluster = ret; else parent.AddCluster(ret); if (UpdateGraphBoundingBoxPreservingCenter()) Invalidate(); AddCluster(ret, false); return ret; }
public void AddNodeToCluster(DCluster owner, DNode node) { node.ParentObject = owner; owner.AddNode(node); owner.DrawingCluster.AddNode(node.DrawingNode); owner.GeometryCluster.AddChild(node.GeometryNode); }
private void RebuildFromDrawingGraph() { if (Graph.GeometryGraph == null) { // A geometry graph is required. Note that I have to set the node boundary curves myself (because they depend on the label size, which in turn depends on the rendering engine). Graph.CreateGeometryGraph(); foreach (DrawingNode drawingNode in Graph.NodeMap.Values) SetNodeBoundaryCurve(Graph, drawingNode); } // Create DNode instances NodeMap.Clear(); foreach (DrawingNode drawingNode in Graph.NodeMap.Values) NodeMap[drawingNode.Id] = new DNode(this, drawingNode); // Create DCluster instances if (Graph.RootSubgraph != null && Graph.RootSubgraph.GeometryNode != null) { m_RootCluster = new DCluster(this, Graph.RootSubgraph); NodeMap[Graph.RootSubgraph.Id] = m_RootCluster; PopulateDClusterFromDrawing(m_RootCluster, Graph.RootSubgraph); } // Create DEdge instances Edges.Clear(); foreach (DrawingEdge drawingEdge in Graph.Edges) Edges.Add(new DEdge(NodeMap[drawingEdge.SourceNode.Id], NodeMap[drawingEdge.TargetNode.Id], drawingEdge, ConnectionToGraph.Connected)); FirePropertyChanged("HasContent"); }
public DCluster AddCluster(DCluster parent) { return AddCluster(parent, null); }
internal void AddCluster(DCluster cluster) { m_Clusters.Add(cluster); }
private void PopulateDClusterFromDrawing(DCluster dc, Subgraph drawingc) { foreach (var drawingn in drawingc.Nodes) dc.AddNode(NodeMap[drawingn.Id]); foreach (var drawingc2 in drawingc.Subgraphs) { DCluster dc2 = new DCluster(dc, drawingc2); dc.AddCluster(dc2); NodeMap[drawingc2.Id] = dc2; PopulateDClusterFromDrawing(dc2, drawingc2); } }
private void CreateGamete(DGraph graph, DCluster gamete) { var inNode = graph.AddNode("Gamete_in"); inNode.DrawingNode.Attr.Shape = MsaglShape.Circle; inNode.DrawingNode.Attr.FillColor = MsaglColor.Red; graph.AddNodeToCluster(gamete, inNode); var splitter = graph.AddNode("Gamete_Splitter"); splitter.DrawingNode.Attr.Shape = MsaglShape.Circle; splitter.DrawingNode.Attr.FillColor = MsaglColor.Blue; graph.AddNodeToCluster(gamete, splitter); var sperm = Clustering_Cell_AddNode(graph, gamete, "Sperm", "Sperm"); var oocyte = Clustering_Cell_AddNode(graph, gamete, "Oocyte", "Oocyte"); var matureOocyte = Clustering_Cell_AddNode(graph, gamete, "MatureOocyte", "Mature\nOocyte"); var zygote = Clustering_Cell_AddNode(graph, gamete, "Zygote", "Zygote"); Clustering_Cell_AddEdge(graph, inNode, splitter, null); Clustering_Cell_AddEdge(graph, splitter, sperm, "Sperm_Effector_Act"); Clustering_Cell_AddEdge(graph, splitter, oocyte, "Oocyte_Effector_Act"); Clustering_Cell_AddEdge(graph, oocyte, matureOocyte, "Maturation"); Clustering_Cell_AddEdge(graph, matureOocyte, zygote, "Fertilization");//*/ }
private void CreateDifferentiation(DGraph graph, DCluster differentiation) { var inNode = graph.AddNode("Differentiation_in"); inNode.DrawingNode.Attr.Shape = MsaglShape.Circle; inNode.DrawingNode.Attr.FillColor = MsaglColor.Red; graph.AddNodeToCluster(differentiation, inNode); var precursor = Clustering_Cell_AddNode(graph, differentiation, "Precursor", "Precursor"); var earlyMeiosis = Clustering_Cell_AddNode(graph, differentiation, "EarlyMeiosis", "Early Meiosis"); var meiosis = Clustering_Cell_AddNode(graph, differentiation, "Diff_Meiosis", "Meiosis"); var gamete = graph.AddCluster(differentiation, "Gamete"); Clustering_ApplyNodeAttributes(gamete); CreateGamete(graph, gamete); Clustering_Cell_AddEdge(graph, inNode, precursor, null); Clustering_Cell_AddEdge(graph, precursor, earlyMeiosis, "GLD-1_Act\nOR\nGLD-2_Act"); Clustering_Cell_AddEdge(graph, earlyMeiosis, meiosis, "Pachytene"); Clustering_Cell_AddEdge(graph, meiosis, gamete, "MEK-2_Act\nAND\nMPK-1_Act");//*/ }
private void CreateProliferation(DGraph graph, DCluster proliferation) { var inNode = graph.AddNode("Proliferation_in"); inNode.DrawingNode.Attr.Shape = MsaglShape.Circle; inNode.DrawingNode.Attr.FillColor = MsaglColor.Red; graph.AddNodeToCluster(proliferation, inNode); var splitter = graph.AddNode("Proliferation_Splitter"); splitter.DrawingNode.Attr.Shape = MsaglShape.Circle; splitter.DrawingNode.Attr.FillColor = MsaglColor.Blue; graph.AddNodeToCluster(proliferation, splitter); var mitosis = graph.AddCluster(proliferation, "Mitosis"); Clustering_ApplyNodeAttributes(mitosis); CreateMitosis(graph, mitosis); var meiosis = graph.AddCluster(proliferation, "Meiosis"); Clustering_ApplyNodeAttributes(meiosis); CreateMeiosis(graph, meiosis); Clustering_Cell_AddEdge(graph, inNode, mitosis, null); Clustering_Cell_AddEdge(graph, mitosis, splitter, "Early Meiosis"); Clustering_Cell_AddEdge(graph, splitter, graph.NodeMap["G0"], null); Clustering_Cell_AddEdge(graph, splitter, graph.NodeMap["Inter"], null);//*/ }
private void CreateMeiosis(DGraph graph, DCluster meiosis) { var inter = Clustering_Cell_AddNode(graph, meiosis, "Inter", "Inter"); var rest = Clustering_Cell_AddNode(graph, meiosis, "Rest", "Rest"); var meiosis_cycle = graph.AddCluster(meiosis, "Meiosis_Cycle"); Clustering_ApplyNodeAttributes(meiosis_cycle); var pro = Clustering_Cell_AddNode(graph, meiosis_cycle, "Pro", "Pro"); var meta = Clustering_Cell_AddNode(graph, meiosis_cycle, "Meta", "Meta"); var ana = Clustering_Cell_AddNode(graph, meiosis_cycle, "Ana", "Ana"); var telo = Clustering_Cell_AddNode(graph, meiosis_cycle, "Telo", "Telo"); Clustering_Cell_AddEdge(graph, inter, pro, null); Clustering_Cell_AddEdge(graph, pro, meta, null); Clustering_Cell_AddEdge(graph, meta, ana, null); Clustering_Cell_AddEdge(graph, ana, telo, null); Clustering_Cell_AddEdge(graph, meiosis_cycle, inter, "exit cell\ncycle"); Clustering_Cell_AddEdge(graph, meiosis_cycle, rest, null);//*/ }
private void CreateMitosis(DGraph graph, DCluster mitosis) { var inNode = graph.AddNode("Mitosis_In"); graph.AddNodeToCluster(mitosis, inNode); inNode.DrawingNode.Attr.Shape = MsaglShape.Circle; inNode.DrawingNode.Attr.FillColor = MsaglColor.Red; var g0 = Clustering_Cell_AddNode(graph, mitosis, "G0", "G0"); var mitosis_cycle = graph.AddCluster(mitosis, "Mitosis_Cycle"); Clustering_ApplyNodeAttributes(mitosis_cycle); var g1 = Clustering_Cell_AddNode(graph, mitosis_cycle, "G1", "G1"); var s = Clustering_Cell_AddNode(graph, mitosis_cycle, "S", "S"); var g2 = Clustering_Cell_AddNode(graph, mitosis_cycle, "G2", "G2"); var m = Clustering_Cell_AddNode(graph, mitosis_cycle, "M", "M"); Clustering_Cell_AddEdge(graph, inNode, g0, null); Clustering_Cell_AddEdge(graph, g0, g1, null); Clustering_Cell_AddEdge(graph, g1, s, null); Clustering_Cell_AddEdge(graph, s, g2, null); Clustering_Cell_AddEdge(graph, g2, m, null); Clustering_Cell_AddEdge(graph, mitosis_cycle, g0, "exit cell\ncycle");//*/ }
private DNode Clustering_Cell_AddNode(DGraph graph, DCluster cluster, string id, string label) { var ret = graph.AddNode(id); if (label != null) ret.Label = new DTextLabel(ret, label); graph.AddNodeToCluster(cluster, ret); Clustering_ApplyNodeAttributes(ret); return ret; }