Example #1
0
        public void Connect(string pURL, string pApplicationName, string pUsername, string pPassword)
        {
            udError error = udContext.udContext_TryResume(ref pContext, pURL, pApplicationName, pUsername, true);

            if (error != udError.udE_Success)
            {
                error = udContext_Connect(ref pContext, pURL, pApplicationName, pUsername, pPassword);
            }
            if (error == Vault.udError.udE_ConnectionFailure)
            {
                throw new Exception("Could not connect to server.");
            }
            else if (error == Vault.udError.udE_AuthFailure)
            {
                throw new Exception("Username or Password incorrect.");
            }
            else if (error == Vault.udError.udE_OutOfSync)
            {
                throw new Exception("Your clock doesn't match the remote server clock.");
            }
            else if (error == Vault.udError.udE_SecurityFailure)
            {
                throw new Exception("Could not open a secure channel to the server.");
            }
            else if (error == Vault.udError.udE_ServerFailure)
            {
                throw new Exception("Unable to negotiate with server, please confirm the server address");
            }
            else if (error != Vault.udError.udE_Success)
            {
                throw new Exception("Unknown error occurred: " + error.ToString() + ", please try again later.");
            }
        }
Example #2
0
        public void Render(udRenderTarget renderView, udRenderInstance[] pModels, int modelCount, RenderOptions options)
        {
            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");
            }

            udError error = udRenderContext_Render(pRenderer, renderView.pRenderView, pModels, modelCount, options.options);

            if (error != Vault.udError.udE_Success)
            {
                Debug.Log("vdkRenderContext.Render failed: " + error.ToString());
            }
            options.pickRendered = true;
        }
Example #3
0
        public void Unload()
        {
            udError error = udPointCloud_Unload(ref pModel);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("udPointCloud.Unload failed.");
            }
        }
Example #4
0
            public void RestoreAttribute(string attributeName)
            {
                udError error = udConvert_RestoreAttribute(pConvertContext, attributeName);

                if (error != udError.udE_Success)
                {
                    throw new UDException(error);
                }
            }
Example #5
0
        public void GetMatrix(udRenderTargetMatrix matrixType, double[] cameraMatrix)
        {
            udError error = udRenderTarget_GetMatrix(pRenderView, matrixType, cameraMatrix);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("vdkRenderView.GetMatrix failed.");
            }
        }
Example #6
0
        public void GetMetadata(ref string ppJSONMetadata)
        {
            udError error = udPointCloud_GetMetadata(pModel, ref ppJSONMetadata);

            if (error != udError.udE_Success)
            {
                throw new UDException(error);
            }
        }
Example #7
0
        public void TryResume(string pURL, string pApplicationName, string email = null, bool useDongle = false)
        {
            udError error = udContext_TryResume(ref pContext, pURL, pApplicationName, email, System.Convert.ToInt32(useDongle)); //Set to 1 to try use the dongle

            if (error != udError.udE_Success)
            {
                throw new UDException(error);
            }
        }
Example #8
0
        public void Destroy()
        {
            udError error = vdkConvert_DestroyContext(ref pConvertContext);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("vdkConvertContext.Destroy failed.");
            }
        }
Example #9
0
        public void Destroy()
        {
            udError error = udRenderContext_Destroy(ref pRenderer);

            if (error != udError.udE_Success)
            {
                throw new Exception("udRenderContext.Destroy failed.");
            }
        }
Example #10
0
        public vdkQueryFilter()
        {
            udError error = vdkQueryFilter_Create(ref pQueryFilter);

            if (error != udError.udE_Success)
            {
                throw new Exception("Query Creation Failed: " + error.ToString());
            }
        }
Example #11
0
        /*
         * Set the vdkQueryFilter to find voxels within a cylinder.
         *
         * Note
         *
         *  When inverted, this filter will return all points outside the cylinder.
         * Parameters
         *
         * pQueryFilter: The vdkQueryFilter to configure.
         *
         * centrePoint: The world space {X,Y,Z} array for the center point of the cylinder.
         *
         * radius: The radius of the cylinder (the world space axis are defined by yawPitchRoll) the circle exists in local axis XY extruded along Z.
         *
         * halfHeight: The half-height of the cylinder (the world space axis are defined by yawPitchRoll) the circle exists in local axis XY extruded along Z.
         *
         * yawPitchRoll: The rotation of the cylinder (in radians). Applied in YPR order.
         *
         */
        public void SetAsCylinder(double[] centrePoint, double radius, double halfHeight, double[] yawPitchRoll)
        {
            udError error = vdkQueryFilter_SetAsCylinder(pQueryFilter, centrePoint, radius, halfHeight, yawPitchRoll);

            if (error != udError.udE_Success)
            {
                throw new Exception("Query SetAsCylinder Failed: " + error.ToString());
            }
        }
Example #12
0
        /*
         * Invert the result of a vdkQueryFilter
         *
         * Parameters
         *
         * inverted: True if the filter should be inverted, False is it should behave as default.
         *
         */
        public void SetInverted(bool inverted)
        {
            udError error = vdkQueryFilter_SetInverted(pQueryFilter, inverted);

            if (error != udError.udE_Success)
            {
                throw new Exception("Query Inversion Failed: " + error.ToString());
            }
        }
