@@ -63,14 +63,14 @@ struct QuickPosePickerView: View {
6363 Text ( " Fitness " )
6464 }
6565 Menu {
66- Picker ( " Rowing " , selection: $selectedFeatures) {
67- ForEach ( QuickPose . Feature. allDemoFeatures ( component: " Rowing " ) , id: \. self) { feature in
68- Text ( " Rowing " )
66+ Picker ( " Sports " , selection: $selectedFeatures) {
67+ ForEach ( QuickPose . Feature. allDemoFeatures ( component: " Sports " ) , id: \. self) { feature in
68+ Text ( " Cycling/ Rowing" )
6969 }
7070 }
7171 . tint ( . white)
7272 } label: {
73- Text ( " Rowing " )
73+ Text ( " Sports " )
7474 }
7575 Menu {
7676 Picker ( " Health " , selection: $selectedFeatures) {
@@ -82,6 +82,16 @@ struct QuickPosePickerView: View {
8282 } label: {
8383 Text ( " Health " )
8484 }
85+ Menu {
86+ Picker ( " Conditional " , selection: $selectedFeatures) {
87+ ForEach ( QuickPose . Feature. allDemoFeatures ( component: " Conditional " ) , id: \. self) { feature in
88+ Text ( feature. first? . displayString ?? " " )
89+ }
90+ }
91+ . tint ( . white)
92+ } label: {
93+ Text ( " Conditional " )
94+ }
8595
8696 Menu {
8797 Picker ( " Debug " , selection: $showDebugString) {
@@ -223,11 +233,15 @@ extension QuickPose.Feature {
223233 public static func allDemoFeatures( component: String ) -> [ [ QuickPose . Feature ] ] {
224234
225235 if component == " Health " {
226- return [ [ . rangeOfMotion( . shoulder( side: . left, clockwiseDirection: false ) ) ] , [ . rangeOfMotion( . shoulder( side: . right, clockwiseDirection: true ) ) ] +
236+ return [ [ . rangeOfMotion( . shoulder( side: . left, clockwiseDirection: false ) ) ] , [ . rangeOfMotion( . shoulder( side: . right, clockwiseDirection: true ) ) ] ,
227237 [ . rangeOfMotion( . hip( side: . right, clockwiseDirection: true ) ) ] , [ . rangeOfMotion( . knee( side: . right, clockwiseDirection: true ) ) ] , [ . rangeOfMotion( . neck( clockwiseDirection: false ) ) , . rangeOfMotion( . back( clockwiseDirection: false ) ) ] ]
238+ } else if component == " Conditional " {
239+ let greenStyle = QuickPose . Style ( conditionalColors: [ QuickPose . Style. ConditionalColor ( min: 40 , max: nil , color: UIColor . green) ] )
240+ let redStyle = QuickPose . Style ( conditionalColors: [ QuickPose . Style. ConditionalColor ( min: 180 , max: nil , color: UIColor . red) ] )
241+ return [ [ . rangeOfMotion( . shoulder( side: . left, clockwiseDirection: false ) , style: greenStyle) ] , [ . rangeOfMotion( . knee( side: . right, clockwiseDirection: true ) , style: redStyle) ] ]
228242 } else if component == " Fitness " {
229243 return [ [ . fitness( . squatCounter) ] , [ . fitness( . pushUpCounter) ] , [ . fitness( . jumpingJackCounter) ] ]
230- } else if component == " Rowing " {
244+ } else if component == " Sports " {
231245 let bikeStyle = QuickPose . Style ( relativeFontSize: 0.33 , relativeArcSize: 0.4 , relativeLineWidth: 0.3 )
232246 let feature1 : QuickPose . Feature = . rangeOfMotion( . shoulder( side: . right, clockwiseDirection: false ) , style: bikeStyle)
233247 let feature2 : QuickPose . Feature = . rangeOfMotion( . elbow( side: . right, clockwiseDirection: false ) , style: bikeStyle)
@@ -237,11 +251,9 @@ extension QuickPose.Feature {
237251 } else {
238252 return QuickPose . Landmarks. Group. commonLimbs ( ) . map { [ QuickPose . Feature. overlay ( $0) ] } + [ [ QuickPose . Feature. showPoints ( ) ] ]
239253 }
240-
241254 }
242255
243-
244256 public static func allDemoFeatureComponents( ) -> [ String ] {
245- return [ " General " , " Fitness " , " Health " , " Rowing " ]
257+ return [ " General " , " Fitness " , " Health " , " Conditional " , " Sports " ]
246258 }
247259}
0 commit comments