Skip to content

UCPP_SlicerSideBar

A user interface widget class for controlling the slicer in the Virtual Anatomy Unreal Engine project.

This class is responsible for:

  • Displaying/hiding the slicer plane
  • Handling checkbox interaction for enabling/disabling the slicer
  • Modifying distance and rotation of the slicer plane
  • Providing buttons for quick access to predefined values
  • Managing error states when slicer components are not found
  • Interacting with the slicer actor in the 3D world

Public Methods

void SetSlicerActor(ACPP_Slicer* InSlicerActor)

Description:

Sets the slicer actor.

Parameters:

  • InSlicerActor โ€“ the slicer actor to associate with the sidebar.

void ShowSlicerPlane()

Description:

Shows the slicer plane. Called when the sidebar is shown.

void HideSlicerPlane()

Description:

Hides the slicer plane. Called when the sidebar is hidden.

bool GetSlicerErrorState()

Description:

Checks whether the slicer is giving an error.

Returns:

  • true if there's an error; false otherwise.

hangeSlicerCheckbox(bool bIsChecked)

Description:

Handles checkbox state change.

Parameters:

  • bIsChecked โ€“ true if checked; false otherwise.

ChangeSlicerDistance(float NewValue)

Description:

Updates the slicer distance.

Parameters:

  • NewValue โ€“ new distance value from slider or button.

ChangeSlicerRotation(float NewValue)

Description:

Updates the slicer rotation.

Parameters:

  • NewValue โ€“ new rotation value from slider or button.

Protected Properties

  • UCPP_GameInstance* GameInstance โ€“ Reference to the game instance to load saved slicer parameters.
  • ACPP_Slicer* SlicerActor โ€“ Reference to the slicer actor in the scene.
  • bool bIsSlicerGivingError โ€“ Set to true if slicer fails to initialize correctly.
  • FSlicerSlideBarsParameters SlicerParameters โ€“ Struct holding the distance and rotation slider values.

Predefined Button Click Handlers

Functions triggered when clicking buttons with fixed distance or rotation values.

Distance button handlers

  • void OnDistance0Click() โ€“ Sets distance to 0
  • void OnDistance50Click() โ€“ Sets distance to 50
  • void OnDistance100Click() โ€“ Sets distance to 100
  • void OnDistance150Click() โ€“ Sets distance to 150
  • void OnDistance200Click() โ€“ Sets distance to 200

Rotation button handlers

  • void OnRotationRearClick() โ€“ Sets rotation to 90ยฐ
  • void OnRotationFrontClick() โ€“ Sets rotation to 270ยฐ
  • void OnRotationLeftClick() โ€“ Sets rotation to 0ยฐ
  • void OnRotationRightClick() โ€“ Sets rotation to 180ยฐ

UI Widgets

Widgets used in the sidebar (bound via UMG):

  • UCPP_SlicerSlideBar* DistanceSlider: Controls distance of the slicer
  • UCPP_SlicerSlideBar* RotationSlider: Controls rotation of the slicer
  • UCheckBox* SlicerCheckbox: Checkbox for enabling/disabling slicer

Predefined Buttons (UButton*)

  • Distance: Distance0, Distance50, Distance100, Distance150, Distance200
  • Rotation: RotationRear, RotationFront, RotationLeft, RotationRight