cgv
Loading...
Searching...
No Matches
cgv::gui::provider Class Referenceabstract

derive from this class to provide a gui to the current viewer More...

#include <provider.h>

Inheritance diagram for cgv::gui::provider:
cgv::app::overlay cgv::gui::base_provider vr_emulator vr_test cgv::app::canvas_overlay cgv::app::navigator cgv::app::themed_canvas_overlay cgv::app::color_map_editor cgv::app::color_map_legend cgv::app::color_selector cgv::app::performance_monitor

Public Member Functions

update of gui
void remove_element (cgv::base::base_ptr)
 remove a single element from the gui
 
void remove_all_elements ()
 this method removes all elements from the gui and can be used in a method that rebuilds the complete gui
 
cgv::base::base_ptr find_element (const std::string &name)
 find a gui element by name in the current group, return empty pointer if not found
 
template<typename T >
data::ref_ptr< view< T > > find_view (const T &value, int *idx_ptr=0)
 find a view of a given class member
 
template<typename T >
data::ref_ptr< control< T > > find_control (T &value, int *idx_ptr=0)
 find a control of a given class member
 
control_ptr find_control_void (void *value_ptr, int *idx_ptr)
 access to control of untyped member pointer
 
view_ptr find_view_void (void *value_ptr, int *idx_ptr)
 access to view of untyped member pointer
 
template<typename T >
void set_control_property (T &value, const std::string &property_name, const std::string &property_value)
 Set the property value of all controls of a given class member.
 

interface used by the parent gui

gui_group_ptr parent_group
 driver specific handle for the group gui element managing the gui built in the provider
 
providerparent_provider
 
class gui_group
 make the gui group a friend class
 
void set_parent (gui_group_ptr)
 the gui window sets the parent group through this method
 
void update_parent ()
 update the parent group
 
gui_group_ptr get_parent_group () const
 use the parent group to append to be managed elements that should be destroyed in a post_recreate_gui event
 
view_ptr add_view_void (const std::string &label, const void *value_ptr, const std::string &value_type, const std::string &gui_type, const std::string &options, const std::string &align)
 add a newly created view to the group
 
control_ptr add_control_void (const std::string &label, void *value_ptr, abst_control_provider *acp, const std::string &value_type, const std::string &gui_type, const std::string &options, const std::string &align, void *user_data)
 add a newly created control to the group
 

callbacks

virtual void on_select ()
 called by selection_change_cb whenever the gui of this provider is selected
 
virtual void on_deselect ()
 called by selection_change_cb whenever the gui of this provider is deselected
 
virtual void selection_change_cb (cgv::base::base_ptr new_child, bool selected)
 this is called by the gui group when the selection changes
 
 provider ()
 default construction
 
 ~provider ()
 ensure to remove posted recreation callbacks
 
virtual std::string get_gui_name () const
 Derive a name for this instance that can be used in the gui as heading.
 
virtual std::string get_parent_type () const
 Returns the group type that should be used by the class embedding the gui of the provider.
 
virtual bool ensure_selected_in_tab_group_parent ()
 ensure that my UI is selected in the parent group in case this is a tab group, otherwise return false
 
virtual void update_member (void *member_ptr)
 call this to update all views and controls of a member
 
virtual void update_all_members ()
 call this to update all views and controls of all member
 
virtual std::string get_menu_path () const
 return a path in the main menu to select the gui
 
virtual shortcut get_shortcut () const
 return a shortcut to activate the gui without menu navigation
 
virtual void create_gui ()=0
 you must overload this for gui creation
 
virtual void recreate_gui ()
 Recreate the gui of this instance right now.
 
virtual void post_recreate_gui ()
 delayed recreation of gui
 

creation of gui

void align (const std::string &_align)
 send pure alignment information
 
std::string concat_enum_def (const std::vector< std::string > &names, const std::string &additional_first_name="", const std::string &additional_last_name="")
 add a new group to the given parent group, not supported yet
 
gui_group_ptr add_object_gui (cgv::base::base_ptr object, const std::string &label, const std::string &group_type, const std::string &options, const std::string &align)
 
