bool DataSetVOC::loadBBoxes(CStr &nameNE, vector<Vec4i> &boxes, vecI &clsIdx) { string fName = format(_S(annoPathW), _S(nameNE)); FileStorage fs(fName, FileStorage::READ); FileNode fn = fs["annotation"]["object"]; boxes.clear(); clsIdx.clear(); if (fn.isSeq()){ for (FileNodeIterator it = fn.begin(), it_end = fn.end(); it != it_end; it++) loadBox(*it, boxes, clsIdx); } else loadBox(fn, boxes, clsIdx); return true; }
bool userInit() { pMesh_Box = loadBox(); box = Box(100.f, vec3(0.f, 0.f, 5.f), loadPic("../bin/Images/Box.jpg")); //pMesh_World = loadBox(); //world = Box(100000.0f, vec3(-700.f, -20.f, 10.f), loadPic("../bin/Images/wall_texture.jpg")); pMesh_AK = loadMesh("../bin/Mods/AK.obj"); ak = AK(0.006f, vec3(0, 0,0),loadPic("../bin/Images/tex_AK.jpg")); GLuint buff[] = { pMesh_AK->vertexBuffer, pMesh_Box->vertexBuffer }; //GLuint buff[] = { pMesh_World->vertexBuffer, pMesh_Box->vertexBuffer }; // create a vertex buffer glGenBuffers(2, buff); glBindBuffer(GL_ARRAY_BUFFER, pMesh_AK->vertexBuffer); glBufferData(GL_ARRAY_BUFFER, pMesh_AK->vertexList.size()*sizeof(vertex), &pMesh_AK->vertexList[0], GL_STATIC_DRAW); /*glGenBuffers(2, buff); glBindBuffer(GL_ARRAY_BUFFER, pMesh_AK->vertexBuffer); glBufferData(GL_ARRAY_BUFFER, pMesh_World->vertexList.size()*sizeof(vertex), &pMesh_World->vertexList[0], GL_STATIC_DRAW); */ // init camera camera.eye = vec3(0, 0.2f, 1); camera.at = vec3(0, 0, 0); camera.up = vec3(0, 1, 0); camera.viewMatrix = mat4::lookAt(camera.eye, camera.at, camera.up); return true; }
void CNetzKinoBrowser::showNKCategoriesMenu() { dprintf(DEBUG_NORMAL, "CNetzKinoBrowser::showNKMenu:\n"); // load Categories CHintBox loadBox(LOCALE_NETZKINO, g_Locale->getText(LOCALE_NK_SCAN_FOR_CATEGORIES)); loadBox.paint(); cats = nkparser.GetCategoryList(); loadBox.hide(); if(cats.empty()) { //FIXME show error MessageBox(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NK_ERROR), CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); return; } // menu CMenuWidget* mainMenu = new CMenuWidget(LOCALE_NETZKINO, NEUTRINO_ICON_NETZKINO_SMALL); mainMenu->disableMenuPosition(); // categories for (unsigned i = 0; i < cats.size(); i++) { mainMenu->addItem(new CMenuForwarder(cats[i].title.c_str(), true, NULL, new CNKMovies(cNKFeedParser::CATEGORY, cats[i].id, cats[i].title), "", CRCInput::RC_nokey, NEUTRINO_ICON_NETZKINO)); } // search /* std::string search; CStringInputSMS stringInput(LOCALE_YT_SEARCH, &search); mainMenu->addItem(new CMenuForwarder(LOCALE_YT_SEARCH, true, search, &stringInput, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_NETZKINO)); mainMenu->addItem(new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, new CNKMovies(cNKFeedParser::SEARCH, 0, search), "", CRCInput::RC_nokey, NEUTRINO_ICON_NETZKINO)); */ mainMenu->exec(NULL, ""); mainMenu->hide(); delete mainMenu; mainMenu = NULL; }
void CNKMovies::showNKMoviesMenu() { dprintf(DEBUG_NORMAL, "CNKMovies::showNKMoviesMenu: mode:%d id:%d title:%s\n", catMode, catID, caption.c_str()); // CHintBox loadBox(LOCALE_NETZKINO, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); loadBox.paint(); loadNKTitles(catMode, caption, catID); loadBox.hide(); if(m_vMovieInfo.empty()) { MessageBox(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NK_ERROR), CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); return; } // std::string title; title = "NetzKino"; title += ": "; title += caption; moviesMenu = new CMenuFrameBox(title.c_str(), NEUTRINO_ICON_NETZKINO_SMALL); for (unsigned int i = 0; i < m_vMovieInfo.size(); i++) { moviesMenu->addItem(new CMenuFrameBoxItem(m_vMovieInfo[i].epgTitle.c_str(), this, "play", file_exists(m_vMovieInfo[i].tfile.c_str())? m_vMovieInfo[i].tfile.c_str() : DATADIR "/neutrino/icons/nopreview.jpg")); } //moviesMenu->setItemsPerPage(10, 3); moviesMenu->setItemBoxColor(COL_YELLOW); moviesMenu->setHeaderButtons(NKHeadButtons, NK_HEAD_BUTTONS_COUNT); moviesMenu->addKey(CRCInput::RC_info, this, CRCInput::getSpecialKeyName(CRCInput::RC_info)); moviesMenu->addKey(CRCInput::RC_record, this, CRCInput::getSpecialKeyName(CRCInput::RC_record)); moviesMenu->exec(NULL, ""); //moviesMenu->hide(); delete moviesMenu; moviesMenu = NULL; }
void EditModuleList::initialize() //------------------------------- { rescale(); move( frame().r ); centre(); _moduleBox = new ModuleList( this, _moduleBoxR.r ); _moduleBox->show(); _okButton = new WDefPushButton( this, _okButtonR.r, _okButtonR.t ); _cancelButton = new WPushButton( this, _cancelButtonR.r, _cancelButtonR.t ); _enableButton = new WPushButton( this, _enableButtonR.r, _enableButtonR.t ); _disableButton = new WPushButton( this, _disableButtonR.r, _disableButtonR.t ); _helpButton = new WPushButton( this, _helpButtonR.r, _helpButtonR.t ); _okButton->show(); _cancelButton->show(); _enableButton->show(); _disableButton->show(); _helpButton->show(); _okButton->onClick( this, (cbw) okButton ); _cancelButton->onClick( this, (cbw) cancelButton ); _enableButton->onClick( this, (cbw) enableButton ); _disableButton->onClick( this, (cbw) disableButton ); _helpButton->onClick( this, (cbw) helpButton ); if( _addRemove ) { _addButton = new WPushButton( this, _addButtonR.r, _addButtonR.t ); _removeButton = new WPushButton( this, _removeButtonR.r, _removeButtonR.t ); _addButton->show(); _removeButton->show(); _addButton->onClick( this, (cbw) addButton ); _removeButton->onClick( this, (cbw) removeButton ); } loadBox(); _moduleBox->reset(); _moduleBox->setFocus(); show(); }