Skip to main content

Feature_Tree_Model

Feature_Tree_Model

Model class for Feature_Tree_Widget following model-view architecture. More…

#include <Feature_Tree_Model.hpp>

Inherits from QObject

Public Signals

Name
void featureColorChanged(std::string const & feature_key, std::string const & hex_color)
Emitted when feature colors change.

Public Functions

Name
Feature_Tree_Model(QObject * parent =[nullptr])
~Feature_Tree_Model() override =default
void setDataManager(std::shared_ptr< DataManager > data_manager)
Set the DataManager instance.
std::string getFeatureColor(std::string const & feature_key) const
Get color for a specific feature.
void setFeatureColor(std::string const & feature_key, std::string const & hex_color)
Set color for a specific feature.
std::string getDefaultColorForType(DM_DataType data_type) const
Get default color for a data type.
void setEnabledFeatures(std::vector< std::string > const & feature_keys)
Set enabled features (for state management).
std::vector< std::string > getEnabledFeatures() const
Get currently enabled features.
bool isFeatureEnabled(std::string const & feature_key) const
Check if a feature is enabled.

Detailed Description

class Feature_Tree_Model;

Model class for Feature_Tree_Widget following model-view architecture.

Handles state management including:

  • Color assignments for features
  • Default color schemes by data type
  • Feature state persistence
  • Integration with DataManager

Public Signals Documentation

signal featureColorChanged

void featureColorChanged(
    std::string const & feature_key,
    std::string const & hex_color
)

Emitted when feature colors change.

Parameters:

  • feature_key The feature that changed color
  • hex_color The new color

Public Functions Documentation

function Feature_Tree_Model

explicit Feature_Tree_Model(
    QObject * parent =nullptr
)

function ~Feature_Tree_Model

~Feature_Tree_Model() override =default

function setDataManager

void setDataManager(
    std::shared_ptr< DataManager > data_manager
)

Set the DataManager instance.

Parameters:

function getFeatureColor

std::string getFeatureColor(
    std::string const & feature_key
) const

Get color for a specific feature.

Parameters:

  • feature_key The feature key

Return: Hex color string (e.g., “#FF0000”)

function setFeatureColor

void setFeatureColor(
    std::string const & feature_key,
    std::string const & hex_color
)

Set color for a specific feature.

Parameters:

  • feature_key The feature key
  • hex_color Hex color string (e.g., “#FF0000”)

function getDefaultColorForType

std::string getDefaultColorForType(
    DM_DataType data_type
) const

Get default color for a data type.

Parameters:

  • data_type The data type

Return: Hex color string

function setEnabledFeatures

void setEnabledFeatures(
    std::vector< std::string > const & feature_keys
)

Set enabled features (for state management).

Parameters:

  • feature_keys Vector of feature keys that are enabled

function getEnabledFeatures

std::vector< std::string > getEnabledFeatures() const

Get currently enabled features.

Return: Vector of enabled feature keys

function isFeatureEnabled

bool isFeatureEnabled(
    std::string const & feature_key
) const

Check if a feature is enabled.

Parameters:

  • feature_key The feature key to check

Return: True if enabled, false otherwise


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