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


C++ Output::FollowMouseAndDraw方法代码示例

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


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

示例1: Execute

void AddGate::Execute()
{
	//Get a Pointer to the Input / Output Interfaces
	Output* pOut = pManager->GetOutput();
	Input* pIn = pManager->GetInput();

	//A generic gate pointer to hold any type of gate to be added
	Gate *pG = NULL;

	//Create new object of a gate according to the type of the action
	switch (ActType)
	{
	case ADD_AND_GATE_2:
	{
		pG = new AND2(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_OR_GATE_2:
	{
		pG = new OR2(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_Buff:
	{
		pG = new BUFFER(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_INV:
	{
		pG = new NOT(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_NAND_GATE_2:
	{
		pG = new NAND2(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_NOR_GATE_2:
	{
		pG = new NOR2(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_XOR_GATE_2:
	{
		pG = new XOR2(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_XNOR_GATE_2:
	{
		pG = new XNOR2(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_AND_GATE_3:
	{
		pG = new AND3(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_OR_GATE_3:
	{
		pG = new OR3(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_NAND_GATE_3:
	{
		pG = new NAND3(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_NOR_GATE_3:
	{
		pG = new NOR3(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_XOR_GATE_3:
	{
		pG = new XOR3(GInfo, AND2_FANOUT);
		break;
	}
	case ADD_XNOR_GATE_3:
	{
		pG = new XNOR3(GInfo, AND2_FANOUT);
		break;
	}
	}

	//if redo draw the gate in it's initial position
	if (REDO)
	{
		string GateImage = "Images\\PNG Gates\\", GateNumber;
		stringstream ss;
		ss << (int)ActType ;
		ss >> GateNumber;
		GateImage += GateNumber + ".png";
		pManager->GetOutput()->DrawPNGImage(GateImage, GInfo);
		pManager->AddComponent(pG);
		return;
	}

	//if the gate wase successfully added this will return true and false if escape key was pressed to cancel the addition
	if (pOut->FollowMouseAndDraw(pManager, pG))
		pManager->AddComponent(pG), GInfo = pG->get_GraphicInfo();
//.........这里部分代码省略.........
开发者ID:3bhady,项目名称:Logic-Simulator,代码行数:101,代码来源:AddGate.cpp


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