Home > Software engineering >  VTK vtkUnstructuredGrid. InsertNextCell;
VTK vtkUnstructuredGrid. InsertNextCell;

Time:09-17

For help, in the c # implementation vtkUnstructuredGrid grid; (int) grid. InsertNextCell (cell. CellType, cell. IdList) when adding data, time consuming, could you tell me how can I improve execution efficiency, small white question,
Foreach (PartUnit model in parts2Nodes. Keys)
{
if (! Model. The Visible)
{
continue;
}
Foreach (AbstractCell cell in the model. The Cells)
{
If (availableCellIds!=null & amp; & AvailableCellIds. BinarySearch (cell. CellId) & lt; 0)
{
continue;
}
If (filterScalarRange)
{
Bool bOutofRange=false;
If (scalars. Length & lt;=cell. The CellId
| | scalars [cell CellId]==null) continue;
DVal=scalars [cell CellId] [index];
If (dVal & lt; MinVal | | dVal & gt; Very much)
{
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. The Count;
Foreach (int id in the cell. The Ids)
{
PointsState [id]=true;
}
}
}
  • Related