예제 #1
0
void FaceInstance::selectedChanged (const Selectable& selectable)
{
	if (selectable.isSelected()) {
		g_SelectedFaceInstances.insert(*this);
	} else {
		g_SelectedFaceInstances.erase(*this);
	}
	m_selectionChanged(selectable);
}
예제 #2
0
void FaceInstance::selectedChanged(const Selectable& selectable)
{
	if (selectable.isSelected())
	{
		Selection().push_back(this);
	}
	else
	{
		FaceInstanceSet::reverse_iterator found = std::find(Selection().rbegin(), Selection().rend(), this);

		// Emit an error if the instance is not in the list
		ASSERT_MESSAGE(found != Selection().rend(), "selection-tracking error");

		Selection().erase(--found.base());
	}

	if (m_selectionChanged)
	{
		m_selectionChanged(selectable);
	}
}