cgv
Loading...
Searching...
No Matches
base_provider_generator.h
1#pragma once
2
3#include <cgv/base/register.h>
4#include <string>
5#include "base_provider.h"
6
7#include "lib_begin.h"
8
9namespace cgv {
10 namespace gui {
11
13 class CGV_API base_provider_generator : public cgv::base::base, public cgv::signal::tacker, public cgv::base::registration_listener
14{
15protected:
18 std::string definition;
19 std::string options;
20 gui_definition(const std::string& _def="", const std::string& _opt="") : definition(_def), options(_opt) {}
21 };
23 typedef std::map<std::string,gui_definition> def_map_type;
25 typedef def_map_type::const_iterator def_map_iter;
27 typedef std::map<cgv::base::base_ptr,base_provider_ptr> pvd_map_type;
29 typedef pvd_map_type::iterator pvd_map_iter;
35 std::vector<cgv::base::base_ptr> unmatched_objects;
39 bool generate_object_gui(cgv::base::base_ptr object);
41 std::map<std::string,long long> gui_files;
45 void timer_event(double,double);
46public:
50 std::string get_type_name() const;
52 bool self_reflect(cgv::reflect::reflection_handler& rh);
54 void on_set(void* member_ptr);
56 bool parse_gui_file(const std::string& file_name);
58 void register_object(cgv::base::base_ptr object, const std::string& options);
60 void unregister_object(cgv::base::base_ptr object, const std::string& options);
61};
62
63 }
64}
65
66#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
def_map_type defs_by_type
mappings from type to gui definitions
def_map_type::const_iterator def_map_iter
iterator type for map
def_map_type defs_by_name
mappings from name to gui definitions
pvd_map_type providers
store map to base_providers
std::map< cgv::base::base_ptr, base_provider_ptr > pvd_map_type
type of map from objects to base_providers
std::vector< cgv::base::base_ptr > unmatched_objects
keep track of unmatched objects
std::map< std::string, long long > gui_files
store read gui files with last write times
bool check_file_update
whether to check files
pvd_map_type::iterator pvd_map_iter
iterator type of base_provider map
std::map< std::string, gui_definition > def_map_type
type of mapping from strings to gui definitions
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
the cgv namespace
Definition print.h:11
interfaces that allows to listen to registration events.
Definition register.h:218
each gui definition consists of the textual definition as well as an options string