public void Init() { bPOI=false; iIndex=0; sDescription=""; sComment=""; fFix=false; fLat=0F; fLon=0F; fAlt=0F; fESpeed=-1000000F; fNSpeed=-1000000F; fVSpeed=-1000000F; fRoll=-1000F; fPitch=-1000F; sAltUnit=""; sSpeedUnit=""; fSpeed=0F; fHeading=0F; sIcon=""; sPortInfo=""; iHour=0; fSec=0F; iMonth=0; iYear=0; bShowInfo=false; bTrackLine=false; gpsTrack=null; bRestartTrack=false; colorTrack=Color.FromArgb(255); iAPRSIconTable=-1; iAPRSIconCode=-1; fTrack=false; }
public void SetTrack(GPSTrackerOverlay gpsTrackerOverlay,GPSTrack gpsTrack,string sDescription,Color colorTrack, string sIcon, bool bShowInfo) { m_gpsTrack=gpsTrack; m_gpsTrackerOverlay = gpsTrackerOverlay; m_bShowInfo = bShowInfo; m_uVerticesCount=(gpsTrack.m_uPointCount/50000)+1; m_fTotalDistance=0; m_colorTrack=colorTrack; m_fCurrentVerticalExaggeration = -1F; m_bCalculateDistance = true; m_fStartAlt = gpsTrack.m_fAlt[0]; m_fStartLatitud = gpsTrack.m_fLat[0]; m_fStartLongitude = gpsTrack.m_fLon[0]; m_sDescription = sDescription; m_sIconFileName = sIcon; if (m_sIconFileName=="") m_sIconFileName = GpsTrackerPlugin.m_sPluginDirectory + "\\Gpsx.png"; #if !DEBUG try #endif { this.texture = TextureLoader.FromFile(m_drawArgs.device, this.m_sIconFileName, 0, 0, 1, 0, Format.Unknown, Pool.Managed, Filter.Box, Filter.Box, 0); } #if !DEBUG catch (Microsoft.DirectX.Direct3D.InvalidDataException) { this.texture = TextureLoader.FromFile(m_drawArgs.device, GpsTrackerPlugin.m_sPluginDirectory + "\\gpsx.png", 0, 0, 1, 0, Format.Unknown, Pool.Managed, Filter.Box, Filter.Box, 0); } #endif using (Surface s = this.texture.GetSurfaceLevel(0)) { SurfaceDescription desc = s.Description; this.m_iTextureWidth = desc.Width; this.m_iTextureHeight = desc.Height; this.m_iIconWidth = desc.Width; this.m_iIconHeight = desc.Height; this.m_iIconWidthHalf = desc.Width / 2; this.m_iIconHeightHalf = desc.Height / 2; this.spriteSize = new Rectangle(0, 0, desc.Width, desc.Height); } this.isSelectable = true; this.sprite = new Sprite(m_drawArgs.device); this.isInitialized = true; this.RenderPriority = RenderPriority.Icons; }