您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GlobalRegistry函数代码示例

51自学网 2021-06-01 21:19:00
  C++
这篇教程C++ GlobalRegistry函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GlobalRegistry

// Loads the default shortcuts from the registryvoid 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,


示例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,


示例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,


示例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,


示例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,


示例6: switch

// Get default texturesTexturePtr 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,


示例7: GlobalRegistry

// RegistryKeyObserver implementation, gets called upon key changevoid 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,


示例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,


示例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,


示例10: ToggleShowSizeInfo

// greebo: This toggles the brush size info display in the ortho viewsvoid 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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,



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


C++ GlobalSceneGraph函数代码示例
C++ GlobalReAlloc函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。