OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ScalingProperties.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <map>
4
5class __declspec(dllexport) ScalingProperties
6{
7public:
8 enum class ScalingMethod
9 {
10 autoScale, rangeScale, UNKNOWN
11 };
12 enum class ScalingFunction
13 {
14 linScale, logScale, UNKNOWN
15 };
16
17 const std::string GetPropertyNameScalingMethod(void) { return nameScalingMethod; }
18 const std::string GetPropertyNameRangeMax(void) { return nameRangeMax; }
19 const std::string GetPropertyNameRangeMin(void) { return nameRangeMin; }
20 const std::string GetPropertyNameScalingFunction(void) { return nameScalingFunction; }
21 const std::string GetPropertyNameColourResolution(void) { return nameColourResolution; }
22
23 const std::string GetPropertyValueAutoscaling(void) { return valueAutoScaling; }
24 const std::string GetPropertyValueRangeScaling(void) { return valueRangeScaling; }
25 const std::string GetPropertyValueLogscaling(void) { return valueLogScale; }
26 const std::string GetPropertyValueLinScaling(void) { return valueLinScale; }
27
28 const ScalingMethod GetScalingMethod(std::string scaling)
29 {
30 ScalingMethod returnVal;
31 scalingMethodMapping.find(scaling) == scalingMethodMapping.end() ? returnVal = ScalingMethod::UNKNOWN : returnVal = scalingMethodMapping.at(scaling);
32 return returnVal;
33 }
34
35 const ScalingFunction GetScalingFunction(std::string funct)
36 {
37 ScalingFunction returnVal;
38 scalingFunctionMapping.find(funct) == scalingFunctionMapping.end() ? returnVal = ScalingFunction::UNKNOWN : returnVal = scalingFunctionMapping.at(funct);
39 return returnVal;
40 }
41
42private:
43 const std::string nameScalingMethod = "Scaling Method";
44 const std::string valueRangeScaling = "Range";
45 const std::string nameRangeMax = "Max";
46 const std::string nameRangeMin = "Min";
47 const std::string valueAutoScaling = "Auto";
48
49 const std::string nameScalingFunction = "Scaling Function";
50 const std::string valueLogScale = "Log10 scale";
51 const std::string valueLinScale = "Linear scale";
52
53 const std::string nameColourResolution = "Colour Resolution";
54
55 std::map < std::string, ScalingMethod> scalingMethodMapping{ {valueAutoScaling, ScalingMethod::autoScale}, {valueRangeScaling, ScalingMethod::rangeScale} };
56 std::map < std::string, ScalingFunction> scalingFunctionMapping{ {valueLinScale,ScalingFunction::linScale}, {valueLogScale, ScalingFunction::logScale} };
57};