• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GlobalSelectionSystem函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GlobalSelectionSystem函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalSelectionSystem函数的具体用法?C++ GlobalSelectionSystem怎么用?C++ GlobalSelectionSystem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GlobalSelectionSystem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: resizeBrushesToBounds

void resizeBrushesToBounds(const AABB& aabb, const std::string& shader)
{
	if (GlobalSelectionSystem().getSelectionInfo().brushCount == 0)
	{
		gtkutil::MessageBox::ShowError(_("No brushes selected."), GlobalMainFrame().getTopLevelWindow());
		return;
	}

	GlobalSelectionSystem().foreachBrush([&] (Brush& brush)
	{ 
		brush.constructCuboid(aabb, shader, TextureProjection());
	});

	SceneChangeNotify();
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:15,代码来源:Primitives.cpp


示例2: cloneSelected

void cloneSelected(const cmd::ArgumentList& args)
{
	// Check for the correct editing mode (don't clone components)
	if (GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) {
		return;
	}

	UndoableCommand undo("cloneSelected");

	// Create the list that will take the cloned instances
	SelectionCloner::Map cloned;

	SelectionCloner cloner;
	GlobalSceneGraph().root()->traverse(cloner);

	// Create a new namespace and move all cloned nodes into it
	INamespacePtr clonedNamespace = GlobalNamespaceFactory().createNamespace();
	assert(clonedNamespace != NULL);

	// Move items into the temporary namespace, this will setup the links
	clonedNamespace->connect(cloner.getCloneRoot());

	// Get the namespace of the current map
	scene::IMapRootNodePtr mapRoot = GlobalMapModule().getRoot();
	if (mapRoot == NULL) return; // not map root (this can happen)

	INamespacePtr nspace = mapRoot->getNamespace();
	if (nspace)
    {
		// Prepare the nodes for import
		nspace->ensureNoConflicts(cloner.getCloneRoot());
		// Now move all nodes into the target namespace
		nspace->connect(cloner.getCloneRoot());
	}

	// Unselect the current selection
	GlobalSelectionSystem().setSelectedAll(false);

	// Finally, move the cloned nodes to their destination and select them
	cloner.moveClonedNodes(true);

	if (registry::getValue<int>(RKEY_OFFSET_CLONED_OBJECTS) == 1)
	{
		// Move the current selection by one grid unit to the "right" and "downwards"
		nudgeSelected(eNudgeDown);
		nudgeSelected(eNudgeRight);
	}
}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:48,代码来源:Transformation.cpp


示例3: mergeSelectedBrushes

void mergeSelectedBrushes(const cmd::ArgumentList& args)
{
	// Get the current selection
	BrushPtrVector brushes = selection::algorithm::getSelectedBrushes();

	if (brushes.empty()) {
		rMessage() << _("CSG Merge: No brushes selected.") << std::endl;
		wxutil::Messagebox::ShowError(_("CSG Merge: No brushes selected."));
		return;
	}

	if (brushes.size() < 2) {
		rMessage() << "CSG Merge: At least two brushes have to be selected.\n";
		wxutil::Messagebox::ShowError("CSG Merge: At least two brushes have to be selected.");
		return;
	}

	rMessage() << "CSG Merge: Merging " << brushes.size() << " brushes." << std::endl;

	UndoableCommand undo("mergeSelectedBrushes");

	// Take the last selected node as reference for layers and parent
	scene::INodePtr merged = GlobalSelectionSystem().ultimateSelected();

	scene::INodePtr parent = merged->getParent();
	assert(parent != NULL);

	// Create a new BrushNode
	scene::INodePtr node = GlobalBrushCreator().createBrush();

	// Insert the newly created brush into the (same) parent entity
	parent->addChildNode(node);

	// Move the new brush to the same layers as the merged one
	node->assignToLayers(merged->getLayers());

	// Get the contained brush
	Brush* brush = Node_getBrush(node);

	// Attempt to merge the selected brushes into the new one
	if (!Brush_merge(*brush, brushes, true))
	{
		rWarning() << "CSG Merge: Failed - result would not be convex." << std::endl;
		return;
	}

	ASSERT_MESSAGE(!brush->empty(), "brush left with no faces after merge");

	// Remove the original brushes
	for (BrushPtrVector::iterator i = brushes.begin(); i != brushes.end(); ++i)
	{
		scene::removeNodeFromParent(*i);
	}

	// Select the new brush
	Node_setSelected(node, true);

	rMessage() << "CSG Merge: Succeeded." << std::endl;
	SceneChangeNotify();
}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:60,代码来源:CSG.cpp


示例4: onEntryActivated

void SelectionSetToolmenu::onEntryActivated()
{
	// Create new selection set if possible
	std::string name = _entry->get_entry()->get_text();

	if (name.empty()) return;

	// don't create empty sets
	if (GlobalSelectionSystem().countSelected() == 0)
	{
		ui::IDialogPtr dialog = GlobalDialogManager().createMessageBox(
			_("Cannot create selection set"),
			_("Cannot create a selection set, there is nothing selected in the current scene."),
			ui::IDialog::MESSAGE_CONFIRM);

		dialog->run();
		return;
	}

	ISelectionSetPtr set = GlobalSelectionSetManager().createSelectionSet(name);

	assert(set != NULL);

	set->assignFromCurrentScene();

	// Clear the entry again
	_entry->get_entry()->set_text("");
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:28,代码来源:SelectionSetToolmenu.cpp


示例5: setFixedTessCmd

void PatchInspector::emitTesselation()
{
	UndoableCommand setFixedTessCmd("patchSetFixedTesselation");

	wxSpinCtrl* fixedSubdivX = findNamedObject<wxSpinCtrl>(this, "PatchInspectorSubdivisionsX");
	wxSpinCtrl* fixedSubdivY = findNamedObject<wxSpinCtrl>(this, "PatchInspectorSubdivisionsY");

	Subdivisions tess(
		fixedSubdivX->GetValue(),
		fixedSubdivY->GetValue()
	);

	bool fixed = findNamedObject<wxCheckBox>(this, "PatchInspectorFixedSubdivisions")->GetValue();

	// Save the setting into the selected patch(es)
	GlobalSelectionSystem().foreachPatch([&] (Patch& patch)
	{
		patch.setFixedSubdivisions(fixed, tess);
	});

	fixedSubdivX->Enable(fixed);
	fixedSubdivY->Enable(fixed);
	findNamedObject<wxStaticText>(this, "PatchInspectorSubdivisionsXLabel")->Enable(fixed);
	findNamedObject<wxStaticText>(this, "PatchInspectorSubdivisionsYLabel")->Enable(fixed);

	GlobalMainFrame().updateAllWindows();
}
开发者ID:nbohr1more,项目名称:DarkRadiant,代码行数:27,代码来源:PatchInspector.cpp


示例6: blocker

void ModelCache::refreshSelectedModels(const cmd::ArgumentList& args)
{
	// Disable screen updates for the scope of this function
	ui::ScreenUpdateBlocker blocker(_("Processing..."), _("Reloading Models"));

	// Find all models in the current selection
	ModelFinder walker;
	GlobalSelectionSystem().foreachSelected(walker);

	// Remove the selected models from the cache
	ModelFinder::ModelPaths models = walker.getModelPaths();

	for (ModelFinder::ModelPaths::const_iterator i = models.begin();
		 i != models.end(); ++i)
	{
		ModelMap::iterator found = _modelMap.find(*i);

		if (found != _modelMap.end())
		{
			_modelMap.erase(found);
		}
	}

	// Traverse the entities and submit a refresh call
	ModelFinder::Entities entities = walker.getEntities();

	for (ModelFinder::Entities::const_iterator i = entities.begin();
		 i != entities.end(); ++i)
	{
		(*i)->refreshModel();
	}
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:32,代码来源:ModelCache.cpp


示例7: PasteToCamera

void PasteToCamera (void)
{
	CamWnd& camwnd = *g_pParentWnd->GetCamWnd();
	GlobalSelectionSystem().setSelectedAll(false);

	UndoableCommand undo("pasteToCamera");

	Selection_Paste();

	// Work out the delta
	Vector3 mid = selection::algorithm::getCurrentSelectionCenter();
	Vector3 delta = vector3_snapped(camwnd.getCameraOrigin(), GlobalGrid().getGridSize()) - mid;

	// Move to camera
	GlobalSelectionSystem().translateSelected(delta);
}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:16,代码来源:commands.cpp


示例8: Scene_BrushResize_Selected

void Scene_BrushResize_Selected(scene::Graph& graph, const AABB& bounds, const char* shader)
{
  if(GlobalSelectionSystem().countSelected() != 0)
  {
    const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path();

    Brush* brush = Node_getBrush(path.top());
    if(brush != 0)
    {
      TextureProjection projection;
      TexDef_Construct_Default(projection);
      Brush_ConstructCuboid(*brush, bounds, shader, projection);
      SceneChangeNotify();
    }
  }
}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:16,代码来源:brushmanip.cpp


示例9: Entity_moveSelectedPrimitives

/// moves selected primitives to entity, which is or its primitive is ultimateSelected() or firstSelected()
void Entity_moveSelectedPrimitives( bool toLast ){
	if ( GlobalSelectionSystem().countSelected() < 2 ) {
		globalErrorStream() << "Source and target entity primitives should be selected!\n";
		return;
	}

	const scene::Path& path = toLast? GlobalSelectionSystem().ultimateSelected().path() : GlobalSelectionSystem().firstSelected().path();
	scene::Node& node = ( !Node_isEntity( path.top() ) && path.size() > 1 )? path.parent() : path.top();

	if ( Node_isEntity( node ) && node_is_group( node ) ) {
		StringOutputStream command;
		command << "movePrimitivesToEntity " << makeQuoted( Node_getEntity( node )->getEntityClass().name() );
		UndoableCommand undo( command.c_str() );
		Scene_parentSelectedBrushesToEntity( GlobalSceneGraph(), node );
	}
}
开发者ID:Garux,项目名称:netradiant-custom,代码行数:17,代码来源:entity.cpp


示例10: message

/**
 * Callback common to all of the commands that trigger a processing by mesh
 * visitor when selected. This callback does its own internal dispatch to
 * distinctly handle the various commands.
 *
 * @param commandString The command token.
 */
void
MainMenu::CommandMeshVisitor(const std::string& commandString)
{
   // Look up the registered mesh visitor for this command.
   VisitorMap::const_iterator visitorMapIter = _visitorMap.find(commandString);
   MeshVisitor *meshVisitor;
   if (visitorMapIter == _visitorMap.end() ||
       (meshVisitor = visitorMapIter->second) == NULL)
   {
      // That's odd, there isn't one. Bail out.
      std::string message(commandString + ": " + DIALOG_INTERNAL_ERROR);
      GenericPluginUI::ErrorReportDialog(DIALOG_ERROR_TITLE, message.c_str());
      return;
   }
   // Let Radiant know the name of the operation responsible for the changes
   // that are about to happen.
   UndoableCommand undo(commandString.c_str());
   // Apply the visitor to every selected mesh.
   meshVisitor->ResetVisitedCount();
   GlobalSelectionSystem().foreachSelected(*meshVisitor);
   if (meshVisitor->GetVisitedCount() == 0)
   {
      // Warn if there weren't any meshes selected (so nothing happened). 
      GenericPluginUI::WarningReportDialog(DIALOG_WARNING_TITLE,
                                           DIALOG_NOMESHES_MSG);
   }
}
开发者ID:Garux,项目名称:netradiant-custom,代码行数:34,代码来源:MainMenu.cpp


示例11: GlobalSelectionSystem

void LightNode::renderInactiveComponents(RenderableCollector& collector, const VolumeTest& volume, const bool selected) const
{
	// greebo: We are not in component selection mode (and the light is still selected),
	// check if we should draw the center of the light anyway
	if (selected
		&& GlobalSelectionSystem().ComponentMode() != SelectionSystem::eVertex
		&& EntitySettings::InstancePtr()->alwaysShowLightVertices())
	{
		if (_light.isProjected())
		{
			EntitySettings& settings = *EntitySettings::InstancePtr();
			const Vector3& colourStartEndInactive = settings.getLightVertexColour(EntitySettings::VERTEX_START_END_DESELECTED);
			const Vector3& colourVertexInactive = settings.getLightVertexColour(EntitySettings::VERTEX_DESELECTED);

			const_cast<Light&>(_light).colourLightStart() = colourStartEndInactive;
			const_cast<Light&>(_light).colourLightEnd() = colourStartEndInactive;
			const_cast<Light&>(_light).colourLightTarget() = colourVertexInactive;
			const_cast<Light&>(_light).colourLightRight() = colourVertexInactive;
			const_cast<Light&>(_light).colourLightUp() = colourVertexInactive;

			// Render the projection points
			_light.renderProjectionPoints(collector, volume, localToWorld());
		}
		else
		{
			const Vector3& colourVertexInactive = EntitySettings::InstancePtr()->getLightVertexColour(
				EntitySettings::VERTEX_INACTIVE);

			const_cast<Light&>(_light).getDoom3Radius().setCenterColour(colourVertexInactive);
			_light.renderLightCentre(collector, volume, localToWorld());
		}
	}
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:33,代码来源:LightNode.cpp


示例12: NudgeSelection

void NudgeSelection (ENudgeDirection direction, float fAmount, EViewType viewtype)
{
	AxisBase axes(AxisBase_forViewType(viewtype));
	Vector3 view_direction(-axes.z);
	Vector3 nudge(AxisBase_axisForDirection(axes, direction) * fAmount);
	GlobalSelectionSystem().NudgeManipulator(nudge, view_direction);
}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:7,代码来源:commands.cpp


示例13: evaluateTransform

void LightNode::evaluateTransform() {
	if (getType() == TRANSFORM_PRIMITIVE) {
		_light.translate(getTranslation());
		_light.rotate(getRotation());
	}
	else {
		// Check if the light center is selected, if yes, transform it, if not, it's a drag plane operation
		if (GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex) {
			if (_lightCenterInstance.isSelected()) {
				// Retrieve the translation and apply it to the temporary light center variable
				// This adds the translation vector to the previous light origin
				_light.getDoom3Radius().m_centerTransformed =
										_light.getDoom3Radius().m_center + getTranslation();
			}

			if (_lightTargetInstance.isSelected()) {
				// Delegate the work to the Light class
				_light.translateLightTarget(getTranslation());
			}

			if (_lightRightInstance.isSelected()) {
				// Save the new light_right vector
				_light.rightTransformed() = _light.right() + getTranslation();
			}

			if (_lightUpInstance.isSelected()) {
				// Save the new light_up vector
				_light.upTransformed() = _light.up() + getTranslation();
			}

			if (_lightStartInstance.isSelected()) {
				// Delegate the work to the Light class (including boundary checks)
				_light.translateLightStart(getTranslation());
			}

			if (_lightEndInstance.isSelected()) {
				// Save the new light_up vector
				_light.endTransformed() = _light.end() + getTranslation();
			}

			// If this is a projected light, then it is likely for the according vertices to have changed, so update the projection
			if (_light.isProjected()) {
				// Call projection changed, so that the recalculation can be triggered (call for projection() would be ignored otherwise)
				_light.projectionChanged();

				// Recalculate the frustum
				_light.projection();
			}
		}
		else {
			// Ordinary Drag manipulator
			//m_dragPlanes.m_bounds = _light.aabb();
			// greebo: Be sure to use the actual lightAABB for evaluating the drag operation, NOT
			// the aabb() or localABB() method, that returns the bounding box including the light center,
			// which may be positioned way out of the volume
			m_dragPlanes.m_bounds = _light.lightAABB();
			_light.setLightRadius(m_dragPlanes.evaluateResize(getTranslation(), rotation()));
		}
	}
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:60,代码来源:LightNode.cpp


示例14: GlobalSelectionSystem

// free all map elements, reinitialize the structures that depend on them
void Map::freeMap() {
    map::PointFile::Instance().clear();

    GlobalSelectionSystem().setSelectedAll(false);
    GlobalSelectionSystem().setSelectedAllComponents(false);

    GlobalShaderClipboard().clear();
    GlobalRegion().clear();

    m_resource->removeObserver(*this);

    // Reset the resource pointer
    m_resource = IMapResourcePtr();

    GlobalLayerSystem().reset();
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:17,代码来源:Map.cpp


示例15: Select_SetShader

void Select_SetShader (const std::string& shader)
{
	if (GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) {
		Scene_BrushSetShader_Selected(GlobalSceneGraph(), shader);
	}
	Scene_BrushSetShader_Component_Selected(GlobalSceneGraph(), shader);
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:7,代码来源:select.cpp


示例16: evaluateViewDependent

void BrushInstance::renderComponents (Renderer& renderer, const VolumeTest& volume) const
{
	m_brush.evaluateBRep();

	const Matrix4& localToWorld = Instance::localToWorld();

	renderer.SetState(m_brush.m_state_point, Renderer::eWireframeOnly);
	renderer.SetState(m_brush.m_state_point, Renderer::eFullMaterials);

	if (volume.fill() && GlobalSelectionSystem().ComponentMode() == SelectionSystem::eFace) {
		evaluateViewDependent(volume, localToWorld);
		renderer.addRenderable(m_render_faces_wireframe, localToWorld);
	} else {
		m_brush.renderComponents(GlobalSelectionSystem().ComponentMode(), renderer, volume, localToWorld);
	}
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:16,代码来源:BrushInstance.cpp


示例17: getDefaultBoundsFromSelection

AABB getDefaultBoundsFromSelection()
{
	AABB aabb = GlobalSelectionSystem().getWorkZone().bounds;

	float gridSize = GlobalGrid().getGridSize();

	if (aabb.extents[0] == 0)
	{
		aabb.extents[0] = gridSize;
	}

	if (aabb.extents[1] == 0)
	{
		aabb.extents[1] = gridSize;
	}

	if (aabb.extents[2] == 0)
	{
		aabb.extents[2] = gridSize;
	}

	if (aabb.isValid())
	{
		return aabb;
	}

	return AABB(Vector3(0, 0, 0), Vector3(64, 64, 64));
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:28,代码来源:Prefab.cpp


示例18: _index

GroupCycle::GroupCycle() :
	_index(0),
	_updateActive(false)
{
	GlobalSelectionSystem().addObserver(this);
	rescanSelection();
}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:7,代码来源:GroupCycle.cpp


示例19: entitylist_tree_select

static gboolean entitylist_tree_select(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data)
{
  GtkTreeIter iter;
  gtk_tree_model_get_iter(model, &iter, path);
  scene::Node* node;
  gtk_tree_model_get_pointer(model, &iter, 0, &node);
  scene::Instance* instance;
  gtk_tree_model_get_pointer(model, &iter, 1, &instance);
  Selectable* selectable = Instance_getSelectable(*instance);

  if(node == 0)
  {
    if(path_currently_selected != FALSE)
    {
      getEntityList().m_selection_disabled = true;
      GlobalSelectionSystem().setSelectedAll(false);
      getEntityList().m_selection_disabled = false;
    }
  }
  else if(selectable != 0)
  {
    getEntityList().m_selection_disabled = true;
    selectable->setSelected(path_currently_selected == FALSE);
    getEntityList().m_selection_disabled = false;
    return TRUE;
  }

  return FALSE;
}
开发者ID:clbr,项目名称:netradiant,代码行数:29,代码来源:entitylist.cpp


示例20: mirrorSelection

void mirrorSelection(int axis)
{
	Vector3 flip(1, 1, 1);
	flip[axis] = -1;

	GlobalSelectionSystem().scaleSelected(flip);
}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:7,代码来源:Transformation.cpp



注:本文中的GlobalSelectionSystem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GlobalSize函数代码示例发布时间:2022-05-30
下一篇:
C++ GlobalSceneGraph函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap