cgv
Loading...
Searching...
No Matches
gui_creator.h
1#pragma once
2
3#include <string>
4
5#include "lib_begin.h"
6
7namespace cgv {
8 namespace gui {
9
10class 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
22extern CGV_API void register_gui_creator(gui_creator* gc, const char* creator_name);
23
25extern 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
30template <class T>
32{
33public:
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>
helper template for registration of gui creators
Definition gui_creator.h: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
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