cgv
gui_creator.h
1 #pragma once
2 
3 #include <string>
4 
5 #include "lib_begin.h"
6 
7 namespace cgv {
8  namespace gui {
9 
10 class provider;
11 
14 {
16  virtual bool create(provider* p, const std::string& label,
17  void* value_ptr, const std::string& value_type,
18  const std::string& gui_type, const std::string& options, bool* toggles) = 0;
19 };
20 
22 extern CGV_API void register_gui_creator(gui_creator* gc, const char* creator_name);
23 
25 extern CGV_API bool create_gui(provider* p, const std::string& label,
26  void* value_ptr, const std::string& value_type,
27  const std::string& gui_type = "", const std::string& options = "", bool* toggles = 0);
28 
30 template <class T>
32 {
33 public:
34  gui_creator_registration(const char* creator_name) {
35  register_gui_creator(new T(), creator_name);
36  }
37 };
38 
39 
40  }
41 }
42 
43 #include <cgv/config/lib_end.h>
cgv::gui::gui_creator::create
virtual bool create(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)=0
attempt to create a gui and return whether this was successful
cgv::gui::create_gui
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
Definition: gui_creator.cxx:21
cgv::gui::provider
derive from this class to provide a gui to the current viewer
Definition: provider.h:64
cgv::gui::gui_creator
interface for gui creators
Definition: gui_creator.h:14
cgv::gui::register_gui_creator
void register_gui_creator(gui_creator *gc, const char *creator_name)
register a gui creator
Definition: gui_creator.cxx:15
cgv::gui::gui_creator_registration
helper template for registration of gui creators
Definition: gui_creator.h:32
cgv
the cgv namespace
Definition: vr_calib.cxx:9