internal AlternativeViewpointCapability(ProductionNode node)
     : base(node)
 {
     this.viewpointChangedEvent = new StateChangedEvent(node,
         SafeNativeMethods.xnRegisterToViewPointChange,
         SafeNativeMethods.xnUnregisterFromViewPointChange);
 }
 internal UserPositionCapability(ProductionNode node)
     : base(node)
 {
     this.userPositionChanged = new StateChangedEvent(node,
         SafeNativeMethods.xnRegisterToUserPositionChange,
         SafeNativeMethods.xnUnregisterFromUserPositionChange);
 }
Example #3
0
 public StateChangedEvent(ProductionNode node, RegisterFunc reg, UnregisterFunc unreg)
 {
     this.node = node;
     this.reg = reg;
     this.unreg = unreg;
     this.internalHandler = new SafeNativeMethods.XnStateChangedHandler(InternalHandler);
 }
Example #4
0
 private static IntPtr Create(Context context, CodecID codecID, ProductionNode initializer)
 {
     IntPtr nodeHandle;
     int status = SafeNativeMethods.xnCreateCodec(context.InternalObject, codecID.InternalValue, initializer.InternalObject, out nodeHandle);
     WrapperUtils.ThrowOnError(status);
     return nodeHandle;
 }
Example #5
0
		internal CroppingCapability(ProductionNode node) :
			base(node)
		{
			this.croppingChanged = new StateChangedEvent(node,
				SafeNativeMethods.xnRegisterToCroppingChange,
				SafeNativeMethods.xnUnregisterFromCroppingChange);
		}
Example #6
0
		internal MirrorCapability(ProductionNode node) :
			base(node)
		{
			this.mirrorChangedEvent = new StateChangedEvent(node,
				SafeNativeMethods.xnRegisterToMirrorChange,
				SafeNativeMethods.xnUnregisterFromMirrorChange);
		}
Example #7
0
        internal GeneralIntCapability(ProductionNode node, string capabilityName)
            : base(node)
        {
            this.capabilityName = capabilityName;
            this.internalHandler = this.InternalHandler;

            int status = SafeNativeMethods.xnGetGeneralIntRange(this.InternalObject, this.capabilityName, out this.min, out this.max, out this.step, out this.defaultVal, out this.isAutoSupported);
            WrapperUtils.ThrowOnError(status);
        }
 public void GetPixelCoordinatesInViewpoint(ProductionNode viewpoint, int x, int y, out int altX, out int altY)
 {
     uint uAltX;
     uint uAltY;
     int status = SafeNativeMethods.xnGetPixelCoordinatesInViewPoint(this.InternalObject, viewpoint.InternalObject, (uint)x, (uint)y, out uAltX, out uAltY);
     WrapperUtils.ThrowOnError(status);
     altX = (int)uAltX;
     altY = (int)uAltY;
 }
Example #9
0
        internal SkeletonCapability(ProductionNode node)
            : base(node)
        {
            this.jointConfigurationChangedEvent = new StateChangedEvent(node,
                SafeNativeMethods.xnRegisterToJointConfigurationChange,
                SafeNativeMethods.xnUnregisterFromJointConfigurationChange);

            this.internalCalibrationStart = new SafeNativeMethods.XnCalibrationStart(this.InternalCalibrationStart);
            this.internalCalibrationEnd = new SafeNativeMethods.XnCalibrationEnd(this.InternalCalibrationEnd);
        }
Example #10
0
        public ProductionNode FindExistingNode(NodeType type)
        {
            IntPtr nodeHandle;
            int    status = SafeNativeMethods.xnFindExistingRefNodeByType(this.InternalObject, type, out nodeHandle);

            WrapperUtils.ThrowOnError(status);
            ProductionNode node = CreateProductionNodeObject(nodeHandle, type);

            // release the handle
            SafeNativeMethods.xnProductionNodeRelease(nodeHandle);

            return(node);
        }
Example #11
0
        public ProductionNode GetProductionNodeByName(string name)
        {
            IntPtr nodeHandle;
            int    status = SafeNativeMethods.xnGetRefNodeHandleByName(this.InternalObject, name, out nodeHandle);

            WrapperUtils.ThrowOnError(status);

            ProductionNode node = CreateProductionNodeObject(nodeHandle);

            // release the handle
            SafeNativeMethods.xnProductionNodeRelease(nodeHandle);

            return(node);
        }
