求助,在C# 執行vtkUnstructuredGrid grid; (int)grid.InsertNextCell(cell.CellType, cell.IdList)添加資料時,非常耗時,請問怎么才能提升執行效率,小白提問。
foreach (PartUnit model in parts2Nodes.Keys)
{
if (!model.Visible)
{
continue;
}
foreach (AbstractCell cell in model.Cells)
{
if (availableCellIds != null && availableCellIds.BinarySearch(cell.CellId) < 0)
{
continue;
}
if (filterScalarRange)
{
bool bOutofRange = false;
if (scalars.Length <= cell.CellId
|| scalars[cell.CellId] == null) continue;
dVal = scalars[cell.CellId][index];
if (dVal < minVal || dVal > maxVal)
{
bOutofRange = true;
}
if (bOutofRange) continue;
}
iCellId = (int)grid.InsertNextCell(cell.CellType, cell.IdList);
actualCellId2OriginalId[iCellId] = cell.CellId;
curScalars.Add(scalars[cell.CellId]);
int iCount = cell.Count;
foreach (int id in cell.Ids)
{
pointsState[id] = true;
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/43667.html
標籤:圖形處理/算法
上一篇:通過SHCreateShellFolderView中獲取XP桌面的IShellView
下一篇:mfc 進度條
