cgv
Loading...
Searching...
No Matches
subprovider.h
1#pragma once
2
3#include "provider.h"
4
5#include "lib_begin.h"
6
7namespace cgv {
8 namespace gui {
9
11class CGV_API subprovider
12{
13private:
14 // used in the optional tree node to store its visibility state
15 int tree_node_handle = 0;
16
17protected:
19 provider* provider_ptr = nullptr;
20
22 void update_member(void* member_ptr);
23
25 template<typename T>
26 void set_and_update_member(T& member, const T& value) {
27
28 member = value;
29 update_member(&member);
30 }
31
33 virtual void create_gui_impl(cgv::base::base* b, provider* p) = 0;
34
35public:
38 void create_gui(provider* p);
39
43 void create_gui_tree_node(provider* p, const std::string& title, bool initial_visibility, const std::string& options = "");
44};
45
46 }
47}
48
49#include <cgv/config/lib_end.h>
base class for all classes that can be registered with support for dynamic properties (see also secti...
Definition base.h:75
derive from this class to provide a gui to the current viewer
Definition provider.h:64
derive from this class to use a provider from another viewer
Definition subprovider.h:12
virtual void create_gui_impl(cgv::base::base *b, provider *p)=0
implement this to add gui controls using the supplied base and provider
void set_and_update_member(T &member, const T &value)
call this to update the value and all views and controls of a member
Definition subprovider.h:26
bool create_gui(provider *p, const std::string &label, void *value_ptr, const std::string &value_type, const std::string &gui_type, const std::string &options, bool *toggles)
create the gui for a composed structure
the cgv namespace
Definition print.h:11