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

Method RenderData

Rendering/OpenGL2/vtkOpenGLImageMapper.cxx:579–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577// Expects data to be X, Y, components
578
579void vtkOpenGLImageMapper::RenderData(vtkViewport* viewport, vtkImageData* data, vtkActor2D* actor)
580{
581 void* ptr0;
582 double shift, scale;
583
584 vtkWindow* window = viewport->GetVTKWindow();
585 if (!window)
586 {
587 vtkErrorMacro(<< "vtkOpenGLImageMapper::RenderData - no window set for viewport");
588 return;
589 }
590
591 if (!data->GetPointData()->GetScalars())
592 {
593 return;
594 }
595
596 this->Actor->SetProperty(actor->GetProperty());
597
598 // Make this window current. May have become not current due to
599 // data updates since the render started.
600 window->MakeCurrent();
601
602 vtkOpenGLClearErrorMacro();
603
604 shift = this->GetColorShift();
605 scale = this->GetColorScale();
606
607 ptr0 =
608 data->GetScalarPointer(this->DisplayExtent[0], this->DisplayExtent[2], this->DisplayExtent[4]);
609
610 // Get the position of the image actor
611 int* actorPos = actor->GetActualPositionCoordinate()->GetComputedViewportValue(viewport);
612 // negative positions will already be clipped to viewport
613 actorPos[0] += this->PositionAdjustment[0];
614 actorPos[1] += this->PositionAdjustment[1];
615
616 this->Actor->SetPosition(actorPos[0], actorPos[1]);
617 this->Actor->SetPosition2(actor->GetPosition2());
618
619 switch (data->GetPointData()->GetScalars()->GetDataType())
620 {
621 vtkTemplateMacro(
622 vtkOpenGLImageMapperRender(this, data, static_cast<VTK_TT*>(ptr0), shift, scale, viewport));
623 default:
624 vtkErrorMacro(<< "Unsupported image type: " << data->GetScalarType());
625 }
626
627 vtkOpenGLCheckErrorMacro("failed after RenderData");
628}
629
630void vtkOpenGLImageMapper::DrawPixels(
631 vtkViewport* viewport, int width, int height, int numComponents, void* data)

Callers 1

RenderStartMethod · 0.80

Calls 15

GetVTKWindowMethod · 0.80
GetColorShiftMethod · 0.80
GetColorScaleMethod · 0.80
GetScalarPointerMethod · 0.80
GetPosition2Method · 0.80
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
SetPropertyMethod · 0.45
GetPropertyMethod · 0.45
MakeCurrentMethod · 0.45

Tested by

no test coverage detected