ColorPalette 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
  2. *
  3. * This library is open source and may be redistributed and/or modified under
  4. * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  5. * (at your option) any later version. The full license is in LICENSE file
  6. * included with this distribution, and on the openscenegraph.org website.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * OpenSceneGraph Public License for more details.
  12. */
  13. #ifndef OSGUI_COLORPALETTE
  14. #define OSGUI_COLORPALETTE
  15. #include <osg/Object>
  16. #include <osg/Vec4>
  17. #include <osgUI/Export>
  18. namespace osgUI
  19. {
  20. class OSGUI_EXPORT ColorPalette : public osg::Object
  21. {
  22. public:
  23. ColorPalette();
  24. ColorPalette(const ColorPalette& cp, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
  25. META_Object(osgUI, ColorPalette);
  26. typedef std::vector<osg::Vec4f> Colors;
  27. void setColors(const Colors& colors) { _colors = colors; }
  28. Colors& getColors() { return _colors; }
  29. const Colors& getColors() const { return _colors; }
  30. typedef std::vector<std::string> Names;
  31. void setNames(const Names& names) { _names = names; }
  32. Names& getNames() { return _names; }
  33. const Names& getNames() const { return _names; }
  34. protected:
  35. virtual ~ColorPalette() {}
  36. Colors _colors;
  37. Names _names;
  38. };
  39. }
  40. #endif