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


C++ TRACK::Delete方法代码示例

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


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

示例1: handleKeyPress

/* function to handle key press events */
void handleKeyPress( SDL_keysym *keysym )
{
	VERTEX tvec1, tvec2, fr, fl, bl, br, camray, selvert;
	QUATERNION trot;
	BEZIER * lastbez;
	BEZIER * colbez;
	ROADSTRIP * tempstrip;
	BEZIER patch;
	bool l;
	int i;
	string tstr;
	
	//else if (timefactor == 0 && !menu.InMenu()) timefactor = 0;
		//		else timefactor = 1.0;
//	else
	{
		switch ( keysym->sym )
		{
		case SDLK_ESCAPE:
			/* ESC key was pressed */
			Quit( 0 );
			//menu.MainMenu();
			break;
		/*case SDLK_F7:
			
			tvec1 = tvec1.rotate(0,0,6.21652);
			cout << tvec1[0] << "," << tvec1[1] << endl;
		
			
			tvec2.Set(44.464,-126.8737,0);
			
			trot.Rotate(6.21652, 0, 0, 1);
			tvec2 = trot.RotateVec(tvec2);
			tvec2.DebugPrint();
			break;*/
		/*case SDLK_F7:
			if (timefactor != 100.0f)
				timefactor = 100.0f;
			else
				timefactor = 1.0f;
			break;*/
		/*case SDLK_PAGEUP:
			//tmpvert = cam.GetVelocity();
			cam.MoveRelative(0.0f, 0.0f, -2.0f);
			//cam.Update();
			//cam.LoadVelocityIdentity();
			break;
		case SDLK_PAGEDOWN:
			//tmpvert = cam.GetVelocity();
			cam.MoveRelative(0.0f, 0.0f, 2.0f);
			//cam.Update();
			//cam.LoadVelocityIdentity();
			break;*/
			
		case SDLK_BACKSPACE:
			if (activestrip != NULL)
			{
				if (activestrip->DeleteLastPatch())
				{
					if (activestrip->NumPatches() == 0)
					{
						mq1.AddMessage("Deleted patch and empty road");
						track.Delete(activestrip);
						activestrip = NULL;
						editordata.numbezinput = 0;
					}
					else
					{
						mq1.AddMessage("Deleted patch");
						lastbez = activestrip->GetLastPatch();
						if (lastbez != NULL)
						{
							editordata.bezinput[0] = lastbez->points[0][0];
							editordata.bezinput[1] = lastbez->points[0][1];
							editordata.bezinput[2] = lastbez->points[0][2];
							editordata.bezinput[3] = lastbez->points[0][3];
						}
						else
							editordata.numbezinput = 0;
					}
				}
				else
					mq1.AddMessage("Can't delete patch: no patches on this road");
			}
			else
			{
				mq1.AddMessage("Can't delete patch: no road selected");
			}
			break;
			
		case 'h':
			editordata.helppage++;
			break;
		
		case 'd':
			if (activestrip != NULL)
			{
				track.Delete(activestrip);
				mq1.AddMessage("Deleted road.");
//.........这里部分代码省略.........
开发者ID:VDrift,项目名称:trackeditor,代码行数:101,代码来源:main.cpp


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