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


C++ GetCell函数代码示例

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


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

示例1: GetItemText

CString CVariablesGrid::GetFullName( int row )
{
	// Get the full name.
	CString fullName = GetItemText( row, 0 );
	CGridTreeCell* treeCell = (CGridTreeCell*)GetCell( row, 0 );
	int curLevel = treeCell->GetLevel();
	if (curLevel > 1)
	{
		for (int i = row - 1; i >= 1; --i)
		{
			if (curLevel <= 1)
				break;
			CGridTreeCell* treeCell = (CGridTreeCell*)GetCell(i, 0);
			int level = treeCell->GetLevel();
			if (level == curLevel - 1)
			{
				// Found a new part to tack on.
				fullName = GetItemText(i, 0) + "." + fullName;
				curLevel--;
			}
		}
	}

	return fullName;
}
开发者ID:ClowReed32,项目名称:Cthugha-Engine-Demos,代码行数:25,代码来源:VariablesGrid.cpp

示例2: GetCell

void GeneratorData::LinkCells( glm::vec2 posA, glm::vec2 posB )
{
    auto& cellA = GetCell( posA );
    auto& cellB = GetCell( posB );
    if (posA.x > posB.x)
    {
        cellA.AddEntrance( EntranceType::Left );
        cellB.AddEntrance( EntranceType::Right );
    }
    else if (posA.y > posB.y)
    {
        cellA.AddEntrance( EntranceType::Bottom );
        cellB.AddEntrance( EntranceType::Top );
    }
    else if (posA.x < posB.x)
    {
        cellA.AddEntrance( EntranceType::Right );
        cellB.AddEntrance( EntranceType::Left );
    }
    else
    {
        cellA.AddEntrance( EntranceType::Top );
        cellB.AddEntrance( EntranceType::Bottom );
    }
}
开发者ID:HalalUr,项目名称:Reaping2,代码行数:25,代码来源:generator_data.cpp

示例3: GetCell

bool JelloMesh::isInterior(const JelloMesh::Spring& s) const
{
    int i1,j1,k1,i2,j2,k2;
    GetCell(s.m_p1, i1, j1, k1);
    GetCell(s.m_p2, i2, j2, k2);
    return isInterior(i1,j1,k1) || isInterior(i2,j2,k2);
}
开发者ID:SafeKing,项目名称:cis-563,代码行数:7,代码来源:jelloMesh.cpp

示例4: GetGridBkColor

