00001
00002
00003
00004
00005
00006 #include "CSettings.h"
00007 #include <QStringList>
00008 #include <QColor>
00009
00010
00011
00012
00013
00014
00015 CSettings::CSettings(const char *path,QObject *parent):QSettings(QString().fromStdString(path),QSettings::IniFormat,parent)
00016 {
00017 this->sync();
00018 }
00019
00020
00021 CSettings::~CSettings(){}
00022
00023
00024 void CSettings::SetGetCreateSettings()
00025 {
00026 beginGroup("APPCREATE");
00027 this->setValue("splashImage",value("splashImage","../DATA/Splash.png"));
00028 this->setValue("splashTime",value("splashTime",200));
00029 this->setValue("splashShow",value("splashShow","true"));
00030 this->setValue("consoleAtStartup",value("consoleAtStartup","true"));
00031 this->setValue("logOpenGL",value("logOpenGL","false"));
00032 this->setValue("logOpenGLAll",value("logOpenGLAll","false"));
00033 this->setValue("sceneAtStartup",value("sceneAtStartup","").toString());
00034 this->setValue("validatorPath",value("validatorPath","../DATA/GLSLValidator/glslvalidate.exe"));
00035
00036 QStringList slist("C:/Programme/IDM Computer Solutions/UltraEdit-32/uedit32.exe"); slist << "";
00037 this->setValue("editorPath",value("editorPath",slist));
00038 endGroup();
00039 sync();
00040 }
00041
00042
00043 void CSettings::SetGetPropertiesSettings()
00044 {
00045 beginGroup("RENDERING");
00046 setValue("RenderMode",value("RenderMode",1));
00047 setValue("StepSize",value("StepSize",0.05));
00048 setValue("MaxSamples",value("MaxSamples",1000));
00049 setValue("ApplyNoise",value("ApplyNoise",false));
00050 setValue("FBOSize",value("FBOSize",512));
00051 setValue("TransferSize",value("TransferSize",512));
00052 setValue("MinClip",value("MinClip",0));
00053 endGroup();
00054
00055 beginGroup("LIGHTING");
00056 setValue("enableLighting",value("enableLighting",false));
00057 setValue("setLocalViewer",value("setLocalViewer",true));
00058 setValue("setHeadlight",value("setHeadLight",true));
00059 setValue("showLight",value("showLight",false));
00060 setValue("lightColor",value("lightColor",QColor("white")));
00061 setValue("gradDeltaX",value("gradDeltaX",0.5));
00062 setValue("gradDeltaY",value("gradDeltaX",0.5));
00063 setValue("gradDeltaZ",value("gradDeltaX",0.5));
00064 setValue("ambience",value("ambience",0.6));
00065 setValue("specularity",value("specularity",1.0));
00066 endGroup();
00067
00068 beginGroup("SHADOWS");
00069 setValue("EnableShadows",value("EnableShadows",false));
00070 setValue("ShadowQuality",value("ShadowQuality",0.5));
00071 setValue("ShadowTreshold",value("ShadowTreshold",0.2));
00072 endGroup();
00073
00074 beginGroup("MIP");
00075 setValue("VERTEX_SHADER",value("VERTEX_SHADER","../DATA/Shader/DVR_VERTEX_BACK_FRONT_v1.2.vs"));
00076 setValue("FRAGMENT_SHADER",value("FRAGMENT_SHADER","../DATA/Shader/DVR_FRAGMENT_BACK_FRONT_MIP_v1.2.fs"));
00077 endGroup();
00078
00079 sync();
00080 }
00081
00082
00083 void CSettings::SetRecentFiles(QStringList & recent)
00084 {
00085 beginGroup("RECENT");
00086 this->setValue("recentScenes",recent);
00087 endGroup();
00088 sync();
00089 }
00090
00091
00092 QStringList CSettings::GetRecentFiles()
00093 {
00094 beginGroup("RECENT");
00095 QStringList & recent = this->value("recentScenes").toStringList();
00096 endGroup();
00097 sync();
00098 return recent;
00099 }