void integrate_object_gui (cgv::base::base_ptr object)
 call this in create_gui() function to integrate gui of another provider object by setting the parent group and parent provider of the other object
 
void inline_object_gui (cgv::base::base_ptr object)
 integrate (if not explicitly done before) and inline the gui of another object that must be derived from provider
 
gui_group_ptr add_group (const std::string &label, const std::string &group_type, const std::string &options="", const std::string &align="\n")
 add a newly created subgroup to the group
 
cgv::base::base_ptr add_decorator (const std::string &label, const std::string &decorator_type, const std::string &options="", const std::string &align="\n")
 add a newly created decorator to the group
 
button_ptr add_button (const std::string &label, const std::string &options="", const std::string &align="\n")
 use the current gui driver to append a new button with the given label
 
template<typename T >
data::ref_ptr< view< T > > add_view (const std::string &label, const T &value, const std::string &gui_type="", const std::string &options="", const std::string &align="\n")
 use this to add a new view to the gui with a given value type, gui type and init options
 
template<typename T >
data::ref_ptr< control< T > > add_control (const std::string &label, T &value, const std::string &gui_type="", const std::string &options="", const std::string &align="\n")
 use this to add a new control to the gui with a given value type, gui type and init options
 
template<typename T >
data::ref_ptr< control< T > > add_control (const std::string &label, control_provider< T > *provider, const std::string &gui_type="", const std::string &options="", const std::string &align="\n", void *user_data=0)
 use this to add a new control to the gui, where the control is implemented with a control provider class
 
template<typename T >
data::ref_ptr< control< T > > add_member_control (cgv::base::base *base_ptr, const std::string &label, T &value, const std::string &gui_type="", const std::string &options="", const std::string &align="\n")
 add control with callback to cgv::base::on_set method on cgv::gui::control::value_change
 
bool add_tree_node (const std::string &label, bool &toggle, int level, const std::string &a="\n", gui_group_ptr ggp=gui_group_ptr())
 add a collapsable node to the gui (deprecated)
 
template<typename T >
bool begin_tree_node (const std::string &label, const T &value, bool initial_visibility=false, const std::string &options="", gui_group_ptr ggp=gui_group_ptr())
 Begin a sub tree of a tree structured gui.
 
template<typename T >
void end_tree_node (const T &value)
 template specialization that allows to specify value reference plus node_instance by using the result of the function with_instance(value,idx) for the value argument finish a sub tree begun with begin_tree_node

 
template<typename T >
bool is_tree_node_visible (const T &value) const
 return whether the sub tree attached to a value is visible
 
template<typename T >
void set_tree_node_visibility (const T &value, bool is_visible)
 set the visibility status of sub tree attached to a value. This calls the post_recreate method if needed.
 
bool begin_tree_node_void (const std::string &label, const void *value_ptr, int index=-1, bool initial_visibility=false, const std::string &options="", gui_group_ptr ggp=gui_group_ptr())
 void version of the templated functions
 
void end_tree_node_void (const void *value_ptr, int index=-1)
 
bool is_tree_node_visible_void (const void *value_ptr, int index) const
 
void set_tree_node_visibility_void (const void *value_ptr, int index, bool is_visible)
 
template<typename T >
bool add_gui (const std::string &label, T &value, const std::string &gui_type="", const std::string &options="")
 Add a composed gui of the given gui_type for the given value.
 
template<typename T >
static bool & ref_tree_node_visible_flag (const T &value)
 return a reference to the boolean flag, that tells whether the tree node for the passed value is visible
 
static bool & ref_tree_node_visible_flag_void (const void *value_ptr, int index=-1)
 

Detailed Description

derive from this class to provide a gui to the current viewer

Definition at line 63 of file provider.h.

Constructor & Destructor Documentation

◆ provider()

cgv::gui::provider::provider ( )

default construction

Definition at line 332 of file provider.cxx.

◆ ~provider()

cgv::gui::provider::~provider ( )

ensure to remove posted recreation callbacks

Definition at line 493 of file provider.cxx.

Member Function Documentation

◆ add_button()

button_ptr cgv::gui::provider::add_button ( const std::string &  label,
const std::string &  options = "",
const std::string &  align = "\n" 
)

