Ejemplo n.º 1
0
        /* Displaying current frames hand joints */
        private void DisplayJoints(HandData handOutput, long timeStamp = 0)
        {
            if (_form.GetJointsState() || _form.GetSkeletonState() || _form.GetExtremitiesState())
            {
                //Iterate hands
                var nodes          = new JointData[][] { new JointData[0x20], new JointData[0x20] };
                var extremityNodes = new ExtremityData[][] { new ExtremityData[0x6], new ExtremityData[0x6] };

                int numOfHands = handOutput.NumberOfHands;

                if (numOfHands == 1)
                {
                    _mCursorPoints[1].Clear();
                }

                for (int i = 0; i < 2; i++)
                {
                    //Get hand by time of appearance
                    IHand handData;
                    if (handOutput.QueryHandData(AccessOrderType.ACCESS_ORDER_BY_TIME, i, out handData) == Status.STATUS_NO_ERROR)
                    {
                        if (handData != null)
                        {
                            var nodeIndex = handData.BodySide == BodySideType.BODY_SIDE_LEFT ? 0 : 1;
                            //Iterate Joints
                            foreach (var tJ in handData.TrackedJoints)
                            {
                                nodes[nodeIndex][(int)tJ.Key] = tJ.Value;
                            }   // end iterating over joints

                            // iterate over extremity points
                            if (_form.GetExtremitiesState())
                            {
                                for (int j = 0; j < HandData.NUMBER_OF_EXTREMITIES; j++)
                                {
                                    foreach (var eP in handData.ExtremityPoints)
                                    {
                                        extremityNodes[nodeIndex][(int)eP.Key] = eP.Value;
                                    }
                                }
                            }
                        }
                    }
                } // end iterating over hands


                _form.DisplayJoints(nodes, 2);
                if (numOfHands > 0)
                {
                    if (_form.GetExtremitiesState())
                    {
                        _form.DisplayExtremities(numOfHands, extremityNodes);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /* 显示当前帧手关节*/
        private void DisplayJoints(HandData handOutput, long timeStamp = 0)
        {
            if (_form.GetJointsState() || _form.GetSkeletonState() || _form.GetExtremitiesState())
            {
                //迭代手
                var nodes          = new JointData[][] { new JointData[0x20], new JointData[0x20] };
                var extremityNodes = new ExtremityData[][] { new ExtremityData[0x6], new ExtremityData[0x6] };

                int numOfHands = handOutput.NumberOfHands;

                if (numOfHands == 1)
                {
                    _mCursorPoints[1].Clear();
                }

                for (int i = 0; i < numOfHands; i++)
                {
                    //在出现的时候检测手
                    IHand handData;
                    if (handOutput.QueryHandData(AccessOrderType.ACCESS_ORDER_BY_TIME, i, out handData) == Status.STATUS_NO_ERROR)
                    {
                        if (handData != null)
                        {
                            //迭代手关节
                            foreach (var tJ in handData.TrackedJoints)
                            {
                                nodes[i][(int)tJ.Key] = tJ.Value;
                            }
                            // 手关节迭代结束

                            // 迭代手边缘点
                            if (_form.GetExtremitiesState())
                            {
                                for (int j = 0; j < HandData.NUMBER_OF_EXTREMITIES; j++)
                                {
                                    foreach (var eP in handData.ExtremityPoints)
                                    {
                                        extremityNodes[i][(int)eP.Key] = eP.Value;
                                    }
                                }
                            }
                        }
                    }
                } //迭代手结束


                _form.DisplayJoints(nodes, numOfHands);
                if (numOfHands > 0)
                {
                    if (_form.GetExtremitiesState())
                    {
                        _form.DisplayExtremities(numOfHands, extremityNodes);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 internal static pxcmStatus QueryExtremityPointINT(IntPtr instance, ExtremityType extremityLabel, out ExtremityData extremityPoint)
 {
     extremityPoint = new ExtremityData();
     return PXCMHandData_IHand_QueryExtremityPoint(instance, extremityLabel, extremityPoint);
 }
Ejemplo n.º 4
0
            /** 		
                 @brief Return the data of a specific extremity point
			
                 @param[in] extremityLabel - the id of the requested extremity point.
                 @param[out] extremityPoint - the location data of the requested extremity point.
			
                 @return PXC_STATUS_NO_ERROR - operation succeeded.
			
                 @see ExtremityType
                 @see ExtremityData
             */
            public pxcmStatus QueryExtremityPoint(ExtremityType extremityLabel, out ExtremityData extremityPoint)
            {
                return QueryExtremityPointINT(instance, extremityLabel, out extremityPoint);
            }
Ejemplo n.º 5
0
 /**
  *   @brief Return the data of a specific extremity point
  *
  *   @param[in] extremityLabel - the id of the requested extremity point.
  *   @param[out] extremityPoint - the location data of the requested extremity point.
  *
  *   @return PXC_STATUS_NO_ERROR - operation succeeded.
  *
  *   @see ExtremityType
  *   @see ExtremityData
  */
 public pxcmStatus QueryExtremityPoint(ExtremityType extremityLabel, out ExtremityData extremityPoint)
 {
     return(QueryExtremityPointINT(instance, extremityLabel, out extremityPoint));
 }
Ejemplo n.º 6
0
        internal static pxcmStatus QueryExtremityPointINT(IntPtr instance, ExtremityType extremityLabel, out ExtremityData extremityPoint)
        {
            extremityPoint = new ExtremityData();

            return(PXCMHandData_IHand_QueryExtremityPoint(instance, extremityLabel, extremityPoint));
        }
Ejemplo n.º 7
0
 private static extern pxcmStatus PXCMHandData_IHand_QueryExtremityPoint(IntPtr instance, ExtremityType extremityLabel, [Out] ExtremityData extremityPoint);