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

C++ GlobalRegistry函数代码示例

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

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



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

示例1: GlobalRegistry

// Loads the default shortcuts from the registry
void EventManager::loadAccelerators() {
	if (_debugMode) {
		std::cout << "EventManager: Loading accelerators...\n";
	}

	xml::NodeList shortcutSets = GlobalRegistry().findXPath("user/ui/input//shortcuts");

	if (_debugMode) {
		std::cout << "Found " << shortcutSets.size() << " sets.\n";
	}

	// If we have two sets of shortcuts, delete the default ones
	if (shortcutSets.size() > 1) {
		GlobalRegistry().deleteXPath("user/ui/input//shortcuts[@name='default']");
	}

	// Find all accelerators
	xml::NodeList shortcutList = GlobalRegistry().findXPath("user/ui/input/shortcuts//shortcut");

	if (shortcutList.size() > 0) {
		rMessage() << "EventManager: Shortcuts found in Registry: " <<
			static_cast<int>(shortcutList.size()) << std::endl;
		for (unsigned int i = 0; i < shortcutList.size(); i++) {
			const std::string key = shortcutList[i].getAttributeValue("key");

			if (_debugMode) {
				std::cout << "Looking up command: " << shortcutList[i].getAttributeValue("command") << "\n";
				std::cout << "Key is: >> " << key << " << \n";
			}

			// Try to lookup the command
			IEventPtr event = findEvent(shortcutList[i].getAttributeValue("command"));

			// Check for a non-empty key string
			if (key != "") {
				 // Check for valid command definitions were found
				if (!event->empty()) {
					// Get the modifier string (e.g. "SHIFT+ALT")
					const std::string modifierStr = shortcutList[i].getAttributeValue("modifiers");

					if (!duplicateAccelerator(key, modifierStr, event)) {
						// Create the accelerator object
						IAccelerator& accelerator = addAccelerator(key, modifierStr);

						// Connect the newly created accelerator to the command
						accelerator.connectEvent(event);
					}
				}
				else {
					rWarning() << "EventManager: Cannot load shortcut definition (command invalid)."
						<< std::endl;
				}
			}
		}
	}
	else {
		// No accelerator definitions found!
		rWarning() << "EventManager: No shortcut definitions found..." << std::endl;
	}
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:61,代码来源:EventManager.cpp


示例2: GlobalRegistry

void StimTypes::save()
{
	// Find the storage entity
	std::string storageEClass = GlobalRegistry().get(RKEY_STORAGE_ECLASS);
	Entity* storageEntity = findEntityByClass(storageEClass);

	if (storageEntity != NULL)
	{
		std::string prefix = GlobalRegistry().get(RKEY_STORAGE_PREFIX);

		// Clean the storage entity from any previous definitions
		{
			// Instantiate a visitor to gather the keys to delete
			CustomStimRemover remover(storageEntity);
			// Visit each keyvalue with the <self> class as visitor
			storageEntity->forEachKeyValue(remover);
			// Scope ends here, the keys are deleted now
			// as the CustomStimRemover gets destructed
		}

		// Now store all custom stim types to the storage entity
		for (StimTypeMap::iterator i = _stimTypes.begin(); i != _stimTypes.end(); ++i)
		{
			StimType& s = i->second;
			std::string idStr = string::to_string(i->first);

			if (s.custom) {
				// spawnarg is something like "editor_dr_stim_1002" => "MyStim"
				storageEntity->setKeyValue(prefix + idStr, s.caption);
			}
		}
	}
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:33,代码来源:StimTypes.cpp


示例3: GlobalRegistry

void WindowPosition::saveToPath(const std::string& path)
{
	GlobalRegistry().setAttribute(path, "xPosition", string::to_string(_position[0]));
	GlobalRegistry().setAttribute(path, "yPosition", string::to_string(_position[1]));
	GlobalRegistry().setAttribute(path, "width", string::to_string(_size[0]));
	GlobalRegistry().setAttribute(path, "height", string::to_string(_size[1]));
}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:7,代码来源:WindowPosition.cpp


示例4: rMessage

void Clipper::initialiseModule(const ApplicationContext& ctx)
{
	rMessage() << "Clipper::initialiseModule called\n";

	_useCaulk = registry::getValue<bool>(RKEY_CLIPPER_USE_CAULK);
	_caulkShader = GlobalRegistry().get(RKEY_CLIPPER_CAULK_SHADER);

	GlobalRegistry().signalForKey(RKEY_CLIPPER_USE_CAULK).connect(
        sigc::mem_fun(this, &Clipper::keyChanged)
    );
	GlobalRegistry().signalForKey(RKEY_CLIPPER_CAULK_SHADER).connect(
        sigc::mem_fun(this, &Clipper::keyChanged)
    );

	constructPreferences();

	// Register the clip commands
	GlobalCommandSystem().addCommand("ClipSelected", boost::bind(&Clipper::clipSelectionCmd, this, _1));
	GlobalCommandSystem().addCommand("SplitSelected", boost::bind(&Clipper::splitSelectedCmd, this, _1));
	GlobalCommandSystem().addCommand("FlipClip", boost::bind(&Clipper::flipClipperCmd, this, _1));

	// Connect some events to these commands
	GlobalEventManager().addCommand("ClipSelected", "ClipSelected");
	GlobalEventManager().addCommand("SplitSelected", "SplitSelected");
	GlobalEventManager().addCommand("FlipClip", "FlipClip");
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:26,代码来源:Clipper.cpp


示例5: GlobalRegistry

void SplitPaneLayout::saveStateToPath(const std::string& path)
{
	GlobalRegistry().createKeyWithName(path, "pane", "horizontal");
	_splitPane.posHPane.saveToPath(path + "/pane[@name='horizontal']");

	GlobalRegistry().createKeyWithName(path, "pane", "vertical1");
	_splitPane.posVPane1.saveToPath(path + "/pane[@name='vertical1']");

	GlobalRegistry().createKeyWithName(path, "pane", "vertical2");
	_splitPane.posVPane2.saveToPath(path + "/pane[@name='vertical2']");

	GlobalRegistry().deleteXPath(RKEY_SPLITPANE_VIEWTYPES);
	xml::Node node = GlobalRegistry().createKey(RKEY_SPLITPANE_VIEWTYPES);

	// Camera is assigned -1 as viewtype
	int topLeft = _quadrants[QuadrantTopLeft].xyWnd != NULL ? _quadrants[QuadrantTopLeft].xyWnd->getViewType() : -1;
	int topRight = _quadrants[QuadrantTopRight].xyWnd != NULL ? _quadrants[QuadrantTopRight].xyWnd->getViewType() : -1;
	int bottomLeft = _quadrants[QuadrantBottomLeft].xyWnd != NULL ? _quadrants[QuadrantBottomLeft].xyWnd->getViewType() : -1;
	int bottomRight = _quadrants[QuadrantBottomRight].xyWnd != NULL ? _quadrants[QuadrantBottomRight].xyWnd->getViewType() : -1;

	node.setAttributeValue("topleft", string::to_string(topLeft));
	node.setAttributeValue("topright", string::to_string(topRight));
	node.setAttributeValue("bottomleft", string::to_string(bottomLeft));
	node.setAttributeValue("bottomright", string::to_string(bottomRight));
}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:25,代码来源:SplitPaneLayout.cpp


示例6: switch

// Get default textures
TexturePtr Doom3ShaderSystem::getDefaultInteractionTexture(ShaderLayer::Type t)
{
    TexturePtr defaultTex;

    // Look up based on layer type
    switch (t)
    {
    case ShaderLayer::DIFFUSE:
    case ShaderLayer::SPECULAR:
        defaultTex = GetTextureManager().getBinding(
            GlobalRegistry().get(RKEY_BITMAPS_PATH) + IMAGE_BLACK
        );
        break;

    case ShaderLayer::BUMP:
        defaultTex = GetTextureManager().getBinding(
            GlobalRegistry().get(RKEY_BITMAPS_PATH) + IMAGE_FLAT
        );
        break;
	default:
		break;
    }

    return defaultTex;
}
开发者ID:nbohr1more,项目名称:DarkRadiant,代码行数:26,代码来源:Doom3ShaderSystem.cpp


示例7: GlobalRegistry

// RegistryKeyObserver implementation, gets called upon key change
void MapCompiler::keyChanged (const std::string& changedKey, const std::string& newValue)
{
	_errorCheckParameters = GlobalRegistry().get(RKEY_ERROR_CHECK_PARAMETERS);
	_errorFixParameters = GlobalRegistry().get(RKEY_ERROR_FIX_PARAMETERS);
	_compilerBinary = GlobalRegistry().get(RKEY_COMPILER_BINARY);
	_compileParameters = GlobalRegistry().get(RKEY_COMPILE_PARAMETERS);
	_materialParameters = GlobalRegistry().get(RKEY_MATERIAL_PARAMETERS);
}
开发者ID:ibrahimmusba,项目名称:ufoai,代码行数:9,代码来源:MapCompiler.cpp


示例8: loadFromPath

void WindowPosition::loadFromPath(const std::string& path)
{
	_position[0] = string::convert<int>(GlobalRegistry().getAttribute(path, "xPosition"));
	_position[1] = string::convert<int>(GlobalRegistry().getAttribute(path, "yPosition"));

	_size[0] = string::convert<int>(GlobalRegistry().getAttribute(path, "width"));
	_size[1] = string::convert<int>(GlobalRegistry().getAttribute(path, "height"));
}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:8,代码来源:WindowPosition.cpp


示例9: _index

MapPosition::MapPosition(unsigned int index) :
    _index(index),
    _position(0,0,0),
    _angle(0,0,0)
{
    // Construct the entity key names from the index
    _posKey = GlobalRegistry().get(RKEY_MAP_POSROOT) + string::to_string(_index);
    _angleKey = GlobalRegistry().get(RKEY_MAP_ANGLEROOT) + string::to_string(_index);
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:9,代码来源:MapPosition.cpp


示例10: ToggleShowSizeInfo

// greebo: This toggles the brush size info display in the ortho views
void ToggleShowSizeInfo ()
{
	if (GlobalRegistry().get("user/ui/showSizeInfo") == "1") {
		GlobalRegistry().set("user/ui/showSizeInfo", "0");
	} else {
		GlobalRegistry().set("user/ui/showSizeInfo", "1");
	}
	SceneChangeNotify();
}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:10,代码来源:commands.cpp


示例11: GlobalRegistry

void MainFrame::SaveWindowInfo (void)
{
	// Delete all the current window states from the registry
	GlobalRegistry().deleteXPath(RKEY_WINDOW_STATE);

	// Tell the position tracker to save the information
	_windowPosition.saveToPath(RKEY_WINDOW_STATE);

	GdkWindow* window = GTK_WIDGET(m_window)->window;
	if (window != NULL)
		GlobalRegistry().setAttribute(RKEY_WINDOW_STATE, "state", string::toString(gdk_window_get_state(window)));
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:12,代码来源:mainframe.cpp


示例12: GlobalRegistry

void Map::removeCameraPosition() {
    const std::string keyLastCamPos = GlobalRegistry().get(RKEY_LAST_CAM_POSITION);
    const std::string keyLastCamAngle = GlobalRegistry().get(RKEY_LAST_CAM_ANGLE);

    if (m_world_node != NULL) {
        // Retrieve the entity from the worldspawn node
        Entity* worldspawn = Node_getEntity(m_world_node);
        assert(worldspawn != NULL); // This must succeed

        worldspawn->setKeyValue(keyLastCamPos, "");
        worldspawn->setKeyValue(keyLastCamAngle, "");
    }
}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:13,代码来源:Map.cpp


示例13: GlobalRegistry

void MouseEventManager::loadCameraEventDefinitions ()
{
	xml::NodeList camviews = GlobalRegistry().findXPath("user/ui/input//cameraview");

	if (camviews.size() > 0) {

		// Find all the camera definitions
		xml::NodeList eventList = camviews[0].getNamedChildren("event");

		if (eventList.size() > 0) {
			globalOutputStream() << "MouseEventManager: Camera Definitions found: " << eventList.size() << "\n";
			for (unsigned int i = 0; i < eventList.size(); i++) {
				// Get the event name
				const std::string eventName = eventList[i].getAttributeValue("name");

				// Check if any recognised event names are found and construct the according condition.
				if (eventName == "EnableFreeLookMode") {
					_cameraConditions[ui::camEnableFreeLookMode] = getCondition(eventList[i]);
				} else if (eventName == "DisableFreeLookMode") {
					_cameraConditions[ui::camDisableFreeLookMode] = getCondition(eventList[i]);
				} else {
					globalOutputStream() << "MouseEventManager: Warning: Ignoring unknown event name: " << eventName
							<< "\n";
				}
			}
		} else {
			// No Camera definitions found!
			globalOutputStream() << "MouseEventManager: Critical: No camera event definitions found!\n";
		}
	} else {
		// No Camera definitions found!
		globalOutputStream() << "MouseEventManager: Critical: No camera event definitions found!\n";
	}
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:34,代码来源:MouseEvents.cpp


示例14: rMessage

void RadiantSelectionSystem::initialiseModule(const ApplicationContext& ctx) 
{
    rMessage() << "RadiantSelectionSystem::initialiseModule called.\n";

    constructStatic();

    SetManipulatorMode(eTranslate);
    pivotChanged();

    _sigSelectionChanged.connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::pivotChangedSelection)
    );

    GlobalGrid().signal_gridChanged().connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::pivotChanged)
    );

    GlobalRegistry().signalForKey(RKEY_ROTATION_PIVOT).connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::keyChanged)
    );

    // Pass a reference to self to the global event manager
    GlobalEventManager().connectSelectionSystem(this);

    // Connect the bounds changed caller
    GlobalSceneGraph().signal_boundsChanged().connect(
        sigc::mem_fun(this, &RadiantSelectionSystem::onSceneBoundsChanged)
    );

    GlobalRenderSystem().attachRenderable(*this);
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:31,代码来源:RadiantSelectionSystem.cpp


示例15: GlobalRegistry

void MRU::saveRecentFiles()
{
	// Delete all existing MRU/element nodes
	GlobalRegistry().deleteXPath(RKEY_MAP_MRUS);

	std::size_t counter = 1;

	// Now wade through the list and save them in the correct order
	for (MRUList::const_iterator i = _list.begin(); i != _list.end(); ++counter, ++i)
	{
		const std::string key = RKEY_MAP_MRUS + "/map" + string::to_string(counter);

		// Save the string into the registry
		GlobalRegistry().set(key, (*i));
	}
}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:16,代码来源:MRU.cpp


示例16: _numMaxFiles

MRU::MRU() :
	_numMaxFiles(registry::getValue<int>(RKEY_MRU_LENGTH)),
	_loadLastMap(registry::getValue<bool>(RKEY_LOAD_LAST_MAP)),
	_list(_numMaxFiles),
	_emptyMenuItem(_(RECENT_FILES_CAPTION), *this, 0)
{
	GlobalRegistry().signalForKey(RKEY_MRU_LENGTH).connect(
        sigc::mem_fun(this, &MRU::keyChanged)
    );

	// Add the preference settings
	constructPreferences();

	// Create _numMaxFiles menu items
	for (std::size_t i = 0; i < _numMaxFiles; i++) {

		_menuItems.push_back(MRUMenuItem(string::to_string(i), *this, i+1));

		MRUMenuItem& item = (*_menuItems.rbegin());

		const std::string commandName = std::string("MRUOpen") + string::to_string(i+1);

		// Connect the command to the last inserted menuItem
		GlobalCommandSystem().addCommand(
			commandName,
			std::bind(&MRUMenuItem::activate, &item, std::placeholders::_1)
		);
		GlobalEventManager().addCommand(commandName, commandName);
	}
}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:30,代码来源:MRU.cpp


示例17: renderWireframe

		void renderWireframe (Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const
		{
			renderSolid(renderer, volume, localToWorld, selected);
			if (GlobalRegistry().get("user/ui/xyview/showEntityNames") == "1") {
				renderer.addRenderable(m_renderName, localToWorld);
			}
		}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:7,代码来源:miscmodel.cpp


示例18: GlobalRegistry

void MouseEventManager::loadCameraStrafeDefinitions()
{
	// Find all the camera strafe definitions
	xml::NodeList strafeList = GlobalRegistry().findXPath("user/ui/input/cameraview/strafemode");

	if (!strafeList.empty())
	{
		// Get the strafe condition flags
		_toggleStrafeCondition.modifierFlags = _modifiers.getModifierFlags(strafeList[0].getAttributeValue("toggle"));
		_toggleForwardStrafeCondition.modifierFlags = _modifiers.getModifierFlags(strafeList[0].getAttributeValue("forward"));

		try {
			_strafeSpeed = boost::lexical_cast<float>(strafeList[0].getAttributeValue("speed"));
		}
		catch (boost::bad_lexical_cast e) {
			_strafeSpeed = DEFAULT_STRAFE_SPEED;
		}

		try {
			_forwardStrafeFactor = boost::lexical_cast<float>(strafeList[0].getAttributeValue("forwardFactor"));
		}
		catch (boost::bad_lexical_cast e) {
			_forwardStrafeFactor = 1.0f;
		}
	}
	else {
		// No Camera strafe definitions found!
		rMessage() << "MouseEventManager: Critical: No camera strafe definitions found!\n";
	}
}
开发者ID:nbohr1more,项目名称:DarkRadiant,代码行数:30,代码来源:MouseEvents.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GlobalSceneGraph函数代码示例发布时间:2022-05-30
下一篇:
C++ GlobalReAlloc函数代码示例发布时间: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