Skip to main content

WhiskerWidgetState

WhiskerWidgetState

State class for Whisker_Widget. More…

#include <WhiskerWidgetState.hpp>

Inherits from EditorState, QObject

Public Signals

Name
void faceOrientationChanged(FaceOrientation orientation)
Emitted when face orientation changes.
void numWhiskersToTrackChanged(int num)
Emitted when number of whiskers to track changes.
void lengthThresholdChanged(double threshold)
Emitted when length threshold changes.
void clipLengthChanged(int length)
Emitted when clip length changes.
void linkingToleranceChanged(float tolerance)
Emitted when linking tolerance changes.
void whiskerPadKeyChanged(std::string const & key)
Emitted when whisker pad key changes.
void whiskerPadPositionChanged(float x, float y)
Emitted when whisker pad position changes.
void useMaskModeChanged(bool use_mask)
Emitted when mask mode changes.
void selectedMaskKeyChanged(std::string const & key)
Emitted when selected mask key changes.
void currentWhiskerChanged(int whisker)
Emitted when current whisker selection changes.
void autoDLChanged(bool auto_dl)
Emitted when auto DL mode changes.

Public Functions

Name
WhiskerWidgetState(QObject * parent =[nullptr])
Construct a new WhiskerWidgetState.
~WhiskerWidgetState() override =default
virtual QString getTypeName() const override
Get the type name for this state.
virtual QString getDisplayName() const override
Get the display name for UI.
virtual void setDisplayName(QString const & name) override
Set the display name.
virtual std::string toJson() const override
Serialize state to JSON.
virtual bool fromJson(std::string const & json) override
Restore state from JSON.
FaceOrientation faceOrientation() const
int numWhiskersToTrack() const
double lengthThreshold() const
int clipLength() const
float linkingTolerance() const
std::string const & whiskerPadKey() const
float whiskerPadX() const
float whiskerPadY() const
bool useMaskMode() const
std::string const & selectedMaskKey() const
int currentWhisker() const
bool autoDL() const
void setFaceOrientation(FaceOrientation orientation)
void setNumWhiskersToTrack(int num)
void setLengthThreshold(double threshold)
void setClipLength(int length)
void setLinkingTolerance(float tolerance)
void setWhiskerPadKey(std::string const & key)
void setWhiskerPadPosition(float x, float y)
void setUseMaskMode(bool use_mask)
void setSelectedMaskKey(std::string const & key)
void setCurrentWhisker(int whisker)
void setAutoDL(bool auto_dl)

Public Attributes

Name
TimePosition current_position

Additional inherited members

Public Signals inherited from EditorState

Name
void stateChanged()
Emitted when any state property changes.
void displayNameChanged(QString const & newName)
Emitted when display name changes.
void dirtyChanged(bool isDirty)
Emitted when dirty state changes.

Public Functions inherited from EditorState

Name
EditorState(QObject * parent =[nullptr])
Construct a new EditorState.
~EditorState() override =default
Virtual destructor.
QString getInstanceId() const
Get unique instance ID.
bool isDirty() const
Check if state has unsaved changes.
void markClean()
Mark state as clean (after save).

Protected Functions inherited from EditorState

Name
void markDirty()
Mark state as modified.
void setInstanceId(QString const & id)
Set instance ID (for deserialization).
QString generateInstanceId()
Generate a new unique instance ID.

Detailed Description

class WhiskerWidgetState;

State class for Whisker_Widget.

WhiskerWidgetState is a single-instance widget state that manages the whisker tracking configuration.

Usage


// Create state (typically done by EditorCreationController)
auto state = std::make_shared<WhiskerWidgetState>();
registry->registerState(state);

// Modify settings
state->setNumWhiskersToTrack(3);
state->setFaceOrientation(FaceOrientation::Left);

// Serialize for workspace save
std::string json = state->toJson();

Public Signals Documentation

signal faceOrientationChanged

void faceOrientationChanged(
    FaceOrientation orientation
)

Emitted when face orientation changes.

signal numWhiskersToTrackChanged

