color_map.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef COLOR_MAP_H
8 #define COLOR_MAP_H
9 
10 #include <algorithm>
11 #include <limits>
12 #include <map>
13 #include <QColor>
14 #include "sol.hpp"
15 
16 class ColorMap
17 {
18 public:
19  using Ptr = std::shared_ptr<ColorMap>;
20 
22 
23  QString script() const
24  {
25  return _script;
26  }
27 
28  QColor mapColor(double value) const;
29 
30  QString getError(sol::error err) const;
31 
32 private:
35  QString _script;
36 };
37 
38 // Storing ColoMaps as a "singleton"
39 std::map<QString, ColorMap::Ptr>& ColorMapLibrary();
42 
43 #endif // COLOR_MAP_H
sol::protected_function_result
Definition: sol.hpp:17228
sol::basic_protected_function
Definition: forward.hpp:1159
ColorMap::getError
QString getError(sol::error err) const
Definition: color_map.cpp:29
ColorMap::_lua_engine
sol::state _lua_engine
Definition: color_map.h:33
ColorMap::_lua_function
sol::protected_function _lua_function
Definition: color_map.h:34
SaveColorMapToSettings
void SaveColorMapToSettings()
Definition: color_map.cpp:54
ColorMap::script
QString script() const
Definition: color_map.h:23
sol.hpp
ColorMap::setScrip
sol::protected_function_result setScrip(QString script)
Definition: color_map.cpp:10
sol::error
Definition: sol.hpp:4573
ColorMap::mapColor
QColor mapColor(double value) const
Definition: color_map.cpp:34
LoadColorMapFromSettings
void LoadColorMapFromSettings()
Definition: color_map.cpp:65
ColorMap::_script
QString _script
Definition: color_map.h:35
ColorMap::Ptr
std::shared_ptr< ColorMap > Ptr
Definition: color_map.h:19
sol::state
Definition: sol.hpp:28238
ColorMap
Definition: color_map.h:16
ColorMapLibrary
std::map< QString, ColorMap::Ptr > & ColorMapLibrary()
Definition: color_map.cpp:48


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:43