cgv
Loading...
Searching...
No Matches
base_provider.h
1#pragma once
2
3#include <cgv/base/base.h>
4#include <cgv/gui/provider.h>
5
6#include "lib_begin.h"
7
8namespace cgv {
9 namespace gui {
10
12class CGV_API base_provider : public cgv::base::base, public provider
13{
14protected:
15 std::string parent_type, parent_options;
16 cgv::base::base_ptr instance;
17 std::string textual_gui_definition;
18 bool is_named_gui_assignment_m;
19 unsigned nr_toggles;
20 bool* toggles;
21 enum ParsingTasks { PT_NR_TOGGLES, PT_INIT_TOGGLES, PT_CREATE_GUI };
22 void parse_definition(ParsingTasks pt);
23 std::string error_start(const char* ptr) const;
24 bool find_member(const std::string& name, void*& member_ptr, std::string& member_type);
25public:
28 const std::string& gui_def = "", bool _is_named_gui_assignment = false);
30 base_provider(const std::string& file_name,
35 bool self_reflect(cgv::reflect::reflection_handler& rh);
37 std::string get_parent_type() const;
39 std::string get_type_name() const;
43 void read_gui_definition(const std::string& file_name);
45 void set_gui_definition(const std::string& new_def);
47 const std::string& get_gui_definition() const;
49 bool is_named_gui_assignment() const { return is_named_gui_assignment_m; }
51 void set_named_gui_assignment(bool value = true) { is_named_gui_assignment_m = value; }
53 void set_instance(cgv::base::base_ptr _instance);
55 cgv::base::base_ptr get_instance() const;
57 void create_gui();
58};
59
61
62 }
63}
64
65#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
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
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