use the current gui driver to append a new button with the given label

Definition at line 176 of file provider.cxx.

References align(), cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

Referenced by vr_test::create_gui(), and vr_emulator::create_gui().

◆ add_control() [1/2]

template<typename T >
data::ref_ptr< control< T > > cgv::gui::provider::add_control ( const std::string &  label,
control_provider< T > *  provider,
const std::string &  gui_type = "",
const std::string &  options = "",
const std::string &  align = "\n",
void *  user_data = 0 
)
inline

use this to add a new control to the gui, where the control is implemented with a control provider class

Definition at line 126 of file provider.h.

References cgv::data::ref_ptr< T, is_ref_counted >::empty().

◆ add_control() [2/2]

template<typename T >
data::ref_ptr< control< T > > cgv::gui::provider::add_control ( const std::string &  label,
T &  value,
const std::string &  gui_type = "",
const std::string &  options = "",
const std::string &  align = "\n" 
)
inline

use this to add a new control to the gui with a given value type, gui type and init options

Definition at line 119 of file provider.h.

References cgv::data::ref_ptr< T, is_ref_counted >::empty().

◆ add_control_void()

control_ptr cgv::gui::provider::add_control_void ( const std::string &  label,
void *  value_ptr,
abst_control_provider acp,
const std::string &  value_type,
const std::string &  gui_type,
const std::string &  options,
const std::string &  align,
void *  user_data 
)

add a newly created control to the group

Definition at line 28 of file provider.cxx.

References align(), cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ add_decorator()

cgv::base::base_ptr cgv::gui::provider::add_decorator ( const std::string &  label,
const std::string &  decorator_type,
const std::string &  options = "",
const std::string &  align = "\n" 
)

◆ add_group()

gui_group_ptr cgv::gui::provider::add_group ( const std::string &  label,
const std::string &  group_type,
const std::string &  options = "",
const std::string &  align = "\n" 
)

add a newly created subgroup to the group

Definition at line 160 of file provider.cxx.

References align(), cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ add_gui()

template<typename T >
bool cgv::gui::provider::add_gui ( const std::string &  label,
T &  value,
const std::string &  gui_type = "",
const std::string &  options = "" 
)
inline

Add a composed gui of the given gui_type for the given value.

This function returns false if no cgv::base::gui_creator has been registered for the given gui_type. The plugin cg_ext contains registers gui_creators for the most important types of the framework. The supported values for the options parameter are specific for the gui_type. Currently these are not documented and can only be found in the source code of the cg_ext plugin.

Definition at line 247 of file provider.h.

References cgv::gui::create_gui().

Referenced by cgv::gui::arrow_render_style_gui_creator::create(), cgv::gui::box_render_style_gui_creator::create(), cgv::gui::box_wire_render_style_gui_creator::create(), cgv::gui::cone_render_style_gui_creator::create(), cgv::gui::ellipsoid_render_style_gui_creator::create(), cgv::gui::line_render_style_gui_creator::create(), cgv::gui::normal_render_style_gui_creator::create(), cgv::gui::point_render_style_gui_creator::create(), cgv::gui::rectangle_render_style_gui_creator::create(), cgv::gui::sphere_render_style_gui_creator::create(), cgv::gui::spline_tube_render_style_gui_creator::create(), cgv::gui::surface_render_style_gui_creator::create(), cgv::gui::surfel_render_style_gui_creator::create(), cgv::gui::volume_render_style_gui_creator::create(), cgv::plot::plot_base::create_base_config_gui(), vr_test::create_gui(), vr_emulator::create_gui(), cgv::plot::plot3d::create_gui(), cgv::gui::directory_helper::create_gui(), cgv::gui::file_helper::create_gui(), and cgv::plot::plot_base::create_plot_gui().

◆ add_member_control()

template<typename T >
data::ref_ptr< control< T > > cgv::gui::provider::add_member_control ( cgv::base::base base_ptr,
const std::string &  label,
T &  value,
const std::string &  gui_type = "",
const std::string &  options = "",
const std::string &  align = "\n" 
)
inline

