void Display::snowCB(Fl_Value_Input* w, Display* c) { Map* m = c->getMap(); m->setSnow(w->value()); GLWindow* win = c->getGWin(); win->setMap(m); win->redraw(); }
void Display::topCB(Fl_Button* w, Display* d) { GLWindow* g = d->getGWin(); Camera* c = g->getCam(); c->setTheta(-70); g->setCam(c); g->redraw(); }
void Display::sideCB(Fl_Button* w, Display* d) { GLWindow* g = d->getGWin(); Camera* c = g->getCam(); c->setPhi(4); g->setCam(c); g->redraw(); }
void Display::colorCB(Fl_Color_Chooser* color, Display* d) { Map* m = d->getMap(); m->setColor(color->r(), color->g(), color->b()); GLWindow* win = d->getGWin(); win->setMap(m); win->redraw(); }
void Display::bothCB(Fl_Round_Button* b, Display* d) { Map* m = d->getMap(); m->setType(2); GLWindow* win = d->getGWin(); win->setMap(m); win->redraw(); }
void Display::subCB(Fl_Button* w, Display* c) { Map* m = c->getMap(); //std::cout<<m->getHeights(0, 0) << std::endl; m->fractalize(); //std::cout << m->getHeights(5, 4) << std::endl; GLWindow* win = c->getGWin(); win->setMap(m); win->redraw(); }
void Display::hCB(Fl_Slider* s, Display* d) { s->range(d->min, d->max); Map* m = d->getMap(); m->changeCoord(d->tile_x, d->tile_y, s->value()); float height = m->getHeights(d->tile_x, d->tile_y); s->value(height); GLWindow* win = d->getGWin(); win->setMap(m); win->redraw(); }
void Display::upCB(Fl_Button* w, Display* d) { Map* m = d->getMap(); GLWindow* win = d->getGWin(); //std::cout << d->tile_x <<d->tile_y<< std::endl; if (d->tile_y == 0) d->tile_y = m->getRow()-1; else d->tile_y--; win->setColor(d->tile_x, d->tile_y); win->redraw(); }
void Display::createCB(Fl_Button* w, Display* c){ Map* m = c->getMap(); c->tile_x = c->tile_y = 0; m->setSize(c->r,c->c,c->x,c->y); //std::cout << c->max << std::endl; m->setRange(c->max, c->min); m->createMap(); GLWindow* win = c->getGWin(); win->setColor(c->tile_x, c->tile_y); win->setMap(m); win->redraw(); }
void Display::rightCB(Fl_Button* w, Display* d) { Map* m = d->getMap(); GLWindow* win = d->getGWin(); //std::cout << d->tile_x <<d->tile_y<< std::endl; if (d->tile_x == m->getCol() - 1) d->tile_x = 0; else d->tile_x++; win->setColor(d->tile_x, d->tile_y); win->redraw(); }
bool updateModule(){ static int userLastStatus[MAX_USERS] = {-1}; for(int userID = 0; userID < MAX_USERS; userID++){ if(userLastStatus[userID] != _kinect->getSkeletonState(userID)){ userLastStatus[userID] = _kinect->getSkeletonState(userID); printf("USER %d HAS STATUS %d\n",userID,userLastStatus[userID]); } Matrix skeletonOrientation[TOTAL_JOINTS]; Vector skeletonPosition[TOTAL_JOINTS]; double confPosition[TOTAL_JOINTS], confOrientation[TOTAL_JOINTS]; if(!_kinect->getSkeletonOrientation(skeletonOrientation,confOrientation,userID)) continue; _kinect->getSkeletonPosition(skeletonPosition,confPosition,userID); _glWindow->setData(userID,userLastStatus[userID],skeletonOrientation, confPosition,skeletonPosition,confOrientation); _glWindow->redraw(); } ImageOf<PixelInt> img = _kinect->getDepthMap(); imgPort.prepare() = img; imgPort.write(); return true; };