当前位置: 首页>>代码示例>>C++>>正文


C++ XMLTag::createChildTag方法代码示例

本文整理汇总了C++中XMLTag::createChildTag方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLTag::createChildTag方法的具体用法?C++ XMLTag::createChildTag怎么用?C++ XMLTag::createChildTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLTag的用法示例。


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

示例1: _setupXMLStructure

void SimulationOptions::_setupXMLStructure( Util::XMLParser & xmlOpts )
{
	XMLTag * root = xmlOpts.createRootTag("SteerSimOptions", "This file contains options for SteerSim.  Edit this file to your preference, and\nthen use the '-config' command line option to load these options in SteerSim.\nOptions specified by the command line will override options in this configuration file.");

	// primary option groups
	root->createChildTag("keyboard", "Maps various actions to keyboard input (config for keybaord not implemented yet!)");
	root->createChildTag("mouse", "Maps various actions to mouse input (config for mouse not implemented yet!)");
	XMLTag * guiTag = root->createChildTag("gui", "Options related to the openGL visualization and interaction.  Also, make sure to look at the engine driver options for more interface-related options.");
	XMLTag * globalTag = root->createChildTag("global", "Options related to the main execution of the steersim");
	XMLTag * engineTag = root->createChildTag("engine", "Options related to the simulation engine");
	XMLTag * gridDatabaseTag = root->createChildTag("gridDatabase", "Options related to the spatial database");
	XMLTag * engineDriversTag = root->createChildTag("engineDrivers", "Options related to engine drivers");
	root->createChildTag("modules", "Module-specific options.  Any options specified on the command-line will override the options specified here.  Modules specified here will not necessarily be loaded when started; for that use the startupModules option for the engine.", XML_DATA_TYPE_CONTAINER, NULL, &_moduleOptionsXMLParser );

	// option sub-groups
	engineDriversTag->createChildTag("commandLine", "Options for the command-line engine driver (currently there are no options for the command-line)");
	XMLTag * glfwEngineDriverTag = engineDriversTag->createChildTag("glfw", "Options for the GLFW engine driver");
	engineDriversTag->createChildTag("qt", "Options for the Qt engine driver (config for qt not implemented yet!)");

	// GUI options
	guiTag->createChildTag("useAntialiasing", "Set to \"true\" to remove jaggies, for smoother-looking visuals, but lower performance", XML_DATA_TYPE_BOOLEAN, &guiOptions.useAntialiasing);
	guiTag->createChildTag("useShadows", "DO NOT USE THIS VALUE.  It is only kept here for backwards compatibility.", XML_DATA_TYPE_BOOLEAN, &_dummyUseShadowsFlag);
	guiTag->createChildTag("useVsync", "Set to \"false\" for higher performance that is not synchronizeded with the display's refresh rate", XML_DATA_TYPE_BOOLEAN, &guiOptions.useVsync);
	guiTag->createChildTag("mouseRotationFactor", "Scaling factor for sensitivity of camera rotation when using mouse.", XML_DATA_TYPE_FLOAT, &guiOptions.mouseRotationFactor);
	guiTag->createChildTag("mouseZoomFactor", "Scaling factor for sensitivity of camera zoom when using mouse", XML_DATA_TYPE_FLOAT, &guiOptions.mouseZoomFactor);
	guiTag->createChildTag("mouseMovementFactor", "Scaling factor for sensitivity of camera movement when using mouse", XML_DATA_TYPE_FLOAT, &guiOptions.mouseMovementFactor);
	guiTag->createChildTag("canUseMouseSelection", "Set to \"true\" to be able to select agents with the mouse, \"false\" is recommended when using many many agents, because selection algorithm is brute-force and slow", XML_DATA_TYPE_BOOLEAN, &guiOptions.canUseMouseSelection);
	guiTag->createChildTag("canUseMouseWheelZoom", "Set to \"true\" to be able to zoom with the mouse wheel; this does not disable other possible ways to zoom the camera.", XML_DATA_TYPE_BOOLEAN, &guiOptions.canUseMouseWheelZoom);
	guiTag->createChildTag("cameraPosition", "Camera's physical position in the 3-D scene", XML_DATA_TYPE_XYZ, &guiOptions.cameraPosition);
	guiTag->createChildTag("cameraLookAt", "The 3-D point the camera will look at", XML_DATA_TYPE_XYZ, &guiOptions.cameraLookAt);
	guiTag->createChildTag("cameraUp", "The vector that represnts the upright orientation for the camera", XML_DATA_TYPE_XYZ, &guiOptions.cameraUp);
	guiTag->createChildTag("cameraVerticalFieldOfView", "The vertical field of view of the camera, in degrees", XML_DATA_TYPE_FLOAT, &guiOptions.cameraFovy);
	guiTag->createChildTag("backgroundColor", "The background color of the openGL visualization", XML_DATA_TYPE_RGB, &guiOptions.backgroundColor);
	guiTag->createChildTag("lineWidth", "width of lines drawn in the GUI", XML_DATA_TYPE_FLOAT, &guiOptions.lineWidth);

	// global options
	globalTag->createChildTag("engineDriver", "The name of the engine driver to use, if not specified from command line", XML_DATA_TYPE_STRING, &globalOptions.engineDriver);
	globalTag->createChildTag("redirectCoutToFile", "If a filename is specified, std::cout will be redirected to that filename.  NOTE: Only std::cout will be redirected; low-level and C-style output will not be redirected.", XML_DATA_TYPE_STRING, &globalOptions.coutRedirectionFilename);
	globalTag->createChildTag("redirectCerrToFile", "If a filename is specified, std::cerr will be redirected to that filename.  NOTE: Only std::cerr will be redirected; low-level and C-style output will not be redirected.  Exceptions will be caught and redirected to both the new and the original std::cerr output.", XML_DATA_TYPE_STRING, &globalOptions.cerrRedirectionFilename);
	globalTag->createChildTag("redirectClogToFile", "If a filename is specified, std::clog will be redirected to that filename.  NOTE: Only std::clog will be redirected; low-level and C-style output will not be redirected.", XML_DATA_TYPE_STRING, &globalOptions.clogRedirectionFilename);

	// engine options
	engineTag->createChildTag("moduleSearchPath","The default directory to search for dynamic plug-in modules at runtime.", XML_DATA_TYPE_STRING, &engineOptions.moduleSearchPath);
	engineTag->createChildTag("testCaseSearchPath","The default directory to search for test cases at runtime.", XML_DATA_TYPE_STRING, &engineOptions.testCaseSearchPath);
	engineTag->createChildTag("startupModules", "The list of modules to use on startup.  Modules specified by the command line will be merged with this list.", XML_DATA_TYPE_CONTAINER, NULL, &_startupModulesXMLParser);
	engineTag->createChildTag("numThreads", "The default number of threads to run on the simulation", XML_DATA_TYPE_UNSIGNED_INT, &engineOptions.numThreads);
	engineTag->createChildTag("numFrames", "The default number of frames to simulate - 0 means run the entire simulation until all agents are disabled.", XML_DATA_TYPE_UNSIGNED_INT, &engineOptions.numFramesToSimulate);
	engineTag->createChildTag("fixedFPS", "The fixed frames-per-second for the simulation clock.  This value is used when simulationClockMode is \"fixed-fast\" or \"fixed-real-time\".", XML_DATA_TYPE_FLOAT, &engineOptions.fixedFPS);
	engineTag->createChildTag("minVariableDt", "The minimum time-step allowed when the clock is in \"variable-real-time\" mode.  If the proposed time-step is smaller, this value will be used instead, effectively limiting the max frame rate.", XML_DATA_TYPE_FLOAT, &engineOptions.minVariableDt);
	engineTag->createChildTag("maxVariableDt", "The maximum time-step allowed when the clock is in \"variable-real-time\" mode.  If the proposed time-step is larger, this value will be used instead, at the expense of breaking synchronization between simulation time and real-time.", XML_DATA_TYPE_FLOAT, &engineOptions.maxVariableDt);
	engineTag->createChildTag("clockMode", "can be either \"fixed-fast\" (fixed simulation frame rate, running as fast as possible), \"fixed-real-time\" (fixed simulation frame rate, running in real-time), or \"variable-real-time\" (variable simulation frame rate in real-time).", XML_DATA_TYPE_STRING, &engineOptions.clockMode);

	// grid database options
	gridDatabaseTag->createChildTag("maxItemsPerGridCell", "Max number of items a grid cell can contain", XML_DATA_TYPE_UNSIGNED_INT, &gridDatabaseOptions.maxItemsPerGridCell);
	gridDatabaseTag->createChildTag("sizeX", "Total size of the grid along the X axis", XML_DATA_TYPE_FLOAT, &gridDatabaseOptions.gridSizeX);
	gridDatabaseTag->createChildTag("sizeZ", "Total size of the grid along the Z axis", XML_DATA_TYPE_FLOAT, &gridDatabaseOptions.gridSizeZ);
	gridDatabaseTag->createChildTag("numCellsX", "Number of cells in the grid along the X axis", XML_DATA_TYPE_UNSIGNED_INT, &gridDatabaseOptions.numGridCellsX);
	gridDatabaseTag->createChildTag("numCellsZ", "Number of cells in the grid along the Z axis", XML_DATA_TYPE_UNSIGNED_INT, &gridDatabaseOptions.numGridCellsZ);
	gridDatabaseTag->createChildTag("draw", "Draws the grid if \"true\".", XML_DATA_TYPE_BOOLEAN, &gridDatabaseOptions.drawGrid);

	// GLFW engine driver options
	glfwEngineDriverTag->createChildTag("startWithClockPaused", "Starts the clock paused if \"true\".", XML_DATA_TYPE_BOOLEAN, &glfwEngineDriverOptions.pausedOnStart);
	glfwEngineDriverTag->createChildTag("windowSizeX", "Width of the openGL window in pixels", XML_DATA_TYPE_UNSIGNED_INT, &glfwEngineDriverOptions.windowSizeX);
	glfwEngineDriverTag->createChildTag("windowSizeY", "Height of the openGL window in pixels", XML_DATA_TYPE_UNSIGNED_INT, &glfwEngineDriverOptions.windowSizeY);
	glfwEngineDriverTag->createChildTag("windowPositionX", "Position of the openGL window in x", XML_DATA_TYPE_UNSIGNED_INT, &glfwEngineDriverOptions.windowPositionX);
	glfwEngineDriverTag->createChildTag("windowPositionY", "Position of the openGL window in y", XML_DATA_TYPE_UNSIGNED_INT, &glfwEngineDriverOptions.windowPositionY);
	glfwEngineDriverTag->createChildTag("windowTitle", "Title of the openGL window", XML_DATA_TYPE_STRING, &glfwEngineDriverOptions.windowTitle);
	glfwEngineDriverTag->createChildTag("fullscreen", "Uses fullscreen (rather than windowed) mode if \"true\".", XML_DATA_TYPE_BOOLEAN, &glfwEngineDriverOptions.fullscreen);
	glfwEngineDriverTag->createChildTag("stereoMode", "The stereoscopic mode. Can be one of \"off\", \"side-by-side\", \"top-and-bottom\", or \"quadbuffer\".", XML_DATA_TYPE_STRING, &glfwEngineDriverOptions.stereoMode);
}
开发者ID:CG-F15-12-Rutgers,项目名称:SteerLite,代码行数:70,代码来源:SimulationOptions.cpp


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