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

Method ManageTextDisplay

Interaction/Widgets/vtkImagePlaneWidget.cxx:1300–1332  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1298
1299//------------------------------------------------------------------------------
1300void vtkImagePlaneWidget::ManageTextDisplay()
1301{
1302 if (!this->DisplayText)
1303 {
1304 return;
1305 }
1306
1307 if (this->State == vtkImagePlaneWidget::WindowLevelling)
1308 {
1309 auto result = vtk::format_to_n(this->TextBuff, VTK_IMAGE_PLANE_WIDGET_MAX_TEXTBUFF,
1310 "Window, Level: ( {:g}, {:g} )", this->CurrentWindow, this->CurrentLevel);
1311 *result.out = '\0';
1312 }
1313 else if (this->State == vtkImagePlaneWidget::Cursoring)
1314 {
1315 if (this->CurrentImageValue == VTK_DOUBLE_MAX)
1316 {
1317 auto result =
1318 vtk::format_to_n(this->TextBuff, VTK_IMAGE_PLANE_WIDGET_MAX_TEXTBUFF, "Off Image");
1319 *result.out = '\0';
1320 }
1321 else
1322 {
1323 auto result = vtk::format_to_n(this->TextBuff, VTK_IMAGE_PLANE_WIDGET_MAX_TEXTBUFF,
1324 "( {:g}, {:g}, {:g} ): {:g}", this->CurrentCursorPosition[0],
1325 this->CurrentCursorPosition[1], this->CurrentCursorPosition[2], this->CurrentImageValue);
1326 *result.out = '\0';
1327 }
1328 }
1329
1330 this->TextActor->SetInput(this->TextBuff);
1331 this->TextActor->Modified();
1332}
1333
1334//------------------------------------------------------------------------------
1335void vtkImagePlaneWidget::Push(double* p1, double* p2)

Callers 4

StartCursorMethod · 0.95
StartWindowLevelMethod · 0.95
OnMouseMoveMethod · 0.95
StartWindowLevelMethod · 0.45

Calls 3

format_to_nFunction · 0.50
SetInputMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected