OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
TemplateDefaultManager.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include <string>
5#include <map>
6
7namespace ot { class Painter2D; };
8
9class __declspec(dllexport) DefaultValue
10{
11public:
12 DefaultValue();
13 DefaultValue(const DefaultValue&other);
14 virtual ~DefaultValue();
15
16 DefaultValue& operator=(const DefaultValue&other);
17
18 enum {UNDEFINED, DOUBLE, LONG, BOOL, STRING, COLOR, GUIPainter} type;
19
20 double d;
21 long l;
22 bool b;
23 std::string s;
24 int c[3];
25 ot::Painter2D* m_painter;
26};
27
28class __declspec(dllexport) TemplateDefaultManager
29{
30public:
31 TemplateDefaultManager();
32 virtual ~TemplateDefaultManager();
33
34 void loadDefaultTemplate(void);
35 void setDefaultTemplate(const std::string &templateName);
36 void loadDefaults(const std::string &category);
37 std::string loadDefaultMaterials(void);
38
39 double getDefaultDouble(const std::string &category, const std::string &value, double defVal);
40 long getDefaultLong(const std::string &category, const std::string &value, long defVal);
41 bool getDefaultBool(const std::string &category, const std::string &value, bool defVal);
42 std::string getDefaultString(const std::string &category, const std::string &value, const std::string &defVal);
43 int getDefaultColor(const std::string &category, const std::string &value, int component, int defVal);
44
47 const ot::Painter2D* getDefaultGuiPainter(const std::string& category, const std::string& value);
48
49 static TemplateDefaultManager* getTemplateDefaultManager(void);
50
51 bool isUIMenuPageVisible(const std::string &page);
52 bool isUIMenuGroupVisible(const std::string &page, const std::string &group);
53 bool isUIMenuActionVisible(const std::string &page, const std::string &group, const std::string &action);
54
55 const std::map < std::string, std::map<std::string, DefaultValue>> &getDefaultMaterials(void) { return defaultMaterialsMap; }
56
57private:
58 void clearSettings(void);
59 DefaultValue getDefaultValue(const std::string &category, const std::string &value);
60
61 std::string defaultTemplateName;
62 std::map < std::string, std::map<std::string, DefaultValue>> defaultMap;
63 std::map < std::string, std::map<std::string, DefaultValue>> defaultMaterialsMap;
64};
bsoncxx::types::value value
Definition DocumentManager.h:16
Definition Painter2D.h:17
double double double b[]
Definition GeometryOperations.h:24
UICORE_API_EXPORT objectType type(UID _objectUID)
Will return the object type of the specified object.
Definition uiAPI.cpp:596
Definition Connector.h:8