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

Method ResizeMainArcTable

Common/DataModel/vtkReebGraph.cxx:2310–2335  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2308
2309//------------------------------------------------------------------------------
2310void vtkReebGraph::Implementation::ResizeMainArcTable(int newSize)
2311{
2312 int oldsize, i;
2313 if ((this->MainArcTable.Size - this->MainArcTable.Number) < newSize)
2314 {
2315 oldsize = this->MainArcTable.Size;
2316 if (!this->MainArcTable.Size)
2317 this->MainArcTable.Size = newSize;
2318 while ((this->MainArcTable.Size - this->MainArcTable.Number) < newSize)
2319 this->MainArcTable.Size <<= 1;
2320
2321 this->MainArcTable.Buffer =
2322 (vtkReebArc*)realloc(this->MainArcTable.Buffer, sizeof(vtkReebArc) * this->MainArcTable.Size);
2323 for (i = oldsize; i < this->MainArcTable.Size - 1; i++)
2324 {
2325 this->GetArc(i)->LabelId0 = i + 1;
2326 // clear arc
2327 this->GetArc(i)->LabelId1 = -2;
2328 }
2329
2330 this->GetArc(i)->LabelId0 = this->MainArcTable.FreeZone;
2331 // clear arc
2332 this->GetArc(i)->LabelId1 = -2;
2333 this->MainArcTable.FreeZone = oldsize;
2334 }
2335}
2336
2337//------------------------------------------------------------------------------
2338void vtkReebGraph::Implementation::ResizeMainLabelTable(int newSize)

Callers 1

AddPathMethod · 0.95

Calls 1

GetArcMethod · 0.95

Tested by

no test coverage detected