void SceneViewerContextMenu::enterVectorImageGroup() {
  if (m_groupIndexToBeEntered == -1) return;

  TVectorImageP vi =
      (TVectorImageP)TTool::getImage(false);  // getCurrentImage();
  if (!vi) return;
  vi->enterGroup(m_groupIndexToBeEntered);
  TSelection *selection = TSelection::getCurrent();
  if (selection) selection->selectNone();
  m_viewer->update();
}
void TSelectionHandle::setSelection(TSelection *selection)
{
	if (getSelection() == selection)
		return;
	TSelection *oldSelection = getSelection();
	if (oldSelection) {
		oldSelection->selectNone();
		// disable selection related commands
		CommandManager *commandManager = CommandManager::instance();
		int i;
		for (i = 0; i < (int)m_enabledCommandIds.size(); i++)
			commandManager->setHandler(m_enabledCommandIds[i].c_str(), 0);
		m_enabledCommandIds.clear();
	}
	m_selectionStack.back() = selection;
	if (selection)
		selection->enableCommands();
	emit selectionSwitched(oldSelection, selection);
}