add control with callback to cgv::base::on_set method on cgv::gui::control::value_change

use this method to add a control of a member and a callback to the on_set method of the cgv::base::base class.

Definition at line 137 of file provider.h.

References cgv::base::base::on_set().

Referenced by cgv::gui::arrow_render_style_gui_creator::create(), cgv::gui::box_render_style_gui_creator::create(), cgv::gui::box_wire_render_style_gui_creator::create(), cgv::gui::clod_point_render_style_gui_creator::create(), cgv::gui::cone_render_style_gui_creator::create(), cgv::gui::ellipsoid_render_style_gui_creator::create(), cgv::gui::group_render_style_gui_creator::create(), cgv::gui::line_render_style_gui_creator::create(), cgv::gui::normal_render_style_gui_creator::create(), cgv::gui::point_render_style_gui_creator::create(), cgv::gui::rectangle_render_style_gui_creator::create(), cgv::gui::slab_render_style_gui_creator::create(), cgv::gui::sphere_render_style_gui_creator::create(), cgv::gui::spline_tube_render_style_gui_creator::create(), cgv::gui::surface_render_style_gui_creator::create(), cgv::gui::surfel_render_style_gui_creator::create(), cgv::gui::volume_render_style_gui_creator::create(), cgv::plot::plot_base::create_bar_config_gui(), cgv::plot::plot_base::create_base_config_gui(), cgv::plot::plot3d::create_config_gui(), cgv::plot::plot_base::create_config_gui(), vr_emulator::create_controller_gui(), vr_test::create_gui(), vr_emulator::create_gui(), cgv::plot::axis_config::create_gui(), cgv::plot::plot2d::create_gui(), cgv::plot::plot_base::create_gui(), cgv::app::navigator::create_gui_impl(), cgv::app::color_map_editor::create_gui_impl(), cgv::app::color_map_legend::create_gui_impl(), cgv::app::color_selector::create_gui_impl(), cgv::app::performance_monitor::create_gui_impl(), cgv::plot::plot3d::create_line_config_gui(), cgv::plot::plot_base::create_plot_gui(), and cgv::plot::plot_base::create_stick_config_gui().

◆ add_object_gui()

gui_group_ptr cgv::gui::provider::add_object_gui ( cgv::base::base_ptr  object,
const std::string &  label,
const std::string &  group_type,
const std::string &  options,
const std::string &  align 
)

Definition at line 121 of file provider.cxx.

◆ add_tree_node()

bool cgv::gui::provider::add_tree_node ( const std::string &  label,
bool &  toggle,
int  level,
const std::string &  a = "\n",
gui_group_ptr  ggp = gui_group_ptr() 
)

add a collapsable node to the gui (deprecated)

This method is one possibility to support tree like guis with nodes that can be opened or closed. The other prefarable possibitly builds on the functions begin_tree_node() and end_tree_node().

Each node is represented by a heading with the text provided in the first parameter and of heading level specified in the first parameter. The state of the node is stored in a boolean variable "toggle" that must be supplied by the implementation of the provider. The toggle needs to be initialized in the constructor and is used in the create_gui method to only provide the gui of the subtree if toggle is true. Every time the status of the node is changed, the whole gui is rebuild with the post_recreate_gui method. The value of the toggle is also the return parameter of add_tree_node such the typical code inside the create_gui method looks like

if (add_tree_node("Node", toggle, 2)) {
align("\a"); // indent gui elements of tree node
// create gui of subtree
align("\b"); // undo indentation
}
void align(const std::string &_align)
send pure alignment information
Definition provider.cxx:36
bool add_tree_node(const std::string &label, bool &toggle, int level, const std::string &a="\n", gui_group_ptr ggp=gui_group_ptr())
add a collapsable node to the gui (deprecated)
Definition provider.cxx:183

Definition at line 183 of file provider.cxx.

References parent_group, post_recreate_gui(), and cgv::utils::to_string().

◆ add_view()

template<typename T >
data::ref_ptr< view< T > > cgv::gui::provider::add_view ( const std::string &  label,
const T &  value,
const std::string &  gui_type = "",
const std::string &  options = "",
const std::string &  align = "\n" 
)
inline

