public License[] EnumerateLicenses() { IntPtr pArray; uint size; int status = SafeNativeMethods.xnEnumerateLicenses(this.InternalObject, out pArray, out size); WrapperUtils.ThrowOnError(status); License[] result = null; try { result = new License[size]; IntPtr ptr = pArray; for (int i = 0; i < size; ++i) { result[i] = (License)Marshal.PtrToStructure(ptr, typeof(License)); ptr = (IntPtr)(ptr.ToInt64() + Marshal.SizeOf(typeof(License))); } } finally { SafeNativeMethods.xnFreeLicensesList(pArray); } return(result); }
public void AddNodeFromList(IEnumerator <NodeInfo> current) { NodeInfoListEnumerator enumer = (NodeInfoListEnumerator)current; int status = SafeNativeMethods.xnNodeInfoListAddNodeFromList(this.InternalObject, enumer.InternalObject); WrapperUtils.ThrowOnError(status); }
public void Remove(IEnumerator <NodeInfo> location) { NodeInfoListEnumerator enumer = (NodeInfoListEnumerator)location; int status = SafeNativeMethods.xnNodeInfoListRemove(this.InternalObject, enumer.InternalObject); WrapperUtils.ThrowOnError(status); }
private Context(IntPtr pContext, bool addRef) : base(pContext) { this.errorStateChangedHandler = this.ErrorStateChangedCallback; this.nodeCreationHandler = this.NodeCreationCallback; this.nodeDestructionHandler = this.NodeDestructionCallback; lock (Context.staticLock) { if (Context.allContexts.ContainsKey(pContext)) { throw new GeneralException("C# wrapper: creating a Context object wrapping an already wrapped object!"); } Context.allContexts.Add(pContext, this); } if (addRef) { WrapperUtils.ThrowOnError(SafeNativeMethods.xnContextAddRef(pContext)); } this.shutdownHandler = OnContextShuttingDown; WrapperUtils.ThrowOnError(SafeNativeMethods.xnContextRegisterForShutdown(pContext, this.shutdownHandler, IntPtr.Zero, out this.shutdownCallbackHandle)); }
public void Add(ProductionNodeDescription description, string creationInfo, NodeInfoList neededNodes) { int status = SafeNativeMethods.xnNodeInfoListAdd(this.InternalObject, description, creationInfo, neededNodes == null ? IntPtr.Zero : neededNodes.InternalObject); WrapperUtils.ThrowOnError(status); }
public void OpenFileRecording(string fileName) { this.usingDeprecatedAPI = true; int status = SafeNativeMethods.xnContextOpenFileRecording(this.InternalObject, fileName); WrapperUtils.ThrowOnError(status); }
public Point3D GetCoM(UserID id) { Point3D com = new Point3D(); int status = SafeNativeMethods.xnGetUserCoM(this.InternalObject, id, out com); WrapperUtils.ThrowOnError(status); return(com); }
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); }
public int DecodeData(IntPtr source, int sourceSize, IntPtr destination, int destinationSize) { UInt32 written; int status = SafeNativeMethods.xnDecodeData(this.InternalObject, source, (UInt32)sourceSize, destination, (UInt32)destinationSize, out written); WrapperUtils.ThrowOnError(status); return((int)written); }
private static IntPtr Create() { IntPtr pErrors; int status = SafeNativeMethods.xnEnumerationErrorsAllocate(out pErrors); WrapperUtils.ThrowOnError(status); return(pErrors); }
public ProductionNode GetProductionNodeByName(string name) { IntPtr nodeHandle; int status = SafeNativeMethods.xnGetNodeHandleByName(this.InternalObject, name, out nodeHandle); WrapperUtils.ThrowOnError(status); return(CreateProductionNodeObject(nodeHandle)); }
private static IntPtr Create(Context context, string format) { IntPtr nodeHandle; int status = SafeNativeMethods.xnCreateScriptNode(context.InternalObject, format, out nodeHandle); WrapperUtils.ThrowOnError(status); return(nodeHandle); }
public Int32 GetNumFrames(string nodeName) { UInt32 frames; int status = SafeNativeMethods.xnGetPlayerNumFrames(this.InternalObject, nodeName, out frames); WrapperUtils.ThrowOnError(status); return((Int32)frames); }
public Int64 GetIntProperty(string propName) { UInt64 value; int status = SafeNativeMethods.xnGetIntProperty(this.InternalObject, propName, out value); WrapperUtils.ThrowOnError(status); return((Int64)value); }
public ProductionNode OpenFileRecordingEx(string fileName) { IntPtr hPlayer; int status = SafeNativeMethods.xnContextOpenFileRecordingEx(this.InternalObject, fileName, out hPlayer); WrapperUtils.ThrowOnError(status); return(new Player(this, hPlayer, false)); }
public BoundingBox3D GetPosition(int index) { BoundingBox3D pos = new BoundingBox3D(); int status = SafeNativeMethods.xnGetUserPosition(this.InternalObject, (uint)index, ref pos); WrapperUtils.ThrowOnError(status); return(pos); }
public Point3D[] ConvertRealWorldToProjective(Point3D[] realWorldPoints) { Point3D[] projective = new Point3D[realWorldPoints.Length]; int status = SafeNativeMethods.xnConvertRealWorldToProjective(this.InternalObject, (uint)realWorldPoints.Length, realWorldPoints, projective); WrapperUtils.ThrowOnError(status); return(projective); }
public Point3D[] ConvertProjectiveToRealWorld(Point3D[] projectivePoints) { Point3D[] realWorld = new Point3D[projectivePoints.Length]; int status = SafeNativeMethods.xnConvertProjectiveToRealWorld(this.InternalObject, (uint)projectivePoints.Length, projectivePoints, realWorld); WrapperUtils.ThrowOnError(status); return(realWorld); }
public LockHandle LockForChanges() { int handle; int status = SafeNativeMethods.xnLockNodeForChanges(this.InternalObject, out handle); WrapperUtils.ThrowOnError(status); return(new LockHandle(handle)); }
public double GetRealProperty(string propName) { double value; int status = SafeNativeMethods.xnGetRealProperty(this.InternalObject, propName, out value); WrapperUtils.ThrowOnError(status); return(value); }
public Int64 TellTimestamp() { UInt64 timestamp; int status = SafeNativeMethods.xnTellPlayerTimestamp(this.InternalObject, out timestamp); WrapperUtils.ThrowOnError(status); return((Int64)timestamp); }
public ProductionNode OpenFileRecordingEx(string fileName) { IntPtr hScriptNode; int status = SafeNativeMethods.xnContextOpenFileRecordingEx(this.InternalObject, fileName, out hScriptNode); WrapperUtils.ThrowOnError(status); return(CreateProductionNodeFromNative(hScriptNode)); }
public SkeletonJointOrientation GetSkeletonJointOrientation(UserID user, SkeletonJoint joint) { SkeletonJointOrientation orientation = new SkeletonJointOrientation(); int status = SafeNativeMethods.xnGetSkeletonJointOrientation(this.InternalObject, user, joint, ref orientation); WrapperUtils.ThrowOnError(status); return(orientation); }
public ProductionNode CreateProductionTree(NodeInfo nodeInfo) { IntPtr nodeHandle; int status = SafeNativeMethods.xnCreateProductionTree(this.InternalObject, nodeInfo.InternalObject, out nodeHandle); WrapperUtils.ThrowOnError(status); return(CreateProductionNodeObject(nodeHandle, nodeInfo.Description.Type)); }
public Int32 TellFrame(string nodeName) { UInt32 frame; int status = SafeNativeMethods.xnTellPlayerFrame(this.InternalObject, nodeName, out frame); WrapperUtils.ThrowOnError(status); return((Int32)frame); }
public NodeInfoList EnumerateExistingNodes(NodeType type) { IntPtr pList; int status = SafeNativeMethods.xnEnumerateExistingNodesByType(this.InternalObject, type, out pList); WrapperUtils.ThrowOnError(status); return(new NodeInfoList(pList)); }
static private IntPtr Create() { IntPtr pQuery; int status = SafeNativeMethods.xnNodeQueryAllocate(out pQuery); WrapperUtils.ThrowOnError(status); return(pQuery); }
private static IntPtr Init() { IntPtr pContext; int status = SafeNativeMethods.xnInit(out pContext); WrapperUtils.ThrowOnError(status); return(pContext); }
private static IntPtr Create(Context context, string name) { IntPtr handle; int status = SafeNativeMethods.xnCreateMockNode(context.InternalObject, NodeType.Audio, name, out handle); WrapperUtils.ThrowOnError(status); return(handle); }
public ProductionNode FindExistingNode(NodeType type) { IntPtr nodeHandle; int status = SafeNativeMethods.xnFindExistingNodeByType(this.InternalObject, type, out nodeHandle); WrapperUtils.ThrowOnError(status); return(CreateProductionNodeObject(nodeHandle, type)); }