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

Method UpdateRectangle

Rendering/Core/vtkTextActor.cxx:848–886  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

846
847//------------------------------------------------------------------------------
848int vtkTextActor::UpdateRectangle(vtkViewport* viewport)
849{
850 if (this->TextProperty->GetMTime() > this->ScaledTextProperty->GetMTime() ||
851 this->GetMTime() > this->BuildTime)
852 {
853 this->ComputeScaledFont(viewport);
854 }
855
856 vtkWindow* win = viewport->GetVTKWindow();
857 if (!win)
858 {
859 vtkErrorMacro(<< "No render window available: cannot determine DPI.");
860 return 0;
861 }
862
863 // check if we need to render the string
864 if (this->ScaledTextProperty->GetMTime() > this->BuildTime || !this->InputRendered ||
865 this->GetMTime() > this->BuildTime || this->RenderedDPI != win->GetDPI())
866 {
867 if (!this->RenderImage(this->ScaledTextProperty, viewport))
868 {
869 vtkErrorMacro(<< "Failed rendering text to buffer");
870 return 0;
871 }
872
873 // Check if we need to create a new rectangle.
874 // Need to check if angle has changed.
875 // justification and line offset are handled in ComputeRectangle
876 this->ComputeRectangle(viewport);
877
878 this->ImageData->Modified();
879 this->Texture->SetInputData(this->ImageData);
880 this->Texture->Modified();
881 this->InputRendered = true;
882 this->RenderedDPI = win->GetDPI();
883 this->BuildTime.Modified();
884 }
885 return 1;
886}
887
888//------------------------------------------------------------------------------
889void vtkTextActor::SpecifiedToDisplay(double* pos, vtkViewport* vport, int specified)

Callers 3

GetBoundingBoxMethod · 0.95
GetSizeMethod · 0.95
RenderOpaqueGeometryMethod · 0.95

Calls 7

ComputeScaledFontMethod · 0.95
RenderImageMethod · 0.95
ComputeRectangleMethod · 0.95
GetVTKWindowMethod · 0.80
GetMTimeMethod · 0.45
ModifiedMethod · 0.45
SetInputDataMethod · 0.45

Tested by

no test coverage detected