use this to add a new view to the gui with a given value type, gui type and init options

Definition at line 112 of file provider.h.

References cgv::data::ref_ptr< T, is_ref_counted >::empty().

Referenced by cgv::plot::plot3d::create_config_gui(), vr_emulator::create_controller_gui(), vr_test::create_gui(), vr_emulator::create_gui(), and cgv::app::color_map_editor::create_gui_impl().

◆ add_view_void()

view_ptr cgv::gui::provider::add_view_void ( const std::string &  label,
const void *  value_ptr,
const std::string &  value_type,
const std::string &  gui_type,
const std::string &  options,
const std::string &  align 
)

add a newly created view to the group

Definition at line 21 of file provider.cxx.

References align(), cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ align()

◆ begin_tree_node()

template<typename T >
bool cgv::gui::provider::begin_tree_node ( const std::string &  label,
const T &  value,
bool  initial_visibility = false,
const std::string &  options = "",
gui_group_ptr  ggp = gui_group_ptr() 
)
inline

Begin a sub tree of a tree structured gui.

This function addes a toggle button and a heading for the tree node. The toggle button can be used to show or hide the subtree below the tree node. The heading shows simply the label parameter. The function returns the visibility state of the subtree below the tree node. Therefore its contents should only be specified if the function returns true. In that case one needs to terminate the gui elements added for the tree node with the end_tree_node function. A typical example would be

if (begin_tree_node("Node", composed_value)) {
align("\a"); // indent gui elements of tree node
// create gui of composed_value
align("\b"); // undo indentation
end_tree_node(composed_value);
}
bool begin_tree_node(const std::string &label, const T &value, bool initial_visibility=false, const std::string &options="", gui_group_ptr ggp=gui_group_ptr())
Begin a sub tree of a tree structured gui.
Definition provider.h:212
void end_tree_node(const T &value)
template specialization that allows to specify value reference plus node_instance by using the result...
Definition provider.h:222

The state of the toggle button is attached to a boolean flag that is globally managed by the provider. If your this pointer can be converted to cgv::base::base, the on_set callback with a pointer to the flag is called when the user toggles the tree node. To check in the on_set callback for the tree node toggle one can get a reference to the boolean flag with the ref_tree_node_visible_flag method.

To allocate the boolean flag the reference to a value controlled by the tree node is specified. The pointer to the controlled value is used as key for a map that manages the toggle states of all tree node buttons. If there is no superior structure whose value is controlled by the tree node, one can specify any of the values controled by the tree node. It is just important that no two tree nodes use the same value and that the pointer to the value cannot change. The latter is for example the case, when one uses an entry in a std::vector that can change size and reallocate its values. Then one should use the std::vector itself as value. In order to be able to distinguish the different elements of a vector one can extend the key from a value reference to a pair of a value reference plus an index. The index is then the index of the vector element. This is done by specifying with_index(value, idx) in the value argument. An example could look as follows:

if (begin_tree_node("Node", vec)) {
align("\a"); // indent gui elements of tree node
for (unsigned i=0; i<vec.size; ++i) {
if (begin_tree_node(std::string("element ")+cgv::utils::to_string(i), with_index(vec,i))) {
align("\a"); // indent gui elements of tree node for vector element
// create gui of vector element
align("\b"); // undo indentation
}
}
align("\b"); // undo indentation
}
with_index_struct< T > with_index(const T &_value, int _index)
helper function to support value references as well as value references with index for the tree_node ...
Definition provider.h:28
std::string to_string(const std::string &v, unsigned int w, unsigned int p, bool)
specialization of conversion from string to strings

Definition at line 212 of file provider.h.

