Beispiel #1
0
void selectAllOfType(const cmd::ArgumentList& args) {
	if (GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) {
		if (GlobalSelectionSystem().ComponentMode() == SelectionSystem::eFace) {
			// Deselect all faces
			GlobalSelectionSystem().setSelectedAllComponents(false);
			// Select all faces carrying the shader selected in the Texture Browser
			Scene_BrushSelectByShader_Component(GlobalSceneGraph(), GlobalTextureBrowser().getSelectedShader());
		}
	}
	else {
		// Find any classnames of selected entities
		EntityGetSelectedClassnamesWalker classnameFinder;
		GlobalSelectionSystem().foreachSelected(classnameFinder);

		// De-select everything
		GlobalSelectionSystem().setSelectedAll(false);

		if (!classnameFinder.getClassnameList().empty()) {
			// Instantiate a selector class
			EntitySelectByClassnameWalker classnameSelector(
				classnameFinder.getClassnameList()
			);

			// Traverse the scenegraph, select all matching the classname list
			Node_traverseSubgraph(GlobalSceneGraph().root(), classnameSelector);
		}
		else {
			Scene_BrushSelectByShader(GlobalSceneGraph(), GlobalTextureBrowser().getSelectedShader());
			Scene_PatchSelectByShader(GlobalSceneGraph(), GlobalTextureBrowser().getSelectedShader());
		}
	}

	SceneChangeNotify();
}
	void TextureOverviewDialog::onSelectionChanged (GtkWidget* widget, TextureOverviewDialog* self)
	{
		self->_selectedTexture = gtkutil::TreeModel::getSelectedString(self->_selection, TEXTUREOVERVIEW_NAME);
		GlobalSelectionSystem().setSelectedAllComponents(false);
		GlobalSelectionSystem().setSelectedAll(false);
		if (GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) {
			Scene_BrushSelectByShader_Component(GlobalSceneGraph(), self->_selectedTexture);
		} else {
			Scene_BrushSelectByShader(GlobalSceneGraph(), self->_selectedTexture);
		}
	}