コード例 #1
0
        public void CreateViewObjectsFor(InfraReader netWork)
        {
            Dictionary <string, NetworkElement> sourceElements = netWork.NetworkElements;

            foreach (NetworkElement element in sourceElements.Values)
            {
                ViewNetworkElement elementInView = new ViewNetworkElement(element);
                trackElements[elementInView.ID] = elementInView;
            }

            Dictionary <string, PlatformEdge> sourcePlatforms = netWork.PlatformEdges;

            foreach (PlatformEdge platformEdge in sourcePlatforms.Values)
            {
                ViewPlatform platformInView = new ViewPlatform(platformEdge);

                ViewNetworkElement elementInView = FindMatchingViewElement(platformEdge.Location);

                if (elementInView != null)
                {
                    platformInView.OnElement = elementInView;
                    platformInView.UpdateFractions();
                }
                platForms[platformInView.ID] = platformInView;
            }
        }
コード例 #2
0
        public override void AllElementsConnected(InfraReader infra)
        {
            foreach (NetworkElement element in connectedElements)
            {
                //Point NetworkElement
                if (element.From == this)
                {
                    Point point = element.LogicalStartPoint;
                    if (!point.IsEmpty)
                    {
                        AddPoint(point, counts);
                    }
                }
                if (element.To == this)
                {
                    Point point = element.LogicalEndPoint;
                    if (!point.IsEmpty)
                    {
                        AddPoint(point, counts);
                    }
                }
            }
            Point newLogicalCenter = GetLogicalCenter(counts);

            if (newLogicalCenter != Point.Empty)
            {
                this.logicalCenter = newLogicalCenter;
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: atilli/RailMLViewer
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);



            InfraReader infra = new InfraReader();

            infra.InitFromFile("Infra.xml");

            Form1 mainForm = new Form1();

            mainForm.SetIntialNetwork(infra);

            Application.Run(mainForm);
        }
コード例 #4
0
 internal void ChangeToViewNetwork(InfraReader netWork)
 {
     managedObjects = new NetworkViewData();
     managedObjects.CreateViewObjectsFor(netWork);
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: atilli/RailMLViewer
 public void SetIntialNetwork(InfraReader infra)
 {
     networkView.ChangeToViewNetwork(infra);
 }