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:
trueif there's an error;falseotherwise.
hangeSlicerCheckbox(bool bIsChecked)
Description:
Handles checkbox state change.
Parameters:
bIsCheckedโtrueif checked;falseotherwise.
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 totrueif 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 0void OnDistance50Click()โ Sets distance to 50void OnDistance100Click()โ Sets distance to 100void OnDistance150Click()โ Sets distance to 150void 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 slicerUCPP_SlicerSlideBar* RotationSlider: Controls rotation of the slicerUCheckBox* SlicerCheckbox: Checkbox for enabling/disabling slicer
Predefined Buttons (UButton*)
- Distance:
Distance0,Distance50,Distance100,Distance150,Distance200 - Rotation:
RotationRear,RotationFront,RotationLeft,RotationRight