bool ViewCollection::remove(unsigned int Key) { ViewInstancesHash::iterator iNode= m_ViewInstanceHash.find(Key); if (iNode != m_ViewInstanceHash.end()) { // Ok, the key exist if (selectionSize() > 0) { // if the geometry is selected, unselect it unselect(Key); } m_MainInstances.remove(Key); m_ViewInstanceHash.remove(Key); // Delete the conteneur //qDebug("ViewCollection::removeNode : Element succesfuly deleted"); return true; } else { // KO, key doesn't exist return false; } }
bool GLC_3DViewCollection::remove(GLC_uint Key) { ViewInstancesHash::iterator iNode= m_3DViewInstanceHash.find(Key); if (iNode != m_3DViewInstanceHash.end()) { // Ok, the key exist if (selectionSize() > 0) { // if the geometry is selected, unselect it unselect(Key); } m_MainInstances.remove(Key); m_3DViewInstanceHash.remove(Key); // Delete the conteneur // Bounding box validity if (NULL != m_pBoundingBox) { delete m_pBoundingBox; m_pBoundingBox= NULL; } //qDebug("GLC_3DViewCollection::removeNode : Element succesfuly deleted"); return true; } else { // KO, key doesn't exist return false; } }
void EventCanvas::selectAtTick(unsigned int tick)/*{{{*/ { CItemList list = _items; if(multiPartSelectionAction && !multiPartSelectionAction->isChecked()) list = getItemlistForCurrentPart(); //CItemList list = getItemlistForCurrentPart(); //Select note nearest tick, if none selected and there are any if (!list.empty() && selectionSize() == 0) { iCItem i = list.begin(); CItem* nearest = i->second; while (i != list.end()) { CItem* cur = i->second; unsigned int curtk = abs(cur->x() + cur->part()->tick() - tick); unsigned int neartk = abs(nearest->x() + nearest->part()->tick() - tick); if (curtk < neartk) { nearest = cur; } i++; } if (!nearest->isSelected()) { selectItem(nearest, true); if(editor->isGlobalEdit()) populateMultiSelect(nearest); songChanged(SC_SELECTION); } itemPressed(nearest); m_tempPlayItems.append(nearest); QTimer::singleShot(NOTE_PLAY_TIME, this, SLOT(playReleaseForItem())); } }/*}}}*/
bool hasSelection() const { return selectionSize() > 0; }