Beispiel #1
0
 private void ProcessPanos(PanoModel panos, string objectDir)
 {
     foreach (var pano in panos.Panos)
     {
         ProcessPano(pano, panos, objectDir);
     }
     xmlService.WriteToFile(objectDir);
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            mode++;
            if (mode > 2)
            {
                mode = 0;
            }
        }
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            mode--;
            if (mode < 0)
            {
                mode = 2;
            }
        }

        if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.RightArrow))
        {
            if (mode == 0)
            {
                panoTrace.SetActive(false);
                groundTruth.SetActive(false);
                modelMode = PanoModel.TwoD;
            }
            if (mode == 1)
            {
                panoTrace.SetActive(true);
                groundTruth.SetActive(false);
                modelMode = PanoModel.PanoTrace;
            }
            if (mode == 2)
            {
                panoTrace.SetActive(false);
                groundTruth.SetActive(true);
                modelMode = PanoModel.GroundTruth;
            }
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            Recalibrate();
        }
    }
Beispiel #3
0
        private IEnumerable <XElement> GetHotspots(XDocument xdoc, PanoModel panos)
        {
            var hotspots = xdoc.Root.Descendants("hotspot");

            foreach (var hotspot in hotspots)
            {
                if (!hotspot.Attribute("style").Value.Equals("infospot"))
                {
                    hotspot.SetAttributeValue("style", "hotspotstyle");
                    var linkedScene = new XAttribute("linkedscene", panos.Panos.FirstOrDefault(p => p.Id.Equals(hotspot.Attribute("href").Value)).Omschrijving);
                    hotspot.Attribute("href").Remove();
                    hotspot.Add(linkedScene);
                }
            }

            return(hotspots);
        }
Beispiel #4
0
        private void ProcessPano(Pano pano, PanoModel panoModel, string objectDir)
        {
            HttpResponseMessage result;
            string soortAanbod = panoModel.SoortAanbod;

            using (HttpClient client = new HttpClient())
            {
                result = client.GetAsync($"http://partnerapi.funda.nl/feeds/MijnFunda.svc/GetKrpanoXmlContent/?type={soortAanbod}&globalId={panoModel.GlobalId}&mediaGuid={pano.Id}").Result;
            }

            if (result.IsSuccessStatusCode)
            {
                var xml    = result.Content.ReadAsStringAsync().Result;
                var xdoc   = XDocument.Parse(Sanitize(xml));
                var images = xdoc.Root.Descendants("tablet").Descendants();
                xmlService.AddScene(pano, GetHotspots(xdoc, panoModel), images.First().FirstAttribute.Value);
            }
            else
            {
                Console.WriteLine(result.ReasonPhrase);
            }
        }