Example #12
0
        public ProductionNode FindExistingNode(NodeType type)
        {
            IntPtr nodeHandle;
            int    status = SafeNativeMethods.xnFindExistingRefNodeByType(this.InternalObject, type, out nodeHandle);

            if (status != 0)
            {
                return(null);
            }

            ProductionNode node = CreateProductionNodeObject(nodeHandle, type);

            // release the handle
            SafeNativeMethods.xnProductionNodeRelease(nodeHandle);

            return(node);
        }
 internal DeviceIdentificationCapability(ProductionNode node) :
     base(node)
 {
 }
Example #14
0
 public Int32 TellFrame(ProductionNode node)
 {
     return TellFrame(node.Name);
 }
Example #15
0
 internal PoseDetectionCapability(ProductionNode node)
     : base(node)
 {
     this.internalPoseDetected = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseDetected);
     this.internalPoseEnded = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseEnded);
 }
Example #16
0
        private ProductionNode CreateProductionNodeObject(IntPtr nodeHandle, NodeType?type)
        {
            lock (this)
            {
                if (!this.allNodes.ContainsKey(nodeHandle))
                {
                    if (type == null)
                    {
                        IntPtr pNodeInfo = SafeNativeMethods.xnGetNodeInfo(nodeHandle);
                        type = SafeNativeMethods.xnNodeInfoGetDescription(pNodeInfo).Type;
                    }

                    ProductionNode node;

                    switch (type)
                    {
                    case NodeType.Device:
                        node = new Device(this, nodeHandle, true);
                        break;

                    case NodeType.Depth:
                        node = new DepthGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.Image:
                        node = new ImageGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.Audio:
                        node = new AudioGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.IR:
                        node = new IRGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.User:
                        node = new UserGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.Recorder:
                        node = new Recorder(this, nodeHandle, true);
                        break;

                    case NodeType.Player:
                        node = new Player(this, nodeHandle, true);
                        break;

                    case NodeType.Gesture:
                        node = new GestureGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.Scene:
                        node = new SceneAnalyzer(this, nodeHandle, true);
                        break;

                    case NodeType.Hands:
                        node = new HandsGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.Codec:
                        node = new Codec(this, nodeHandle, true);
                        break;

                    case NodeType.ProductionNode:
                        node = new ProductionNode(this, nodeHandle, true);
                        break;

                    case NodeType.Generator:
                        node = new Generator(this, nodeHandle, true);
                        break;

                    case NodeType.MapGenerator:
                        node = new MapGenerator(this, nodeHandle, true);
                        break;

                    case NodeType.ScriptNode:
                        node = new ScriptNode(this, nodeHandle, true);
                        break;

                    default:
                        throw new NotImplementedException("C# wrapper: Unknown generator type!");
                    }
                    this.allNodes[nodeHandle] = node;
                }

                return(this.allNodes[nodeHandle]);
            }             // lock
        }
 public void SeekToFrame(ProductionNode node, Int32 frameOffset, PlayerSeekOrigin origin)
 {
     SeekToFrame(node.Name, frameOffset, origin);
 }
 public Int32 TellFrame(ProductionNode node)
 {
     return(TellFrame(node.Name));
 }
Example #19
0
 public Codec(Context context, CodecID codecID, ProductionNode initializer) :
     this(context, Create(context, codecID, initializer), false)
 {
 }
Example #20
0
        private ProductionNode CreateProductionNodeObject(IntPtr nodeHandle, NodeType? type)
        {
            lock (this)
            {
                if (!this.allNodes.ContainsKey(nodeHandle))
                {
                    if (type == null)
                    {
                        IntPtr pNodeInfo = SafeNativeMethods.xnGetNodeInfo(nodeHandle);
                        type = NodeInfo.FromNative(pNodeInfo).Description.Type;
                    }

                    ProductionNode node;

                    switch (type)
                    {
                        case NodeType.Device:
                            node = new Device(this, nodeHandle, true);
                            break;
                        case NodeType.Depth:
                            node = new DepthGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.Image:
                            node = new ImageGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.Audio:
                            node = new AudioGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.IR:
                            node = new IRGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.User:
                            node = new UserGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.Recorder:
                            node = new Recorder(this, nodeHandle, true);
                            break;
                        case NodeType.Player:
                            node = new Player(this, nodeHandle, true);
                            break;
                        case NodeType.Gesture:
                            node = new GestureGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.Scene:
                            node = new SceneAnalyzer(this, nodeHandle, true);
                            break;
                        case NodeType.Hands:
                            node = new HandsGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.Codec:
                            node = new Codec(this, nodeHandle, true);
                            break;
                        case NodeType.ProductionNode:
                            node = new ProductionNode(this, nodeHandle, true);
                            break;
                        case NodeType.Generator:
                            node = new Generator(this, nodeHandle, true);
                            break;
                        case NodeType.MapGenerator:
                            node = new MapGenerator(this, nodeHandle, true);
                            break;
                        case NodeType.ScriptNode:
                            node = new ScriptNode(this, nodeHandle, true);
                            break;
                        default:
                            throw new NotImplementedException("C# wrapper: Unknown generator type!");
                    }
                    this.allNodes[nodeHandle] = node;
                }

                return this.allNodes[nodeHandle];
            } // lock
        }
Example #21
0
        public void RemoveNodeFromRecording(ProductionNode node)
        {
            int status = SafeNativeMethods.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject);

            WrapperUtils.ThrowOnError(status);
        }
Example #22
0
 public Capability(ProductionNode node) :
     base(node.InternalObject, true)
 {
     this.node = node;
 }
Example #23
0
		public void RemoveNodeFromRecording(ProductionNode node)
		{
			int status = SafeNativeMethods.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject);
			WrapperUtils.ThrowOnError(status);
		}
Example #24
0
		public void AddNodeToRecording(ProductionNode node)
		{
			AddNodeToRecording(node, CodecID.Null);
		}
Example #25
0
		public void AddNodeToRecording(ProductionNode node, CodecID codec)
		{
			int status = SafeNativeMethods.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue);
			WrapperUtils.ThrowOnError(status);
		}
Example #26
0
 public NodeCreatedEventArgs(ProductionNode createdNode)
 {
     this.createdNode = createdNode;
 }
Example #27
0
		private ProductionNode CreateProductionNodeObject(IntPtr nodeHandle, NodeType? type)
		{
			lock (this)
			{
				if (!this.allNodes.ContainsKey(nodeHandle))
				{
					if (type == null)
					{
						IntPtr pNodeInfo = SafeNativeMethods.xnGetNodeInfo(nodeHandle);
                        type = NodeInfo.FromNative(pNodeInfo).Description.Type;
					}

					ProductionNode node;

                   	// start with concrete types
                    if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Device))
                    {
                        node = new Device(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Depth))
                    {
                        node = new DepthGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Image))
                    {
                        node = new ImageGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Audio))
                    {
                        node = new AudioGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.IR))
                    {
                        node = new IRGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.User))
                    {
                        node = new UserGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Recorder))
                    {
                        node = new Recorder(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Player))
                    {
                        node = new Player(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Gesture))
                    {
                        node = new GestureGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Scene))
                    {
                        node = new SceneAnalyzer(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Hands))
                    {
                        node = new HandsGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Codec))
                    {
                        node = new Codec(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.ScriptNode))
                    {
                        node = new ScriptNode(this, nodeHandle, true);
                    }
                    // move on to abstract types
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.MapGenerator))
                    {
                        node = new MapGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Generator))
                    {
                        node = new Generator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.ProductionNode))
                    {
                        node = new ProductionNode(this, nodeHandle, true);
                    }
                    else
                    {
                        throw new NotImplementedException("C# wrapper: Unknown generator type!");
                    }

					this.allNodes[nodeHandle] = node;
				}

				return this.allNodes[nodeHandle];
			} // lock
		}
Example #28
0
 public void AddNodeToRecording(ProductionNode node)
 {
     AddNodeToRecording(node, CodecID.Null);
 }
Example #29
0
        public void RemoveNeededNode(ProductionNode needed)
        {
            int status = SafeNativeMethods.xnRemoveNeededNode(this.InternalObject, needed.InternalObject);

            WrapperUtils.ThrowOnError(status);
        }
 public void SetViewpoint(ProductionNode other)
 {
     int status = SafeNativeMethods.xnSetViewPoint(this.InternalObject, other.InternalObject);
     WrapperUtils.ThrowOnError(status);
 }
 public Int32 GetNumFrames(ProductionNode node)
 {
     return(GetNumFrames(node.Name));
 }
        public void SetViewpoint(ProductionNode other)
        {
            int status = SafeNativeMethods.xnSetViewPoint(this.InternalObject, other.InternalObject);

            WrapperUtils.ThrowOnError(status);
        }
Example #33
0
 public Codec(Context context, CodecID codecID, ProductionNode initializer)
     : this(context, Create(context, codecID, initializer), false)
 {
 }
