本文整理匯總了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;
}
示例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 );
}
}
示例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);
}
示例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();
}
示例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;
}
示例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 );
}
}
示例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;
}
示例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);
}
};
示例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);
}
}
示例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);
}
示例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);
}
}
示例12: GetCell
void XYViewGridControl::UpdateXYData()
{
for (int i = 1; i < GetRowCount(); i++)
{
GetCell(i, 1)->UpdateText();
GetCell(i, 2)->UpdateText();
}
AutoSize();
InvalidateAll();
}
示例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);
}
示例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);
}
}
}
}
}
示例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;
}