本文整理汇总了C++中MapLayer::GetGridCellFromCoord方法的典型用法代码示例。如果您正苦于以下问题:C++ MapLayer::GetGridCellFromCoord方法的具体用法?C++ MapLayer::GetGridCellFromCoord怎么用?C++ MapLayer::GetGridCellFromCoord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapLayer
的用法示例。
在下文中一共展示了MapLayer::GetGridCellFromCoord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTopographiccalculationSideofstream
void CWet_hView::OnTopographiccalculationSideofstream()
{
MapLayer *pSourceLayer = gpMapWnd->m_pMap->GetLayer( "Cells" );
MapLayer *pToLayer = gpMapWnd->m_pMap->GetLayer("STRGRID");
MapLayer *pFlowDirectionLayer = gpMapWnd->m_pMap->GetLayer("FLOWDIR");
int colToSet = pSourceLayer->GetFieldCol("SIDE");
int thisCount = pSourceLayer->GetRecordCount();
int order = -1;
for ( int i=0; i < thisCount; i++ )
{
Poly *pPoly = pSourceLayer->GetPolygon(i);
float test = pPoly->GetArea();
Vertex centroid = pPoly->GetCentroid();
// int colOrder = pSourceLayer->GetFieldCol("ORDER");
// pSourceLayer->GetData(i,colOrder,order);
int side = -1;
// if (order == 1)
// side = 0;
// else
// {
int row = 0;
int col = 0;
pFlowDirectionLayer->GetGridCellFromCoord( centroid.x, centroid.y, row, col);
side = pFlowDirectionLayer->GetSideOfStream(row, col, pToLayer);
// }
pSourceLayer->SetData(i, colToSet, side);
}
}