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,
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
60typedef cgv::data::ref_ptr<base_provider> base_provider_ptr;
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
reference counted pointer, which can work together with types that are derived from ref_counted,...
Definition ref_ptr.h:160
data::ref_ptr< cgv::base::named, true > get_named()
perform downcast to named
std::string get_parent_type() const
Returns the group type that should be used by the class embedding the gui of the provider.
base_provider(cgv::base::base_ptr _instance=cgv::base::base_ptr(), const std::string &gui_def="", bool _is_named_gui_assignment=false)
construct from instance and gui definition
void create_gui()
you must overload this for gui creation
bool self_reflect(cgv::reflect::reflection_handler &rh)
used for simple self reflection
std::string get_type_name() const
overload to return the type name of this object. By default the type interface is queried over get_ty...
provider()
default construction
Definition provider.cxx:332
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
Definition base.h:37
namespace that holds the abstract gui interface
Definition vr_calib.cxx:10
this header is dependency free
Definition print.h:11