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


C++ CGrid::GetAlphaIndex方法代码示例

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


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

示例1: OnLButtonDown

void CEasyGenView::OnLButtonDown(UINT nFlags, CPoint point)
{
	CEasyGenDoc *pDoc = GetDocument();
	S_POSINFO   inf;
	CTris       *t;
	CNmVec3     p;
	int         tab;

	m_LDP = point;

	BOOL kCTRL  = nFlags & MK_CONTROL;
	BOOL kSHIFT = nFlags & MK_SHIFT;

	BOOL Refresh = FALSE;

	int mod = pDoc->GetModifier();

	switch (tab = pDoc->GetActiveTab())
	{
	case (TAB_GRID):
		break;
	case (TAB_MODIFIER):

		// Get a vertex to drag(CTRL+SHIFT+LeftBut)
		if (kCTRL && kSHIFT)
		{
			if (GetXYZ(point, p))
			{
				if (g_Grid.GetInfo(p.x, p.y, &inf))
				{
					m_VertexGot = g_Grid.GetK(inf.i, inf.j);
				}
			}
		}

		// Exclude triangle from export | to prevent erroneus exclusion
		if (!kCTRL && kSHIFT && g_Grid.OptionExcludedTrisGet())
		{
			if (GetXYZ(point, p))
			{
				t = g_Grid.GetTris(g_Grid.GetTris(p.x, p.y));

				if (t)
				{
					t->SetExcluded(!t->GetExcluded());
					pDoc->m_bInvalidateGridColor = TRUE;
					Refresh                      = TRUE;
				}
			}
		}

		break;
	case (TAB_ALPHAMAP):
		int curindex;

		curindex = g_AlphamapMan.GetCurSel();

		// paint the alphamap (CTRL+SHIFT+LeftBut)
		if (kCTRL && kSHIFT && curindex != -1)
		{
			if (GetXYZ(point, p))
			{
				if (g_Grid.GetInfo(p.x, p.y, &inf))
				{
					m_VertexGot = g_Grid.GetK(inf.i, inf.j);
//					g_Grid.SetAlphaIndex(m_VertexGot, curindex );
					g_Grid.PaintAlphaIndex(inf.i, inf.j, pDoc->m_dwPaintRadius, curindex);
					Refresh = TRUE;
				}
			}
		}

		int indexgot;

		// copy alphamap index (SHIFT+LeftBut)
		if (!kCTRL && kSHIFT)
		{
			if (GetXYZ(point, p))
			{
				if (g_Grid.GetInfo(p.x, p.y, &inf))
				{
					m_VertexGot = g_Grid.GetK(inf.i, inf.j);
					indexgot    = g_Grid.GetAlphaIndex(m_VertexGot);
					if (indexgot != g_AlphamapMan.GetCurSel())
					{
						g_AlphamapMan.SetCurSel(indexgot);
						pDoc->UpdateFormView(TAB_ALPHAMAP);
					}
				}
			}
		}

		break;
	case (TAB_MODELS):

		// MD3 - Selecting
		if (!kCTRL && kSHIFT)
		{
			CNmVec3  ray, dummy;
			float    md3_dist, hitterra_dist;
//.........这里部分代码省略.........
开发者ID:etlegacy,项目名称:EasyGen,代码行数:101,代码来源:EasyGenView.cpp


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