public void Connect(string pURL, string pApplicationName, string pUsername, string pPassword) { vdkError error = vdkContext_Connect(ref pContext, pURL, pApplicationName, pUsername, pPassword); if (error == Vault.vdkError.vE_ConnectionFailure) { throw new Exception("Could not connect to server."); } else if (error == Vault.vdkError.vE_AuthFailure) { throw new Exception("Username or Password incorrect."); } else if (error == Vault.vdkError.vE_OutOfSync) { throw new Exception("Your clock doesn't match the remote server clock."); } else if (error == Vault.vdkError.vE_SecurityFailure) { throw new Exception("Could not open a secure channel to the server."); } else if (error == Vault.vdkError.vE_ServerFailure) { throw new Exception("Unable to negotiate with server, please confirm the server address"); } else if (error != Vault.vdkError.vE_Success) { throw new Exception("Unknown error occurred, please try again later."); } }
public void Render(vdkRenderView renderView, vdkRenderInstance[] pModels, int modelCount) { if (modelCount == 0) { return; } if (renderView == null) { throw new Exception("renderView is null"); } if (renderView.pRenderView == IntPtr.Zero) { throw new Exception("RenderView not initialised"); } if (pRenderer == IntPtr.Zero) { throw new Exception("renderContext not initialised"); } vdkError error = vdkRenderContext_Render(pRenderer, renderView.pRenderView, pModels, modelCount, (IntPtr.Zero)); if (error == vdkError.vE_InvalidLicense) { context.RequestLicense(LicenseType.Render); error = vdkRenderContext_Render(pRenderer, renderView.pRenderView, pModels, modelCount, (IntPtr)0); } if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderContext.Render failed: " + error.ToString()); } }
public void RenewLicense(LicenseType type) { vdkError error = vdkContext_RenewLicense(pContext, type); if (error != Vault.vdkError.vE_Success) { throw new Exception("VDK License Error: " + error.ToString()); } }
public void Destroy() { vdkError error = vdkRenderContext_Destroy(ref pRenderer); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderContext.Destroy failed."); } }
public void DoConvert() { vdkError error = vdkConvert_DoConvert(pConvertContext); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkConvertContext.DoConvert failed."); } }
public void Try_Resume(string pURL, string pApplicationName, string pUsername, bool tryDongle) { vdkError error = vdkContext_TryResume(ref pContext, pURL, pApplicationName, pUsername, tryDongle); if (error != vdkError.vE_Success) { throw new Exception("Unable to keep session alive: " + error.ToString()); } }
public void GetMetadata(ref string ppJSONMetadata) { vdkError error = vdkPointCloud_GetMetadata(pModel, ref ppJSONMetadata); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkPointCloud.GetMetadata failed."); } }
public void Unload() { vdkError error = vdkPointCloud_Unload(ref pModel); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkPointCloud.Unload failed."); } }
public void KeepAlive() { vdkError error = vdkContext_KeepAlive(pContext); if (error != vdkError.vE_Success) { throw new Exception("Unable to keep session alive: " + error.ToString()); } }
public void SetMatrix(RenderViewMatrix matrixType, double[] cameraMatrix) { vdkError error = vdkRenderView_SetMatrix(pRenderView, matrixType, cameraMatrix); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderView.SetMatrix failed."); } }
public void AddFile(string fileName) { vdkError error = vdkConvert_AddItem(pConvertContext, fileName); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkConvertContext.AddItem failed."); } }
public void Destroy() { vdkError error = vdkConvert_DestroyContext(ref pConvertContext); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkConvertContext.Destroy failed."); } }
public void Render(vdkRenderView renderView, vdkRenderInstance[] pModels, int modelCount) { vdkError error = vdkRenderContext_Render(pRenderer, renderView.pRenderView, pModels, modelCount, (IntPtr)0); if (error != vdkError.vE_Success && error != vdkError.vE_InvalidLicense) { throw new Exception("vdkRenderContext.Render failed."); } }
public void RequestLicense(LicenseType type) { vdkError error = vdkContext_RequestLicense(pContext, type); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkContext.Disconnect failed."); } }
public void Create(vdkContext context) { vdkError error = vdkConvert_CreateContext(context.pContext, ref pConvertContext); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkConvertContext.Create failed."); } }
public void GetLicenseInfo(LicenseType type, ref vdkLicenseInfo info) { vdkError error = vdkContext_GetLicenseInfo(pContext, type, ref info); if (error != Vault.vdkError.vE_Success && error != Vault.vdkError.vE_InvalidLicense) { throw new Exception("vdkContext.GetLicenseInfo failed."); } }
public void Disconnect() { vdkError error = vdkContext_Disconnect(ref pContext); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkContext.Disconnect failed."); } }
public void SetFileName(string fileName) { vdkError error = vdkConvert_SetOutputFilename(pConvertContext, fileName); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkConvertContext.SetOutputFilename failed."); } }
public void Load(vdkContext context, string modelLocation, ref vdkPointCloudHeader header) { vdkError error = vdkPointCloud_Load(context.pContext, ref pModel, modelLocation, ref header); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkPointCloud.Load failed."); } this.context = context; }
public void Create(vdkContext context, vdkRenderContext renderer, UInt32 width, UInt32 height) { vdkError error = vdkRenderView_Create(context.pContext, ref pRenderView, renderer.pRenderer, width, height); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderView.Create failed."); } this.context = context; }
public void Create(vdkContext context) { vdkError error = vdkRenderContext_Create(context.pContext, ref pRenderer); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderContext.Create failed."); } this.context = context; }
public void SetMatrix(RenderViewMatrix matrixType, double[] cameraMatrix) { if (pRenderView == IntPtr.Zero) { throw new Exception("view not instantiated"); } vdkError error = vdkRenderView_SetMatrix(pRenderView, matrixType, cameraMatrix); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderView.SetMatrix failed: " + error.ToString()); } }
public void Destroy() { if (pRenderer == IntPtr.Zero) { return; } vdkError error = vdkRenderContext_Destroy(ref pRenderer); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderContext.Destroy failed: " + error.ToString()); } pRenderer = IntPtr.Zero; }
public void Destroy() { if (colorBufferHandle.IsAllocated) { colorBufferHandle.Free(); } if (depthBufferHandle.IsAllocated) { depthBufferHandle.Free(); } vdkError error = vdkRenderView_Destroy(ref pRenderView); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderView.Destroy failed."); } }
public void Create(vdkContext context, vdkRenderContext renderer, UInt32 width, UInt32 height) { if (context.pContext == IntPtr.Zero) { throw new Exception("context not instantiated"); } if (renderer.pRenderer == IntPtr.Zero) { throw new Exception("renderer not instantiated"); } vdkError error = vdkRenderView_Create(context.pContext, ref pRenderView, renderer.pRenderer, width, height); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderView.Create failed: " + error.ToString()); } this.context = context; }
public void SetTargets(ref UInt32[] colorBuffer, UInt32 clearColor, ref float[] depthBuffer) { if (colorBufferHandle.IsAllocated) { colorBufferHandle.Free(); } if (depthBufferHandle.IsAllocated) { depthBufferHandle.Free(); } colorBufferHandle = GCHandle.Alloc(colorBuffer, GCHandleType.Pinned); depthBufferHandle = GCHandle.Alloc(depthBuffer, GCHandleType.Pinned); vdkError error = vdkRenderView_SetTargets(pRenderView, colorBufferHandle.AddrOfPinnedObject(), clearColor, depthBufferHandle.AddrOfPinnedObject()); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderView.SetTargets failed."); } }
public void Create(vdkContext context) { //ensure we destroy the existing context if we are creating a new one: if (pRenderer != IntPtr.Zero) { Destroy(); } if (context.pContext == IntPtr.Zero) { throw new Exception("context not instantiatiated"); } vdkError error = vdkRenderContext_Create(context.pContext, ref pRenderer); if (error != Vault.vdkError.vE_Success) { throw new Exception("vdkRenderContext.Create failed: " + error.ToString()); } this.context = context; }