Referenced by cgv::gui::arrow_render_style_gui_creator::create(), cgv::gui::cone_render_style_gui_creator::create(), cgv::gui::line_render_style_gui_creator::create(), cgv::gui::point_render_style_gui_creator::create(), cgv::gui::rectangle_render_style_gui_creator::create(), cgv::gui::sphere_render_style_gui_creator::create(), cgv::gui::surface_render_style_gui_creator::create(), cgv::gui::surfel_render_style_gui_creator::create(), cgv::gui::volume_render_style_gui_creator::create(), cgv::plot::plot3d::create_config_gui(), cgv::plot::plot_base::create_config_gui(), vr_test::create_gui(), vr_emulator::create_gui(), cgv::plot::axis_config::create_gui(), cgv::plot::plot2d::create_gui(), cgv::plot::plot3d::create_gui(), cgv::plot::plot_base::create_gui(), cgv::app::color_map_editor::create_gui_impl(), cgv::app::color_selector::create_gui_impl(), cgv::gui::subprovider::create_gui_tree_node(), cgv::app::overlay::create_layout_gui(), and cgv::plot::plot_base::create_plot_gui().

◆ begin_tree_node_void()

bool cgv::gui::provider::begin_tree_node_void ( const std::string &  label,
const void *  value_ptr,
int  index = -1,
bool  initial_visibility = false,
const std::string &  options = "",
gui_group_ptr  ggp = gui_group_ptr() 
)

void version of the templated functions

Definition at line 207 of file provider.cxx.

References align(), cgv::base::has_property(), cgv::base::base::on_set(), parent_group, post_recreate_gui(), and cgv::utils::to_string().

Referenced by cgv::app::overlay::begin_overlay_gui().

◆ concat_enum_def()

std::string cgv::gui::provider::concat_enum_def ( const std::vector< std::string > &  names,
const std::string &  additional_first_name = "",
const std::string &  additional_last_name = "" 
)

add a new group to the given parent group, not supported yet

concatenate names in string to enum declaration and optionally prepend or append given additional names

Add group with the gui of another object inside.

Add a new group, where the group elements are defined by another object that must be derived from provider. You can use the same group types as in the add_group method. concatenate names in string to enum declaration and optionally prepend or append given additional names

Definition at line 43 of file provider.cxx.

◆ create_gui()

virtual void cgv::gui::provider::create_gui ( )
pure virtual

you must overload this for gui creation

Implemented in cgv::gui::base_provider, cgv::app::overlay, vr_test, and vr_emulator.

Referenced by inline_object_gui(), and recreate_gui().

◆ end_tree_node()

◆ end_tree_node_void()

void cgv::gui::provider::end_tree_node_void ( const void *  value_ptr,
int  index = -1 
)

Definition at line 269 of file provider.cxx.

◆ ensure_selected_in_tab_group_parent()

bool cgv::gui::provider::ensure_selected_in_tab_group_parent ( )
virtual

ensure that my UI is selected in the parent group in case this is a tab group, otherwise return false

ensure that my UI is selected in the closest parent that is a tab group

Definition at line 407 of file provider.cxx.

References get_parent_group().

◆ find_control()

template<typename T >
data::ref_ptr< control< T > > cgv::gui::provider::find_control ( T &  value,
int *  idx_ptr = 0 
)
inline

find a control of a given class member

find the next control of the given value in the current group. If the index pointer is given, start at the index to which the pointer points and set this index to the index of the child index of the found control

Definition at line 330 of file provider.h.

References cgv::data::ref_ptr< T, is_ref_counted >::empty().

Referenced by cgv::plot::plot_base::create_plot_gui().

◆ find_control_void()

control_ptr cgv::gui::provider::find_control_void ( void *  value_ptr,
int *  idx_ptr 
)

access to control of untyped member pointer

Definition at line 315 of file provider.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ find_element()

cgv::base::base_ptr cgv::gui::provider::find_element ( const std::string &  name)

find a gui element by name in the current group, return empty pointer if not found

Definition at line 306 of file provider.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ find_view()

template<typename T >
data::ref_ptr< view< T > > cgv::gui::provider::find_view ( const T &  value,
int *  idx_ptr = 0 
)
inline

find a view of a given class member

find the next view of the given value in the current group. If the index pointer is given, start at the index to which the pointer points and set this index to the index of the child index of the found view

Definition at line 320 of file provider.h.

References cgv::data::ref_ptr< T, is_ref_counted >::empty().

◆ find_view_void()

view_ptr cgv::gui::provider::find_view_void ( void *  value_ptr,
int *  idx_ptr 
)

access to view of untyped member pointer

