diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-11 22:45:14 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-11 22:45:14 (GMT) |
commit | 9ed8d9a6732e1eea0265ff84917278a82d81e2dd (patch) | |
tree | 6322830c95d70b2310b45c7008cfd4dac6d4bf31 /src/rendersettings.cc | |
parent | 647fdf5f98f6337955972375a17837aede922988 (diff) |
Some small refactoring of color handling to support using the color() module to change only alpha
Diffstat (limited to 'src/rendersettings.cc')
-rw-r--r-- | src/rendersettings.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/rendersettings.cc b/src/rendersettings.cc new file mode 100644 index 0000000..ee57c34 --- /dev/null +++ b/src/rendersettings.cc @@ -0,0 +1,35 @@ +#include "rendersettings.h" + +RenderSettings *RenderSettings::inst(bool erase) +{ + static RenderSettings *instance = new RenderSettings; + if (erase) { + delete instance; + instance = NULL; + } + return instance; +} + +RenderSettings::RenderSettings() +{ + this->colors[BACKGROUND_COLOR] = QColor(0xff, 0xff, 0xe5); + this->colors[OPENCSG_FACE_FRONT_COLOR] = QColor(0xf9, 0xd7, 0x2c); + this->colors[OPENCSG_FACE_BACK_COLOR] = QColor(0x9d, 0xcb, 0x51); + this->colors[CGAL_FACE_FRONT_COLOR] = QColor(0xf9, 0xd7, 0x2c); + this->colors[CGAL_FACE_BACK_COLOR] = QColor(0x9d, 0xcb, 0x51); + this->colors[CGAL_FACE_2D_COLOR] = QColor(0x00, 0xbf, 0x99); + this->colors[CGAL_EDGE_FRONT_COLOR] = QColor(0xff, 0x00, 0x00); + this->colors[CGAL_EDGE_BACK_COLOR] = QColor(0xff, 0x00, 0x00); + this->colors[CGAL_EDGE_2D_COLOR] = QColor(0xff, 0x00, 0x00); + this->colors[CROSSHAIR_COLOR] = QColor(0x80, 0x00, 0x00); +} + +QColor RenderSettings::color(RenderColor idx) const +{ + return this->colors[idx]; +} + +void RenderSettings::setColors(const QMap<RenderColor, QColor> &colors) +{ + this->colors = colors; +} |