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

Method Get2DPosition

Rendering/Annotation/vtkAxisActor.cxx:927–954  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

925
926//------------------------------------------------------------------------------
927void vtkAxisActor::Get2DPosition(
928 vtkViewport* viewport, double multi, double scenePos[3], double displayPos[2])
929{
930 double display[3];
931 viewport->SetWorldPoint(scenePos[0], scenePos[1], scenePos[2], 1.0);
932 viewport->WorldToDisplay();
933 viewport->GetDisplayPoint(display);
934 displayPos[0] = display[0];
935 displayPos[1] = display[1];
936
937 int offsetSign = 1;
938 if (this->TitleAlignLocation == VTK_ALIGN_TOP)
939 {
940 offsetSign = -1;
941 }
942
943 if (this->AxisType == VTK_AXIS_TYPE_X)
944 {
945 displayPos[1] += offsetSign * multi * this->VerticalOffsetXTitle2D;
946 }
947 else if (this->AxisType == VTK_AXIS_TYPE_Y)
948 {
949 displayPos[0] += offsetSign * multi * this->HorizontalOffsetYTitle2D;
950 }
951
952 displayPos[0] = std::max(displayPos[0], 10.);
953 displayPos[1] = std::max(displayPos[1], 10.);
954}
955
956//------------------------------------------------------------------------------
957void vtkAxisActor::BuildExponent2D(vtkViewport* viewport, bool force)

Callers 2

BuildTitle2DMethod · 0.95
BuildExponent2DMethod · 0.95

Calls 2

maxFunction · 0.50
WorldToDisplayMethod · 0.45

Tested by

no test coverage detected