public void Connect(string pURL, string pApplicationName, string pUsername, string pPassword) { vdkError error = vdkContext_Connect(ref pContext, pURL, pApplicationName, pUsername, pPassword); if (error != vdkError.vE_Success) { error = vdkContext.vdkContext_TryResume(ref pContext, pURL, pApplicationName, pUsername, true); } 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: " + error.ToString() + ", 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 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 KeepAlive() { vdkError error = vdkContext_KeepAlive(pContext); if (error != vdkError.vE_Success) { throw new Exception("Unable to keep session alive: " + error.ToString()); } }
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: " + error.ToString()); } 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 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 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; }