public string GetMapConfigPath() { string res = Util.CStringToSharp(BrowserInterop.vtsMapGetConfigPath(Handle)); Util.CheckError(); return(res); }
public string GetPositionUrl() { string res = Util.CStringToSharp(BrowserInterop.vtsMapGetPositionUrl(Handle)); Util.CheckError(); return(res); }
public Map(string createOptions) { handle = BrowserInterop.vtsMapCreate(createOptions); Util.CheckError(); AssignInternalDelegates(); AssignInternalCallbacks(); }
public double GetPositionFov() { double res = BrowserInterop.vtsMapGetPositionFov(Handle); Util.CheckError(); return(res); }
public double[] GetPositionRotationLimited() { double[] res = new double[3]; BrowserInterop.vtsMapGetPositionRotationLimited(Handle, res); Util.CheckError(); return(res); }
public bool GetPositionSubjective() { bool res = BrowserInterop.vtsMapGetPositionSubjective(Handle); Util.CheckError(); return(res); }
public bool GetMapConfigAvailable() { bool res = BrowserInterop.vtsMapGetConfigAvailable(Handle); Util.CheckError(); return(res); }
public void Load(IntPtr handle) { faceMode = (FaceMode)BrowserInterop.vtsGetMeshFaceMode(handle); Util.CheckError(); IntPtr bufPtr; uint bufSize; BrowserInterop.vtsGetMeshIndices(handle, out bufPtr, out bufSize, out indicesCount); Util.CheckError(); if (indicesCount > 0) { short[] tmp = new short[indicesCount]; Marshal.Copy(bufPtr, tmp, 0, (int)indicesCount); indices = new ushort[indicesCount]; Buffer.BlockCopy(tmp, 0, indices, 0, (int)indicesCount * 2); } BrowserInterop.vtsGetMeshVertices(handle, out bufPtr, out bufSize, out verticesCount); Util.CheckError(); vertices = new byte[bufSize]; Marshal.Copy(bufPtr, vertices, 0, (int)bufSize); attributes = new List <VertexAttribute>(4); for (uint i = 0; i < 4; i++) { VertexAttribute a; uint type; BrowserInterop.vtsGetMeshAttribute(handle, i, out a.offset, out a.stride, out a.components, out type, out a.enable, out a.normalized); Util.CheckError(); a.type = (GpuType)type; attributes.Add(a); } }
public string GetStatistics() { string res = Util.CStringToSharp(BrowserInterop.vtsMapGetStatistics(Handle)); Util.CheckError(); return(res); }
public double[] GetProj() { double[] proj = new double[16]; BrowserInterop.vtsCameraGetProjMatrix(Handle, proj); Util.CheckInterop(); return(proj); }
public double[] GetView() { double[] view = new double[16]; BrowserInterop.vtsCameraGetViewMatrix(Handle, view); Util.CheckInterop(); return(view); }
public void Load(Map map) { if (colorHorizon == null) { colorHorizon = new float[4]; colorZenith = new float[4]; } float[] colors = new float[8]; double[] parameters = new double[5]; BrowserInterop.vtsCelestialAtmosphere(map.Handle, colors, parameters); Util.CheckInterop(); for (int i = 0; i < 4; i++) { colorHorizon[i] = colors[i]; colorZenith[i] = colors[i + 4]; } colorGradientExponent = parameters[0]; BrowserInterop.vtsCelestialAtmosphereDerivedAttributes(map.Handle, ref boundaryThickness, ref horizontalExponent, ref verticalExponent); Util.CheckInterop(); { IntPtr ptr = BrowserInterop.vtsDrawsAtmosphereDensityTexture(map.Handle); Util.CheckInterop(); if (ptr == IntPtr.Zero) { densityTexture = null; } else { GCHandle hnd = GCHandle.FromIntPtr(ptr); densityTexture = hnd.Target; } } }
public bool GetSearchable() { bool res = BrowserInterop.vtsMapGetSearchable(Handle); Util.CheckInterop(); return(res); }
private void LoadSimple(ref List <DrawSimpleTask> tasks, IntPtr group, uint cnt) { Util.CheckInterop(); if (tasks == null) { tasks = new List <DrawSimpleTask>((int)cnt); } else { tasks.Clear(); } for (uint i = 0; i < cnt; i++) { DrawSimpleTask t; IntPtr pm = IntPtr.Zero, ptc = IntPtr.Zero, pbs = IntPtr.Zero; BrowserInterop.vtsDrawsSimpleTask(group, i, ref pm, ref ptc, ref pbs); Util.CheckInterop(); if (pm == IntPtr.Zero) { continue; } t.data = (DrawSimpleBase)Marshal.PtrToStructure(pbs, typeof(DrawSimpleBase)); t.mesh = Load(pm); t.texColor = Load(ptc); tasks.Add(t); } }
public double[] GetRotation() { double[] res = new double[3]; BrowserInterop.vtsNavigationGetRotation(Handle, res); Util.CheckInterop(); return(res); }
public double GetFov() { double res = BrowserInterop.vtsNavigationGetFov(Handle); Util.CheckInterop(); return(res); }
public bool GetMapRenderComplete() { bool res = BrowserInterop.vtsMapGetRenderComplete(Handle); Util.CheckInterop(); return(res); }
public bool GetSubjective() { bool res = BrowserInterop.vtsNavigationGetSubjective(Handle); Util.CheckInterop(); return(res); }
public SearchTask Search(string query) { IntPtr ptr = BrowserInterop.vtsMapSearch(Handle, query); Util.CheckInterop(); return(new SearchTask(ptr)); }
public bool GetMapconfigReady() { bool res = BrowserInterop.vtsMapGetConfigReady(Handle); Util.CheckInterop(); return(res); }
private void Load(ref List <DrawTask> tasks, IntPtr group) { Util.CheckError(); try { uint cnt = BrowserInterop.vtsDrawsCount(group); Util.CheckError(); if (tasks == null) { tasks = new List <DrawTask>((int)cnt); } else { tasks.Clear(); } for (uint i = 0; i < cnt; i++) { DrawTask t; IntPtr pm, ptc, ptm; IntPtr dataPtr = BrowserInterop.vtsDrawsAllInOne(group, i, out pm, out ptc, out ptm); Util.CheckError(); t.data = (DrawBase)Marshal.PtrToStructure(dataPtr, typeof(DrawBase)); t.mesh = Load(pm); t.texColor = Load(ptc); t.texMask = Load(ptm); tasks.Add(t); } } finally { BrowserInterop.vtsDrawsDestroy(group); Util.CheckError(); } }
public bool GetProjected() { bool res = BrowserInterop.vtsMapGetProjected(Handle); Util.CheckInterop(); return(res); }
public double GetMapRenderProgress() { double res = BrowserInterop.vtsMapGetRenderProgress(Handle); Util.CheckInterop(); return(res); }
public string GetCreditsShort() { string res = Util.CStringToSharp(BrowserInterop.vtsMapGetCreditsShort(Handle)); Util.CheckError(); return(res); }
public static uint GpuTypeSize(GpuType type) { uint s = BrowserInterop.vtsGpuTypeSize((uint)type); CheckInterop(); return(s); }
public double[] Convert(double[] point, Srs srsFrom, Srs srsTo) { Util.CheckArray(point, 3); double[] res = new double[3]; BrowserInterop.vtsMapConvert(Handle, point, res, (uint)srsFrom, (uint)srsTo); Util.CheckInterop(); return(res); }
public void GetView(out double[] eye, out double[] target, out double[] up) { eye = new double[3]; target = new double[3]; up = new double[3]; BrowserInterop.vtsCameraGetView(Handle, eye, target, up); Util.CheckInterop(); }
public static double[] Inverse44(double[] r) { Util.CheckArray(r, 16); double[] res = new double[16]; BrowserInterop.vtsMathInverse44(res, r); Util.CheckInterop(); return(res); }
public static double[] Inverse33(double[] r) { Util.CheckArray(r, 9); double[] res = new double[9]; BrowserInterop.vtsMathInverse33(res, r); Util.CheckError(); return(res); }
public void SetView(double[] eye, double[] target, double[] up) { Util.CheckArray(eye, 3); Util.CheckArray(target, 3); Util.CheckArray(up, 3); BrowserInterop.vtsCameraSetView(Handle, eye, target, up); Util.CheckInterop(); }