Example #1
0
        /// <summary>
        /// at least source points should be non zero
        /// </summary>
        /// <param name="myPCLTarget"></param>
        /// <param name="myPCLSource"></param>
        /// <param name="myPCLResult"></param>
        /// <param name="changeColor"></param>
        public void Show3PointClouds(PointCloudVertices myPCLSource, PointCloudVertices myPCLTarget, PointCloudVertices myPCLResult, bool changeColor)
        {
            this.OpenGLControl.RemoveAllModels();

            //target in green
            List <System.Drawing.Color> myColors;

            if (myPCLTarget != null)
            {
                if (changeColor)
                {
                    myColors = ColorExtensions.ToColorList(myPCLTarget.Count, 0, 255, 0, 255);
                    PointCloudVertices.SetColorToList(myPCLTarget, myColors);
                }
                this.OpenGLControl.ShowPointCloud("ICP Target", myPCLTarget);
            }

            if (myPCLSource != null)
            {
                //source in white
                myColors = ColorExtensions.ToColorList(myPCLSource.Count, 255, 255, 255, 255);
                if (changeColor)
                {
                    PointCloudVertices.SetColorToList(myPCLSource, myColors);
                }
                this.OpenGLControl.ShowPointCloud("ICP To be matched", myPCLSource);
            }

            if (myPCLResult != null)
            {
                //transformed in red
                myColors = ColorExtensions.ToColorList(myPCLResult.Count, 255, 0, 0, 255);
                if (changeColor)
                {
                    PointCloudVertices.SetColorToList(myPCLResult, myColors);
                }
                this.OpenGLControl.ShowPointCloud("ICP Solution", myPCLResult);
            }
        }