本文整理汇总了C#中LibGeo.GeoCoord.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# GeoCoord.Clone方法的具体用法?C# GeoCoord.Clone怎么用?C# GeoCoord.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGeo.GeoCoord
的用法示例。
在下文中一共展示了GeoCoord.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tile
private bool m_triedReload = false; // limits reload attempts
#endregion Fields
#region Constructors
public Tile(TileSet ts, string tileScale, GeoCoord topLeft, GeoCoord bottomRight)
{
m_tileSet = ts;
m_tileScale = tileScale;
m_topLeft = topLeft.Clone();
m_bottomRight = bottomRight.Clone();
#if DEBUG
LibSys.StatusBar.Trace("Tile() topLeft=" + m_topLeft.ToString() + " bottomRight=" + m_bottomRight.ToString());
#endif
}
示例2: toPixelLocationPrint
public override Point toPixelLocationPrint(GeoCoord loc, ITile tile)
{
int xx = 0;
int yy = 0;
if(tile != null)
{
// the idea here is to simplify conversion for tiles around 180, when camera operates
// on coordinates above 180 and below -180
int offsetX = 0;
int offsetY = 0;
Point offset;
if(!(offset=tile.getOffset()).IsEmpty)
{
offsetX = offset.X;
offsetY = offset.Y;
}
GeoCoord tileTopLeft = tile.getTopLeft();
GeoCoord tileTopLeftN = tileTopLeft.Clone();
tileTopLeftN.Normalize();
GeoCoord locN = loc.Clone();
locN.Normalize();
double dOffsetLng = locN.Lng - tileTopLeftN.Lng;
double dOffsetLat = locN.Lat - tileTopLeftN.Lat;
xx = (int)Math.Round((tileTopLeft.Lng + dOffsetLng - m_coverageTopLeftPrint.Lng) / xScalePrint) + offsetX;
yy = (int)Math.Round((tileTopLeft.Lat + dOffsetLat - m_coverageTopLeftPrint.Lat) / yScalePrint) + offsetY;
}
else
{
// express location longitude and latitude in terms of camera coordinates:
double dOffsetLng = loc.Lng - m_location.Lng;
while(dOffsetLng >= 180.0d)
{
dOffsetLng -= 360.0d;
}
while(dOffsetLng <= -180.0d)
{
dOffsetLng += 360.0d;
}
if(TileSetTerra.This.hasRenderedTiles && TileSetTerra.This.insideCurrentZone(loc))
{
Point screenPt = TileSetTerra.This.toScreenPoint(loc, true);
screenPt.Offset(m_pictureManager.OffsetXPrint, m_pictureManager.OffsetYPrint);
return screenPt;
}
else
{
xx = (int)Math.Round(dOffsetLng / xScalePrint + pictureWidthPrint / 2.0d);
yy = (int)Math.Round((loc.Lat - m_location.Lat) / yScalePrint + pictureHeightPrint / 2.0d);
}
}
//LibSys.StatusBar.Trace("toPixelLocation(" + loc + ") x=" + xx + " y=" + yy);
Point ret = new Point(xx, yy);
ret.Offset(m_pictureManager.OffsetXPrint, m_pictureManager.OffsetYPrint);
return ret;
}
示例3: TileTerra
private bool m_triedReload = false; // limits reload attempts
#endregion Fields
#region Constructors
public TileTerra(TileSetTerra ts, Scale tileScale, GeoCoord topLeft, GeoCoord bottomRight)
{
m_tileSet = ts;
m_tileScale = tileScale;
m_topLeft = topLeft.Clone();
m_bottomRight = bottomRight.Clone();
//LibSys.StatusBar.Trace("TileTerra() topLeft=" + m_topLeft.ToString() + " bottomRight=" + m_bottomRight.ToString());
}
示例4: toPixelLocation
public override Point toPixelLocation(GeoCoord loc, ITile tile)
{
int xx = 0;
int yy = 0;
if(tile != null)
{
// the idea here is to simplify conversion for tiles around 180, when camera operates
// on coordinates above 180 and below -180
int offsetX = 0;
int offsetY = 0;
Point offset;
if(!(offset=tile.getOffset()).IsEmpty)
{
offsetX = offset.X;
offsetY = offset.Y;
}
GeoCoord tileTopLeft = tile.getTopLeft();
GeoCoord tileTopLeftN = tileTopLeft.Clone();
tileTopLeftN.Normalize();
GeoCoord locN = loc.Clone();
locN.Normalize();
double dOffsetLng = locN.Lng - tileTopLeftN.Lng;
double dOffsetLat = locN.Lat - tileTopLeftN.Lat;
xx = (int)Math.Round((tileTopLeft.Lng + dOffsetLng - m_coverageTopLeft.Lng) / xScale) + offsetX;
yy = (int)Math.Round((tileTopLeft.Lat + dOffsetLat - m_coverageTopLeft.Lat) / yScale) + offsetY;
return new Point(xx, yy);
}
else
{
// express location longitude and latitude in terms of camera coordinates:
double dOffsetLng = loc.Lng - m_location.Lng;
while(dOffsetLng >= 180.0d)
{
dOffsetLng -= 360.0d;
}
while(dOffsetLng <= -180.0d)
{
dOffsetLng += 360.0d;
}
double dOffsetLat = loc.Lat - m_location.Lat;
if(TileSetTerra.This.hasRenderedTiles && !TileSetTerra.This.RetilingSpecial && TileSetTerra.This.insideCurrentZone(loc) && insideScreenRectangle(loc))
{
Point screenPt = TileSetTerra.This.toScreenPoint(loc, false);
return screenPt;
}
else
{
xx = (int)Math.Round(dOffsetLng / xScale + pictureWidth / 2.0d);
yy = (int)Math.Round((loc.Lat - m_location.Lat) / yScale + pictureHeight / 2.0d);
return new Point(xx, yy);
}
}
}