Class PanelVis

Class Documentation

class PanelVis

This class serves as an interface for managing an instance of PanelConfig It allows elements to be specified for a UI panel for the visualisation

Public Functions

PanelVis(std::shared_ptr<PanelConfig> _m, std::shared_ptr<EnvironmentData> _environment)

Note

This should only be constructed by ModelVis

Parameters
  • _m – Reference which this interface manages

  • _environment – Environment description to be used for validating correctness of requested environment UI elements

void newSection(const std::string &header_text, bool begin_open = true)

Add a header to begin a collapsible group of elements

Parameters
  • header_text – Text of the header

  • begin_open – If true, the section will not begin in a collapsed state

void newEndSection()

End a section, the following elements are not part of the previous collapsible section

Note

If this is not preceded by a call to newSection() it will have no effect

void newStaticLabel(const std::string &label_text)

Add a label containing a fixed string

Parameters

label_text – Text of the label

void newSeparator()

Add a separator, creates a horizontal line between two consecutive elements Useful is organising a single panel into multiple sections

template<typename T>
void newEnvironmentPropertySlider(const std::string &property_name, T min, T max)

Add a slider which displays the named environment property and allows it’s value to be updated by dragging a slider through the defined range

Parameters
  • property_name – Name of the affected environment property

  • min – Minimum value of the slider

  • max – Maximum value of the slider

Template Parameters

T – Type of the named environment property

template<typename T, flamegpu::size_type N = 0>
void newEnvironmentPropertySlider(const std::string &property_name, flamegpu::size_type index, T min, T max)

Add a slider which displays the named environment property and allows it’s value to be updated by dragging a slider through the defined range

Note

Environment property arrays cannot be added as a whole, each element must be specified individually

Parameters
  • property_name – Name of the affected environment property

  • min – Minimum value of the slider

  • max – Maximum value of the slider

  • index – Index of the specified element within the environment property array

Template Parameters
  • T – Type of the named environment property

  • N – Optional, length of the named environment property. 0 can be provided to ignore this check

template<typename T>
void newEnvironmentPropertyDrag(const std::string &property_name, T min, T max, float speed)

Add a drag element which displays the named environment property (or environment property array element) and allows it’s value to be updated by clicking and dragging the mouse left/right. Double click can also be used to enter a new value via typing.

Parameters
  • property_name – Name of the affected environment property

  • min – Minimum value that can be set

  • max – Maximum value that can be set

  • speed – Amount the value changes per pixel dragged

Template Parameters

T – Type of the named environment property

template<typename T, flamegpu::size_type N = 0>
void newEnvironmentPropertyDrag(const std::string &property_name, flamegpu::size_type index, T min, T max, float speed)

Add a drag element which displays the named environment property (or environment property array element) and allows it’s value to be updated by clicking and dragging the mouse left/right. Double click can also be used to enter a new value via typing.

Note

Environment property arrays cannot be added as a whole, each element must be specified individually

Parameters
  • property_name – Name of the affected environment property

  • min – Minimum value that can be set

  • max – Maximum value that can be set

  • speed – Amount the value changes per pixel dragged

  • index – Index of the specified element within the environment property array

Template Parameters
  • T – Type of the named environment property

  • N – Optional, length of the named environment property. 0 can be provided to ignore this check

template<typename T>
void newEnvironmentPropertyInput(const std::string &property_name, T step, T step_fast)

Add a input box (with +/- step buttons) which displays the named environment property (or environment property array element) and allows it’s value to be updated by clicking and dragging the mouse left/right. Double click can also be used to enter a new value via typing.

Parameters
  • property_name – Name of the affected environment property

  • step – Change per button click

  • step_fast – Change per tick when holding button (?)

Template Parameters

T – Type of the named environment property

template<typename T, flamegpu::size_type N = 0>
void newEnvironmentPropertyInput(const std::string &property_name, flamegpu::size_type index, T step, T step_fast)

Add a input box (with +/- step buttons) which displays the named environment property (or environment property array element) and allows it’s value to be updated by clicking and dragging the mouse left/right. Double click can also be used to enter a new value via typing.

Note

Environment property arrays cannot be added as a whole, each element must be specified individually

Parameters
  • property_name – Name of the affected environment property

  • step – Change per button click

  • step_fast – Change per tick when holding button (?)

  • index – Index of the specified element within the environment property array

Template Parameters
  • T – Type of the named environment property

  • N – Optional, length of the named environment property. 0 can be provided to ignore this check

template<typename T>
void newEnvironmentPropertyToggle(const std::string &property_name)

Add a checkbox element which displays the named environment property (or environment property array element) and allows it’s value to be toggled between 0 and 1 by clicking.

Note

This element only supports integer type properties

Parameters

property_name – Name of the affected environment property

Template Parameters

T – Type of the named environment property

template<typename T, flamegpu::size_type N = 0>
void newEnvironmentPropertyToggle(const std::string &property_name, flamegpu::size_type index)

Add a checkbox element which displays the named environment property (or environment property array element) and allows it’s value to be toggled between 0 and 1 by clicking.

Note

This element only supports integer type properties

Note

Environment property arrays cannot be added as a whole, each element must be specified individually

Parameters
  • property_name – Name of the affected environment property

  • index – Index of the specified element within the environment property array

Template Parameters
  • T – Type of the named environment property

  • N – Optional, length of the named environment property. 0 can be provided to ignore this check