public void ReLayoutGraph() { /*graph = new GGraph(true); * count++; * * * * * * foreach (GVertex vertex in existingVertices) * Graph.AddVertex(vertex); * * * //add some edges to the graph * //AddNewGraphEdge(existingVertices[0], existingVertices[1]); * //AddNewGraphEdge(existingVertices[0], existingVertices[2]); * * * NotifyPropertyChanged("Graph");*/ Graph = new GGraph(true); //existingVertices.Add(new GVertex("Sarah Barber", "Red")); //1 //existingVertices.Add(new GVertex("Marlon Grech", "Blue")); //2 foreach (GVertex vertex in existingVertices) { Graph.AddVertex(vertex); //MessageBox.Show(vertex.ID); } //add some edges to the graph foreach (GEdge obj in connections) { Graph.AddEdge(obj); } //Add Layout Algorithm Types layoutAlgorithmTypes.Add("BoundedFR"); layoutAlgorithmTypes.Add("Circular"); layoutAlgorithmTypes.Add("CompoundFDP"); layoutAlgorithmTypes.Add("EfficientSugiyama"); layoutAlgorithmTypes.Add("FR"); layoutAlgorithmTypes.Add("ISOM"); layoutAlgorithmTypes.Add("KK"); layoutAlgorithmTypes.Add("LinLog"); layoutAlgorithmTypes.Add("Tree"); //Pick a default Layout Algorithm Type LayoutAlgorithmType = "Tree"; }
public MainViewModel() { existingVertices = new List <GVertex>(); connections = new List <GEdge>(); Graph = new GGraph(true); //existingVertices.Add(new GVertex("Sarah Barber", "Red")); //1 //existingVertices.Add(new GVertex("Marlon Grech", "Blue")); //2 foreach (GVertex vertex in existingVertices) { Graph.AddVertex(vertex); //MessageBox.Show(vertex.ID); } //add some edges to the graph foreach (GEdge obj in connections) { Graph.AddEdge(obj); } //Add Layout Algorithm Types layoutAlgorithmTypes.Add("BoundedFR"); layoutAlgorithmTypes.Add("Circular"); layoutAlgorithmTypes.Add("CompoundFDP"); layoutAlgorithmTypes.Add("EfficientSugiyama"); layoutAlgorithmTypes.Add("FR"); layoutAlgorithmTypes.Add("ISOM"); layoutAlgorithmTypes.Add("KK"); layoutAlgorithmTypes.Add("LinLog"); layoutAlgorithmTypes.Add("Tree"); //Pick a default Layout Algorithm Type LayoutAlgorithmType = "Tree"; }