Inheritance: NodeWrapper
Beispiel #1
0
 public StateChangedEvent(ProductionNode node, RegisterFunc reg, UnregisterFunc unreg)
 {
     this.node = node;
     this.reg = reg;
     this.unreg = unreg;
     this.internalHandler = new OpenNIImporter.XnStateChangedHandler(InternalHandler);
 }
Beispiel #2
0
 private static IntPtr Create(Context context, CodecID codecID, ProductionNode initializer)
 {
     IntPtr nodeHandle;
     UInt32 status = OpenNIImporter.xnCreateCodec(context.InternalObject, codecID.InternalValue, initializer.InternalObject, out nodeHandle);
     WrapperUtils.CheckStatus(status);
     return nodeHandle;
 }
Beispiel #3
0
 public UserPositionCapability(ProductionNode node)
     : base(node)
 {
     this.userPositionChanged = new StateChangedEvent(node,
         OpenNIImporter.xnRegisterToUserPositionChange,
         OpenNIImporter.xnUnregisterFromUserPositionChange);
 }
Beispiel #4
0
 public CroppingCapability(ProductionNode node)
     : base(node)
 {
     this.croppingChanged = new StateChangedEvent(node,
         OpenNIImporter.xnRegisterToCroppingChange,
         OpenNIImporter.xnUnregisterFromCroppingChange);
 }
 public AlternativeViewPointCapability(ProductionNode node)
     : base(node)
 {
     this.viewPointChangedEvent = new StateChangedEvent(node,
         OpenNIImporter.xnRegisterToViewPointChange,
         OpenNIImporter.xnUnregisterFromViewPointChange);
 }
