cgv
Loading...
Searching...
No Matches
gui_creator.cxx
1#include "gui_creator.h"
2#include <vector>
3
4
5namespace cgv {
6 namespace gui {
7
8std::vector<gui_creator*>& ref_gui_creators()
9{
10 static std::vector<gui_creator*> creators;
11 return creators;
12}
13
15void register_gui_creator(gui_creator* gc, const char* creator_name)
16{
17 ref_gui_creators().push_back(gc);
18}
19
21bool create_gui(provider* p, const std::string& label,
22 void* value_ptr, const std::string& value_type,
23 const std::string& gui_type, const std::string& options, bool* toggles)
24{
25 for (unsigned i=0; i<ref_gui_creators().size(); ++i)
26 if (ref_gui_creators()[i]->create(p,label,value_ptr,value_type,gui_type,options,toggles))
27 return true;
28 return false;
29}
30
31 }
32}
derive from this class to provide a gui to the current viewer
Definition provider.h:64
void register_gui_creator(gui_creator *gc, const char *creator_name)
register a gui creator
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
interface for gui creators
Definition gui_creator.h:14