Example #34
0
		public void RemoveNeededNode(ProductionNode needed)
		{
			int status = SafeNativeMethods.xnRemoveNeededNode(this.InternalObject, needed.InternalObject);
			WrapperUtils.ThrowOnError(status);
		}
Example #35
0
        public void AddNodeToRecording(ProductionNode node, CodecID codec)
        {
            int status = SafeNativeMethods.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue);

            WrapperUtils.ThrowOnError(status);
        }
 internal HandTouchingFOVEdgeCapability(ProductionNode node)
     : base(node)
 {
     this.internalHandTouchingFOVEdge = new SafeNativeMethods.XnHandTouchingFOVEdge(this.InternalHandTouchingFOVEdge);
 }
Example #37
0
 internal HandTouchingFOVEdgeCapability(ProductionNode node)
     : base(node)
 {
     this.internalHandTouchingFOVEdge = new SafeNativeMethods.XnHandTouchingFOVEdge(this.InternalHandTouchingFOVEdge);
 }
Example #38
0
 public NodeCreatedEventArgs(ProductionNode createdNode)
 {
     this.createdNode = createdNode;
 }
 public bool IsViewpointSupported(ProductionNode other)
 {
     return SafeNativeMethods.xnIsViewPointSupported(this.InternalObject, other.InternalObject);
 }
Example #40
0
        private ProductionNode CreateProductionNodeObject(IntPtr nodeHandle, NodeType?type)
        {
            lock (this)
            {
                if (!this.allNodes.ContainsKey(nodeHandle))
                {
                    if (type == null)
                    {
                        IntPtr pNodeInfo = SafeNativeMethods.xnGetNodeInfo(nodeHandle);
                        type = NodeInfo.FromNative(pNodeInfo).Description.Type;
                    }

                    ProductionNode node;

                    // start with concrete types
                    if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Device))
                    {
                        node = new Device(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Depth))
                    {
                        node = new DepthGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Image))
                    {
                        node = new ImageGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Audio))
                    {
                        node = new AudioGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.IR))
                    {
                        node = new IRGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.User))
                    {
                        node = new UserGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Recorder))
                    {
                        node = new Recorder(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Player))
                    {
                        node = new Player(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Gesture))
                    {
                        node = new GestureGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Scene))
                    {
                        node = new SceneAnalyzer(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Hands))
                    {
                        node = new HandsGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Codec))
                    {
                        node = new Codec(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.ScriptNode))
                    {
                        node = new ScriptNode(this, nodeHandle, true);
                    }
                    // move on to abstract types
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.MapGenerator))
                    {
                        node = new MapGenerator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.Generator))
                    {
                        node = new Generator(this, nodeHandle, true);
                    }
                    else if (SafeNativeMethods.xnIsTypeDerivedFrom(type.Value, NodeType.ProductionNode))
                    {
                        node = new ProductionNode(this, nodeHandle, true);
                    }
                    else
                    {
                        throw new NotImplementedException("C# wrapper: Unknown generator type!");
                    }

                    this.allNodes[nodeHandle] = node;
                }

                return(this.allNodes[nodeHandle]);
            }             // lock
        }
Example #41
0
 /// @brief Used to release an added node
 /// 
 /// This will release an added node from the context.
 /// @note - It is the responsibility of the caller to call this only on nodes created using the @ref CreateNode
 /// method and only when the context is valid! This method should be called on every node created BEFORE
 /// calling @ref Dispose.
 ///
 /// @param node The node to release
 public void ReleaseNode(ProductionNode node)
 {
     Log("disposing type=" + node.GetType(), NIEventLogger.Categories.Initialization, NIEventLogger.Sources.BaseObjects, NIEventLogger.VerboseLevel.Verbose);
     // note no need to stop generating a generator because disposing will do it for us.
     node.Dispose();
 }
Example #42
0
 public Int32 GetNumFrames(ProductionNode node)
 {
     return GetNumFrames(node.Name);
 }
 public bool IsViewpointAs(ProductionNode other)
 {
     return(SafeNativeMethods.xnIsViewPointAs(this.InternalObject, other.InternalObject));
 }
Example #44
0
 public void SeekToFrame(ProductionNode node, Int32 frameOffset, PlayerSeekOrigin origin)
 {
     SeekToFrame(node.Name, frameOffset, origin);
 }
Example #45
0
 internal DeviceIdentificationCapability(ProductionNode node) :
     base(node)
 {
 }
 internal PoseDetectionCapability(ProductionNode node)
     : base(node)
 {
     this.internalPoseDetected = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseDetected);
     this.internalPoseEnded    = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseEnded);
 }