Ejemplo n.º 1
0
        /// <summary>
        /// Updates the list of markers with lastest marker coordinates
        /// </summary>
        public static void UpdateCoordinates()
        {
           
            PointCloud.NPPointCloudFrame frame = new PointCloud.NPPointCloudFrame();
                        
            pointcloud.GetFrame(out frame);

            Marker marker = new Marker();

            while (frame != null)
            {
                for (int i = 0; i < frame.Count; i++)
                {
                    marker.MarkerId = i;
                    marker.TimeStamp = Environment.TickCount;
                    marker.xCoordinate = frame.Item(i).X * 1000;
                    marker.yCoordinate = frame.Item(i).Y * 1000;
                    marker.zCoordinate = frame.Item(i).Z * 1000;                    

                    //MarkerList.RefreshMarkerList(marker, frame.Count);

                    if (CoordinatesAvailableEvent != null)
                    {
                        CoordinatesAvailableEvent(marker);
                        m_endOfFrameSent = false; ;
                    }
                    
                }
                //Send number of markers with marker data
                marker.TimeStamp = frame.Count;
                marker.MarkerId = -2147483648;

                if (CoordinatesAvailableEvent != null && m_endOfFrameSent == false)
                {
                    CoordinatesAvailableEvent(marker);
                    m_endOfFrameSent = true;
                }


                pointcloud.GetFrame(out frame);
            }

            
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the list of markers with lastest marker coordinates
        /// </summary>
        public static void UpdateCoordinates()
        {
            PointCloud.NPPointCloudFrame frame = new PointCloud.NPPointCloudFrame();

            pointcloud.GetFrame(out frame);

            Marker marker = new Marker();

            while (frame != null)
            {
                for (int i = 0; i < frame.Count; i++)
                {
                    marker.MarkerId    = i;
                    marker.TimeStamp   = Environment.TickCount;
                    marker.xCoordinate = frame.Item(i).X * 1000;
                    marker.yCoordinate = frame.Item(i).Y * 1000;
                    marker.zCoordinate = frame.Item(i).Z * 1000;

                    //MarkerList.RefreshMarkerList(marker, frame.Count);

                    if (CoordinatesAvailableEvent != null)
                    {
                        CoordinatesAvailableEvent(marker);
                        m_endOfFrameSent = false;;
                    }
                }
                //Send number of markers with marker data
                marker.TimeStamp = frame.Count;
                marker.MarkerId  = -2147483648;

                if (CoordinatesAvailableEvent != null && m_endOfFrameSent == false)
                {
                    CoordinatesAvailableEvent(marker);
                    m_endOfFrameSent = true;
                }


                pointcloud.GetFrame(out frame);
            }
        }