FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::ToolManager Class Reference

Manages tools in FuncDoodle. More...

#include <ToolManager.h>

Public Member Functions

 ToolManager (KeybindsRegistry &keybinds)
 Creates a tool manager bound to the application keybind registry.
 ~ToolManager ()
void RegisterKeybinds ()
 Registers tool-selection keybinds.
void RenderTools ()
 Renders the complete tool UI.
void Buttons ()
 Renders tool-selection buttons.
void Widgets ()
 Renders tool configuration widgets.
void UpdateCursor ()
 Updates cursor state to match the active tool.
void Cursor ()
 Renders or updates the tool cursor overlay.
ToolType GetSelectedTool ()
 Returns the currently selected tool.
float * GetCol ()
 Returns the tool color under the first color slot as normalized RGB values.
float * GetSecCol ()
 Returns the tool color under the secondary color slot as normalized RGB values.
void SetCol (struct Col col)
 Sets the tool color under the first color slot from an 8-bit RGB color.
void SetSecCol (struct Col col)
 Sets the tool color under the secondary color slot from an 8-bit RGB color.
void SetCurCol (struct Col col)
 Sets the CURRENT tool color from an 8-bit RGB color.
float * GetCurCol ()
 Returns the CURRENT tool color as normalized RGB values.
int GetSize () const
 Returns the current tool size.
int GetTolerance () const
 Returns the current tool tolerance (only applicable to bucket tool).
void SetSize (int size)
 Sets the current tool size.

Private Attributes

ToolType m_SelectedTool = ToolType::Pencil
float m_FirstCol [3] = {0.0f, 0.0f, 0.0f}
float m_SecondaryCol [3] = {0.0f, 0.0f, 0.0f}
ColorChoice m_CurrentColor = ColorChoice::First
int m_Size = 1
uint8_t m_Tolerance = 1
KeybindsRegistrym_Keybinds

Detailed Description

Manages tools in FuncDoodle.

Does various stuff like rendering tool buttons, handling tool keybinds

Constructor & Destructor Documentation

◆ ToolManager()

FuncDoodle::ToolManager::ToolManager ( KeybindsRegistry & keybinds)

Creates a tool manager bound to the application keybind registry.

Parameters
keybindsKeybind registry used for tool shortcuts.

◆ ~ToolManager()

FuncDoodle::ToolManager::~ToolManager ( )
default

Member Function Documentation

◆ Buttons()

void FuncDoodle::ToolManager::Buttons ( )

Renders tool-selection buttons.

◆ Cursor()

void FuncDoodle::ToolManager::Cursor ( )

Renders or updates the tool cursor overlay.

◆ GetCol()

float * FuncDoodle::ToolManager::GetCol ( )
inline

Returns the tool color under the first color slot as normalized RGB values.

Returns
Pointer to a 3-float RGB array.

◆ GetCurCol()

float * FuncDoodle::ToolManager::GetCurCol ( )
inline

Returns the CURRENT tool color as normalized RGB values.

Returns
Pointer to a 3-float RGB array.

◆ GetSecCol()

float * FuncDoodle::ToolManager::GetSecCol ( )
inline

Returns the tool color under the secondary color slot as normalized RGB values.

Returns
Pointer to a 3-float RGB array.

◆ GetSelectedTool()

ToolType FuncDoodle::ToolManager::GetSelectedTool ( )
inline

Returns the currently selected tool.

Returns
Active tool type.

◆ GetSize()

int FuncDoodle::ToolManager::GetSize ( ) const
inlinenodiscard

Returns the current tool size.

Returns
Tool size.

◆ GetTolerance()

int FuncDoodle::ToolManager::GetTolerance ( ) const
inlinenodiscard

Returns the current tool tolerance (only applicable to bucket tool).

Returns
Tool tolerance.

◆ RegisterKeybinds()

void FuncDoodle::ToolManager::RegisterKeybinds ( )

Registers tool-selection keybinds.

◆ RenderTools()

void FuncDoodle::ToolManager::RenderTools ( )

Renders the complete tool UI.

◆ SetCol()

void FuncDoodle::ToolManager::SetCol ( struct Col col)
inline

Sets the tool color under the first color slot from an 8-bit RGB color.

Parameters
colNew tool color.

◆ SetCurCol()

void FuncDoodle::ToolManager::SetCurCol ( struct Col col)
inline

Sets the CURRENT tool color from an 8-bit RGB color.

Parameters
colNew tool color.

◆ SetSecCol()

void FuncDoodle::ToolManager::SetSecCol ( struct Col col)
inline

Sets the tool color under the secondary color slot from an 8-bit RGB color.

Parameters
colNew tool color.

◆ SetSize()

void FuncDoodle::ToolManager::SetSize ( int size)
inline

Sets the current tool size.

Parameters
sizeNew tool size.

◆ UpdateCursor()

void FuncDoodle::ToolManager::UpdateCursor ( )

Updates cursor state to match the active tool.

◆ Widgets()

void FuncDoodle::ToolManager::Widgets ( )

Renders tool configuration widgets.

Member Data Documentation

◆ m_CurrentColor

ColorChoice FuncDoodle::ToolManager::m_CurrentColor = ColorChoice::First
private

◆ m_FirstCol

float FuncDoodle::ToolManager::m_FirstCol[3] = {0.0f, 0.0f, 0.0f}
private

◆ m_Keybinds

KeybindsRegistry& FuncDoodle::ToolManager::m_Keybinds
private

◆ m_SecondaryCol

float FuncDoodle::ToolManager::m_SecondaryCol[3] = {0.0f, 0.0f, 0.0f}
private

◆ m_SelectedTool

ToolType FuncDoodle::ToolManager::m_SelectedTool = ToolType::Pencil
private

◆ m_Size

int FuncDoodle::ToolManager::m_Size = 1
private

◆ m_Tolerance

uint8_t FuncDoodle::ToolManager::m_Tolerance = 1
private

The documentation for this class was generated from the following files: