This commit is contained in:
stubbfel
2013-10-22 10:17:47 +02:00
parent 23ccf8de0e
commit 99f465bb0c
18 changed files with 204 additions and 119 deletions

View File

@@ -10,11 +10,10 @@ namespace CampusAppWP8.Model.Campusmap.Map
{
using System.Globalization;
using System.Linq;
using System.Windows;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Utility;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Utility;
/// <summary> A data Model for the building map. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>

View File

@@ -9,7 +9,6 @@
namespace CampusAppWP8.Model.Campusmap.Map
{
using System.Collections.Generic;
using System.Windows;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Utility;

View File

@@ -1,27 +1,27 @@
//-----------------------------------------------------------------------
// <copyright file="MapModel.cs" company="BTU/IIT">
// <copyright file="MapWp8Model.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the map model class</summary>
// <date>22.10.2013</date>
// <summary>Implements the map wp 8 model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.Campusmap.Map
{
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWP8.Model.GeoDb;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Utility;
/// <summary> This Class manage the properties of a Map. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public class MapWp8Model : CampusAppWPortalLib8.Model.Campusmap.Map.MapModel<SpsWp8Model,PlaceWp8Model>
/// <seealso cref="T:CampusAppWPortalLib8.Model.Campusmap.Map.MapModel{CampusAppWP8.Model.GeoDb.SpsWp8Model,CampusAppWP8.Model.GeoDb.PlaceWp8Model}"/>
public class MapWp8Model : CampusAppWPortalLib8.Model.Campusmap.Map.MapModel<SpsWp8Model, PlaceWp8Model>
{
#region Constructors

View File

@@ -9,9 +9,9 @@
namespace CampusAppWP8.Model.Campusmap.Pin
{
using System.Collections.Generic;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Model.Campusmap.Map;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
using CampusAppWP8.Model.GeoDb;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// <summary> abstract class for click abel bins. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>

View File

@@ -8,10 +8,9 @@
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.Campusmap.Pin
{
using System.Windows;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Utility;
/// <summary> Current position pin model. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>

View File

@@ -6,9 +6,10 @@
// <date>14.10.2013</date>
// <summary>Implements the hidden pin place model class</summary>
//-----------------------------------------------------------------------
using CampusAppWPortalLib8.Model.Campusmap.Pin;
namespace CampusAppWP8.Model.Campusmap.Pin
{
using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// <summary> Hidden pin place model. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.Campusmap.MapPinModel"/>

View File

@@ -18,8 +18,8 @@ namespace CampusAppWP8.Model.Campusmap.Pin
{
#region Constructor
/// <summary> Initializes a new instance of the <see cref="InfoPlacePinModel" /> class. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>
/// <summary> Initializes a new instance of the InfoLabPlacePinModel class. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
public InfoLabPlacePinModel()
{
this.ImageSource = Icons.PlaceLab;

View File

@@ -18,8 +18,8 @@ namespace CampusAppWP8.Model.Campusmap.Pin
{
#region Constructor
/// <summary> Initializes a new instance of the <see cref="InfoPlacePinModel" /> class. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>
/// <summary> Initializes a new instance of the InfoPlaceAccessPinModel class. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
public InfoPlaceAccessPinModel()
{
this.ImageSource = Icons.PlaceInfoAccess;

View File

@@ -8,18 +8,6 @@
//-----------------------------------------------------------------------
namespace CampusAppWP8.Pages.Campusmap
{
using CampusAppWP8.File.Places;
using CampusAppWP8.Model.Campusmap.Map;
using CampusAppWP8.Model.Campusmap.Pin;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using CampusAppWP8.Utility.NDEF;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Device.Location;
@@ -31,6 +19,17 @@ namespace CampusAppWP8.Pages.Campusmap
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Navigation;
using CampusAppWP8.File.Places;
using CampusAppWP8.Model.Campusmap.Map;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using CampusAppWP8.Utility.NDEF;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Windows.Networking.Proximity;
/// <summary> Class for the campusMap page. </summary>

View File

@@ -16,16 +16,14 @@ namespace CampusAppWP8.Pages.Campusmap
using System.Windows.Media;
using System.Windows.Navigation;
using CampusAppWP8.File.Places;
using CampusAppWP8.Model.Campusmap;
using CampusAppWP8.Model.Campusmap.Map;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
using CampusAppWP8.Model.Campusmap.Map;
using CampusAppWP8.Model.Campusmap.Pin;
using CampusAppWPortalLib8.Model.Campusmap.Pin;
/// <summary> Class of the RoomListPage. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
@@ -157,8 +155,7 @@ namespace CampusAppWP8.Pages.Campusmap
x = room.GeoRefPoint.Longitude;
y = room.GeoRefPoint.Latitude;
MapPoint roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
MapPoint viewPoint = roompoint - mappoint + offsetPoint;
MapPoint viewPoint = roompoint - this.mappoint + this.offsetPoint;
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, MapPinModel.PinType.InfoRedPlace, new List<PlaceWp8Model> { room }));
}
@@ -303,7 +300,7 @@ namespace CampusAppWP8.Pages.Campusmap
x = room.GeoRefPoint.Longitude;
y = room.GeoRefPoint.Latitude;
MapPoint roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
MapPoint viewPoint = roompoint - mappoint + offsetPoint;
MapPoint viewPoint = roompoint - this.mappoint + this.offsetPoint;
MapPinModel.PinType type;
@@ -328,7 +325,7 @@ namespace CampusAppWP8.Pages.Campusmap
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, type, new List<PlaceWp8Model> { room }));
}
// MapCanvas.Children.Add(this.buildingMap.AddPin(offsetPoint, MapPinModel.PinType.SearchPlace));
// MapCanvas.Children.Add(this.buildingMap.AddPin(offsetPoint, MapPinModel.PinType.SearchPlace));
}
/// <summary> Shows the layer places. </summary>
@@ -354,7 +351,7 @@ namespace CampusAppWP8.Pages.Campusmap
double y = this.building.Building.GeoRefPoint.Latitude;
double x = this.building.Building.GeoRefPoint.Longitude;
this.mappoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
this.offsetPoint = -this.buildingMap.MapImageOffsetPoint;// new Point(-this.buildingMap.MapImageOffsetX, -this.buildingMap.MapImageOffsetY);
this.offsetPoint = -this.buildingMap.MapImageOffsetPoint;
this.MapCanvas.DataContext = this.buildingMap;

View File

@@ -17,11 +17,11 @@ namespace CampusAppWP8.Utility
using System.Windows.Media;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Campusmap.Map;
using CampusAppWPortalLib8.Model.Settings;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Utility;
using Microsoft.Phone.Net.NetworkInformation;
using CampusAppWPortalLib8.Model.Campusmap.Map;
/// <summary> Collection of utility functions. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
@@ -137,15 +137,17 @@ namespace CampusAppWP8.Utility
return retValue;
}
/// <summary> Return the element. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <summary> Gets an element. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <exception cref="IndexOutOfRangeException">
/// Thrown when the index is outside the required range.
/// </exception>
/// <param name="rootObj"> . </param>
/// <param name="parentGridName"> . </param>
/// <param name="elemName"> . </param>
/// <param name="index"> (Optional) </param>
/// <param name="rootObj"> root object. </param>
/// <param name="parentGridName"> name of the parent grid. </param>
/// <param name="elemName"> name of the element(s) </param>
/// <param name="index">
/// (Optional) index of the element in the parent child list.
/// </param>
/// <returns> The element. </returns>
public static FrameworkElement GetElement(DependencyObject rootObj, string parentGridName, string elemName, int index = 0)
{
@@ -252,7 +254,7 @@ namespace CampusAppWP8.Utility
return geoposition;
}
/// <summary> Method set current positon to Zero. </summary>
/// <summary> Method set current position to Zero. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public static void SetGeoPositionToZero()
{
@@ -384,6 +386,7 @@ namespace CampusAppWP8.Utility
{
return true;
}
return false;
}
@@ -406,7 +409,6 @@ namespace CampusAppWP8.Utility
MapPoint currentPoint = new MapPoint(log, lat);
MapPoint tmpCampus = CampusMapPoints.NorthCB;
double minDistance = MapPoint.CalcDistance(currentPoint, tmpCampus);
if (minDistance < 0.01)
{

View File

@@ -36,6 +36,7 @@
<Compile Include="Model\Campusmap\Maps\CampusMapPoints.cs" />
<Compile Include="Model\Campusmap\Maps\MapModel.cs" />
<Compile Include="Model\Campusmap\Pins\MapPinModel.cs" />
<Compile Include="Model\Campusmap\Pins\PinTypes.cs" />
<Compile Include="Model\Departments\ChairModel.cs" />
<Compile Include="Model\Departments\DepartmentModel.cs" />
<Compile Include="Model\Departments\FacultyModel.cs" />

View File

@@ -1,12 +1,17 @@
using CampusAppWPortalLib8.Model.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//-----------------------------------------------------------------------
// <copyright file="CampusMapPoints.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>22.10.2013</date>
// <summary>Implements the campus map points class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Campusmap.Map
{
using CampusAppWPortalLib8.Model.Utility;
/// <summary> The campus map points. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
public class CampusMapPoints
{
#region member
@@ -15,33 +20,41 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
private static MapPoint northCB = new MapPoint(14.293908825617, 51.77670359509875);
/// <summary> The middle campus of cottbus. </summary>
private static MapPoint midCB = new MapPoint(14.324056352976152,51.76737987049448);
private static MapPoint midCB = new MapPoint(14.324056352976152, 51.76737987049448);
/// <summary> The south campus of cottbus. </summary>
private static MapPoint southCB = new MapPoint(14.319497377197282,51.72668339740452);
private static MapPoint southCB = new MapPoint(14.319497377197282, 51.72668339740452);
/// <summary> The middle campus of senftenberg. </summary>
private static MapPoint midSFB = new MapPoint(13.986618441187698,51.522217168257356);
private static MapPoint midSFB = new MapPoint(13.986618441187698, 51.522217168257356);
#endregion
#region porperty
/// <summary> Gets the middle sfb. </summary>
/// <value> The middle sfb. </value>
public static MapPoint MidSFB
{
get { return CampusMapPoints.midSFB; }
}
/// <summary> Gets the south cb. </summary>
/// <value> The south cb. </value>
public static MapPoint SouthCB
{
get { return CampusMapPoints.southCB; }
}
/// <summary> Gets the middle cb. </summary>
/// <value> The middle cb. </value>
public static MapPoint MidCB
{
get { return CampusMapPoints.midCB; }
}
/// <summary> Gets the north cb. </summary>
/// <value> The north cb. </value>
public static MapPoint NorthCB
{
get { return CampusMapPoints.northCB; }

View File

@@ -8,27 +8,29 @@
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Campusmap.Map
{
using System.Collections.Generic;
using CampusAppWPortalLib8.Model.GeoDb;
using CampusAppWPortalLib8.Model.Utility;
using System.Collections.Generic;
/// <summary> This Class manage the properties of a Map. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <summary> A data Model for the map. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <typeparam name="T"> Generic type parameter. SpsModel </typeparam>
/// <typeparam name="V"> Generic type parameter. PlaceModel</typeparam>
public class MapModel<T, V>
where V : PlaceModel
where T : SpsModel<V>, new()
{
#region Constructors
/// <summary> Initializes a new instance of the <see cref="MapModel" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <summary> Initializes a new instance of the MapModel class. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
public MapModel()
{
this.IsReady = false;
}
/// <summary> Initializes a new instance of the <see cref="MapModel" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <summary> Initializes a new instance of the MapModel class. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="placeList"> list of places. </param>
public MapModel(List<V> placeList)
{
@@ -77,6 +79,8 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
/// <value> The reference point. </value>
public MapPoint RefPoint { get; set; }
/// <summary> Gets the map reference point. </summary>
/// <value> The map reference point. </value>
public MapPoint MapRefPoint
{
get
@@ -84,7 +88,6 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
return this.MapImageOffsetPoint + this.RefPoint;
}
}
#endregion
@@ -98,7 +101,7 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
/// <returns> The scroll point. </returns>
public MapPoint GetScrollPoint(MapPoint point)
{
MapPoint result = this.MapRefPoint;
MapPoint result = this.MapRefPoint;
result.X += point.X;
result.Y -= point.Y;
return result;
@@ -114,7 +117,6 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
return this.GetScrollPoint(new MapPoint(x, y));
}
/// <summary> Convert a coordinates to coordinates which address pixels. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>
/// <param name="x"> the x-coordinate. </param>
@@ -122,7 +124,7 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
/// <returns> Point in pixel-size. </returns>
public MapPoint ConverToPixelPoint(double x, double y)
{
return this.ConverToPixelPoint(new MapPoint(x,y));
return this.ConverToPixelPoint(new MapPoint(x, y));
}
/// <summary> Convert a coordinates to coordinates which address pixels. </summary>
@@ -150,7 +152,7 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Map
/// <returns> Point in pixel-size. </returns>
public MapPoint ConverToMapPoint(MapPoint point)
{
MapPoint result = point - this.GeoOffsetPoint;
MapPoint result = point - this.GeoOffsetPoint;
return result;
}

View File

@@ -8,6 +8,7 @@
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Campusmap.Pin
{
using CampusAppWPortalLib8.Model.Campusmap.Pins;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Resources;
@@ -56,38 +57,6 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Pin
#endregion
#region enums
/// <summary> Values that represent PinType. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>
public enum PinType
{
/// <summary>An enum constant representing the hidden option.</summary>
Hidden = 0,
/// <summary>An enum constant representing the search place option.</summary>
SearchPlace = 1,
/// <summary>An enum constant representing the current position option.</summary>
CurrentPosition = 2,
/// <summary>An enum constant representing the info place option.</summary>
InfoPlace = 3,
/// <summary> An enum constant representing the information lab place option. </summary>
InfoLabPlace = 4,
/// <summary> An enum constant representing the information wc place option. </summary>
InfoWcPlace = 5,
/// <summary> An enum constant representing the information red place option. </summary>
InfoRedPlace = 6,
/// <summary> An enum constant representing the information access place option. </summary>
InfoAccesPlace = 7
}
#endregion
#region Property
/// <summary> Gets the information red place pin string. </summary>
@@ -204,6 +173,7 @@ namespace CampusAppWPortalLib8.Model.Campusmap.Pin
}
#endregion
#endregion
#region Method

View File

@@ -0,0 +1,42 @@
//-----------------------------------------------------------------------
// <copyright file="PinTypes.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>22.10.2013</date>
// <summary>Implements the pin types class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Campusmap.Pins
{
#region enums
/// <summary> Values that represent PinType. </summary>
/// <remarks> Stubbfel, 27.08.2013. </remarks>
public enum PinType
{
/// <summary>An enum constant representing the hidden option.</summary>
Hidden = 0,
/// <summary>An enum constant representing the search place option.</summary>
SearchPlace = 1,
/// <summary>An enum constant representing the current position option.</summary>
CurrentPosition = 2,
/// <summary>An enum constant representing the info place option.</summary>
InfoPlace = 3,
/// <summary> An enum constant representing the information lab place option. </summary>
InfoLabPlace = 4,
/// <summary> An enum constant representing the information wc place option. </summary>
InfoWcPlace = 5,
/// <summary> An enum constant representing the information red place option. </summary>
InfoRedPlace = 6,
/// <summary> An enum constant representing the information access place option. </summary>
InfoAccesPlace = 7
}
#endregion
}

View File

@@ -1,16 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//-----------------------------------------------------------------------
// <copyright file="MapPoint.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>22.10.2013</date>
// <summary>Implements the map point class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Utility
{
using System;
/// <summary> A map point. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <seealso cref="T:System.IEquatable{CampusAppWPortalLib8.Model.Utility.MapPoint}"/>
public class MapPoint : IEquatable<MapPoint>
{
#region Constructor
/// <summary> Initializes a new instance of the MapPoint class. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="x"> The x coordinate. </param>
/// <param name="y"> The y coordinate. </param>
public MapPoint(double x, double y)
{
this.X = x;
@@ -21,39 +31,93 @@ namespace CampusAppWPortalLib8.Model.Utility
#region property
/// <summary> Gets or sets the x coordinate. </summary>
/// <value> The x coordinate. </value>
public double X { get; set; }
/// <summary> Gets or sets the y coordinate. </summary>
/// <value> The y coordinate. </value>
public double Y { get; set; }
#endregion
#region method
/// <summary> Addition operator. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="mp1"> The first mapPoint. </param>
/// <param name="mp2"> The second mapPoint. </param>
/// <returns> The result of the operation. </returns>
public static MapPoint operator +(MapPoint mp1, MapPoint mp2)
{
return new MapPoint(mp1.X + mp2.X, mp1.Y + mp2.Y);
}
/// <summary> Subtraction operator. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="mp1"> The first mapPoint. </param>
/// <param name="mp2"> The second mapPoint. </param>
/// <returns> The result of the operation. </returns>
public static MapPoint operator -(MapPoint mp1, MapPoint mp2)
{
return new MapPoint(mp1.X - mp2.X, mp1.Y - mp2.Y);
}
/// <summary> Negation operator. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="mp1"> The mapPoint. </param>
/// <returns> The result of the operation. </returns>
public static MapPoint operator -(MapPoint mp1)
{
return new MapPoint(-mp1.X, -mp1.Y);
}
/// <summary> Multiplication operator. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="mp1"> The first mapPoint. </param>
/// <param name="mp2"> The second mapPoint. </param>
/// <returns> The result of the operation. </returns>
public static MapPoint operator *(MapPoint mp1, MapPoint mp2)
{
return new MapPoint(mp1.X * mp2.X, mp1.Y * mp2.Y);
}
/// <summary> Division operator. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="mp1"> The first mapPoint. </param>
/// <param name="mp2"> The second mapPoint. </param>
/// <returns> The result of the operation. </returns>
public static MapPoint operator /(MapPoint mp1, MapPoint mp2)
{
return new MapPoint(mp1.X / mp2.X, mp1.Y / mp2.Y);
}
/// <summary> Calculates the distance. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="src"> Start Point. </param>
/// <param name="dst"> End Point. </param>
/// <returns> The calculated distance. </returns>
public static double CalcDistance(MapPoint src, MapPoint dst)
{
MapPoint subPoint = dst - src;
subPoint *= subPoint;
double result = Math.Sqrt(subPoint.X + subPoint.Y);
return result;
}
/// <summary> Calculates the distance. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="other"> The map point to compare to this object. </param>
/// <returns> The calculated distance. </returns>
public double CalcDistance(MapPoint other)
{
return MapPoint.CalcDistance(other, this);
}
/// <summary> Tests if this MapPoint is considered equal to another. </summary>
/// <remarks> Stubbfel, 22.10.2013. </remarks>
/// <param name="other"> The map point to compare to this object. </param>
/// <returns> true if the objects are considered equal, false if they are not. </returns>
public bool Equals(MapPoint other)
{
if (other != null && this.X == other.X && this.Y == other.Y)
@@ -64,15 +128,6 @@ namespace CampusAppWPortalLib8.Model.Utility
return false;
}
public static double CalcDistance(MapPoint src, MapPoint dst)
{
MapPoint subPoint = dst - src;
subPoint *= subPoint;
double result = Math.Sqrt(subPoint.X + subPoint.Y);
return result;
}
#endregion
}
}

View File

@@ -3,14 +3,20 @@
<CollectionProperty Name="RecognizedWords">
<Value>akadgrad</Value>
<Value>api</Value>
<Value>cb</Value>
<Value>enum</Value>
<Value>fiedlchr</Value>
<Value>nfc</Value>
<Value>param</Value>
<Value>qr</Value>
<Value>senftenberg</Value>
<Value>sfb</Value>
<Value>sps</Value>
<Value>str</Value>
<Value>stubbfel</Value>
<Value>telefon</Value>
<Value>uni</Value>
<Value>wc</Value>
</CollectionProperty>
</GlobalSettings>
<Analyzers>