------------------------------------------------------------------------------
| 3736 | |
| 3737 | //------------------------------------------------------------------------------ |
| 3738 | void 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 | //------------------------------------------------------------------------------ |
| 3770 | bool vtkOpenGLPolyDataMapper::GetNeedToRebuildBufferObjects( |
no test coverage detected