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.");
            }
        }
Example #2
0
        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());
            }
        }
Example #3
0
        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.");
            }
        }
Example #6
0
        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.");
            }
        }
Example #9
0
        public void KeepAlive()
        {
            vdkError error = vdkContext_KeepAlive(pContext);

            if (error != vdkError.vE_Success)
            {
                throw new Exception("Unable to keep session alive: " + error.ToString());
            }
        }
Example #10
0
        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.");
            }
        }
Example #11
0
        public void AddFile(string fileName)
        {
            vdkError error = vdkConvert_AddItem(pConvertContext, fileName);

            if (error != Vault.vdkError.vE_Success)
            {
                throw new Exception("vdkConvertContext.AddItem failed.");
            }
        }
Example #12
0
        public void Destroy()
        {
            vdkError error = vdkConvert_DestroyContext(ref pConvertContext);

            if (error != Vault.vdkError.vE_Success)
            {
                throw new Exception("vdkConvertContext.Destroy failed.");
            }
        }
Example #13
0
        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.");
            }
        }
Example #14
0
        public void RequestLicense(LicenseType type)
        {
            vdkError error = vdkContext_RequestLicense(pContext, type);

            if (error != Vault.vdkError.vE_Success)
            {
                throw new Exception("vdkContext.Disconnect failed.");
            }
        }
Example #15
0
        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.");
            }
        }
Example #16
0
        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.");
            }
        }
Example #17
0
        public void Disconnect()
        {
            vdkError error = vdkContext_Disconnect(ref pContext);

            if (error != Vault.vdkError.vE_Success)
            {
                throw new Exception("vdkContext.Disconnect failed.");
            }
        }
Example #18
0
        public void SetFileName(string fileName)
        {
            vdkError error = vdkConvert_SetOutputFilename(pConvertContext, fileName);

            if (error != Vault.vdkError.vE_Success)
            {
                throw new Exception("vdkConvertContext.SetOutputFilename failed.");
            }
        }
Example #19
0
        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;
        }
Example #20
0
        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;
        }
Example #21
0
        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;
        }
Example #22
0
        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());
            }
        }
Example #23
0
        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;
        }
Example #24
0
        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.");
            }
        }
Example #25
0
        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;
        }
Example #26
0
        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.");
            }
        }
Example #27
0
        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;
        }