internal AlternativeViewpointCapability(ProductionNode node)
     : base(node)
 {
     this.viewpointChangedEvent = new StateChangedEvent(node,
         SafeNativeMethods.xnRegisterToViewPointChange,
         SafeNativeMethods.xnUnregisterFromViewPointChange);
 }
Пример #2
0
 internal UserPositionCapability(ProductionNode node)
     : base(node)
 {
     this.userPositionChanged = new StateChangedEvent(node,
         SafeNativeMethods.xnRegisterToUserPositionChange,
         SafeNativeMethods.xnUnregisterFromUserPositionChange);
 }
Пример #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);
 }
Пример #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;
 }
Пример #5
0
		internal CroppingCapability(ProductionNode node) :
			base(node)
		{
			this.croppingChanged = new StateChangedEvent(node,
				SafeNativeMethods.xnRegisterToCroppingChange,
				SafeNativeMethods.xnUnregisterFromCroppingChange);
		}
Пример #6
0
		internal MirrorCapability(ProductionNode node) :
			base(node)
		{
			this.mirrorChangedEvent = new StateChangedEvent(node,
				SafeNativeMethods.xnRegisterToMirrorChange,
				SafeNativeMethods.xnUnregisterFromMirrorChange);
		}
Пример #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;
 }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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)
 {
 }
Пример #14
0
 public Int32 TellFrame(ProductionNode node)
 {
     return TellFrame(node.Name);
 }
Пример #15
0
 internal PoseDetectionCapability(ProductionNode node)
     : base(node)
 {
     this.internalPoseDetected = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseDetected);
     this.internalPoseEnded = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseEnded);
 }
Пример #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));
 }
Пример #19
0
 public Codec(Context context, CodecID codecID, ProductionNode initializer) :
     this(context, Create(context, codecID, initializer), false)
 {
 }
Пример #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
        }
Пример #21
0
        public void RemoveNodeFromRecording(ProductionNode node)
        {
            int status = SafeNativeMethods.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject);

            WrapperUtils.ThrowOnError(status);
        }
Пример #22
0
 public Capability(ProductionNode node) :
     base(node.InternalObject, true)
 {
     this.node = node;
 }
Пример #23
0
		public void RemoveNodeFromRecording(ProductionNode node)
		{
			int status = SafeNativeMethods.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject);
			WrapperUtils.ThrowOnError(status);
		}
Пример #24
0
		public void AddNodeToRecording(ProductionNode node)
		{
			AddNodeToRecording(node, CodecID.Null);
		}
Пример #25
0
		public void AddNodeToRecording(ProductionNode node, CodecID codec)
		{
			int status = SafeNativeMethods.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue);
			WrapperUtils.ThrowOnError(status);
		}
Пример #26
0
 public NodeCreatedEventArgs(ProductionNode createdNode)
 {
     this.createdNode = createdNode;
 }
Пример #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
		}
Пример #28
0
 public void AddNodeToRecording(ProductionNode node)
 {
     AddNodeToRecording(node, CodecID.Null);
 }
Пример #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);
        }
Пример #33
0
 public Codec(Context context, CodecID codecID, ProductionNode initializer)
     : this(context, Create(context, codecID, initializer), false)
 {
 }
Пример #34
0
		public void RemoveNeededNode(ProductionNode needed)
		{
			int status = SafeNativeMethods.xnRemoveNeededNode(this.InternalObject, needed.InternalObject);
			WrapperUtils.ThrowOnError(status);
		}
Пример #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);
 }
Пример #37
0
 internal HandTouchingFOVEdgeCapability(ProductionNode node)
     : base(node)
 {
     this.internalHandTouchingFOVEdge = new SafeNativeMethods.XnHandTouchingFOVEdge(this.InternalHandTouchingFOVEdge);
 }
Пример #38
0
 public NodeCreatedEventArgs(ProductionNode createdNode)
 {
     this.createdNode = createdNode;
 }
 public bool IsViewpointSupported(ProductionNode other)
 {
     return SafeNativeMethods.xnIsViewPointSupported(this.InternalObject, other.InternalObject);
 }
Пример #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
        }
Пример #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();
 }
Пример #42
0
 public Int32 GetNumFrames(ProductionNode node)
 {
     return GetNumFrames(node.Name);
 }
 public bool IsViewpointAs(ProductionNode other)
 {
     return(SafeNativeMethods.xnIsViewPointAs(this.InternalObject, other.InternalObject));
 }
Пример #44
0
 public void SeekToFrame(ProductionNode node, Int32 frameOffset, PlayerSeekOrigin origin)
 {
     SeekToFrame(node.Name, frameOffset, origin);
 }
Пример #45
0
 internal DeviceIdentificationCapability(ProductionNode node) :
     base(node)
 {
 }
Пример #46
0
 internal PoseDetectionCapability(ProductionNode node)
     : base(node)
 {
     this.internalPoseDetected = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseDetected);
     this.internalPoseEnded    = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseEnded);
 }