MCPcopy Create free account
hub / github.com/Kitware/VTK / ResizeMainNodeTable

Method ResizeMainNodeTable

Common/DataModel/vtkReebGraph.cxx:1530–1556  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1528
1529//------------------------------------------------------------------------------
1530void vtkReebGraph::Implementation::ResizeMainNodeTable(int newSize)
1531{
1532 int oldsize, i;
1533
1534 if ((this->MainNodeTable.Size - this->MainNodeTable.Number) < newSize)
1535 {
1536 oldsize = this->MainNodeTable.Size;
1537
1538 if (!this->MainNodeTable.Size)
1539 this->MainNodeTable.Size = newSize;
1540 while ((this->MainNodeTable.Size - this->MainNodeTable.Number) < newSize)
1541 this->MainNodeTable.Size <<= 1;
1542
1543 this->MainNodeTable.Buffer = (vtkReebNode*)realloc(
1544 this->MainNodeTable.Buffer, sizeof(vtkReebNode) * this->MainNodeTable.Size);
1545
1546 for (i = oldsize; i < this->MainNodeTable.Size - 1; i++)
1547 {
1548 this->GetNode(i)->ArcDownId = i + 1;
1549 this->GetNode(i)->ArcUpId = -2;
1550 }
1551
1552 this->GetNode(i)->ArcDownId = this->MainNodeTable.FreeZone;
1553 this->GetNode(i)->ArcUpId = -2;
1554 this->MainNodeTable.FreeZone = oldsize;
1555 }
1556}
1557
1558//------------------------------------------------------------------------------
1559int vtkReebGraph::Implementation::CommitSimplification()

Callers

nothing calls this directly

Calls 1

GetNodeMethod · 0.95

Tested by

no test coverage detected