33 #ifndef __H__UG_promesh_registry
34 #define __H__UG_promesh_registry
42 #include "boost/mpl/assert.hpp"
43 #include "boost/mpl/contains.hpp"
72 m_exportedFunction(exportedFunction),
74 m_groupPriority(groupPriority),
76 m_shortcutKey(shortcutKey),
77 m_modifierKey(modifierKey)
146 template<
typename TFunc>
149 std::string group =
"",
150 std::string retValInfos =
"",
151 std::string paramInfos =
"",
152 std::string tooltip =
"",
153 std::string help =
"",
158 using namespace bridge;
159 ExportedFunction* ef =
160 m_reg->add_and_get_function(
161 funcName, func, group, retValInfos,
162 paramInfos, tooltip, help);
164 int& groupPriority = m_groupPriority[group];
166 groupPriority = m_counter;
171 target, shortcutKey, modifyerKey));
182 template <
typename TClass>
185 std::string group =
"",
186 std::string tooltip =
"")
188 return m_reg->add_class_<TClass>(className, group, tooltip);
197 template <
typename TClass,
typename TBaseClass>
200 std::string group =
"",
201 std::string tooltip =
"")
203 return m_reg->add_class_<TClass, TBaseClass>(className, group, tooltip);
212 template <
typename TClass,
typename TBaseClass1,
typename TBaseClass2>
215 std::string group =
"",
216 std::string tooltip =
"")
218 return m_reg->add_class_<TClass, TBaseClass1, TBaseClass2>(
219 className, group, tooltip);
size_t num_parameter() const
const std::string & name() const
const std::string & group() const
Register functions for ug-script and ProMesh through this class.
Definition: promesh_registry.h:122
ProMeshFunctionSet::const_iterator const_func_iter_t
Definition: promesh_registry.h:126
std::map< std::string, int > m_groupPriority
Definition: promesh_registry.h:235
bridge::Registry * m_reg
Definition: promesh_registry.h:232
bridge::ExportedClass< TClass > & add_class_(std::string className, std::string group="", std::string tooltip="")
Register a class at this registry together with its base class.
Definition: promesh_registry.h:199
bridge::ExportedClass< TClass > & add_class_(std::string className, std::string group="", std::string tooltip="")
Register a class at this registry together with two base classes.
Definition: promesh_registry.h:214
const_func_iter_t functions_end() const
Definition: promesh_registry.h:229
ProMeshFunctionSet m_funcSet
Definition: promesh_registry.h:233
int m_counter
Definition: promesh_registry.h:234
const_func_iter_t functions_begin() const
Definition: promesh_registry.h:227
std::multiset< detail::ProMeshFunction > ProMeshFunctionSet
Definition: promesh_registry.h:124
bridge::Registry * registry()
returns a pointer to the ug::bridge::Registry which is encapsulated by this class.
Definition: promesh_registry.h:223
ProMeshRegistry(bridge::Registry *reg)
Definition: promesh_registry.h:128
func_iter_t functions_begin()
Definition: promesh_registry.h:226
ProMeshFunctionSet::iterator func_iter_t
Definition: promesh_registry.h:125
bridge::ExportedClass< TClass > & add_class_(std::string className, std::string group="", std::string tooltip="")
Register a class at this registry.
Definition: promesh_registry.h:184
ProMeshRegistry & add_function(std::string funcName, TFunc func, std::string group="", std::string retValInfos="", std::string paramInfos="", std::string tooltip="", std::string help="", unsigned int target=RT_DEFAULT, int shortcutKey=0, ModifierKeys modifyerKey=MK_NONE)
adds a function to the registry
Definition: promesh_registry.h:147
func_iter_t functions_end()
Definition: promesh_registry.h:228
All functions registered in the ProMeshRegistry are encapsulated in a ProMeshFunction.
Definition: promesh_registry.h:63
int shortcut_key() const
Definition: promesh_registry.h:104
int m_shortcutKey
Definition: promesh_registry.h:112
int m_groupPriority
Definition: promesh_registry.h:110
const bridge::ExportedFunction * exported_function() const
Definition: promesh_registry.h:84
bridge::ExportedFunction * m_exportedFunction
Definition: promesh_registry.h:108
int group_priority() const
Definition: promesh_registry.h:87
bridge::ExportedFunction * exported_function()
Definition: promesh_registry.h:81
unsigned int m_target
Definition: promesh_registry.h:111
ModifierKeys shortcut_modifier_key() const
Definition: promesh_registry.h:105
bool has_target(RegistryTargets t) const
Definition: promesh_registry.h:89
int priority() const
Definition: promesh_registry.h:86
ModifierKeys m_modifierKey
Definition: promesh_registry.h:113
ProMeshFunction(bridge::ExportedFunction *exportedFunction, int priority, int groupPriority, unsigned int target, int shortcutKey=0, ModifierKeys modifierKey=MK_NONE)
Definition: promesh_registry.h:65
int m_priority
Definition: promesh_registry.h:109
UG_API bool operator<(const GeomObjID &gid1, const GeomObjID &gid2)
RegistryTargets
Definition: promesh_registry.h:49
@ RT_UGSCRIPT
Definition: promesh_registry.h:51
@ RT_NO_UGSCRIPT
Definition: promesh_registry.h:56
@ RT_NO_PROMESH
Definition: promesh_registry.h:55
@ RT_PROMESH
Definition: promesh_registry.h:52
@ RT_DEFAULT
Definition: promesh_registry.h:54
@ RT_NONE
Definition: promesh_registry.h:50
size_t target(SM_edge< typename T::value_type > const &e, ug::BidirectionalMatrix< T > const &m)
ModifierKeys
Definition: keys.h:39
@ MK_NONE
Definition: keys.h:40