ColorMapper.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeUnstructGrid/Base.h"
16 
17 #include "CeeCore/RefCountedObject.h"
18 #include "CeeCore/Color3f.h"
19 #include "CeeCore/Str.h"
20 
21 
22 namespace cee {
23 namespace ug {
24 
25 //==================================================================================================
26 //
27 //
28 //
29 //==================================================================================================
30 class CEE_UG_EXPORT ColorMapper : public RefCountedObject
31 {
32 public:
35  {
47  CUSTOM
48  };
49 
52  {
55  CONTINUOUS
56  };
57 
58 public:
59  virtual ~ColorMapper();
60  MappingType type() const;
61  void setTypeFilledContoursUniform(unsigned int numColors);
62  void setTypeFilledContours(const std::vector<double>& values);
63  void setTypeContinuous();
64 
65  ColorScheme colorScheme() const;
66  void setColorScheme(ColorScheme scheme);
67 
68  Color3f aboveRangeColor() const;
69  void setAboveRangeColor(const Color3f& aboveColor);
70  bool isAboveRangeMaskingEnabled() const;
71  void enableAboveRangeMasking(bool enableMasking);
72 
73  Color3f belowRangeColor() const;
74  void setBelowRangeColor(const Color3f& belowColor);
75  bool isBelowRangeMaskingEnabled() const;
76  void enableBelowRangeMasking(bool enableMasking);
77 
78  Color3f undefinedColor() const;
79  void setUndefinedColor(const Color3f& undefinedColor);
80  bool isUndefinedMaskingEnabled() const;
81  void enableUndefinedMasking(bool enableMasking);
82 
83  void setTextureSize(unsigned int textureSize);
84 
85  // FILLED_CONTOURS_UNIFORM and FILLED_CONTOURS
86  unsigned int numberOfFilledContoursColors() const;
87  std::vector<Color3f> filledContoursColors() const;
88  std::vector<double> filledContoursLevelValues() const;
89  void setCustomFilledContoursColors(const std::vector<Color3f>& levelColors);
90 
91  // CONTINUOUS
92  std::vector<double> customContinuousValues() const;
93  std::vector<Color3f> customContinuousColors() const;
94  void setCustomContinuousColorsAtValues(const std::vector<double>& values, const std::vector<Color3f>& colorAtValues);
95  std::vector<double> customContinuousTickMarks() const;
96  void setCustomContinuousTickMarks(const std::vector<double>& tickMarkValues);
97 
98 private:
99  ColorMapper();
100  CEE_PRIVATE_F(ScalarSettings);
101  CEE_PRIVATE_IMPL(ColorMapper);
102  CEE_DISALLOW_COPY_AND_ASSIGN(ColorMapper);
103 };
104 
105 } // namespace ug
106 } // namespace cee
107 
Black to white.
Definition: ColorMapper.h:38
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Green to brown.
Definition: ColorMapper.h:40
Blue to white to red.
Definition: ColorMapper.h:43
White to brown.
Definition: ColorMapper.h:41
Normal.
Definition: ColorMapper.h:36
Thermal 3.
Definition: ColorMapper.h:46
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Thermal 1.
Definition: ColorMapper.h:44
Thermal 2.
Definition: ColorMapper.h:45
Class for storing an RGB color triplet.
Definition: Color3f.h:25
Controlling the color mapping and the color setup of the legend.
Definition: ColorMapper.h:30
MappingType
MappingType of color mapper.
Definition: ColorMapper.h:51
Settings for a specific scalar result.
Definition: ScalarSettings.h:34
White to black.
Definition: ColorMapper.h:39
Filled contours color mapping, customized level values for each level.
Definition: ColorMapper.h:54
Filled contours color mapping, discrete mapping with uniform size for the legend levels.
Definition: ColorMapper.h:53
Normal inverted.
Definition: ColorMapper.h:37
ColorScheme
Color scheme used for the color mapper.
Definition: ColorMapper.h:34
Metal casting.
Definition: ColorMapper.h:42