示例#1
0
        private void CreateRootGraphInternal(CelestialObjectType type, ObjectTypesGraph graph)
        {
            //ObjectTypeVertex parent = new ObjectTypeVertex(string.Format("{0} ({1})", type.Description, type.ShortCode));
            ObjectTypeVertex parent = new ObjectTypeVertex(type.Description, type, _previousRoot);
            graph.AddVertex(parent);

            if (type.Subtypes.Count > 0)
            {
                foreach (CelestialObjectType subtype in type.Subtypes)
                {
                    ObjectTypeVertex child = new ObjectTypeVertex(subtype.Description, subtype, parent);
                    graph.AddVertex(child);
                    graph.AddEdge(new ObjectTypeEdge(parent, child));

                    //CreateGraphInternal(subtype, graph);
                }
            }
        }
示例#2
0
        public void CreateOneLevelGraph(ObjectTypeVertex root)
        {
            var graphTemp = new ObjectTypesGraph();
            CelestialObjectType objectType = root.Tag as CelestialObjectType;

            CreateRootGraphInternal(objectType, graphTemp);
            _currentGraph = graphTemp;

            NotifyPropertyChanged(this, new PropertyChangedEventArgs("CurrentGraph"));
        }
示例#3
0
        //private void CreateRootGraphInternal(CelestialObjectType type, ObjectTypesGraph graph, ObjectTypeVertex parentVertex)
        //{
        //    //ObjectTypeVertex parent = new ObjectTypeVertex(string.Format("{0} ({1})", type.Description, type.ShortCode));
        //    ObjectTypeVertex parent = new ObjectTypeVertex(type.Description, type, parentVertex);
        //    graph.AddVertex(parent);
        //    if (type.Subtypes.Count > 0)
        //    {
        //        foreach (CelestialObjectType subtype in type.Subtypes)
        //        {
        //            ObjectTypeVertex child = new ObjectTypeVertex(subtype.Description, subtype, parent);
        //            graph.AddVertex(child);
        //            graph.AddEdge(new ObjectTypeEdge(parent, child));
        //            //CreateGraphInternal(subtype, graph);
        //        }
        //    }
        //}
        private void CreateGraphInternal(CelestialObjectType type, ObjectTypesGraph graph)
        {
            ObjectTypeVertex parent = new ObjectTypeVertex(type.Description, type);
            graph.AddVertex(parent);

            if (type.Subtypes.Count > 0)
            {
                foreach (CelestialObjectType subtype in type.Subtypes)
                {
                    ObjectTypeVertex child = new ObjectTypeVertex(subtype.Description, subtype, parent);
                    graph.AddVertex(child);
                    graph.AddEdge(new ObjectTypeEdge(parent, child));

                    CreateGraphInternal(subtype, graph);
                }
            }
        }
示例#4
0
        public void CreateMainGraph()
        {
            var graphTemp = new ObjectTypesGraph();

            CreateRootGraphInternal(ObjectTypes[0], graphTemp);
            _currentGraph = graphTemp;

            NotifyPropertyChanged(this, new PropertyChangedEventArgs("CurrentGraph"));
        }