DimensionPickerAction

Qualified name: DimensionPickerAction

class DimensionPickerAction : public mv::gui::WidgetAction

Dimension picker action class.

Action class for picking a dimension from a points dataset Also support searching for a dimension

Author

Thomas Kroes

Public Functions

Q_INVOKABLE DimensionPickerAction(QObject *parent, const QString &title)

Constructor.

Parameters:
  • parent – Pointer to parent object

  • title – Title of the action

void setPointsDataset(const Dataset<Points> &points)

Set the points dataset from which the dimension will be picked.

Parameters:

points – Dataset reference to points dataset

QStringList getDimensionNames() const

Get the names of the dimensions.

std::uint32_t getNumberOfDimensions() const

Get the number of currently loaded dimensions.

std::int32_t getCurrentDimensionIndex() const

Get the current dimension index.

QString getCurrentDimensionName() const

Get the current dimension name.

void setCurrentDimensionIndex(const std::int32_t &dimensionIndex)

Set the current dimension by index.

Parameters:

dimensionIndex – Index of the current dimension

void setCurrentDimensionName(const QString &dimensionName)

Set the current dimension by name.

Parameters:

dimensionName – Name of the current dimension

std::uint32_t getSearchThreshold() const

Get search threshold.

void setSearchThreshold(const std::uint32_t &searchThreshold)

Set search threshold.

Parameters:

searchThreshold – Search threshold

bool maySearch() const

Establishes whether the dimensions can be searched (number of options exceeds the search threshold)

virtual void fromVariantMap(const QVariantMap &variantMap) override

Load widget action from variant map.

Parameters:

Variant – map representation of the widget action

virtual QVariantMap toVariantMap() const override

Save widget action to variant map.

Returns:

Variant map representation of the widget action

void currentDimensionIndexChanged(const std::int32_t &currentDimensionIndex)

Signals that the current dimension index changed.

Parameters:

currentDimensionIndex – Index of the current dimension

void currentDimensionNameChanged(const QString &currentDimensionName)

Signals that the current dimension name changed.

Parameters:

currentDimensionName – Name of the current dimension

inline OptionAction &getCurrentDimensionAction()

Action getters.

Protected Functions

inline virtual QWidget *getWidget(QWidget *parent, const std::int32_t &widgetFlags) override

Get widget representation of the dimension picker action.

Parameters:
  • parent – Pointer to parent widget

  • widgetFlagsWidget flags for the configuration of the widget (type)

virtual void connectToPublicAction(WidgetAction *publicAction, bool recursive) override

Connect this action to a public action.

Parameters:
  • publicAction – Pointer to public action to connect to

  • recursive – Whether to also connect descendant child actions

virtual void disconnectFromPublicAction(bool recursive) override

Disconnect this action from its public action.

Parameters:

recursive – Whether to also disconnect descendant child actions

Protected Attributes

OptionAction _currentDimensionAction

Smart pointer to points dataset from which the dimension will be picked.

std::uint32_t _searchThreshold

Current dimension action.

Protected Static Attributes

static constexpr std::uint32_t DEFAULT_SEARCH_THRESHOLD = 1000

Select from a drop-down below the threshold and above use a search bar.

Friends

friend class AbstractActionsManager
class Widget : public mv::gui::WidgetActionWidget

Widget class for points dimension picker action.

Protected Functions

Widget(QWidget *parent, DimensionPickerAction *dimensionPickerAction)

Constructor.

Parameters:
  • parent – Pointer to parent widget

  • dimensionPickerAction – Smart pointer to dimension picker action