react-native-nitro-pose-exercises 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/NitroPoseExercises.podspec +32 -0
- package/README.md +538 -0
- package/android/CMakeLists.txt +31 -0
- package/android/build.gradle +121 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercises.kt +535 -0
- package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercisesPackage.kt +22 -0
- package/ios/NitroPoseExercises.swift +527 -0
- package/lib/module/NitroPoseExercises.nitro.js +17 -0
- package/lib/module/NitroPoseExercises.nitro.js.map +1 -0
- package/lib/module/config/pushup.js +71 -0
- package/lib/module/config/pushup.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NitroPoseExercises.nitro.d.ts +97 -0
- package/lib/typescript/src/NitroPoseExercises.nitro.d.ts.map +1 -0
- package/lib/typescript/src/config/pushup.d.ts +3 -0
- package/lib/typescript/src/config/pushup.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JAngleDefinition.hpp +69 -0
- package/nitrogen/generated/android/c++/JAngleSnapshot.hpp +61 -0
- package/nitrogen/generated/android/c++/JExerciseConfig.hpp +166 -0
- package/nitrogen/generated/android/c++/JExercisePhase.hpp +67 -0
- package/nitrogen/generated/android/c++/JExerciseType.hpp +61 -0
- package/nitrogen/generated/android/c++/JFormFeedback.hpp +67 -0
- package/nitrogen/generated/android/c++/JFormRule.hpp +79 -0
- package/nitrogen/generated/android/c++/JFormSeverity.hpp +61 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_ExercisePhase.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_FormFeedback.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_HoldProgress.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_RepData.hpp +81 -0
- package/nitrogen/generated/android/c++/JFunc_void_SessionResult.hpp +85 -0
- package/nitrogen/generated/android/c++/JHoldProgress.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNitroPoseExercisesSpec.cpp +311 -0
- package/nitrogen/generated/android/c++/JHybridNitroPoseExercisesSpec.hpp +87 -0
- package/nitrogen/generated/android/c++/JLandmark.hpp +69 -0
- package/nitrogen/generated/android/c++/JPhaseThreshold.hpp +71 -0
- package/nitrogen/generated/android/c++/JRepData.hpp +90 -0
- package/nitrogen/generated/android/c++/JSessionResult.hpp +120 -0
- package/nitrogen/generated/android/c++/JSessionStatus.hpp +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/AngleDefinition.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/AngleSnapshot.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExerciseConfig.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExercisePhase.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExerciseType.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/FormFeedback.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/FormRule.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/FormSeverity.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_ExercisePhase.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_FormFeedback.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_HoldProgress.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_RepData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Func_void_SessionResult.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/HoldProgress.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/HybridNitroPoseExercisesSpec.kt +196 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/Landmark.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/PhaseThreshold.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/RepData.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/SessionResult.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/SessionStatus.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/nitroposeexercisesOnLoad.kt +35 -0
- package/nitrogen/generated/android/nitroposeexercises+autolinking.cmake +81 -0
- package/nitrogen/generated/android/nitroposeexercises+autolinking.gradle +27 -0
- package/nitrogen/generated/android/nitroposeexercisesOnLoad.cpp +66 -0
- package/nitrogen/generated/android/nitroposeexercisesOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/NitroPoseExercises+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Bridge.cpp +100 -0
- package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Bridge.hpp +449 -0
- package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Umbrella.hpp +95 -0
- package/nitrogen/generated/ios/NitroPoseExercisesAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroPoseExercisesAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridNitroPoseExercisesSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroPoseExercisesSpecSwift.hpp +236 -0
- package/nitrogen/generated/ios/swift/AngleDefinition.swift +44 -0
- package/nitrogen/generated/ios/swift/AngleSnapshot.swift +34 -0
- package/nitrogen/generated/ios/swift/ExerciseConfig.swift +83 -0
- package/nitrogen/generated/ios/swift/ExercisePhase.swift +52 -0
- package/nitrogen/generated/ios/swift/ExerciseType.swift +44 -0
- package/nitrogen/generated/ios/swift/FormFeedback.swift +39 -0
- package/nitrogen/generated/ios/swift/FormRule.swift +54 -0
- package/nitrogen/generated/ios/swift/FormSeverity.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_ExercisePhase.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_FormFeedback.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_HoldProgress.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_RepData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_SessionResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/HoldProgress.swift +39 -0
- package/nitrogen/generated/ios/swift/HybridNitroPoseExercisesSpec.swift +73 -0
- package/nitrogen/generated/ios/swift/HybridNitroPoseExercisesSpec_cxx.swift +483 -0
- package/nitrogen/generated/ios/swift/Landmark.swift +44 -0
- package/nitrogen/generated/ios/swift/PhaseThreshold.swift +44 -0
- package/nitrogen/generated/ios/swift/RepData.swift +50 -0
- package/nitrogen/generated/ios/swift/SessionResult.swift +66 -0
- package/nitrogen/generated/ios/swift/SessionStatus.swift +52 -0
- package/nitrogen/generated/shared/c++/AngleDefinition.hpp +95 -0
- package/nitrogen/generated/shared/c++/AngleSnapshot.hpp +87 -0
- package/nitrogen/generated/shared/c++/ExerciseConfig.hpp +122 -0
- package/nitrogen/generated/shared/c++/ExercisePhase.hpp +88 -0
- package/nitrogen/generated/shared/c++/ExerciseType.hpp +80 -0
- package/nitrogen/generated/shared/c++/FormFeedback.hpp +93 -0
- package/nitrogen/generated/shared/c++/FormRule.hpp +105 -0
- package/nitrogen/generated/shared/c++/FormSeverity.hpp +80 -0
- package/nitrogen/generated/shared/c++/HoldProgress.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridNitroPoseExercisesSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridNitroPoseExercisesSpec.hpp +117 -0
- package/nitrogen/generated/shared/c++/Landmark.hpp +95 -0
- package/nitrogen/generated/shared/c++/PhaseThreshold.hpp +97 -0
- package/nitrogen/generated/shared/c++/RepData.hpp +97 -0
- package/nitrogen/generated/shared/c++/SessionResult.hpp +108 -0
- package/nitrogen/generated/shared/c++/SessionStatus.hpp +88 -0
- package/package.json +187 -0
- package/src/NitroPoseExercises.nitro.ts +155 -0
- package/src/config/pushup.ts +62 -0
- package/src/index.tsx +28 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroPoseExercisesSpec_cxx.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
import VisionCamera
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A class implementation that bridges HybridNitroPoseExercisesSpec over to C++.
|
|
13
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
14
|
+
*
|
|
15
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
16
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
17
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
|
+
*/
|
|
20
|
+
open class HybridNitroPoseExercisesSpec_cxx {
|
|
21
|
+
/**
|
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::nitroposeexercises::bridge::swift`)
|
|
23
|
+
* from `NitroPoseExercises-Swift-Cxx-Bridge.hpp`.
|
|
24
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
25
|
+
*/
|
|
26
|
+
public typealias bridge = margelo.nitro.nitroposeexercises.bridge.swift
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Holds an instance of the `HybridNitroPoseExercisesSpec` Swift protocol.
|
|
30
|
+
*/
|
|
31
|
+
private var __implementation: any HybridNitroPoseExercisesSpec
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
|
+
*/
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridNitroPoseExercisesSpec_
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Create a new `HybridNitroPoseExercisesSpec_cxx` that wraps the given `HybridNitroPoseExercisesSpec`.
|
|
40
|
+
* All properties and methods bridge to C++ types.
|
|
41
|
+
*/
|
|
42
|
+
public init(_ implementation: any HybridNitroPoseExercisesSpec) {
|
|
43
|
+
self.__implementation = implementation
|
|
44
|
+
self.__cxxPart = .init()
|
|
45
|
+
/* no base class */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the actual `HybridNitroPoseExercisesSpec` instance this class wraps.
|
|
50
|
+
*/
|
|
51
|
+
@inline(__always)
|
|
52
|
+
public func getHybridNitroPoseExercisesSpec() -> any HybridNitroPoseExercisesSpec {
|
|
53
|
+
return __implementation
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
58
|
+
* This acquires one additional strong reference on the object!
|
|
59
|
+
*/
|
|
60
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
61
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Casts an unsafe pointer to a `HybridNitroPoseExercisesSpec_cxx`.
|
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNitroPoseExercisesSpec_cxx>`.
|
|
67
|
+
* This removes one strong reference from the object!
|
|
68
|
+
*/
|
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNitroPoseExercisesSpec_cxx {
|
|
70
|
+
return Unmanaged<HybridNitroPoseExercisesSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridNitroPoseExercisesSpec>`.
|
|
76
|
+
*/
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridNitroPoseExercisesSpec_ {
|
|
78
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
80
|
+
return cachedCxxPart
|
|
81
|
+
} else {
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridNitroPoseExercisesSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridNitroPoseExercisesSpec_(newCxxPart)
|
|
84
|
+
return newCxxPart
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
92
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
93
|
+
*/
|
|
94
|
+
@inline(__always)
|
|
95
|
+
public var memorySize: Int {
|
|
96
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Compares this object with the given [other] object for reference equality.
|
|
101
|
+
*/
|
|
102
|
+
@inline(__always)
|
|
103
|
+
public func equals(other: HybridNitroPoseExercisesSpec_cxx) -> Bool {
|
|
104
|
+
return self.__implementation === other.__implementation
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Call dispose() on the Swift class.
|
|
109
|
+
* This _may_ be called manually from JS.
|
|
110
|
+
*/
|
|
111
|
+
@inline(__always)
|
|
112
|
+
public func dispose() {
|
|
113
|
+
self.__implementation.dispose()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Call toString() on the Swift class.
|
|
118
|
+
*/
|
|
119
|
+
@inline(__always)
|
|
120
|
+
public func toString() -> String {
|
|
121
|
+
return self.__implementation.toString()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Properties
|
|
125
|
+
public final var status: Int32 {
|
|
126
|
+
@inline(__always)
|
|
127
|
+
get {
|
|
128
|
+
return self.__implementation.status.rawValue
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public final var onRepComplete: bridge.std__optional_std__function_void_const_RepData_____data______ {
|
|
133
|
+
@inline(__always)
|
|
134
|
+
get {
|
|
135
|
+
return { () -> bridge.std__optional_std__function_void_const_RepData_____data______ in
|
|
136
|
+
if let __unwrappedValue = self.__implementation.onRepComplete {
|
|
137
|
+
return bridge.create_std__optional_std__function_void_const_RepData_____data______({ () -> bridge.Func_void_RepData in
|
|
138
|
+
let __closureWrapper = Func_void_RepData(__unwrappedValue)
|
|
139
|
+
return bridge.create_Func_void_RepData(__closureWrapper.toUnsafe())
|
|
140
|
+
}())
|
|
141
|
+
} else {
|
|
142
|
+
return .init()
|
|
143
|
+
}
|
|
144
|
+
}()
|
|
145
|
+
}
|
|
146
|
+
@inline(__always)
|
|
147
|
+
set {
|
|
148
|
+
self.__implementation.onRepComplete = { () -> ((_ data: RepData) -> Void)? in
|
|
149
|
+
if bridge.has_value_std__optional_std__function_void_const_RepData_____data______(newValue) {
|
|
150
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RepData_____data______(newValue)
|
|
151
|
+
return { () -> (RepData) -> Void in
|
|
152
|
+
let __wrappedFunction = bridge.wrap_Func_void_RepData(__unwrapped)
|
|
153
|
+
return { (__data: RepData) -> Void in
|
|
154
|
+
__wrappedFunction.call(__data)
|
|
155
|
+
}
|
|
156
|
+
}()
|
|
157
|
+
} else {
|
|
158
|
+
return nil
|
|
159
|
+
}
|
|
160
|
+
}()
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
public final var onPhaseChange: bridge.std__optional_std__function_void_ExercisePhase____phase______ {
|
|
165
|
+
@inline(__always)
|
|
166
|
+
get {
|
|
167
|
+
return { () -> bridge.std__optional_std__function_void_ExercisePhase____phase______ in
|
|
168
|
+
if let __unwrappedValue = self.__implementation.onPhaseChange {
|
|
169
|
+
return bridge.create_std__optional_std__function_void_ExercisePhase____phase______({ () -> bridge.Func_void_ExercisePhase in
|
|
170
|
+
let __closureWrapper = Func_void_ExercisePhase(__unwrappedValue)
|
|
171
|
+
return bridge.create_Func_void_ExercisePhase(__closureWrapper.toUnsafe())
|
|
172
|
+
}())
|
|
173
|
+
} else {
|
|
174
|
+
return .init()
|
|
175
|
+
}
|
|
176
|
+
}()
|
|
177
|
+
}
|
|
178
|
+
@inline(__always)
|
|
179
|
+
set {
|
|
180
|
+
self.__implementation.onPhaseChange = { () -> ((_ phase: ExercisePhase) -> Void)? in
|
|
181
|
+
if bridge.has_value_std__optional_std__function_void_ExercisePhase____phase______(newValue) {
|
|
182
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_ExercisePhase____phase______(newValue)
|
|
183
|
+
return { () -> (ExercisePhase) -> Void in
|
|
184
|
+
let __wrappedFunction = bridge.wrap_Func_void_ExercisePhase(__unwrapped)
|
|
185
|
+
return { (__phase: ExercisePhase) -> Void in
|
|
186
|
+
__wrappedFunction.call(__phase.rawValue)
|
|
187
|
+
}
|
|
188
|
+
}()
|
|
189
|
+
} else {
|
|
190
|
+
return nil
|
|
191
|
+
}
|
|
192
|
+
}()
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public final var onFormFeedback: bridge.std__optional_std__function_void_const_FormFeedback_____feedback______ {
|
|
197
|
+
@inline(__always)
|
|
198
|
+
get {
|
|
199
|
+
return { () -> bridge.std__optional_std__function_void_const_FormFeedback_____feedback______ in
|
|
200
|
+
if let __unwrappedValue = self.__implementation.onFormFeedback {
|
|
201
|
+
return bridge.create_std__optional_std__function_void_const_FormFeedback_____feedback______({ () -> bridge.Func_void_FormFeedback in
|
|
202
|
+
let __closureWrapper = Func_void_FormFeedback(__unwrappedValue)
|
|
203
|
+
return bridge.create_Func_void_FormFeedback(__closureWrapper.toUnsafe())
|
|
204
|
+
}())
|
|
205
|
+
} else {
|
|
206
|
+
return .init()
|
|
207
|
+
}
|
|
208
|
+
}()
|
|
209
|
+
}
|
|
210
|
+
@inline(__always)
|
|
211
|
+
set {
|
|
212
|
+
self.__implementation.onFormFeedback = { () -> ((_ feedback: FormFeedback) -> Void)? in
|
|
213
|
+
if bridge.has_value_std__optional_std__function_void_const_FormFeedback_____feedback______(newValue) {
|
|
214
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_FormFeedback_____feedback______(newValue)
|
|
215
|
+
return { () -> (FormFeedback) -> Void in
|
|
216
|
+
let __wrappedFunction = bridge.wrap_Func_void_FormFeedback(__unwrapped)
|
|
217
|
+
return { (__feedback: FormFeedback) -> Void in
|
|
218
|
+
__wrappedFunction.call(__feedback)
|
|
219
|
+
}
|
|
220
|
+
}()
|
|
221
|
+
} else {
|
|
222
|
+
return nil
|
|
223
|
+
}
|
|
224
|
+
}()
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public final var onHoldProgress: bridge.std__optional_std__function_void_const_HoldProgress_____progress______ {
|
|
229
|
+
@inline(__always)
|
|
230
|
+
get {
|
|
231
|
+
return { () -> bridge.std__optional_std__function_void_const_HoldProgress_____progress______ in
|
|
232
|
+
if let __unwrappedValue = self.__implementation.onHoldProgress {
|
|
233
|
+
return bridge.create_std__optional_std__function_void_const_HoldProgress_____progress______({ () -> bridge.Func_void_HoldProgress in
|
|
234
|
+
let __closureWrapper = Func_void_HoldProgress(__unwrappedValue)
|
|
235
|
+
return bridge.create_Func_void_HoldProgress(__closureWrapper.toUnsafe())
|
|
236
|
+
}())
|
|
237
|
+
} else {
|
|
238
|
+
return .init()
|
|
239
|
+
}
|
|
240
|
+
}()
|
|
241
|
+
}
|
|
242
|
+
@inline(__always)
|
|
243
|
+
set {
|
|
244
|
+
self.__implementation.onHoldProgress = { () -> ((_ progress: HoldProgress) -> Void)? in
|
|
245
|
+
if bridge.has_value_std__optional_std__function_void_const_HoldProgress_____progress______(newValue) {
|
|
246
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_HoldProgress_____progress______(newValue)
|
|
247
|
+
return { () -> (HoldProgress) -> Void in
|
|
248
|
+
let __wrappedFunction = bridge.wrap_Func_void_HoldProgress(__unwrapped)
|
|
249
|
+
return { (__progress: HoldProgress) -> Void in
|
|
250
|
+
__wrappedFunction.call(__progress)
|
|
251
|
+
}
|
|
252
|
+
}()
|
|
253
|
+
} else {
|
|
254
|
+
return nil
|
|
255
|
+
}
|
|
256
|
+
}()
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
public final var onPoseLost: bridge.std__optional_std__function_void____ {
|
|
261
|
+
@inline(__always)
|
|
262
|
+
get {
|
|
263
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
264
|
+
if let __unwrappedValue = self.__implementation.onPoseLost {
|
|
265
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
266
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
267
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
268
|
+
}())
|
|
269
|
+
} else {
|
|
270
|
+
return .init()
|
|
271
|
+
}
|
|
272
|
+
}()
|
|
273
|
+
}
|
|
274
|
+
@inline(__always)
|
|
275
|
+
set {
|
|
276
|
+
self.__implementation.onPoseLost = { () -> (() -> Void)? in
|
|
277
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
278
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
279
|
+
return { () -> () -> Void in
|
|
280
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
281
|
+
return { () -> Void in
|
|
282
|
+
__wrappedFunction.call()
|
|
283
|
+
}
|
|
284
|
+
}()
|
|
285
|
+
} else {
|
|
286
|
+
return nil
|
|
287
|
+
}
|
|
288
|
+
}()
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
public final var onPoseRegained: bridge.std__optional_std__function_void____ {
|
|
293
|
+
@inline(__always)
|
|
294
|
+
get {
|
|
295
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
296
|
+
if let __unwrappedValue = self.__implementation.onPoseRegained {
|
|
297
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
298
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
299
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
300
|
+
}())
|
|
301
|
+
} else {
|
|
302
|
+
return .init()
|
|
303
|
+
}
|
|
304
|
+
}()
|
|
305
|
+
}
|
|
306
|
+
@inline(__always)
|
|
307
|
+
set {
|
|
308
|
+
self.__implementation.onPoseRegained = { () -> (() -> Void)? in
|
|
309
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
310
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
311
|
+
return { () -> () -> Void in
|
|
312
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
313
|
+
return { () -> Void in
|
|
314
|
+
__wrappedFunction.call()
|
|
315
|
+
}
|
|
316
|
+
}()
|
|
317
|
+
} else {
|
|
318
|
+
return nil
|
|
319
|
+
}
|
|
320
|
+
}()
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
public final var onSessionComplete: bridge.std__optional_std__function_void_const_SessionResult_____result______ {
|
|
325
|
+
@inline(__always)
|
|
326
|
+
get {
|
|
327
|
+
return { () -> bridge.std__optional_std__function_void_const_SessionResult_____result______ in
|
|
328
|
+
if let __unwrappedValue = self.__implementation.onSessionComplete {
|
|
329
|
+
return bridge.create_std__optional_std__function_void_const_SessionResult_____result______({ () -> bridge.Func_void_SessionResult in
|
|
330
|
+
let __closureWrapper = Func_void_SessionResult(__unwrappedValue)
|
|
331
|
+
return bridge.create_Func_void_SessionResult(__closureWrapper.toUnsafe())
|
|
332
|
+
}())
|
|
333
|
+
} else {
|
|
334
|
+
return .init()
|
|
335
|
+
}
|
|
336
|
+
}()
|
|
337
|
+
}
|
|
338
|
+
@inline(__always)
|
|
339
|
+
set {
|
|
340
|
+
self.__implementation.onSessionComplete = { () -> ((_ result: SessionResult) -> Void)? in
|
|
341
|
+
if bridge.has_value_std__optional_std__function_void_const_SessionResult_____result______(newValue) {
|
|
342
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_SessionResult_____result______(newValue)
|
|
343
|
+
return { () -> (SessionResult) -> Void in
|
|
344
|
+
let __wrappedFunction = bridge.wrap_Func_void_SessionResult(__unwrapped)
|
|
345
|
+
return { (__result: SessionResult) -> Void in
|
|
346
|
+
__wrappedFunction.call(__result)
|
|
347
|
+
}
|
|
348
|
+
}()
|
|
349
|
+
} else {
|
|
350
|
+
return nil
|
|
351
|
+
}
|
|
352
|
+
}()
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
public final var currentPhase: Int32 {
|
|
357
|
+
@inline(__always)
|
|
358
|
+
get {
|
|
359
|
+
return self.__implementation.currentPhase.rawValue
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
public final var repCount: Double {
|
|
364
|
+
@inline(__always)
|
|
365
|
+
get {
|
|
366
|
+
return self.__implementation.repCount
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
public final var landmarks: bridge.std__vector_Landmark_ {
|
|
371
|
+
@inline(__always)
|
|
372
|
+
get {
|
|
373
|
+
return { () -> bridge.std__vector_Landmark_ in
|
|
374
|
+
var __vector = bridge.create_std__vector_Landmark_(self.__implementation.landmarks.count)
|
|
375
|
+
for __item in self.__implementation.landmarks {
|
|
376
|
+
__vector.push_back(__item)
|
|
377
|
+
}
|
|
378
|
+
return __vector
|
|
379
|
+
}()
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Methods
|
|
384
|
+
@inline(__always)
|
|
385
|
+
public final func initialize(modelPath: std.string) -> bridge.Result_std__shared_ptr_Promise_void___ {
|
|
386
|
+
do {
|
|
387
|
+
let __result = try self.__implementation.initialize(modelPath: String(modelPath))
|
|
388
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
|
|
389
|
+
let __promise = bridge.create_std__shared_ptr_Promise_void__()
|
|
390
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
|
|
391
|
+
__result
|
|
392
|
+
.then({ __result in __promiseHolder.resolve() })
|
|
393
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
394
|
+
return __promise
|
|
395
|
+
}()
|
|
396
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
|
|
397
|
+
} catch (let __error) {
|
|
398
|
+
let __exceptionPtr = __error.toCpp()
|
|
399
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@inline(__always)
|
|
404
|
+
public final func release() -> bridge.Result_void_ {
|
|
405
|
+
do {
|
|
406
|
+
try self.__implementation.release()
|
|
407
|
+
return bridge.create_Result_void_()
|
|
408
|
+
} catch (let __error) {
|
|
409
|
+
let __exceptionPtr = __error.toCpp()
|
|
410
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
@inline(__always)
|
|
415
|
+
public final func loadExercise(config: ExerciseConfig) -> bridge.Result_void_ {
|
|
416
|
+
do {
|
|
417
|
+
try self.__implementation.loadExercise(config: config)
|
|
418
|
+
return bridge.create_Result_void_()
|
|
419
|
+
} catch (let __error) {
|
|
420
|
+
let __exceptionPtr = __error.toCpp()
|
|
421
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@inline(__always)
|
|
426
|
+
public final func processFrame(frame: bridge.std__shared_ptr_margelo__nitro__camera__HybridFrameSpec_) -> bridge.Result_void_ {
|
|
427
|
+
do {
|
|
428
|
+
try self.__implementation.processFrame(frame: { () -> any HybridFrameSpec in
|
|
429
|
+
let __unsafePointer = bridge.get_std__shared_ptr_margelo__nitro__camera__HybridFrameSpec_(frame)
|
|
430
|
+
let __instance = HybridFrameSpec_cxx.fromUnsafe(__unsafePointer)
|
|
431
|
+
return __instance.getHybridFrameSpec()
|
|
432
|
+
}())
|
|
433
|
+
return bridge.create_Result_void_()
|
|
434
|
+
} catch (let __error) {
|
|
435
|
+
let __exceptionPtr = __error.toCpp()
|
|
436
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
@inline(__always)
|
|
441
|
+
public final func startSession(targetReps: Double, countdownSeconds: Double) -> bridge.Result_void_ {
|
|
442
|
+
do {
|
|
443
|
+
try self.__implementation.startSession(targetReps: targetReps, countdownSeconds: countdownSeconds)
|
|
444
|
+
return bridge.create_Result_void_()
|
|
445
|
+
} catch (let __error) {
|
|
446
|
+
let __exceptionPtr = __error.toCpp()
|
|
447
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
@inline(__always)
|
|
452
|
+
public final func pauseSession() -> bridge.Result_void_ {
|
|
453
|
+
do {
|
|
454
|
+
try self.__implementation.pauseSession()
|
|
455
|
+
return bridge.create_Result_void_()
|
|
456
|
+
} catch (let __error) {
|
|
457
|
+
let __exceptionPtr = __error.toCpp()
|
|
458
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
@inline(__always)
|
|
463
|
+
public final func resumeSession() -> bridge.Result_void_ {
|
|
464
|
+
do {
|
|
465
|
+
try self.__implementation.resumeSession()
|
|
466
|
+
return bridge.create_Result_void_()
|
|
467
|
+
} catch (let __error) {
|
|
468
|
+
let __exceptionPtr = __error.toCpp()
|
|
469
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
@inline(__always)
|
|
474
|
+
public final func stopSession() -> bridge.Result_void_ {
|
|
475
|
+
do {
|
|
476
|
+
try self.__implementation.stopSession()
|
|
477
|
+
return bridge.create_Result_void_()
|
|
478
|
+
} catch (let __error) {
|
|
479
|
+
let __exceptionPtr = __error.toCpp()
|
|
480
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Landmark.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `Landmark`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias Landmark = margelo.nitro.nitroposeexercises.Landmark
|
|
14
|
+
|
|
15
|
+
public extension Landmark {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitroposeexercises.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `Landmark`.
|
|
20
|
+
*/
|
|
21
|
+
init(x: Double, y: Double, z: Double, visibility: Double) {
|
|
22
|
+
self.init(x, y, z, visibility)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@inline(__always)
|
|
26
|
+
var x: Double {
|
|
27
|
+
return self.__x
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@inline(__always)
|
|
31
|
+
var y: Double {
|
|
32
|
+
return self.__y
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@inline(__always)
|
|
36
|
+
var z: Double {
|
|
37
|
+
return self.__z
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@inline(__always)
|
|
41
|
+
var visibility: Double {
|
|
42
|
+
return self.__visibility
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PhaseThreshold.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `PhaseThreshold`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias PhaseThreshold = margelo.nitro.nitroposeexercises.PhaseThreshold
|
|
14
|
+
|
|
15
|
+
public extension PhaseThreshold {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitroposeexercises.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `PhaseThreshold`.
|
|
20
|
+
*/
|
|
21
|
+
init(phase: ExercisePhase, angleName: String, minAngle: Double, maxAngle: Double) {
|
|
22
|
+
self.init(phase, std.string(angleName), minAngle, maxAngle)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@inline(__always)
|
|
26
|
+
var phase: ExercisePhase {
|
|
27
|
+
return self.__phase
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@inline(__always)
|
|
31
|
+
var angleName: String {
|
|
32
|
+
return String(self.__angleName)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@inline(__always)
|
|
36
|
+
var minAngle: Double {
|
|
37
|
+
return self.__minAngle
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@inline(__always)
|
|
41
|
+
var maxAngle: Double {
|
|
42
|
+
return self.__maxAngle
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RepData.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RepData`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RepData = margelo.nitro.nitroposeexercises.RepData
|
|
14
|
+
|
|
15
|
+
public extension RepData {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitroposeexercises.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RepData`.
|
|
20
|
+
*/
|
|
21
|
+
init(repNumber: Double, durationMs: Double, formScore: Double, angles: [AngleSnapshot]) {
|
|
22
|
+
self.init(repNumber, durationMs, formScore, { () -> bridge.std__vector_AngleSnapshot_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_AngleSnapshot_(angles.count)
|
|
24
|
+
for __item in angles {
|
|
25
|
+
__vector.push_back(__item)
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}())
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@inline(__always)
|
|
32
|
+
var repNumber: Double {
|
|
33
|
+
return self.__repNumber
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@inline(__always)
|
|
37
|
+
var durationMs: Double {
|
|
38
|
+
return self.__durationMs
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@inline(__always)
|
|
42
|
+
var formScore: Double {
|
|
43
|
+
return self.__formScore
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@inline(__always)
|
|
47
|
+
var angles: [AngleSnapshot] {
|
|
48
|
+
return self.__angles.map({ __item in __item })
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SessionResult.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `SessionResult`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias SessionResult = margelo.nitro.nitroposeexercises.SessionResult
|
|
14
|
+
|
|
15
|
+
public extension SessionResult {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitroposeexercises.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `SessionResult`.
|
|
20
|
+
*/
|
|
21
|
+
init(totalReps: Double, totalDurationMs: Double, averageRepDurationMs: Double, averageFormScore: Double, formViolations: [FormFeedback], angleHistory: [AngleSnapshot]) {
|
|
22
|
+
self.init(totalReps, totalDurationMs, averageRepDurationMs, averageFormScore, { () -> bridge.std__vector_FormFeedback_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_FormFeedback_(formViolations.count)
|
|
24
|
+
for __item in formViolations {
|
|
25
|
+
__vector.push_back(__item)
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}(), { () -> bridge.std__vector_AngleSnapshot_ in
|
|
29
|
+
var __vector = bridge.create_std__vector_AngleSnapshot_(angleHistory.count)
|
|
30
|
+
for __item in angleHistory {
|
|
31
|
+
__vector.push_back(__item)
|
|
32
|
+
}
|
|
33
|
+
return __vector
|
|
34
|
+
}())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var totalReps: Double {
|
|
39
|
+
return self.__totalReps
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@inline(__always)
|
|
43
|
+
var totalDurationMs: Double {
|
|
44
|
+
return self.__totalDurationMs
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@inline(__always)
|
|
48
|
+
var averageRepDurationMs: Double {
|
|
49
|
+
return self.__averageRepDurationMs
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@inline(__always)
|
|
53
|
+
var averageFormScore: Double {
|
|
54
|
+
return self.__averageFormScore
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@inline(__always)
|
|
58
|
+
var formViolations: [FormFeedback] {
|
|
59
|
+
return self.__formViolations.map({ __item in __item })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@inline(__always)
|
|
63
|
+
var angleHistory: [AngleSnapshot] {
|
|
64
|
+
return self.__angleHistory.map({ __item in __item })
|
|
65
|
+
}
|
|
66
|
+
}
|