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); }
public StateChangedEvent(ProductionNode node, RegisterFunc reg, UnregisterFunc unreg) { this.node = node; this.reg = reg; this.unreg = unreg; this.internalHandler = new SafeNativeMethods.XnStateChangedHandler(InternalHandler); }
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; }
internal CroppingCapability(ProductionNode node) : base(node) { this.croppingChanged = new StateChangedEvent(node, SafeNativeMethods.xnRegisterToCroppingChange, SafeNativeMethods.xnUnregisterFromCroppingChange); }
internal MirrorCapability(ProductionNode node) : base(node) { this.mirrorChangedEvent = new StateChangedEvent(node, SafeNativeMethods.xnRegisterToMirrorChange, SafeNativeMethods.xnUnregisterFromMirrorChange); }
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; }
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); }
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); }
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); }
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) { }
public Int32 TellFrame(ProductionNode node) { return TellFrame(node.Name); }
internal PoseDetectionCapability(ProductionNode node) : base(node) { this.internalPoseDetected = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseDetected); this.internalPoseEnded = new SafeNativeMethods.XnPoseDetectionCallback(this.InternalPoseEnded); }
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)); }
public Codec(Context context, CodecID codecID, ProductionNode initializer) : this(context, Create(context, codecID, initializer), false) { }
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 }
public void RemoveNodeFromRecording(ProductionNode node) { int status = SafeNativeMethods.xnRemoveNodeFromRecording(this.InternalObject, node.InternalObject); WrapperUtils.ThrowOnError(status); }
public Capability(ProductionNode node) : base(node.InternalObject, true) { this.node = node; }
public void AddNodeToRecording(ProductionNode node) { AddNodeToRecording(node, CodecID.Null); }
public void AddNodeToRecording(ProductionNode node, CodecID codec) { int status = SafeNativeMethods.xnAddNodeToRecording(this.InternalObject, node.InternalObject, codec.InternalValue); WrapperUtils.ThrowOnError(status); }
public NodeCreatedEventArgs(ProductionNode createdNode) { this.createdNode = createdNode; }
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 }
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)); }
internal HandTouchingFOVEdgeCapability(ProductionNode node) : base(node) { this.internalHandTouchingFOVEdge = new SafeNativeMethods.XnHandTouchingFOVEdge(this.InternalHandTouchingFOVEdge); }
public bool IsViewpointSupported(ProductionNode other) { return SafeNativeMethods.xnIsViewPointSupported(this.InternalObject, other.InternalObject); }
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 }
/// @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(); }
public Int32 GetNumFrames(ProductionNode node) { return GetNumFrames(node.Name); }
public bool IsViewpointAs(ProductionNode other) { return(SafeNativeMethods.xnIsViewPointAs(this.InternalObject, other.InternalObject)); }