void SelectionMarkerController::updateInternal() { if(m_inController) return; m_inController = true; FrameSelection* selection = m_frame->selection(); ASSERT(selection); IntRect selectionBounds = enclosingIntRect(selection->bounds()); if(selectionBounds.isEmpty()) { hideMarkers(); m_inController = false; return; } attachMarkers(); IntPoint start(selectionBounds.x(), selectionBounds.y()); IntPoint end(selectionBounds.x() + selectionBounds.width(), selectionBounds.y() + selectionBounds.height()); IntRect bounds = offsetForPosition(selection->start()); if(!bounds.isEmpty()) { start = bounds.location(); } bounds = offsetForPosition(selection->end()); if(!bounds.isEmpty()) { end.setX(bounds.maxX()); end.setY(bounds.maxY()); } showMarkers(start, end); m_inController = false; }
void DBaseDlg::loadGraspButton_clicked(){ PROF_RESET_ALL; PROF_START_TIMER(GET_GRASPS); //get the current hand and check its validity Hand *hand = graspItGUI->getIVmgr()->getWorld()->getCurrentHand(); if (!hand) { DBGA("Load and select a hand before viewing grasps!"); return; } //check the currently loaded model if(!mCurrentLoadedModel){ DBGA("Load model first!"); return; } //clear the previously loaded grasps deleteVectorElements<db_planner::Grasp*, GraspitDBGrasp*>(mGraspList); mGraspList.clear(); mCurrentFrame = 0; //get new grasps from database manager PROF_START_TIMER(GET_GRASPS_CALL); if(!mDBMgr->GetGrasps(*mCurrentLoadedModel,hand->getDBName().toStdString(), &mGraspList)){ DBGA("Load grasps failed"); mGraspList.clear(); return; } PROF_STOP_TIMER(GET_GRASPS_CALL); for(std::vector<db_planner::Grasp*>::iterator it = mGraspList.begin(); it != mGraspList.end(); ){ if( QString((*it)->GetSource().c_str()) == typesComboBox->currentText() || typesComboBox->currentText() == "ALL") ++it; else{ delete (*it); mGraspList.erase(it); } } //set corresponding indices and show the grasp QString numTotal, numCurrent; numTotal.setNum(mGraspList.size()); if(!mGraspList.empty()){ numCurrent.setNum(mCurrentFrame + 1); graspsGroup->setEnabled(TRUE); showGrasp(0); showMarkers(); } else{ numCurrent.setNum(0); graspsGroup->setEnabled(FALSE); } graspIndexLabel->setText(numCurrent + "/" + numTotal); PROF_STOP_TIMER(GET_GRASPS); PROF_PRINT_ALL; }
void TextFrame::ApplyGlobalConfig() { wxFileConfig* conf = wxGetApp().getConfig(); showCaretLine(conf->ReadBool(CONFPATH_EDITOR_SHOWCARETLINE, CONFDEFAULT_EDITOR_SHOWCARETLINE)); showWhiteSpaces(conf->ReadBool(CONFPATH_EDITOR_SHOWWHITESPACES, CONFDEFAULT_EDITOR_SHOWWHITESPACES)); showIndentationGuides(conf->ReadBool(CONFPATH_EDITOR_SHOWINDENTGUIDES, CONFDEFAULT_EDITOR_SHOWINDENTGUIDES)); showEOL(conf->ReadBool(CONFPATH_EDITOR_SHOWENDOFLINES, CONFDEFAULT_EDITOR_SHOWENDOFLINES)); wrapLongLines(conf->ReadBool(CONFPATH_EDITOR_WRAPLONGLINES, CONFDEFAULT_EDITOR_WRAPLONGLINES)); showLineNumbers(conf->ReadBool(CONFPATH_EDITOR_MARGINLINENUMBERS, CONFDEFAULT_EDITOR_MARGINLINENUMBERS)); showMarkers(conf->ReadBool(CONFPATH_EDITOR_MARGINMARKERS, CONFDEFAULT_EDITOR_MARGINMARKERS)); showFolders(conf->ReadBool(CONFPATH_EDITOR_MARGINFOLDERS, CONFDEFAULT_EDITOR_MARGINFOLDERS)); showLongLines(conf->ReadBool(CONFPATH_EDITOR_MARGINLONGLINES, CONFDEFAULT_EDITOR_MARGINLONGLINES)); }
//trigger when the grasp type is changed between pregrasp and final grasp void DBaseDlg::graspTypeChanged(){ showGrasp(mCurrentFrame); showMarkers(); }