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

Method UpdateBufferObjects

Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx:3738–3767  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3736
3737//------------------------------------------------------------------------------
3738void vtkOpenGLPolyDataMapper::UpdateBufferObjects(vtkRenderer* ren, vtkActor* act)
3739{
3740 // Rebuild buffers if needed
3741 if (this->GetNeedToRebuildBufferObjects(ren, act))
3742 {
3743 this->BuildBufferObjects(ren, act);
3744 }
3745
3746 // construct the selection IBO that will reuse the current VBO
3747 vtkSelection* sel = this->GetSelection();
3748 if (sel && sel->GetNumberOfNodes() > 0)
3749 {
3750 if (sel->GetMTime() > this->SelectionTime)
3751 {
3752 std::vector<unsigned int> indexArray[vtkOpenGLPolyDataMapper::PrimitiveTriStrips + 1];
3753 this->BuildSelectionIBO(this->CurrentInput, indexArray, 0);
3754
3755 for (vtkIdType p = vtkOpenGLPolyDataMapper::PrimitiveStart;
3756 p <= vtkOpenGLPolyDataMapper::PrimitiveTriStrips; p++)
3757 {
3758 auto& ibo = this->SelectionPrimitives[p].IBO;
3759
3760 ibo->Upload(indexArray[p], vtkOpenGLIndexBufferObject::ElementArrayBuffer);
3761 ibo->IndexCount = indexArray[p].size();
3762 }
3763
3764 this->SelectionTime = sel->GetMTime();
3765 }
3766 }
3767}
3768
3769//------------------------------------------------------------------------------
3770bool vtkOpenGLPolyDataMapper::GetNeedToRebuildBufferObjects(

Callers 2

RenderPieceStartMethod · 0.95
GaussianRenderMethod · 0.80

Calls 8

BuildBufferObjectsMethod · 0.95
BuildSelectionIBOMethod · 0.95
GetSelectionMethod · 0.45
GetNumberOfNodesMethod · 0.45
GetMTimeMethod · 0.45
UploadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected