public bool GlobalToWorld(Coordinate converter, Vec3D position) { switch (_mapType) { case MapType.UNKNOWN: { return(false); } case MapType.UTM: UTMPos utmpos = new UTMPos(_metaData.Zone(), _metaData.North(), -(position.z + _origin.z), position.x + _origin.x, position.y + _origin.y); converter.SetUTMPos(utmpos); break; case MapType.GEOCENTRIC: CartPos cartpos = new CartPos(position.x + _origin.x, position.y + _origin.y, position.z + _origin.z); converter.SetCartPos(cartpos); break; } return(true); }
public bool GetCartPos(MapPos pos, out CartPos result) { Coordinate converter = new Coordinate(); Vec3D position = pos.position; result = new CartPos(); // Check possibly local 3D under a roiNode RoiNode roi = pos.node as RoiNode; if (roi != null && roi.IsValid()) { position += roi.Position; } switch (_mapType) { case MapType.UNKNOWN: { return(false); } case MapType.UTM: UTMPos utmpos = new UTMPos(_utmZone, _north, -(position.z + _origin.z), position.x + _origin.x, position.y + _origin.y); converter.SetUTMPos(utmpos); break; case MapType.GEOCENTRIC: CartPos cartpos = new CartPos(position.x + _origin.x, position.y + _origin.y, position.z + _origin.z); converter.SetCartPos(cartpos); break; } return(converter.GetCartPos(out result)); }
private static extern bool Coordinate_getUTMPos(IntPtr nativeReference, ref UTMPos pos, Datum datum);
private static extern void Coordinate_setUTMPos(IntPtr nativeReference, ref UTMPos pos, Datum datum);
public bool GetUTMPos(out UTMPos pos, Datum datum = Datum.WGS84) { pos = new UTMPos(); return(Coordinate_getUTMPos(GetNativeReference(), ref pos, datum)); }
public void SetUTMPos(UTMPos pos, Datum datum = Datum.WGS84) { Coordinate_setUTMPos(GetNativeReference(), ref pos, datum); }
private static extern bool UTMPos_create_pos(IntPtr native_reference, [Out] out UTMPos pos);
private static extern IntPtr UTMPos_create_dynamic(ref UTMPos pos);
private static extern IntPtr UTMPos_asString(ref UTMPos pos);