亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rtkgui.cc

?? 一個機器人平臺
?? CC
字號:
/* *  Stage : a multi-robot simulator. *  Copyright (C) 2001, 2002 Richard Vaughan, Andrew Howard and Brian Gerkey. * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * *//* * Desc: The RTK gui implementation * Author: Richard Vaughan, Andrew Howard * Date: 7 Dec 2000 * CVS info: $Id: rtkgui.cc,v 1.14 2002/11/11 03:09:46 rtv Exp $ */#if HAVE_CONFIG_H  #include <config.h>#endif#if HAVE_STRINGS_H  #include <strings.h>#endif// if stage was configured to use the RTK2 GUI#ifdef INCLUDE_RTK2//#undef DEBUG//#undef VERBOSE//#define DEBUG //#define VERBOSE#include <errno.h>#include <sys/time.h>#include <sys/wait.h>#include <signal.h>#include <math.h>#include <unistd.h>#include <sys/mman.h>#include <semaphore.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <pwd.h>#include <stdio.h>#include <netdb.h>#include <fstream>#include <iostream>#include "world.hh"#include "playerdevice.hh"#include "library.hh"// TODO - unwrap RTK code from around the place and have it work// through the GUI hooks// WORLD HOOKS /////////////////////////////void GuiInit( int argc, char** argv ){   rtk_init(&argc, &argv);}void GuiWorldStartup( CWorld* world ){   world->RtkStartup();  return;}void GuiWorldShutdown( CWorld* world ){   world->RtkShutdown();  return;}void GuiWorldUpdate( CWorld* world ){    world->RtkUpdate();  return;}void GuiLoad( CWorld* world ){  world->RtkLoad( world->worldfile );  return;}void GuiSave( CWorld* world ){  world->RtkSave( world->worldfile );}// ENTITY HOOKS ///////////////////////////void GuiEntityStartup( CEntity* ent ){   /* do nothing */  }void GuiEntityShutdown( CEntity* ent ){   /* do nothing */ }void GuiEntityUpdate( CEntity* ent ){  /* do nothing */ }void GuiEntityPropertyChange( CEntity* ent, EntityProperty prop ){   /* do nothing */ }////////////////////////////////////////////void CWorld::AddToMenu( stage_menu_t* menu, CEntity* ent, int check ){  /* BROKEN  assert( menu );  assert( ent );  // if there's no menu item for this type yet  if( menu->items[ ent->lib_entry->type_num ] == NULL )    // create a new menu item    assert( menu->items[ ent->lib_entry->type_num ] =  	    rtk_menuitem_create( menu->menu, ent->lib_entry->token, 1 ));    rtk_menuitem_check( menu->items[ ent->lib_entry->type_num ], check );  */}void CWorld::AddToDataMenu(  CEntity* ent, int check ){  /* BROKEN  assert( ent );  AddToMenu( &this->data_menu, ent, check );  */}void CWorld::AddToDeviceMenu(  CEntity* ent, int check ){  /* BROKEN  assert( ent );  AddToMenu( &this->device_menu, ent, check );  */}// devices check this to see if they should display their databool CWorld::ShowDeviceData( int devtype ){  return rtk_menuitem_ischecked(this->data_item);    /* BROKEN  rtk_menuitem_t* menu_item = data_menu.items[ devtype ];    if( menu_item )    return( rtk_menuitem_ischecked( menu_item ) );    else // if there's no option in the menu, display this data    return true;  */}bool CWorld::ShowDeviceBody( int devtype ){  return rtk_menuitem_ischecked(this->objects_item);  /* BROKEN  rtk_menuitem_t* menu_item = device_menu.items[ devtype ];    if( menu_item )    return( rtk_menuitem_ischecked( menu_item ) );    else // if there's no option in the menu, display this data    return true;  */}// Initialise the GUI// TODO: fix this for client/server operation.bool CWorld::RtkLoad(CWorldFile *worldfile){  int sx, sy;  double scale = 0.01;  double dx, dy;  double ox, oy;  double gridx, gridy;  double minor, major;  bool showgrid;  bool subscribedonly;  // Size of world in pixels  sx = (int) this->matrix->width;  sy = (int) this->matrix->height;    // Grid size in meters  gridx = sx / this->ppm;  gridy = sy / this->ppm;    // Place a hard limit, just to stop it going off the screen  // (TODO - we could get the sceen size from X if we tried?)  if (sx > 1024)    sx = 1024;  if (sy > 768)    sy = 768;    // Grid spacing  minor = 0.2;  major = 1.0;  showgrid = true;  // Size in meters  dx = sx * scale;  dy = sy * scale;    // Origin of the canvas  ox = dx / 2;  oy = dy / 2;    // only show data for subscribed devices  subscribedonly = true;    // if there's a worldfile we adjust the window params to the specified values  if (worldfile != NULL)  {    int section = worldfile->LookupEntity("gui");    // Size of canvas in pixels    sx = (int) worldfile->ReadTupleFloat(section, "size", 0, sx);    sy = (int) worldfile->ReadTupleFloat(section, "size", 1, sy);        // Scale of the pixels    scale = worldfile->ReadLength(section, "scale", 1 / this->ppm);      // Size in meters    dx = sx * scale;    dy = sy * scale;    // Origin of the canvas    ox = worldfile->ReadTupleLength(section, "origin", 0, dx / 2);    oy = worldfile->ReadTupleLength(section, "origin", 1, dy / 2);    // Grid spacing    minor = worldfile->ReadTupleLength(section, "grid", 0, 0.2);    major = worldfile->ReadTupleLength(section, "grid", 1, 1.0);    showgrid = worldfile->ReadInt(section, "showgrid", true);        // toggle display of subscribed or all device data    subscribedonly = worldfile->ReadInt(section, "showsubscribed", false);  }  else    PRINT_DEBUG( "NO WORLDFILE - USING DEFAULT GUI PARAMS" );    //printf( "sx %d sy %d dx %.2f dy %.2f ox %.2f oy %.2f scale %.2f\n",  //  sx, sy, dx, dy, ox, oy, scale );  gridx = ceil(gridx / major) * major;  gridy = ceil(gridy / major) * major;    this->app = rtk_app_create();  this->rtk_update_time = 0;  this->rtk_update_rate = 10;    this->canvas = rtk_canvas_create(this->app);  rtk_canvas_size(this->canvas, sx, sy);  rtk_canvas_scale(this->canvas, scale, scale);  rtk_canvas_origin(this->canvas, ox, oy);  // Add some menu items  this->file_menu = rtk_menu_create(this->canvas, "File");  this->save_menuitem = rtk_menuitem_create(this->file_menu, "Save", 0);  this->stills_menu = rtk_menu_create_sub(this->file_menu, "Capture stills");  this->movie_menu = rtk_menu_create_sub(this->file_menu, "Capture movie");  this->exit_menuitem = rtk_menuitem_create(this->file_menu, "Exit", 0);  this->stills_jpeg_menuitem = rtk_menuitem_create(this->stills_menu, "JPEG format", 1);  this->stills_ppm_menuitem = rtk_menuitem_create(this->stills_menu, "PPM format", 1);  this->stills_series = 0;  this->stills_count = 0;  this->movie_options[0].menuitem = rtk_menuitem_create(this->movie_menu, "Speed x1", 1);  this->movie_options[0].speed = 1;  this->movie_options[1].menuitem = rtk_menuitem_create(this->movie_menu, "Speed x2", 1);  this->movie_options[1].speed = 2;  this->movie_options[2].menuitem = rtk_menuitem_create(this->movie_menu, "Speed x5", 1);  this->movie_options[2].speed = 5;  this->movie_options[3].menuitem = rtk_menuitem_create(this->movie_menu, "Speed x10", 1);  this->movie_options[3].speed = 10;  this->movie_option_count = 4;  this->movie_count = 0;  // Create the view menu  this->view_menu = rtk_menu_create(this->canvas, "View");  // create the view menu items and set their initial checked state  this->grid_item = rtk_menuitem_create(this->view_menu, "Grid", 1);  this->matrix_item = rtk_menuitem_create(this->view_menu, "Matrix", 1);  this->objects_item = rtk_menuitem_create(this->view_menu, "Objects", 1);  this->data_item = rtk_menuitem_create(this->view_menu, "Data", 1);    rtk_menuitem_check(this->grid_item, showgrid);  rtk_menuitem_check(this->matrix_item, 0);  rtk_menuitem_check(this->objects_item, 1);  rtk_menuitem_check(this->data_item, 1);    // create the action menu  this->action_menu = rtk_menu_create(this->canvas, "Action");  this->subscribedonly_item = rtk_menuitem_create(this->action_menu,                                                   "Subscribe to all", 1);  rtk_menuitem_check(this->subscribedonly_item, subscribedonly);  /* BROKEN  //zero the view menus  memset( &device_menu,0,sizeof(stage_menu_t));  memset( &data_menu,0,sizeof(stage_menu_t));  // Create the view/device sub menu  assert( this->data_menu.menu =           rtk_menu_create_sub(this->view_menu, "Data"));  // Create the view/data sub menu  assert( this->device_menu.menu =           rtk_menu_create_sub(this->view_menu, "Object"));  // each device adds itself to the correct view menus in its rtkstartup()  */    // Create the grid  this->fig_grid = rtk_fig_create(this->canvas, NULL, -49);  if (minor > 0)  {    rtk_fig_color(this->fig_grid, 0.9, 0.9, 0.9);    rtk_fig_grid(this->fig_grid, gridx/2, gridy/2, gridx, gridy, minor);  }  if (major > 0)  {    rtk_fig_color(this->fig_grid, 0.75, 0.75, 0.75);    rtk_fig_grid(this->fig_grid, gridx/2, gridy/2, gridx, gridy, major);  }  rtk_fig_show(this->fig_grid, showgrid);    return true;}// Save the GUIbool CWorld::RtkSave(CWorldFile *worldfile){  int section = worldfile->LookupEntity("gui");  if (section < 0)  {    PRINT_WARN("No gui entity in the world file; gui settings have not been saved.");    return true;  }  // Size of canvas in pixels  int sx, sy;  rtk_canvas_get_size(this->canvas, &sx, &sy);  worldfile->WriteTupleFloat(section, "size", 0, sx);  worldfile->WriteTupleFloat(section, "size", 1, sy);  // Origin of the canvas  double ox, oy;  rtk_canvas_get_origin(this->canvas, &ox, &oy);  worldfile->WriteTupleLength(section, "origin", 0, ox);  worldfile->WriteTupleLength(section, "origin", 1, oy);  // Scale of the canvas  double scale;  rtk_canvas_get_scale(this->canvas, &scale, &scale);  worldfile->WriteLength(section, "scale", scale);  // Grid on/off  int showgrid = rtk_menuitem_ischecked(this->grid_item);  worldfile->WriteInt(section, "showgrid", showgrid);    return true;}// Start the GUIbool CWorld::RtkStartup(){  // these must exist already  assert( this->app );  assert( this->app->canvas );    // Initialise rtk  rtk_app_main_init(this->app);  // this rtkstarts all entities  root->RtkStartup();      return true;}// Stop the GUIvoid CWorld::RtkShutdown(){  assert( this->app );  // Finalize rtk  rtk_app_main_term(this->app);  return;}// Update the GUIvoid CWorld::RtkUpdate(){  //PRINT_DEBUG( "updating gui" );  // Process events  rtk_app_main_loop(this->app);  // Refresh the gui at a fixed rate (in simulator time).  if (this->m_sim_time < this->rtk_update_time + 1 / this->rtk_update_rate)    return;  this->rtk_update_time =     this->m_sim_time - fmod(this->m_sim_time, 1 / this->rtk_update_rate);    // Process menus  RtkMenuHandling();          // Update the object tree  root->RtkUpdate();  // Render the canvas  rtk_canvas_render(this->canvas);  return;}// Update the GUIvoid CWorld::RtkMenuHandling(){  char filename[128];      // See if we need to quit the program  if (rtk_menuitem_isactivated(this->exit_menuitem))    ::quit = 1;  if (rtk_canvas_isclosed(this->canvas))    ::quit = 1;  // Save the world file  if (rtk_menuitem_isactivated(this->save_menuitem))    Save();    // Start/stop export (jpeg)  if (rtk_menuitem_isactivated(this->stills_jpeg_menuitem))  {    if (rtk_menuitem_ischecked(this->stills_jpeg_menuitem))    {      this->stills_series++;      rtk_menuitem_enable(this->stills_ppm_menuitem, 0);    }    else      rtk_menuitem_enable(this->stills_ppm_menuitem, 1);        }  if (rtk_menuitem_ischecked(this->stills_jpeg_menuitem))  {    snprintf(filename, sizeof(filename), "stage-%03d-%04d.jpg",             this->stills_series, this->stills_count++);    printf("saving [%s]\n", filename);    rtk_canvas_export_image(this->canvas, filename, RTK_IMAGE_FORMAT_JPEG);  }  // Start/stop export (ppm)  if (rtk_menuitem_isactivated(this->stills_ppm_menuitem))  {    if (rtk_menuitem_ischecked(this->stills_ppm_menuitem))    {      this->stills_series++;      rtk_menuitem_enable(this->stills_jpeg_menuitem, 0);    }    else      rtk_menuitem_enable(this->stills_jpeg_menuitem, 1);        }  if (rtk_menuitem_ischecked(this->stills_ppm_menuitem))  {    snprintf(filename, sizeof(filename), "stage-%03d-%04d.ppm",             this->stills_series, this->stills_count++);    printf("saving [%s]\n", filename);    rtk_canvas_export_image(this->canvas, filename, RTK_IMAGE_FORMAT_PPM);  }  // Update movie menu  this->RtkUpdateMovieMenu();    // Show or hide the grid  if (rtk_menuitem_ischecked(this->grid_item))    rtk_fig_show(this->fig_grid, 1);  else    rtk_fig_show(this->fig_grid, 0);  // clear any matrix rendering, then redraw if the emnu item is checked  this->matrix->unrender();  if (rtk_menuitem_ischecked(this->matrix_item))    this->matrix->render( this );    // enable/disable subscriptions to show sensor data  static bool lasttime = rtk_menuitem_ischecked(this->subscribedonly_item);  bool thistime = rtk_menuitem_ischecked(this->subscribedonly_item);  // for now i check if the menu item changed  if( thistime != lasttime )  {    if( thistime )  // change the subscription counts of any player-capable ent      root->FamilySubscribe();    else      root->FamilyUnsubscribe();    // remember this state    lasttime = thistime;  }        return;}// Handle the movie sub-menu.// This is still yucky.void CWorld::RtkUpdateMovieMenu(){  int i, j;  char filename[128];  CMovieOption *option;    for (i = 0; i < this->movie_option_count; i++)  {    option = this->movie_options + i;        if (rtk_menuitem_isactivated(option->menuitem))    {      if (rtk_menuitem_ischecked(option->menuitem))      {        // Start the movie capture        snprintf(filename, sizeof(filename), "stage-%03d-sp%02d.mpg",                 this->movie_count++, option->speed);        rtk_canvas_movie_start(this->canvas, filename,                               this->rtk_update_rate, option->speed);        // Disable all other capture options        for (j = 0; j < this->movie_option_count; j++)          rtk_menuitem_enable(this->movie_options[j].menuitem, i == j);      }      else      {        // Stop movie capture        rtk_canvas_movie_stop(this->canvas);        // Enable all capture options        for (j = 0; j < this->movie_option_count; j++)          rtk_menuitem_enable(this->movie_options[j].menuitem, 1);      }    }    // Export the frame    if (rtk_menuitem_ischecked(option->menuitem))      rtk_canvas_movie_frame(this->canvas);  }  return;}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久免费| 午夜伦理一区二区| 日本成人在线视频网站| 成人激情视频网站| 精品免费日韩av| 亚洲精品美国一| 成人免费毛片高清视频| 26uuu国产日韩综合| 午夜伦欧美伦电影理论片| 99久久精品国产毛片| 精品99999| 久久精品国产免费| 欧美理论在线播放| 一区二区三区资源| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 国产精品美女久久久久久| 蜜臀av国产精品久久久久| 欧美日韩亚洲国产综合| 亚洲免费观看视频| 97久久精品人人做人人爽| 国产视频一区二区在线| 精品一区二区三区不卡| 日韩视频一区二区| 午夜激情综合网| 欧美综合一区二区| 一区二区三区在线不卡| 在线日韩国产精品| 一区二区三区日韩| 精品视频123区在线观看| 亚洲三级电影网站| 一本久久综合亚洲鲁鲁五月天 | 午夜欧美电影在线观看| 91丨九色丨蝌蚪富婆spa| 国产精品美女一区二区在线观看| 国产精品一区二区久激情瑜伽| 久久综合五月天婷婷伊人| 国产综合色在线| 久久久蜜臀国产一区二区| 国产精品一区二区x88av| 国产农村妇女精品| 不卡在线视频中文字幕| 尤物在线观看一区| 欧美日韩高清在线| 麻豆一区二区99久久久久| 久久综合网色—综合色88| 成人精品视频一区二区三区 | 久久成人综合网| 久久这里只精品最新地址| 国产一区不卡视频| 亚洲国产精品传媒在线观看| 色综合久久中文字幕| 午夜视频久久久久久| 日韩一级二级三级| 国产99久久久精品| 一片黄亚洲嫩模| 日韩欧美国产一区二区在线播放| 国产精品123区| 一区二区在线电影| 69久久夜色精品国产69蝌蚪网| 九一九一国产精品| 亚洲图片你懂的| 欧美另类videos死尸| 国产精品18久久久| 亚洲一区二区三区国产| xf在线a精品一区二区视频网站| 成人午夜免费av| 午夜伊人狠狠久久| 日本一区二区三区国色天香| 色婷婷综合久久久久中文 | 久久综合久久鬼色中文字| 99久久婷婷国产综合精品电影 | 亚洲一区二区三区四区五区黄| 欧美电影精品一区二区| 99久久久久久99| 国产一区二区在线观看免费| 亚洲乱码一区二区三区在线观看| 日韩欧美一级片| 欧美中文字幕一区二区三区| 国内一区二区在线| 亚洲成人精品在线观看| 中文字幕日本乱码精品影院| 日韩一级高清毛片| 欧美日韩精品一区二区天天拍小说| 国产伦精品一区二区三区免费迷| 亚洲午夜电影网| 国产精品国产三级国产普通话三级| 91精品国产91综合久久蜜臀| 色综合久久六月婷婷中文字幕| 韩国欧美国产1区| 蜜桃久久久久久久| 午夜精品免费在线| 亚洲综合免费观看高清在线观看| 亚洲国产高清在线| 久久久精品国产免费观看同学| 欧美精品在线视频| 在线观看欧美日本| 成人黄色小视频在线观看| 狠狠色伊人亚洲综合成人| 午夜精品久久久久久久 | 欧美丝袜丝nylons| 91色综合久久久久婷婷| 丁香婷婷综合色啪| 国产精品18久久久久久久久久久久| 美日韩一区二区| 免费成人av在线播放| 亚洲不卡一区二区三区| 亚欧色一区w666天堂| 亚洲午夜久久久久久久久久久| 亚洲精品一二三| 亚洲人成影院在线观看| 亚洲欧美日韩系列| 日韩美女视频一区二区 | 欧美日韩免费观看一区二区三区| 99久久久国产精品免费蜜臀| 99视频有精品| 99re66热这里只有精品3直播| av欧美精品.com| 91首页免费视频| 91福利精品视频| 欧美视频一区二区三区四区| 欧美色大人视频| 日韩一级视频免费观看在线| 精品国产一区二区三区忘忧草| 欧美一区二区播放| 精品久久久久久亚洲综合网| 久久青草国产手机看片福利盒子| 国产欧美精品区一区二区三区| 国产精品久久久久9999吃药| 一区二区三区四区不卡在线 | 亚洲国产精品一区二区久久 | 欧美一区二区视频免费观看| 日韩午夜在线观看视频| 精品免费一区二区三区| 国产精品视频免费| 亚洲美女淫视频| 日本人妖一区二区| 国产91在线观看| 在线国产亚洲欧美| 91精品国产综合久久久久久久久久| 日韩精品一区二区在线| 国产欧美日本一区二区三区| 久久精品噜噜噜成人88aⅴ | 亚洲成人精品一区二区| 另类小说综合欧美亚洲| 成人免费毛片aaaaa**| 欧美日韩视频在线一区二区| 欧美不卡一二三| 亚洲欧洲三级电影| 男人操女人的视频在线观看欧美| 黄网站免费久久| 在线观看日韩电影| 久久久久国产精品麻豆| 亚洲一区自拍偷拍| 国产伦精一区二区三区| 欧美日韩五月天| 国产精品久久久久久久久快鸭 | 一区二区三国产精华液| 九九九精品视频| 日本伦理一区二区| 精品国产人成亚洲区| 一片黄亚洲嫩模| 国产成人无遮挡在线视频| 69久久99精品久久久久婷婷| 亚洲视频在线观看三级| 精品在线免费观看| 欧美性猛交xxxxxx富婆| 国产视频亚洲色图| 日本视频中文字幕一区二区三区| 91同城在线观看| 久久理论电影网| 免费人成精品欧美精品| 91官网在线观看| 国产精品久久久久aaaa| 国产高清一区日本| 日韩欧美综合一区| 五月激情丁香一区二区三区| 97国产一区二区| 亚洲国产精品ⅴa在线观看| 理论电影国产精品| 91精品黄色片免费大全| 亚洲一区二区在线观看视频| 99re热这里只有精品免费视频| 国产亚洲欧美激情| 国产综合一区二区| 精品处破学生在线二十三| 男女视频一区二区| 91精品国产综合久久久蜜臀图片| 亚洲一区二区三区免费视频| 色狠狠色噜噜噜综合网| 1区2区3区精品视频| 成人av网址在线观看| 国产亚洲人成网站| 国产精品99久久久| 中文字幕欧美日韩一区| 岛国一区二区三区| 国产精品美女久久久久aⅴ | 国产一区欧美一区| 久久综合一区二区| 国产+成+人+亚洲欧洲自线| 久久久久久久久久美女|