void testApp::guisetup() { float dim = 20; float xInit = OFX_UI_GLOBAL_WIDGET_SPACING; float length = 200 - xInit; gui = new ofxUICanvas(0, 0, length + xInit * 2, 2560); gui->setFont("/System/Library/Fonts/Geneva.dfont"); ofColor cb(64, 192), co(192, 192), coh(128, 192), cf(240, 255), cfh(128, 255), cp(96, 192), cpo(255, 192); gui->setUIColors(cb, co, coh, cf, cfh, cp, cpo); gui->addLabel("Sensor", OFX_UI_FONT_LARGE); gui->addSlider("Zoom", 0.01, 1.0, &scale, length, dim); gui->add2DPad("Shift", ofPoint(-1.0,1.0), ofPoint(-1.0,1.0), &shift, length, length); gui->addSlider("Sensor Angle", 0, 360, &sensor_angle, length, dim); gui->addLabel("Region", OFX_UI_FONT_LARGE); gui->addLabelButton("Register", ®ister_region, length, dim); gui->addLabelButton("Clear", &clear_region, length, dim); gui->addLabel("Visualization"); gui->addLabelToggle("Data", &draw_data, length, dim); }
void testApp::setup() { ofSetVerticalSync(true); ofEnableSmoothing(); int n = ofxKinect::numAvailableDevices(); while(sensors.size() < n) { sensors.push_back(ofPtr<CircleSensor>(new CircleSensor())); sensors.back()->setup(); } ofSort(sensors, bySerial); ofxXmlSettings xml; xml.loadFile("settings.xml"); float dim = 20; float xInit = OFX_UI_GLOBAL_WIDGET_SPACING; float length = 320 - xInit; gui = new ofxUICanvas(0, 0, length + xInit * 2, 2560); gui->setFont("/System/Library/Fonts/Geneva.dfont"); ofColor cb(64, 192), co(192, 192), coh(128, 192), cf(240, 255), cfh(128, 255), cp(96, 192), cpo(255, 192); gui->setUIColors(cb, co, coh, cf, cfh, cp, cpo); gui->addLabel("Kinects: " + ofToString(ofxKinect::numConnectedDevices()) + " / " + ofToString(ofxKinect::numTotalDevices()), OFX_UI_FONT_SMALL); gui->addLabel("Background", OFX_UI_FONT_LARGE); gui->addLabelToggle("Debug", &showDebug, length, dim); gui->addLabelButton("Set dead zones", &setDeadZones, length, dim); gui->addLabelButton("Clear", &backgroundClear, length, dim); gui->addLabelToggle("Calibrate", &backgroundCalibrate, length, dim); gui->addSlider("Threshold", 0, 255, &backgroundThreshold, length, dim); gui->addLabel("Tracking", OFX_UI_FONT_LARGE); gui->addSlider("Blur radius", 0, 11, &blurRadius, length, dim); gui->addSlider("Threshold", 0, 255, &circleThreshold, length, dim); gui->addSlider("Min radius", 0, 12, &minRadius, length, dim); gui->addSlider("Max radius", 0, 12, &maxRadius, length, dim); gui->addSlider("Sample radius", 0, 24, &sampleRadius, length, dim); gui->addLabel("Registration", OFX_UI_FONT_LARGE); gui->addLabelButton("Clear", ®istrationClear, length, dim); gui->addLabelToggle("Calibrate", ®istrationCalibrate, length, dim); gui->addSlider("Calibration accuracy", 100, 10000, ®istrationCalibrationAccuracy, length, dim); gui->addLabel("Filtering", OFX_UI_FONT_LARGE); gui->addSlider("Max velocity", 0, 10000, &maxVelocity, length, dim); gui->addSlider("Filter rate", 0, 1, &filterRate, length, dim); }