------------------------------------------------------------------------------
| 250 | |
| 251 | //------------------------------------------------------------------------------ |
| 252 | void vtkOpenGLLowMemoryBatchedPolyDataMapper::DrawPrimitives( |
| 253 | vtkRenderer* renderer, vtkActor* actor, PrimitiveInformation& primitive) |
| 254 | { |
| 255 | bool selecting = this->CurrentSelector != nullptr; |
| 256 | bool tpass = actor->IsRenderingTranslucentPolygonalGeometry(); |
| 257 | auto& agent = primitive.Agent; |
| 258 | agent->PreDraw(renderer, actor, this); |
| 259 | for (auto& iter : this->VTKPolyDataToGLBatchElement) |
| 260 | { |
| 261 | auto glBatchElement = iter.second.get(); |
| 262 | auto& batchElement = glBatchElement->Parent; |
| 263 | bool shouldDraw = batchElement.Visibility // must be visible |
| 264 | && (!selecting || batchElement.Pickability) // and pickable when selecting |
| 265 | && (((selecting || batchElement.IsOpaque || actor->GetForceOpaque()) && |
| 266 | !tpass) // opaque during opaque or when selecting |
| 267 | || ((!batchElement.IsOpaque || actor->GetForceTranslucent()) && tpass && |
| 268 | !selecting)); // translucent during translucent and never selecting |
| 269 | if (!shouldDraw) |
| 270 | { |
| 271 | continue; |
| 272 | } |
| 273 | this->SetShaderValues(glBatchElement); |
| 274 | agent->Draw(renderer, actor, this, primitive.CellGroups, glBatchElement->CellGroupId); |
| 275 | } |
| 276 | agent->PostDraw(renderer, actor, this); |
| 277 | } |
| 278 | |
| 279 | //------------------------------------------------------------------------------ |
| 280 | void vtkOpenGLLowMemoryBatchedPolyDataMapper::RenderPieceStart( |
no test coverage detected