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

Method BuildTitle2D

Rendering/Annotation/vtkAxisActor.cxx:895–924  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Determines scale and position for the 2D Title. Currently, title can only be centered with respect to its axis. ------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

893// title can only be centered with respect to its axis.
894//------------------------------------------------------------------------------
895void vtkAxisActor::BuildTitle2D(vtkViewport* viewport, bool force)
896{
897 if (!this->NeedBuild2D && !force && !this->TitleVisibility)
898 {
899 return;
900 }
901
902 this->UpdateTitleActorProperty();
903
904 double scenePos[3];
905 this->TitleProp->GetReferencePosition(scenePos);
906
907 double position[2];
908 this->Get2DPosition(viewport, 1., scenePos, position);
909
910 if (this->SaveTitlePosition > 0)
911 {
912 if (this->SaveTitlePosition == 1)
913 {
914 this->TitleConstantPosition[0] = position[0];
915 this->TitleConstantPosition[1] = position[1];
916 this->SaveTitlePosition = 2;
917 }
918 position[0] = this->TitleConstantPosition[0];
919 position[1] = this->TitleConstantPosition[1];
920 }
921
922 this->TitleProp->SetDisplayPosition(position[0], position[1]);
923 this->TitleProp->RotateActor2DFromAxisProjection(this->GetPoint1(), this->GetPoint2());
924}
925
926//------------------------------------------------------------------------------
927void vtkAxisActor::Get2DPosition(

Callers 1

BuildAxisMethod · 0.95

Calls 7

Get2DPositionMethod · 0.95
GetPoint1Method · 0.95
GetPoint2Method · 0.95
GetReferencePositionMethod · 0.80
SetDisplayPositionMethod · 0.45

Tested by

no test coverage detected