void numWhiskersToTrackChanged(
    int num
)

Emitted when number of whiskers to track changes.

signal lengthThresholdChanged

void lengthThresholdChanged(
    double threshold
)

Emitted when length threshold changes.

signal clipLengthChanged

void clipLengthChanged(
    int length
)

Emitted when clip length changes.

signal linkingToleranceChanged

void linkingToleranceChanged(
    float tolerance
)

Emitted when linking tolerance changes.

signal whiskerPadKeyChanged

void whiskerPadKeyChanged(
    std::string const & key
)

Emitted when whisker pad key changes.

signal whiskerPadPositionChanged

void whiskerPadPositionChanged(
    float x,
    float y
)

Emitted when whisker pad position changes.

signal useMaskModeChanged

void useMaskModeChanged(
    bool use_mask
)

Emitted when mask mode changes.

signal selectedMaskKeyChanged

void selectedMaskKeyChanged(
    std::string const & key
)

Emitted when selected mask key changes.

signal currentWhiskerChanged

void currentWhiskerChanged(
    int whisker
)

Emitted when current whisker selection changes.

signal autoDLChanged

void autoDLChanged(
    bool auto_dl
)

Emitted when auto DL mode changes.

Public Functions Documentation

function WhiskerWidgetState

explicit WhiskerWidgetState(
    QObject * parent =nullptr
)

Construct a new WhiskerWidgetState.

Parameters:

  • parent Parent QObject (typically nullptr, managed by WorkspaceManager)

function ~WhiskerWidgetState

~WhiskerWidgetState() override =default

function getTypeName

inline virtual QString getTypeName() const override

Get the type name for this state.

Return: “WhiskerWidget”

Reimplements: EditorState::getTypeName

function getDisplayName

virtual QString getDisplayName() const override

Get the display name for UI.

Return: User-visible name (default: “Whisker Tracking”)

Reimplements: EditorState::getDisplayName

function setDisplayName

virtual void setDisplayName(
    QString const & name
) override

Set the display name.

Parameters:

  • name New display name

Reimplements: EditorState::setDisplayName

function toJson

virtual std::string toJson() const override

Serialize state to JSON.

Return: JSON string representation

Reimplements: EditorState::toJson

function fromJson

virtual bool fromJson(
    std::string const & json
) override

Restore state from JSON.

Parameters:

  • json JSON string to parse

Return: true if parsing succeeded

Reimplements: EditorState::fromJson

function faceOrientation

FaceOrientation faceOrientation() const

function numWhiskersToTrack

int numWhiskersToTrack() const

function lengthThreshold

double lengthThreshold() const

function clipLength

int clipLength() const

function linkingTolerance

float linkingTolerance() const

function whiskerPadKey

std::string const & whiskerPadKey() const

function whiskerPadX

float whiskerPadX() const

function whiskerPadY

float whiskerPadY() const

function useMaskMode

bool useMaskMode() const

function selectedMaskKey

std::string const & selectedMaskKey() const

function currentWhisker

int currentWhisker() const

function autoDL

bool autoDL() const

function setFaceOrientation

void setFaceOrientation(
    FaceOrientation orientation
)

function setNumWhiskersToTrack

void setNumWhiskersToTrack(
    int num
)

function setLengthThreshold

void setLengthThreshold(
    double threshold
)

function setClipLength

void setClipLength(
    int length
)

function setLinkingTolerance

void setLinkingTolerance(
    float tolerance
)

function setWhiskerPadKey

void setWhiskerPadKey(
    std::string const & key
)

function setWhiskerPadPosition

void setWhiskerPadPosition(
    float x,
    float y
)

function setUseMaskMode

void setUseMaskMode(
    bool use_mask
)

function setSelectedMaskKey

void setSelectedMaskKey(
    std::string const & key
)

function setCurrentWhisker

void setCurrentWhisker(
    int whisker
)

function setAutoDL

void setAutoDL(
    bool auto_dl
)

Public Attributes Documentation

variable current_position

TimePosition current_position;

Updated on 2026-11-13 at 20:25:39 +0000