Beispiel #6
0
 public MirrorCapability(ProductionNode node)
     : base(node)
 {
     this.mirrorChangedEvent = new StateChangedEvent(node,
         OpenNIImporter.xnRegisterToMirrorChange,
         OpenNIImporter.xnUnregisterFromMirrorChange);
 }
 void skeletonCapability_CalibrationEnd(ProductionNode node, uint id, bool success)
 {
     if (success) {
         Debug.Log("Calibratoin ended successfully");
         skeletonCapability.StartTracking(id);
       	  	} else {
         poseDetectionCapability.StartPoseDetection(calibPose, id);
        	 	}
 }
            return OpenNIImporter.xnIsJointAvailable(this.InternalObject, joint);
        }
        public bool IsProfileAvailable(SkeletonProfile profile)
        {
            return OpenNIImporter.xnIsProfileAvailable(this.InternalObject, profile);
        }

        public void SetSkeletonProfile(SkeletonProfile profile)
        {
            UInt32 status = OpenNIImporter.xnSetSkeletonProfile(this.InternalObject, profile);
Beispiel #9
0
 void hands_HandCreate(ProductionNode node, uint id, ref Point3D position, float fTime)
 {
     Debug.Log ("hands_HandCreate(): Here");
     float x = position.X;
     float y = position.Y;
     float z = position.Z;
     Debug.Log ("hands_HandUpdate(): Position X: " + x + " Y: " + y + " Z: " + z);
     Vector3 pos = new Vector3(x * scale, y * scale, -z * scale);
     bias = pos;
 }
 //--------------------------------
 void gestures_GestureRecognized(ProductionNode node, string strGesture, ref Point3D idPosition, ref Point3D endPosition)
 {
     Debug.Log ("gestures_GestureRecognized(): Here");
     switch (strGesture) {
     case "Wave":
         handsGenerator.StartTracking (ref idPosition);
         break;
     default:
         break;
     }
 }
Beispiel #11
0
 void hands_HandUpdate(ProductionNode node, uint id, ref Point3D position, float fTime)
 {
     float x = position.X;
     float y = position.Y;
     float z = position.Z;
     //	Debug.Log ("hands_HandUpdate(): Position X: " + x + " Y: " + y + " Z: " + z);
     Vector3 pos = new Vector3(x * scale, y * scale, -z * scale);
     pos -= bias;
     //	if (pos.z > 0) pos.z = 0;
     hand.position = pos;
 }
 void skeletonCapbility_CalibrationEnd(ProductionNode node, uint id, bool success)
 {
     if (success)
     {
         this.skeletonCapbility.StartTracking(id);
         this.joints.Add(id, new Dictionary<SkeletonJoint, SkeletonJointPosition>());
     }
     else
     {
         this.poseDetectionCapability.StartPoseDetection(calibPose, id);
     }
 }
Beispiel #13
0
        public ProductionNode GetInstance()
        {
            IntPtr handle = OpenNIImporter.xnNodeInfoGetHandle(this.InternalObject);

            if (handle == IntPtr.Zero)
            {
                return(null);
            }
            else
            {
                return(ProductionNode.FromNative(handle));
            }
        }
Beispiel #14
0
 void _handGenerator_HandCreate(ProductionNode node, uint id, ref xn.Point3D position, float fTime)
 {
     if (_startTime == 0)
     {
         _traceHistory = new SortedList<float, xn.Point3D>();
         _startTime = fTime;
         _traceHistory.Add(0, position);
         _id = id;
         System.Diagnostics.Debug.WriteLine("Hand created");
     }
     else
     {
         _handsGenerator.StopTracking(id);
     }
 }
Beispiel #15
0
 void _handGenerator_HandUpdate(ProductionNode node, uint id, ref xn.Point3D position, float fTime)
 {
     if (id == _id)
     {
         float timeTracking = fTime - _startTime;
         _traceHistory.Add(timeTracking, position);
         CheckStatus();
         System.Diagnostics.Debug.WriteLine("Hand update for " + timeTracking);
     }
 }
 private void UserGenerator_LostUser(ProductionNode node, uint id)
 {
     this.playersInOrderOfAppearance.Remove(id);
     this.OnMessage("Lost player with Id " + id);
     this.OnUserLost();
 }
Beispiel #17
0
 void userGenerator_NewUser(ProductionNode node, uint id)
 {
     App.ViewModel.Status = "Waiting for pose...";
     App.ViewModel.User.UserId = id;
     this.poseDetectionCapability.StartPoseDetection(this.calibPose, id);
 }
Beispiel #18
0
 public void AddNodeToRecording(ProductionNode node)
 {
     AddNodeToRecording(node, CodecID.Null);
 }
Beispiel #19
0
 public UInt32 GetNumFrames(ProductionNode node)
 {
     return(GetNumFrames(node.GetName()));
 }
Beispiel #20
0
 void skeletonCapbility_CalibrationEnd(ProductionNode node, uint id, bool success)
 {
     if (success)
     {
         App.ViewModel.Status = "Tracking user";
         this.skeletonCapbility.StartTracking(id);
         App.ViewModel.Tracking = true;
     }
     else
     {
         App.ViewModel.Status = "Waiting for pose...";
         this.poseDetectionCapability.StartPoseDetection(calibPose, id);
     }
 }
 public PoseDetectionCapability(ProductionNode node)
     : base(node)
 {
     this.internalPoseDetected = new OpenNIImporter.XnPoseDetectionCallback(this.InternalPoseDetected);
     this.internalPoseEnded    = new OpenNIImporter.XnPoseDetectionCallback(this.InternalPoseEnded);
 }
Beispiel #22
0
 public void AddNodeToRecording(ProductionNode node)
 {
     AddNodeToRecording(node, CodecID.Null);
 }
        public void SetViewPoint(ProductionNode other)
        {
            UInt32 status = OpenNIImporter.xnSetViewPoint(this.InternalObject, other.InternalObject);

            WrapperUtils.CheckStatus(status);
        }
Beispiel #24
0
 public UInt32 TellFrame(ProductionNode node)
 {
     return(TellFrame(node.GetName()));
 }
Beispiel #25
0
        public void RemoveNeededNode(ProductionNode needed)
        {
            UInt32 status = OpenNIImporter.xnRemoveNeededNode(this.InternalObject, needed.InternalObject);

            WrapperUtils.CheckStatus(status);
        }
Beispiel #26
0
        public void AddNodeToRecording(ProductionNode node, CodecID codec)
        {
            UInt32 status = OpenNIImporter.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue);

            WrapperUtils.CheckStatus(status);
        }
 private void UserGenerator_NewUser(ProductionNode node, uint id)
 {
     this.playersInOrderOfAppearance.Add(id);
     this.OnMessage("New player detected and assigned Id " + id);
     this.OnUserFound();
 }
