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
std::map< QString, ColorMap::Ptr > & ColorMapLibrary()
Definition: color_map.cpp:48
QString _script
Definition: color_map.h:35
void SaveColorMapToSettings()
Definition: color_map.cpp:54
sol::protected_function_result setScrip(QString script)
Definition: color_map.cpp:10
QColor mapColor(double value) const
Definition: color_map.cpp:34
sol::protected_function _lua_function
Definition: color_map.h:34
sol::state _lua_engine
Definition: color_map.h:33
QString getError(sol::error err) const
Definition: color_map.cpp:29
void LoadColorMapFromSettings()
Definition: color_map.cpp:65
Definition: core.h:1131
std::shared_ptr< ColorMap > Ptr
Definition: color_map.h:19
QString script() const
Definition: color_map.h:23


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:01