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

Method InitFastGeomQuadAllocation

Filters/Geometry/vtkDataSetSurfaceFilter.cxx:2567–2597  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2565
2566//------------------------------------------------------------------------------
2567void vtkDataSetSurfaceFilter::InitFastGeomQuadAllocation(vtkIdType numberOfCells)
2568{
2569 int idx;
2570
2571 this->DeleteAllFastGeomQuads();
2572 // Allocate 100 pointers to arrays.
2573 // This should be plenty (unless we have triangle strips) ...
2574 this->NumberOfFastGeomQuadArrays = 100;
2575 this->FastGeomQuadArrays = new unsigned char*[this->NumberOfFastGeomQuadArrays];
2576 // Initialize all to nullptr;
2577 for (idx = 0; idx < this->NumberOfFastGeomQuadArrays; ++idx)
2578 {
2579 this->FastGeomQuadArrays[idx] = nullptr;
2580 }
2581 // Set pointer to the beginning.
2582 this->NextArrayIndex = 0;
2583 this->NextQuadIndex = 0;
2584
2585 // size the chunks based on the size of a quadrilateral
2586 int quadSize = sizeofFastQuad(4);
2587
2588 // Lets keep the chunk size relatively small.
2589 if (numberOfCells < 100)
2590 {
2591 this->FastGeomQuadArrayLength = 50 * quadSize;
2592 }
2593 else
2594 {
2595 this->FastGeomQuadArrayLength = (numberOfCells / 2) * quadSize;
2596 }
2597}
2598
2599//------------------------------------------------------------------------------
2600void vtkDataSetSurfaceFilter::DeleteAllFastGeomQuads()

Callers 1

InitializeQuadHashMethod · 0.95

Calls 2

sizeofFastQuadFunction · 0.85

Tested by

no test coverage detected