Beispiel #28
0
        public void RemoveNodeFromRecording(ProductionNode node)
        {
            UInt32 status = OpenNIImporter.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject);

            WrapperUtils.CheckStatus(status);
        }
Beispiel #29
0
 public void SeekToFrame(ProductionNode node, Int32 frameOffset, PlayerSeekOrigin origin)
 {
     SeekToFrame(node.GetName(), frameOffset, origin);
 }
 private void UserGenerator_NewUser(ProductionNode node, uint id)
 {
 }
Beispiel #31
0
 public Capability(ProductionNode node) :
     base(node.InternalObject, true)
 {
     this.node = node;
 }
Beispiel #32
0
 void poseDetectionCapability_PoseDetected(ProductionNode node, string pose, uint id)
 {
     App.ViewModel.Status = "Pose detected";
     this.poseDetectionCapability.StopPoseDetection(id);
     this.skeletonCapbility.RequestCalibration(id, true);
 }
Beispiel #33
0
 public Codec(Context context, CodecID codecID, ProductionNode initializer) :
     this(Create(context, codecID, initializer), false)
 {
 }
Beispiel #34
0
 void userGenerator_LostUser(ProductionNode node, uint id)
 {
     App.ViewModel.Status = "Lost user.";
     App.ViewModel.Tracking = false;
     this.ResetPoints();
 }
        void skeletonCapbility_CalibrationEnd(ProductionNode node, uint id, bool success)
        {
            if (success)
            {
                this.skeletonCapbility.StartTracking(id);
                this.joints.Add(id, new Dictionary<SkeletonJoint, SkeletonJointPosition>());

                FMessage[0] = "Calibration ended for user " + id.ToString();
            }
            else
            {
                this.poseDetectionCapability.StartPoseDetection(calibPose, id);
                FMessage[0] = "Pose detection for user  " + id.ToString();
            }
        }
Beispiel #36
0
 public void AddNodeToRecording(ProductionNode node, CodecID codec)
 {
     UInt32 status = OpenNIImporter.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue);
     WrapperUtils.CheckStatus(status);
 }
        void poseDetectionCapability_PoseDetected(ProductionNode node, string pose, uint id)
        {
            this.poseDetectionCapability.StopPoseDetection(id);
            this.skeletonCapbility.RequestCalibration(id, true);

            FMessage[0] = "Pose detected for user: " + id.ToString();
        }
Beispiel #38
0
 public void RemoveNodeFromRecording(ProductionNode node)
 {
     UInt32 status = OpenNIImporter.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject);
     WrapperUtils.CheckStatus(status);
 }
        void userGenerator_NewUser(ProductionNode node, uint id)
        {
            this.poseDetectionCapability.StartPoseDetection(this.calibPose, id);

            FMessage[0] = "New user: " + id.ToString();
        }
Beispiel #40
0
 void _handsGenerator_GenerationRunningChanged(ProductionNode node)
 {
 }
        void userGenerator_LostUser(ProductionNode node, uint id)
        {
            this.joints.Remove(id);

            FMessage[0] = "Lost user: " + id.ToString();
        }
Beispiel #42
0
 void _handGenerator_HandDestroy(ProductionNode node, uint id, float fTime)
 {
     if (id == _id)
     {
         _traceHistory = null;
         _startTime = 0;
         _isTracking = false;
         HandDestroyed(this, EventArgs.Empty);
     }
     System.Diagnostics.Debug.WriteLine("Hand destroy");
 }
 public bool IsViewPointAs(ProductionNode other)
 {
     return(OpenNIImporter.xnIsViewPointAs(this.InternalObject, other.InternalObject));
 }