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

Method ResizeMainLabelTable

Common/DataModel/vtkReebGraph.cxx:2338–2362  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2336
2337//------------------------------------------------------------------------------
2338void vtkReebGraph::Implementation::ResizeMainLabelTable(int newSize)
2339{
2340 int oldsize, i;
2341 if ((this->MainLabelTable.Size - this->MainLabelTable.Number) < newSize)
2342 {
2343 oldsize = this->MainLabelTable.Size;
2344 if (!this->MainLabelTable.Size)
2345 this->MainLabelTable.Size = newSize;
2346 while ((this->MainLabelTable.Size - this->MainLabelTable.Number) < newSize)
2347 this->MainLabelTable.Size <<= 1;
2348
2349 this->MainLabelTable.Buffer = (vtkReebLabel*)realloc(
2350 this->MainLabelTable.Buffer, sizeof(vtkReebLabel) * this->MainLabelTable.Size);
2351
2352 for (i = oldsize; i < this->MainLabelTable.Size - 1; i++)
2353 {
2354 this->GetLabel(i)->ArcId = i + 1;
2355 this->GetLabel(i)->HNext = -2;
2356 }
2357
2358 this->GetLabel(i)->ArcId = this->MainLabelTable.FreeZone;
2359 this->GetLabel(i)->HNext = -2;
2360 this->MainLabelTable.FreeZone = oldsize;
2361 }
2362}
2363
2364//------------------------------------------------------------------------------
2365vtkIdType vtkReebGraph::Implementation::AddPath(

Callers

nothing calls this directly

Calls 1

GetLabelMethod · 0.95

Tested by

no test coverage detected