Tanoda
Events.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9namespace Leap {
10 using LeapInternal;
11 using System;
12
17 public enum LeapEvent {
37 };
42 public class LeapEventArgs : EventArgs {
44 this.type = type;
45 }
46 public LeapEvent type { get; set; }
47 }
48
57 this.frame = frame;
58 }
59
60 public Frame frame { get; set; }
61 }
62
65 this.frame = frame;
66 }
67
68 public LEAP_TRACKING_EVENT frame { get; set; }
69 }
70
78 public class LogEventArgs : LeapEventArgs {
80 this.severity = severity;
81 this.message = message;
82 this.timestamp = timestamp;
83 }
84
85 public MessageSeverity severity { get; set; }
86 public Int64 timestamp { get; set; }
87 public string message { get; set; }
88 }
89
99 this.currentPolicies = currentPolicies;
100 this.oldPolicies = oldPolicies;
101 }
102
103 public UInt64 currentPolicies { get; set; }
104 public UInt64 oldPolicies { get; set; }
105 }
106
115 this.distortion = distortion;
116 this.camera = camera;
117 }
118 public DistortionData distortion { get; protected set; }
119 public Image.CameraType camera { get; protected set; }
120 }
121
129 public ConfigChangeEventArgs(string config_key, bool succeeded, uint requestId) : base(LeapEvent.EVENT_CONFIG_CHANGE) {
130 this.ConfigKey = config_key;
131 this.Succeeded = succeeded;
132 this.RequestId = requestId;
133 }
134 public string ConfigKey { get; set; }
135 public bool Succeeded { get; set; }
136 public uint RequestId { get; set; }
137
138 }
139
147 public SetConfigResponseEventArgs(string config_key, Config.ValueType dataType, object value, uint requestId) : base(LeapEvent.EVENT_CONFIG_RESPONSE) {
148 this.ConfigKey = config_key;
149 this.DataType = dataType;
150 this.Value = value;
151 this.RequestId = requestId;
152 }
153 public string ConfigKey { get; set; }
154 public Config.ValueType DataType { get; set; }
155 public object Value { get; set; }
156 public uint RequestId { get; set; }
157 }
158
165 }
166
173 }
174
183 this.Device = device;
184 }
185 public Device Device { get; set; }
186 }
187
196 public DeviceFailureEventArgs(uint code, string message, string serial) : base(LeapEvent.EVENT_DEVICE_FAILURE) {
197 ErrorCode = code;
198 ErrorMessage = message;
199 DeviceSerialNumber = serial;
200 }
201
202 public uint ErrorCode { get; set; }
203 public string ErrorMessage { get; set; }
204 public string DeviceSerialNumber { get; set; }
205 }
206
209 frameID = frame_id;
210 reason = type;
211 }
212
213 public Int64 frameID { get; set; }
214 public eLeapDroppedFrameType reason { get; set; }
215 }
216
225 this.image = image;
226 }
227
228 public Image image { get; set; }
229 }
230
238 this.frameID = frame_id;
239 this.timestamp = timestamp;
240 this.nPoints = nPoints;
241 }
242
243 public Int64 frameID { get; set; }
244 public Int64 timestamp { get; set; }
245 public UInt32 nPoints { get; set; }
246 }
247
249 public HeadPoseEventArgs(LEAP_VECTOR head_position, LEAP_QUATERNION head_orientation) : base(LeapEvent.EVENT_POINT_MAPPING_CHANGE) {
250 this.headPosition = head_position;
251 this.headOrientation = head_orientation;
252 }
253
254 public LEAP_VECTOR headPosition { get; set; }
255 public LEAP_QUATERNION headOrientation { get; set; }
256 }
257
259 public string threadName;
260 public string[] blockNames;
261
262 public BeginProfilingForThreadArgs(string threadName, params string[] blockNames) {
263 this.threadName = threadName;
264 this.blockNames = blockNames;
265 }
266 }
267
269
271 public string blockName;
272
274 this.blockName = blockName;
275 }
276 }
277
278 public struct EndProfilingBlockArgs {
279 public string blockName;
280
282 this.blockName = blockName;
283 }
284 }
285}
Dispatched when a configuration change is completed.
Definition: Events.cs:128
ConfigChangeEventArgs(string config_key, bool succeeded, uint requestId)
Definition: Events.cs:129
The Config class provides access to Leap Motion system configuration information.
Definition: Config.cs:20
ValueType
Enumerates the possible data types for configuration values.
Definition: Config.cs:164
Dispatched when the connection is established.
Definition: Events.cs:163
Dispatched when the connection is lost.
Definition: Events.cs:171
Dispatched when a device is plugged in.
Definition: Events.cs:181
DeviceEventArgs(Device device)
Definition: Events.cs:182
Dispatched when a device is plugged in, but fails to initialize or when a working device fails in use...
Definition: Events.cs:195
DeviceFailureEventArgs(uint code, string message, string serial)
Definition: Events.cs:196
The Device class represents a physically connected device.
Definition: Device.cs:29
The DistortionData class contains the distortion map for correcting the lens distortion of an image.
Dispatched when the image distortion map changes.
Definition: Events.cs:113
Image.CameraType camera
Definition: Events.cs:119
DistortionData distortion
Definition: Events.cs:118
DistortionEventArgs(DistortionData distortion, Image.CameraType camera)
Definition: Events.cs:114
eLeapDroppedFrameType reason
Definition: Events.cs:214
DroppedFrameEventArgs(Int64 frame_id, eLeapDroppedFrameType type)
Definition: Events.cs:208
Dispatched when a tracking frame is ready.
Definition: Events.cs:55
FrameEventArgs(Frame frame)
Definition: Events.cs:56
The Frame class represents a set of hand and finger tracking data detected in a single frame.
Definition: Frame.cs:24
LEAP_VECTOR headPosition
Definition: Events.cs:254
HeadPoseEventArgs(LEAP_VECTOR head_position, LEAP_QUATERNION head_orientation)
Definition: Events.cs:249
LEAP_QUATERNION headOrientation
Definition: Events.cs:255
Dispatched when an unrequested Image is ready.
Definition: Events.cs:223
ImageEventArgs(Image image)
Definition: Events.cs:224
The Image class represents a stereo image pair from the Leap Motion device.
Definition: Image.cs:20
CameraType
Definition: Image.cs:386
LEAP_TRACKING_EVENT frame
Definition: Events.cs:68
InternalFrameEventArgs(ref LEAP_TRACKING_EVENT frame)
Definition: Events.cs:64
A generic object with no arguments beyond the event type.
Definition: Events.cs:42
LeapEvent type
Definition: Events.cs:46
LeapEventArgs(LeapEvent type)
Definition: Events.cs:43
Dispatched when loggable events are generated by the service and the service connection code.
Definition: Events.cs:78
string message
Definition: Events.cs:87
Int64 timestamp
Definition: Events.cs:86
MessageSeverity severity
Definition: Events.cs:85
LogEventArgs(MessageSeverity severity, Int64 timestamp, string message)
Definition: Events.cs:79
Dispatched when point mapping change events are generated by the service.
Definition: Events.cs:236
PointMappingChangeEventArgs(Int64 frame_id, Int64 timestamp, UInt32 nPoints)
Definition: Events.cs:237
Dispatched when a policy change is complete.
Definition: Events.cs:97
UInt64 oldPolicies
Definition: Events.cs:104
PolicyEventArgs(UInt64 currentPolicies, UInt64 oldPolicies)
Definition: Events.cs:98
UInt64 currentPolicies
Definition: Events.cs:103
Dispatched when a configuration change is completed.
Definition: Events.cs:146
Config.ValueType DataType
Definition: Events.cs:154
SetConfigResponseEventArgs(string config_key, Config.ValueType dataType, object value, uint requestId)
Definition: Events.cs:147
MessageSeverity
Reports whether the message is for a severe failure, a recoverable warning, or a status change.
LeapEvent
An enumeration defining the types of Leap Motion events.
Definition: Events.cs:17
@ EVENT_CONFIG_RESPONSE
Response to a Config value request.
@ EVENT_INTERNAL_FRAME
An internal tracking frame has been received.
@ EVENT_FRAME
A tracking frame has been received.
@ EVENT_POLICY_CHANGE
A change in policy occurred.
@ EVENT_CONNECTION_LOST
The connection with the service has been lost.
@ EVENT_POINT_MAPPING_CHANGE
@ EVENT_IMAGE_COMPLETE
A requested image is available.
@ EVENT_CONNECTION
A connection event has occurred.
@ EVENT_DEVICE_FAILURE
A device failure event has occurred.
@ EVENT_DEVICE_LOST
Event asserted when the underlying device object has been lost.
@ EVENT_IMAGE_REQUEST_FAILED
A requested image could not be provided.
@ EVENT_LOG_EVENT
A diagnostic event has occurred.
@ EVENT_CONFIG_CHANGE
Success response to a Config value change.
@ EVENT_IMAGE
An unrequested image is available.
@ EVENT_DISTORTION_CHANGE
The distortion matrix used for image correction has changed.
@ EVENT_DEVICE
A device event has occurred.
eLeapDroppedFrameType
Definition: LeapC.cs:455
BeginProfilingBlockArgs(string blockName)
Definition: Events.cs:273
BeginProfilingForThreadArgs(string threadName, params string[] blockNames)
Definition: Events.cs:262
EndProfilingBlockArgs(string blockName)
Definition: Events.cs:281