public void loadpath_direct(String Name, String Name_sp, String Name_ep, System.Windows.Point possp, System.Windows.Point posep)
        {
            PathModel ptempPath = new PathModel(pif.content.map, PathModel.PATH_TYPE_DIRECT);

            ptempPath.setName(Name);
            RegistrationAgent.pathRegistrationList.Add(ptempPath);
            HalfPoint    halfpoint_sp = pif.findobjecthalfpoint(Name_sp);
            StationModel pstation_sp  = pif.findobjectstation(Name_sp);

            if (halfpoint_sp != null)
            {
                pif.SetObjectPath_StartPoint(halfpoint_sp);
            }
            else if (pstation_sp != null)
            {
                pif.SetObjectPath_StartPoint(pstation_sp);
            }
            HalfPoint    halfpoint_ep = pif.findobjecthalfpoint(Name_ep);
            StationModel pstation_ep  = pif.findobjectstation(Name_ep);

            if (halfpoint_ep != null)
            {
                pif.SetObjectPath_EndPoint(halfpoint_ep);
            }
            else if (pstation_ep != null)
            {
                pif.SetObjectPath_EndPoint(pstation_ep);
            }


            ptempPath.drawdirectpath(possp, posep);
            ptempPath.ondraw();
            pif.refreshpath();
        }
Example #2
0
 public HalfPointProperties(MainWindow content, HalfPoint hp)
 {
     InitializeComponent();
     this.content           = content;
     this.hp                = hp;
     this.content.IsEnabled = false;
 }
        public void loadpoint(String Name, String label, Point pos, double w, double h)
        {
            HalfPoint temp = new HalfPoint(pif.content.map);

            temp.sethalfpoint(w, h, pos.X, pos.Y, Colors.Red);
            temp.setTextlabel(label);
            temp.setName(Name);
            pif.phalfpoint_manager.Add(temp);
            pif.updateTreeviewPoints(temp.properties.NameObj);
        }
Example #4
0
 public static Pt ToPt(this HalfPoint halfPoint)
 {
     return(new Pt(halfPoint.Value / 2));
 }