Example #13
0
        /*
         * Set the vdkQueryFilter to find voxels within a box.
         *
         * Note:
         *
         *  When inverted, this filter will return all points outside the box.
         *
         * Parameters:
         *
         * pQueryFilter: The vdkQueryFilter to configure.
         *
         * centrePoint: The world space {X,Y,Z} array for the center point.
         *
         * halfSize: The local space {X,Y,Z} half size of the box (the world space axis are defined by yawPitchRoll).
         *
         * yawPitchRoll: The rotation of the model (in radians). Applied in YPR order.
         *
         */
        public void SetAsBox(double[] centrePoint, double[] halfSize, double[] yawPitchRoll)
        {
            udError error = vdkQueryFilter_SetAsBox(pQueryFilter, centrePoint, halfSize, yawPitchRoll);

            if (error != udError.udE_Success)
            {
                throw new Exception("Query SetAsBox Failed: " + error.ToString());
            }
        }
Example #14
0
        /*
         * Set the vdkQueryFilter to find voxels within a sphere.
         *
         *
         * Note:
         *
         *  When inverted, this filter will return all points outside the sphere.
         *
         * Parameters:
         *
         * pQueryFilter: The vdkQueryFilter to configure.
         *
         * centrePoint: The world space {X,Y,Z} array for the center point.
         *
         * radius: The radius from the centerPoint to the edge of the sphere.
         *
         */
        public void SetAsSphere(double[] centrePoint, double radius)
        {
            udError error = vdkQueryFilter_SetAsSphere(pQueryFilter, centrePoint, radius);

            if (error != udError.udE_Success)
            {
                throw new Exception("Query SetAsSphere Failed: " + error.ToString());
            }
        }
Example #15
0
        public void SetMatrix(RenderViewMatrix matrixType, double[] cameraMatrix)
        {
            udError error = udRenderTarget_SetMatrix(pRenderTarget, matrixType, cameraMatrix);

            if (error != udError.udE_Success)
            {
                throw new Exception("udRenderTarget.SetMatrix failed.");
            }
        }
Example #16
0
        public void Render(udRenderTarget renderView, udRenderInstance[] pModels, int modelCount)
        {
            udError error = udRenderContext_Render(pRenderer, renderView.pRenderTarget, pModels, modelCount, (IntPtr)0);

            if (error != udError.udE_Success)
            {
                throw new Exception("udRenderContext.Render failed.");
            }
        }
Example #17
0
        public void GetMetadata(ref string ppJSONMetadata)
        {
            udError error = udPointCloud_GetMetadata(pModel, ref ppJSONMetadata);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("udPointCloud.GetMetadata failed.");
            }
        }
Example #18
0
        public void SetFileName(string fileName)
        {
            udError error = vdkConvert_SetOutputFilename(pConvertContext, fileName);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("vdkConvertContext.SetOutputFilename failed.");
            }
        }
Example #19
0
        public void Create(udContext context)
        {
            udError error = vdkConvert_CreateContext(context.pContext, ref pConvertContext);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("vdkConvertContext.Create failed.");
            }
        }
Example #20
0
            private void SetMatrix(RenderViewMatrix matrixType, double[] cameraMatrix)
            {
                udError error = udRenderTarget_SetMatrix(pRenderTarget, matrixType, cameraMatrix);

                if (error != udError.udE_Success)
                {
                    throw new UDException(error);
                }
            }
Example #21
0
        public void AddFile(string fileName)
        {
            udError error = vdkConvert_AddItem(pConvertContext, fileName);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("vdkConvertContext.AddItem failed.");
            }
        }
Example #22
0
        public void Disconnect()
        {
            udError error = udContext_Disconnect(ref pContext, 0);

            if (error != udError.udE_Success)
            {
                throw new Exception("udContext.Disconnect failed.");
            }
        }
Example #23
0
        public void DoConvert()
        {
            udError error = vdkConvert_DoConvert(pConvertContext);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("vdkConvertContext.DoConvert failed.");
            }
        }
Example #24
0
        public void Try_Resume(string pURL, string pApplicationName, string pUsername, bool tryDongle)
        {
            udError error = udContext_TryResume(ref pContext, pURL, pApplicationName, pUsername, tryDongle);

            if (error != udError.udE_Success)
            {
                throw new Exception("Unable to keep session alive: " + error.ToString());
            }
        }
Example #25
0
        private void Unload()
        {
            udError error = udPointCloud_Unload(ref pModel);

            if (error != udError.udE_Success)
            {
                throw new UDException(error);
            }
        }
Example #26
0
        public void Disconnect(bool endSession = false)
        {
            udError error = udContext_Disconnect(ref pContext, endSession);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("udContext.Disconnect failed.");
            }
        }
Example #27
0
        public void Export(string filename, Geometry.udGeometry geom, ref float pProgress)
        {
            udError error = udPointCloud_Export(pModel, filename, geom.pGeometry, ref pProgress);

            if (error != udError.udE_Success)
            {
                throw new UDException(error);
            }
        }
Example #28
0
        public void GetSessionInfo(ref udSessionInfo info)
        {
            udError error = udContext_GetSessionInfo(pContext, ref info);

            if (error != Vault.udError.udE_Success)
            {
                throw new Exception("udContext.Disconnect failed.");
            }
        }
Example #29
0
        public void ConnectCancel()
        {
            udError error = udContext_ConnectCancel(ref pContextPartial);

            if (error != udError.udE_Success)
            {
                throw new UDException(error);
            }
        }
Example #30
0
            public void Reset()
            {
                udError error = udConvert_Reset(pConvertContext);

                if (error != udError.udE_Success)
                {
                    throw new UDException(error);
                }
            }