Example #1
0
		//---------------------------------------------------------------------
		/// <summary>
		/// Sets a working area and a precision in order to use it during the 
		/// whole mission. When requesting a point outside this area, all
		/// features will return always null.
		/// </summary>
		/// <param name="bottomLeft">
		/// A <see cref="Point"/> as the bottom left corner of the working 
		/// area.
		/// </param>
		/// <param name="topRight"></para>
		/// A <see cref="Point"/> as the bottom left corner of the working 
		/// area.
		/// </param>
		/// <param name="precision">
		/// A <see cref="Dem.Precision"/> as the selected DEM precision.
		/// </param>
		public Features(Point bottomLeft, Point topRight, Dem.Precision precision)
        {
			this.precision = precision;
            this.demList = new DemList(bottomLeft, topRight, precision);
			this.isWorkingAreaSet = true;
			this.SetWorkingArea(bottomLeft, topRight, precision);
        }
Example #2
0
 public object FunctionCall(String id, object[] parameters)
 {
     if (!isDemPrecisionSet && id != "SetPrecision")
         Console.WriteLine("WARNING: DemPrecision is not set. DemManagerService will use default precisions.");
     switch (id)
     {
         case "SetWorkingArea":
             WgsPoint bottomLeft = this.convertUsalPosToWgsPoint((USAL.Position)parameters[0]);
             WgsPoint topRight = this.convertUsalPosToWgsPoint((USAL.Position)parameters[1]);
             f.SetWorkingArea(bottomLeft, topRight, demPrecision);
             break;
         case "SetPrecision":
             demPrecision = (Dem.Precision)parameters[0];
             isDemPrecisionSet = true;
             Console.WriteLine("DemPrecision set to " + demPrecision);
             break;
         case "GetAltitude":
             WgsPoint pWgs = this.convertUsalPosToWgsPoint((USAL.Position)parameters[0]);
             double alt = f.getAltitude(pWgs, demPrecision);
             return alt;
     }
     return null;
 }
        public void ReadXML(XmlTextReader xmltextreader, string endName)
        {
            bool done = false;
            string element = "";

            while (xmltextreader.Read() && !done)
            {
                if (xmltextreader.NodeType == XmlNodeType.Element)
                {
                    element = xmltextreader.Name;
                }
                else if (xmltextreader.NodeType == XmlNodeType.Text)
                {
                    switch (element)
                    {
                        case "demPrecision":
                            if (xmltextreader.Value == "low")
                                demPrecision = Dem.Precision.low;
                            else if (xmltextreader.Value == "medium")
                                demPrecision = Dem.Precision.medium;
                            else if (xmltextreader.Value == "high")
                                demPrecision = Dem.Precision.high;
                            break;
                        case "localGeoidHeight":
                            localGeoidHeight = float.Parse(xmltextreader.Value, NumberStyles.Float, CultureInfo.InvariantCulture);
                            break;
                    }
                }
                else if (xmltextreader.NodeType == XmlNodeType.EndElement)
                {
                    if (xmltextreader.Name == endName)
                    {
                        done = true;
                    }
                }
            }
        }
        public float localGeoidHeight;      // WGS84 geoid height in the area to scan

        public TerrainModelSettings()
        {
            demPrecision = Dem.Precision.medium;
            localGeoidHeight = 0;
        }