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

Method DrawPrimitives

Rendering/OpenGL2/vtkOpenGLLowMemoryBatchedPolyDataMapper.cxx:252–277  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

250
251//------------------------------------------------------------------------------
252void 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//------------------------------------------------------------------------------
280void vtkOpenGLLowMemoryBatchedPolyDataMapper::RenderPieceStart(

Callers 1

RenderPieceDrawMethod · 0.95

Calls 6

PreDrawMethod · 0.45
getMethod · 0.45
GetForceOpaqueMethod · 0.45
GetForceTranslucentMethod · 0.45
DrawMethod · 0.45
PostDrawMethod · 0.45

Tested by

no test coverage detected