Definition at line 323 of file provider.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ get_gui_name()

std::string cgv::gui::provider::get_gui_name ( ) const
virtual

Derive a name for this instance that can be used in the gui as heading.

this method uses the following strategy to automatically determine the name shown in guis for a provider instance:

This method uses the following strategy to automatically determine the name shown in guis for a provider instance:

  • try to cast the object into cgv::base::named, if successful, use get_name() method
  • check whether get_menu_path() results in a path or name. In case of a path, use the last entry of the path as name.
  • try to cast to cgv::base::base and use get_type_name().
  • return "unnamed" otherwise
  • try to cast the object into cgv::base::named, if successful, use get_name() method
  • check whether get_menu_path() results in a path or name. In case of a path, use the last entry of the path as name.
  • try to cast to cgv::base::base and use get_type_name().
  • return "unnamed" otherwise

Definition at line 383 of file provider.cxx.

References get_menu_path(), cgv::base::base::get_named(), and cgv::base::base::get_type_name().

Referenced by update_parent().

◆ get_menu_path()

std::string cgv::gui::provider::get_menu_path ( ) const
virtual

return a path in the main menu to select the gui

Definition at line 424 of file provider.cxx.

Referenced by get_gui_name().

◆ get_parent_group()

gui_group_ptr cgv::gui::provider::get_parent_group ( ) const
inline

use the parent group to append to be managed elements that should be destroyed in a post_recreate_gui event

Definition at line 81 of file provider.h.

Referenced by ensure_selected_in_tab_group_parent(), and inline_object_gui().

◆ get_parent_type()

std::string cgv::gui::provider::get_parent_type ( ) const
virtual

Returns the group type that should be used by the class embedding the gui of the provider.

The default is to use a group of type "align_group". Overload this virtual method to use a different group type, such as layout group.

Reimplemented in cgv::gui::base_provider.

Definition at line 402 of file provider.cxx.

◆ get_shortcut()

shortcut cgv::gui::provider::get_shortcut ( ) const
virtual

return a shortcut to activate the gui without menu navigation

Definition at line 430 of file provider.cxx.

◆ inline_object_gui()

void cgv::gui::provider::inline_object_gui ( cgv::base::base_ptr  object)

integrate (if not explicitly done before) and inline the gui of another object that must be derived from provider

Definition at line 147 of file provider.cxx.

References create_gui(), get_parent_group(), parent_group, and set_parent().

◆ integrate_object_gui()

void cgv::gui::provider::integrate_object_gui ( cgv::base::base_ptr  object)

call this in create_gui() function to integrate gui of another provider object by setting the parent group and parent provider of the other object

Definition at line 137 of file provider.cxx.

References parent_group, and set_parent().

◆ is_tree_node_visible()

template<typename T >
bool cgv::gui::provider::is_tree_node_visible ( const T &  value) const
inline

return whether the sub tree attached to a value is visible

Definition at line 225 of file provider.h.

◆ is_tree_node_visible_void()

bool cgv::gui::provider::is_tree_node_visible_void ( const void *  value_ptr,
int  index 
) const

Definition at line 274 of file provider.cxx.

◆ on_deselect()

void cgv::gui::provider::on_deselect ( )
protectedvirtual

called by selection_change_cb whenever the gui of this provider is deselected

Definition at line 343 of file provider.cxx.

Referenced by selection_change_cb().

◆ on_select()

void cgv::gui::provider::on_select ( )
protectedvirtual

called by selection_change_cb whenever the gui of this provider is selected

Definition at line 338 of file provider.cxx.

Referenced by selection_change_cb().

◆ post_recreate_gui()

void cgv::gui::provider::post_recreate_gui ( )
virtual

delayed recreation of gui

schedule the recreation of the gui for the next time the program is idle. This mechanism is implemented in a thread save way.

Definition at line 509 of file provider.cxx.

References cgv::gui::get_trigger_server(), parent_group, and post_recreate_gui().

Referenced by add_tree_node(), begin_tree_node_void(), cgv::app::color_map_editor::handle_member_change(), cgv::app::color_map_editor::handle_theme_change(), vr_test::on_device_change(), vr_test::on_status_change(), and post_recreate_gui().

