| 44 | |
| 45 | |
| 46 | XnStatus SampleManager::StartSample(int argc, char **argv) |
| 47 | { |
| 48 | // first we create a UserTracker object. This initializes all the openNI portions... |
| 49 | m_pUserTracker = XN_NEW(UserTracker,argc,argv,3000000); |
| 50 | |
| 51 | // make sure the initialization was a success |
| 52 | if(m_pUserTracker->Valid()==FALSE) |
| 53 | { |
| 54 | RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "User tracker invalid"); |
| 55 | } |
| 56 | |
| 57 | // set the user selector and tracking initializers. This is the main method overriden by |
| 58 | // inheriting classes. |
| 59 | if(SetSelectors()!=XN_STATUS_OK) |
| 60 | { |
| 61 | RETURN_WITH_CLEANUP(XN_STATUS_ERROR, "Failed to initialize user selector and tracking initializers"); |
| 62 | } |
| 63 | |
| 64 | // test if we show low confidence joints (if this is true we show low confidence joints as |
| 65 | // dotted lines (confidence 0.5) or dashed lines (confidence lower than 0.5). If false we just |
| 66 | // do not draw low confidence joints. |
| 67 | XnBool bShowLowConfidence = FALSE; |
| 68 | for(int i=1; i<argc; i++) |
| 69 | { |
| 70 | if(xnOSStrCmp(argv[i] , "-ShowLowConfidence") == 0) |
| 71 | { |
| 72 | bShowLowConfidence = TRUE; |
| 73 | } |
| 74 | } |
| 75 | // start the actual running (handled by the scene drawer). |
| 76 | // note pUserTracker is deleted inside DrawScene when quitting. |
| 77 | SceneDrawer *singleton=SceneDrawer::GetInstance(); |
| 78 | // This starts the actual program. NOTE: the DrawScene method never ends except for |
| 79 | // using the exit call to end the program. |
| 80 | singleton->DrawScene(m_pUserTracker,argc,argv,this, bShowLowConfidence); |
| 81 | return XN_STATUS_OK; |
| 82 | } |
| 83 | |
| 84 | void SampleManager::Cleanup() |
| 85 | { |
no test coverage detected