//清除上次选中行
void QuoteTableCtrlGeneralSort::RefreshWnd()
{
	COLORREF color = GetGridBkColor();
	CRect rectCell, rectRow;
	CCellID cell =  GetCellFromPt(m_LastDownPoint);

	CGridCellBase* pCell = GetCell(cell.row, cell.col);
	BOOL bInTextArea = FALSE;
	if (pCell)
	{

		if (GetCellRect(cell.row, cell.col, rectCell) &&
			pCell->GetTextRect(rectCell))
		{
			bInTextArea = rectCell.PtInRect(m_LastDownPoint);
		}
	}

	if ( bInTextArea )
	{
		for (int i=0; i<GetColumnCount(); i++)
		{
			pCell = GetCell(cell.row, i);
		/*	pCell->GetBackClr();*/
			if (pCell)
			{
				pCell->SetState(/*pCell->GetState() | */m_iColProp->GetColumnMask(GetHeadID(i)));
				pCell->SetBackClr(color);
			}
		}
	}
	Invalidate();
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:34,代码来源:QuoteGeneralSortTabCtrl.cpp

示例5: GetColByKey

bool C4Scoreboard::SortBy(int32_t iColKey, bool fReverse)
{
	// get sort col
	int32_t iCol = GetColByKey(iColKey);
	if (iCol<0) return false;
	// sort
	int32_t iSortDir = fReverse ? -1 : +1;
	int32_t iSortBegin=1, iSortEnd=iRows-1;
	while (iSortBegin < iSortEnd)
	{
		int32_t iNewBorder = iSortBegin; int32_t i;
		for (i = iSortBegin; i < iSortEnd; ++i)
			if (GetCell(iCol, i)->iVal * iSortDir > GetCell(iCol, i+1)->iVal * iSortDir)
			{
				SwapRows(i, i+1);
				iNewBorder = i;
			}
		iSortEnd = iNewBorder;
		for (i = iSortEnd; i > iSortBegin; --i)
			if (GetCell(iCol, i-1)->iVal * iSortDir > GetCell(iCol, i)->iVal * iSortDir)
			{
				SwapRows(i-1, i);
				iNewBorder = i;
			}
		iSortBegin = iNewBorder;
	}
	return true;
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:28,代码来源:C4Scoreboard.cpp

示例6: GetCell

void GMassMobAppearGrid::SaveParse(GStageLevel* pStage)
{
	CGridCellBase* cell =  NULL;
	GtLongNumberString num;
	for( gint i = 1 ; i < GetRowCount() ; i++ )
	{
		GStageLevel::MassAppearMob mob;

		cell = GetCell( i, 0 );
		num.SetNumber( (gtchar*)cell->GetText() );
		mob.mIndex = (guint32)num.GetNumber( 0 );

		cell = GetCell( i, 1 );
		num.SetNumber( (gtchar*)cell->GetText() );
		mob.mLevel = (guint32)num.GetNumber( 0 );

		cell = GetCell( i, 2 );
		num.SetNumber( (gtchar*)cell->GetText() );
		mob.mNumLine = (guint32)num.GetNumber( 0 );

		cell = GetCell( i, 3 );
		num.SetNumber( (gtchar*)cell->GetText() );
		mob.mNumMobCount = (guint32)num.GetNumber( 0 );

		pStage->AddMassAppearMob( mob );
	}
}
开发者ID:mujige77,项目名称:WebGame,代码行数:27,代码来源:GMassMobAppearGrid.cpp

示例7: int

/**
	@brief	multi sort function.

	@author	BHK
*/
BOOL CGridCtrlEx::MultiSortItems(const int& low , const int& high)
{
///	if (high == -1)
///		high = GetRowCount() - 1;
	
	int lo = low;
	int hi = high;
	const int mid= int((lo + hi)*0.5);

	ResetSelectedRange();
	SetFocusCell(-1, - 1);

	for(int i = low;i < high;++i)
	{
		for(int j = i + 1;j <= high;++j)
		{
			if(MultiCompare(i , j) > 0)
			{
				for (int col = 0; col < GetColumnCount(); col++)
				{
					CGridCellBase *pCell = GetCell(i, col);
					SetCell(i, col, GetCell(j, col));
					SetCell(j, col, pCell);
				}
				UINT nRowHeight    = m_arRowHeights[i];
				m_arRowHeights[i] = m_arRowHeights[j];
				m_arRowHeights[j] = nRowHeight;
			}
		}
	}
	
	return TRUE;
}
开发者ID:radtek,项目名称:e-load,代码行数:38,代码来源:GridCtrlEx.cpp

示例8: UpdateCell

void UpdateCell(World *const w, unsigned int cellX, unsigned int cellY)
{
	
	unsigned char count = 0;
	//Set up the bounds for our search, ensuring that they are
	//within the array.
	int fromX = cellX - 1;
	//Commented-out functionality is pre world-wrapping
	//if(fromX < 0) {
	//	fromX = 0;
	//}
	int toX = cellX + 1;
	//if(toX >= w->width) {
	//	toX = w->width-1;
	//}
	int fromY = cellY - 1;
	//if(fromY < 0) {
	//	fromY = 0;
	//}
	int toY = cellY + 1;
	//if(toY >= w->height) {
	//	toY = w->height-1;
	//}
	bool ourCell = false; //TODO: Should it default false?
	//Search for adjacent tiles.
	for(int itY = fromY; itY <= toY; ++itY)
	{
		for(int itX = fromX; itX <= toX; ++itX)
		{
		//Is this just our cell?
			if((itX == cellX) && (itY == cellY))
			{
				ourCell = GetCell(w, itX, itY);	
			}
			else if(GetCell(w, itX, itY) == true)
			{
				++count;
			}
		}
	}
	if((count < 2) && (ourCell == true))
	{
		//Death by underpopulation
		SetCell(w, cellX, cellY, false);
	}
	else if((count > 3) && (ourCell == true))
	{
		//Death by overcrowding
		SetCell(w, cellX, cellY, false);
	}
	//Two neighbors on a live cell does nothing.
	//Three on an empty cell creates a live cell (reproduction):
	else if((count == 3) && (ourCell == false))
	{
		SetCell(w, cellX, cellY, true);
	}
};
开发者ID:NotGyro,项目名称:GameOfLife,代码行数:57,代码来源:world.c

示例9: GetCell

void cPath::ProcessIfWalkable(const Vector3i & a_Location, cPathCell * a_Parent, int a_Cost)
{
	cPathCell * cell = GetCell(a_Location);
	int x, y, z;

	// Make sure we fit in the position.
	for (y = 0; y < m_BoundingBoxHeight; ++y)
	{
		for (x = 0; x < m_BoundingBoxWidth; ++x)
		{
			for (z = 0; z < m_BoundingBoxWidth; ++z)
			{
				if (GetCell(a_Location + Vector3i(x, y, z))->m_IsSolid)
				{
					return;
				}
			}
		}
	}

	/*
	y = -1;
	for (x = 0; x < m_BoundingBoxWidth; ++x)
	{
		for (z = 0; z < m_BoundingBoxWidth; ++z)
		{
			if (!GetCell(a_Location + Vector3i(x, y, z))->m_IsSolid)
			{
				return;
			}
		}
	}
	ProcessCell(cell, a_Parent, a_Cost);
	*/

	// Make sure there's at least 1 piece of solid below us.

	bool GroundFlag = false;
	y =-1;
	for (x = 0; x < m_BoundingBoxWidth; ++x)
	{
		for (z = 0; z < m_BoundingBoxWidth; ++z)
		{
			if (GetCell(a_Location + Vector3i(x, y, z))->m_IsSolid)
			{
				GroundFlag = true;
				break;
			}
		}
	}

	if (GroundFlag)
	{
		ProcessCell(cell, a_Parent, a_Cost);
	}
}
开发者ID:SamJBarney,项目名称:cuberite,代码行数:56,代码来源:Path.cpp

示例10: sqrt

void Grid::Addconnections(const int i, const int j, const int iAdder, const int jAdder)
{
    //Centeri = i +
    double Dist = sqrt(iAdder * iAdder + jAdder * jAdder);

    Cell* c1 = GetCell(i,j);
    Cell* c2 = GetCell(i+iAdder,j+jAdder);
    Cell* c3 = GetCell(i-iAdder,j+jAdder);
    Cell* c4 = GetCell(i+iAdder,j-jAdder);
    Cell* c5 = GetCell(i-iAdder,j-jAdder);

    if(c2 && CheckVisibility(c1->Pos,c2->Pos))
        cells[i][j].AddConnection(GetCell(i+iAdder,j+jAdder), Dist);
    if(iAdder != 0)
        if(c3 && CheckVisibility(c1->Pos,c3->Pos))
            cells[i][j].AddConnection(GetCell(i-iAdder,j+jAdder), Dist);
    if(jAdder != 0)
        if(c4 && CheckVisibility(c1->Pos,c4->Pos))
            cells[i][j].AddConnection(GetCell(i+iAdder,j-jAdder), Dist);
    if(iAdder != 0 && jAdder != 0)
        if(c5 && CheckVisibility(c1->Pos,c5->Pos))
            cells[i][j].AddConnection(GetCell(i-iAdder,j-jAdder), Dist);


}
开发者ID:JesseMoll,项目名称:SpiderKiller,代码行数:25,代码来源:Grid.cpp

示例11: GetCell

void CTWenUGCtrlEx::SwapRow(long i, long j)
{
	CUGCell ci, cj;
	for(int cols=0; cols<GetNumberCols(); cols++)
	{
		GetCell(cols, i, &ci);
		GetCell(cols, j, &cj);
		SetCell(cols, i, &cj);
		SetCell(cols, j, &ci);
	}
}
开发者ID:Wanghuaichen,项目名称:SignalProcess,代码行数:11,代码来源:CTWenUGCtrlEx.cpp

示例12: GetCell

void XYViewGridControl::UpdateXYData()
{
    for (int i = 1; i < GetRowCount(); i++)
    {
        GetCell(i, 1)->UpdateText();
        GetCell(i, 2)->UpdateText();
    }

    AutoSize();

    InvalidateAll();
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:12,代码来源:DPO_ViewXYPS.cpp

示例13: GetData

void
GLUndoElementCut::Undo()
{
	// change value to old value
	GetData()->InsertElement(GetCell(), itsValue);

	// create undo object to change it back
	GLUndoElementAppend* undo = 
		new GLUndoElementAppend(GetTable(), GetCell());
	assert(undo != NULL);
	NewUndo(undo);
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:12,代码来源:GLUndoElementCut.cpp

示例14: GetCell

void CvTacticalAnalysisMap::EstablishZoneNeighborhood()
{
	//walk over the map and see which zones are adjacent
	int iW = GC.getMap().getGridWidth();
	int iH = GC.getMap().getGridHeight();

	for(unsigned int iI = 0; iI < m_DominanceZones.size(); iI++)
	{
		m_DominanceZones[iI].ClearNeighboringZones();
	}

	for (int i=0; i<iW; i++)
	{
		for (int j=0; j<iH; j++)
		{
			CvPlot* pA = GC.getMap().plot(i,j);
			CvPlot* pB = GC.getMap().plot(i,j+1);
			CvPlot* pC = GC.getMap().plot(i+1,j);

			CvTacticalAnalysisCell* cA = pA ? GetCell( pA->GetPlotIndex() ) : NULL;
			CvTacticalAnalysisCell* cB = pB ? GetCell( pB->GetPlotIndex() ) : NULL;
			CvTacticalAnalysisCell* cC = pC ? GetCell( pC->GetPlotIndex() ) : NULL;

			if (cA && cB)
			{
				int iA = cA->GetDominanceZone();
				int iB = cB->GetDominanceZone();
				if (iA!=-1 && iB!=-1 && 
					GetZoneByID(iA)->GetTerritoryType()!=TACTICAL_TERRITORY_NO_OWNER &&
					GetZoneByID(iB)->GetTerritoryType()!=TACTICAL_TERRITORY_NO_OWNER
					)
				{
					GetZoneByID(iA)->AddNeighboringZone(iB);
					GetZoneByID(iB)->AddNeighboringZone(iA);
				}
			}
			if (cA && cC)
			{
				int iA = cA->GetDominanceZone();
				int iC = cC->GetDominanceZone();
				if (iA!=-1 && iC!=-1 &&
					GetZoneByID(iA)->GetTerritoryType()!=TACTICAL_TERRITORY_NO_OWNER &&
					GetZoneByID(iC)->GetTerritoryType()!=TACTICAL_TERRITORY_NO_OWNER
					)
				{
					GetZoneByID(iA)->AddNeighboringZone(iC);
					GetZoneByID(iC)->AddNeighboringZone(iA);
				}
			}
		}
	}
}
开发者ID:kawyua,项目名称:Community-Patch-DLL,代码行数:52,代码来源:CvTacticalAnalysisMap.cpp

示例15: GetCell

bool World::IsNewLand(MapPoint const &p) const
{
    if (INVALID_CONTINENT == GetCell(p)->GetContinent())
    {
        uint32 e = GetCell(p)->GetEnv();

        return (e & k_BIT_MOVEMENT_TYPE_LAND)
            || (e & k_BIT_MOVEMENT_TYPE_MOUNTAIN)
            || (e & k_MASK_ENV_CANAL_TUNNEL);
    }

    return false;
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:13,代码来源:WrldCont.cpp


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