◆ recreate_gui()

void cgv::gui::provider::recreate_gui ( )
virtual

Recreate the gui of this instance right now.

Use this method to recreate the gui, dont call create gui directly. Be careful when calling the method from a functor that is attached to a gui element generated by this provider. This can cause the gui element to be destroyed before the callback triggering the recreate_gui method has been completely finished, what might make the program crash. Use the post_recreate_gui method instead.

Definition at line 436 of file provider.cxx.

References create_gui(), parent_group, and remove_all_elements().

◆ ref_tree_node_visible_flag()

template<typename T >
static bool & cgv::gui::provider::ref_tree_node_visible_flag ( const T &  value)
inlinestatic

return a reference to the boolean flag, that tells whether the tree node for the passed value is visible

T can be with_index(v,i) as in the begin_tree_node function. You typically need this function in an on_set callback to check whether the user has toggled a tree node

Definition at line 217 of file provider.h.

Referenced by cgv::gui::directory_helper::is_save_action(), and cgv::gui::file_helper::is_save_action().

◆ ref_tree_node_visible_flag_void()

bool & cgv::gui::provider::ref_tree_node_visible_flag_void ( const void *  value_ptr,
int  index = -1 
)
static

Definition at line 257 of file provider.cxx.

◆ remove_all_elements()

void cgv::gui::provider::remove_all_elements ( )

this method removes all elements from the gui and can be used in a method that rebuilds the complete gui

Definition at line 297 of file provider.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

Referenced by recreate_gui().

◆ remove_element()

void cgv::gui::provider::remove_element ( cgv::base::base_ptr  e)

remove a single element from the gui

Definition at line 290 of file provider.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.

◆ selection_change_cb()

void cgv::gui::provider::selection_change_cb ( cgv::base::base_ptr  new_child,
bool  selected 
)
protectedvirtual

this is called by the gui group when the selection changes

Definition at line 349 of file provider.cxx.

References on_deselect(), on_select(), and parent_group.

Referenced by set_parent().

◆ set_control_property()

template<typename T >
void cgv::gui::provider::set_control_property ( T &  value,
const std::string &  property_name,
const std::string &  property_value 
)
inline

Set the property value of all controls of a given class member.

Use this method to loop over all controls of the given value and set their named property to the specified property value.

Definition at line 343 of file provider.h.

Referenced by cgv::gui::directory_helper::set_default_path(), cgv::gui::file_helper::set_default_path(), cgv::gui::directory_helper::set_title(), and cgv::gui::file_helper::set_title().

◆ set_parent()

void cgv::gui::provider::set_parent ( gui_group_ptr  _parent_group)
protected

the gui window sets the parent group through this method

Definition at line 360 of file provider.cxx.

References parent_group, and selection_change_cb().

Referenced by inline_object_gui(), integrate_object_gui(), and cgv::gui::gui_group::set_provider_parent().

◆ set_tree_node_visibility()

template<typename T >
void cgv::gui::provider::set_tree_node_visibility ( const T &  value,
bool  is_visible 
)
inline

set the visibility status of sub tree attached to a value. This calls the post_recreate method if needed.

Definition at line 228 of file provider.h.

◆ set_tree_node_visibility_void()

void cgv::gui::provider::set_tree_node_visibility_void ( const void *  value_ptr,
int  index,
bool  is_visible 
)

Definition at line 280 of file provider.cxx.

◆ update_all_members()

void cgv::gui::provider::update_all_members ( )
virtual

call this to update all views and controls of all member

Definition at line 116 of file provider.cxx.

References parent_group.

◆ update_member()

◆ update_parent()

void cgv::gui::provider::update_parent ( )
protected

update the parent group

Definition at line 15 of file provider.cxx.

References get_gui_name(), and parent_group.

Friends And Related Symbol Documentation

◆ gui_group

friend class gui_group
friend

make the gui group a friend class

Definition at line 77 of file provider.h.

Member Data Documentation

◆ parent_group

◆ parent_provider

provider* cgv::gui::provider::parent_provider
protected

Definition at line 71 of file provider.h.


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