• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetCell函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: JConvertToBoolean

JBoolean
JXTable::HitSamePart
	(
	const JPoint& pt1,
	const JPoint& pt2
	)
	const
{
	JPoint cell1, cell2;
	return JConvertToBoolean( GetCell(pt1, &cell1) &&
							  GetCell(pt2, &cell2) &&
							  cell1 == cell2 );
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:13,代码来源:JXTable.cpp


示例17: cells

void OCME::BuildImpostorsHierarchy(std::vector<Cell*> & fromCells){
	++impostor_updated;
	/*
	The impostors are built bottom up, starting from the smallest cells (lowest h)
	*/
	std::vector<CellKey> cells_by_level [256];

	std::vector<Cell*>::iterator ci;


	// phase 1. fill the array of level with the cells and compute centroid and data occupancy
	for(ci  = fromCells.begin(); ci != fromCells.end(); ++ci){
		(*ci)->impostor->SetCentroids();
		CellKey & ck = (*ci)->key;
		cells_by_level[COff(ck.h)].push_back(ck);
	}

	unsigned int level = 0;
	while( (level  < 256) &&  cells_by_level[level].empty() ) {++level;} // find the lowest non empty level
	if(level == 256) return;												// if the database is empty return

	// phase 2., bottom up updating of the impostors
	std::vector<vcg::Point3f> smp;
//	unsigned int tmpEnd = level+5;
	for( ; level  < 255;++level ){

			::RemoveDuplicates(cells_by_level[level]);
		// build of the impostors of this level
		for(unsigned int i = 0; i <cells_by_level[level].size();++i) 
				GetCell( cells_by_level[level][i],false)->impostor->Create( this,cells_by_level[level][i]);
		for(unsigned int i = 0; i <cells_by_level[level].size();++i) 
				GetCell( cells_by_level[level][i],false)->impostor->ClearDataCumulate();

		for(unsigned int i = 0; i <cells_by_level[level].size();++i){
			const CellKey &  k = cells_by_level[level][i];
			Cell* cell = GetCell( k,false);
			assert(cell);
			if(!cell->rd->impostor_updated()){
				const CellKey & pk = Parent(k);
			//	to_insert  = (GetCell( pk,false)==NULL);
				if(!UpdateImpostor(pk) /*&& to_insert*/)
					cells_by_level[level+1].push_back(pk);
				else
					octree_roots.push_back(GetCell(pk));
			}
		}
	}
}
开发者ID:GuoXinxiao,项目名称:meshlab,代码行数:48,代码来源:ocme_impostor.cpp


示例18: GetClosestPath

vector<Cell> GetClosestPath(const model::World& world,
                            Cell const & start, Direction const start_dir, Cell const & finish, Game const & game)
{
    
    static map<cashe_key, vector<Cell> > cacshe;
    static int bonus_hash = 0;
    int bonus_hash_cur = 0;
    auto const & map = world.getTilesXY();
    vector<vector<int>> bonuses(map.size(), vector<int>(map[0].size(), 0));
    for (Bonus const & bonus: world.getBonuses())
    {
        bonus_hash_cur += bonus.getX() * bonus.getX() + bonus.getY() * bonus.getY();
        auto bonus_cell= GetCell(bonus, game);
        bonuses[bonus_cell.m_x][bonus_cell.m_y] = (bonus.getType() == PURE_SCORE || bonus.getType() == REPAIR_KIT) ? 1 : 0;
    }
    if (bonus_hash !=  bonus_hash_cur)
    {
        bonus_hash = bonus_hash_cur;
        cacshe.clear();
    }
    
    
    
    cashe_key ck = {start, start_dir, finish};
    if (cacshe.count(ck) == 1)
        return cacshe[ck];
    
    MapT data;
    DSF(world.getTilesXY(), {start, start_dir}, {start, start_dir}, finish, data, bonuses);
    //    PrintMap(world.getTilesXY(), data);
    
    vector<Cell> res;
    int const INF = 1000000;
    int best = INF;
    MapKeyT cur = {finish, LEFT};
    for (auto dir: AllDirections())
    {
        if (data.count({finish,dir}) == 0)
            continue;
        if (data[{finish,dir}].first < best)
        {
            best = data[{finish,dir}].first;
            cur = {finish,dir};
        }
        
    }
    if (best == INF)
        return res;
    
    
    while (cur.first != start)
    {
        res.push_back(cur.first);
        cur = data[cur].second;
    }
    res.push_back(start);
    reverse(res.begin(), res.end());
    cacshe[ck] = res;
    return res;
}
开发者ID:sergey-pisarchik,项目名称:AICup-2015,代码行数:60,代码来源:PathUtils.cpp


示例19: ASSERT

  //
  // Reset
  //
  // Set default values in all cells
  //
  void Placement::Reset()
  {
    ASSERT(IsSetup());

    for (S32 z = 0; z < size.z; z++)
    {
      for (S32 x = 0; x < size.x; x++)
      {
        // Get the required cell
        Cell &cell = GetCell(x, z);

        // Does this cell lie on the footprint
        cell.onFoot = ((x > 0) && (x < size.x - 1) && (z > 0) && (z < size.z - 1));

        // Set default data
        cell.result = PR_NONE;
        cell.map.Set(0, 0);
        cell.zip.Set(-1, -1);
        cell.type.Set(x - 1, z - 1);
      }
    }   

    // Reset best height
    thumpHeight = 0.0F;
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:30,代码来源:footprint_placement.cpp


示例20: radiusPoint

void CUniformGrid::GetUnitsInRadius(NodeVector * dstVector, const Vector3 & point, float radius)
{
	const Vector3 radiusPoint(radius, radius, 0);

	int minX, minY;
	CellCoordFromMapPoint(&minX, &minY, point - radiusPoint);
	minX = math::max(0, math::min(minX, (m_Width - 1)));
	minY = math::max(0, math::min(minY, (m_Height - 1)));

	int maxX, maxY;
	CellCoordFromMapPoint(&maxX, &maxY, point + radiusPoint);
	maxX = math::max(0, math::min(maxX, (m_Width - 1)));
	maxY = math::max(0, math::min(maxY, (m_Height - 1)));

	dstVector->clear();

	for (int y = minY; y <= maxY; ++y)
	{
		for (int x = minX; x <= maxX; ++x)
		{
			// FIXME: non optimal - square, refactor me
			NodeVector *  gridVector = GetCell(x, y);
			dstVector->insert(dstVector->end(), gridVector->begin(), gridVector->end());
		}
	}
}
开发者ID:wolves3d,项目名称:PlayrixTest,代码行数:26,代码来源:UniformGrid.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCenter函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCasterGUID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap