cgv
|
derive from this class to provide a gui to the current viewer More...
#include <provider.h>
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 | |
provider * | parent_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) |
derive from this class to provide a gui to the current viewer
Definition at line 63 of file provider.h.
cgv::gui::provider::provider | ( | ) |
default construction
Definition at line 332 of file provider.cxx.
cgv::gui::provider::~provider | ( | ) |
ensure to remove posted recreation callbacks
Definition at line 493 of file provider.cxx.
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().
|
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().
|
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().
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.
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 a newly created decorator to the group
Definition at line 168 of file provider.cxx.
References align(), cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.
Referenced by cgv::gui::volume_render_style_gui_creator::create(), vr_test::create_gui(), vr_emulator::create_gui(), cgv::plot::plot3d::create_gui(), cgv::plot::plot_base::create_gui(), cgv::app::color_map_editor::create_gui_impl(), and cgv::app::overlay::create_layout_gui().
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.
|
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().
|
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().
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.
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
Definition at line 183 of file provider.cxx.
References parent_group, post_recreate_gui(), and cgv::utils::to_string().
|
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().
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.
void cgv::gui::provider::align | ( | const std::string & | _align | ) |
send pure alignment information
Definition at line 36 of file provider.cxx.
References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and parent_group.
Referenced by add_button(), add_control_void(), add_decorator(), add_group(), add_view_void(), cgv::app::overlay::begin_overlay_gui(), begin_tree_node_void(), 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::plot_base::create_base_config_gui(), 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(), cgv::plot::plot_base::create_plot_gui(), and cgv::app::overlay::end_overlay_gui().
|
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
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:
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().
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().
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.
|
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().
|
inline |
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
This functions should be called only if the corresponding call to begin_tree_node returned true.
Definition at line 222 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(), cgv::plot::plot_base::create_plot_gui(), and cgv::app::overlay::end_overlay_gui().
void cgv::gui::provider::end_tree_node_void | ( | const void * | value_ptr, |
int | index = -1 |
||
) |
Definition at line 269 of file provider.cxx.
|
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().
|
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().
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.
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.
|
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().
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.
|
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:
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().
|
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().
|
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().
|
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.
|
virtual |
return a shortcut to activate the gui without menu navigation
Definition at line 430 of file provider.cxx.
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().
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().
|
inline |
return whether the sub tree attached to a value is visible
Definition at line 225 of file provider.h.
bool cgv::gui::provider::is_tree_node_visible_void | ( | const void * | value_ptr, |
int | index | ||
) | const |
Definition at line 274 of file provider.cxx.
|
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().
|
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().
|
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().
|
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().
|
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().
|
static |
Definition at line 257 of file provider.cxx.
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().
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.
|
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().
|
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().
|
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().
|
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.
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.
|
virtual |
call this to update all views and controls of all member
Definition at line 116 of file provider.cxx.
References parent_group.
|
virtual |
call this to update all views and controls of a member
Definition at line 72 of file provider.cxx.
Referenced by vr_emulator::handle(), vr_test::init_frame(), cgv::app::navigator::on_set(), cgv::app::overlay::on_set(), vr_test::on_set(), vr_emulator::on_set(), cgv::app::canvas_overlay::on_set(), cgv::app::overlay::on_visibility_change(), cgv::gui::directory_helper::set_directory_name(), cgv::gui::file_helper::set_file_name(), and cgv::gui::subprovider::update_member().
|
protected |
update the parent group
Definition at line 15 of file provider.cxx.
References get_gui_name(), and parent_group.
|
friend |
make the gui group a friend class
Definition at line 77 of file provider.h.
|
protected |
driver specific handle for the group gui element managing the gui built in the provider
Definition at line 69 of file provider.h.
Referenced by add_button(), add_control_void(), add_decorator(), add_group(), add_tree_node(), add_view_void(), align(), begin_tree_node_void(), cgv::gui::base_provider::create_gui(), find_control_void(), find_element(), find_view_void(), cgv::gui::gui_group::get_provider_parent(), inline_object_gui(), integrate_object_gui(), post_recreate_gui(), recreate_gui(), remove_all_elements(), remove_element(), selection_change_cb(), set_parent(), update_all_members(), and update_parent().
|
protected |
Definition at line 71 of file provider.h.