ScalarSettings.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 #include "CeeUnstructGrid/ColorMapper.h"
21 #include "CeeUnstructGrid/ContourLines.h"
22 
23 
24 namespace cee {
25 namespace ug {
26 
27 class ColorMapper;
28 
29 //==================================================================================================
30 //
31 //
32 //
33 //==================================================================================================
34 class CEE_UG_EXPORT ScalarSettings : public RefCountedObject
35 {
36 public:
39  {
41  BELOW
42  };
43 
46  {
47  OFF,
49  VISIBLE_ITEMS
50  };
51 
54  {
56  AUTO,
57  ALWAYS
58  };
59 
65  {
66  LEFT,
68  TOP,
70  FOLLOW_LAYOUT
71  };
72 
77  {
79  VERTICAL
80  };
81 
82 public:
83  virtual ~ScalarSettings();
84 
85  double rangeMinimum() const;
86  double rangeMaximum() const;
87  void setRange(double min, double max);
88 
89  AutoRangeMode autoRangeMode() const;
90  void setAutoRangeMode(AutoRangeMode mode);
91 
92  const ColorMapper& colorMapper() const;
93  ColorMapper& colorMapper();
94 
95  const ContourLines& contourLines() const;
96  ContourLines& contourLines();
97 
98  bool logarithmicMapping() const;
99  void setLogarithmicMapping(bool logMapper);
100 
101  bool nodeAveragedValues() const;
102  void setNodeAveragedValues(bool useNodeAveraging);
103 
104  LegendVisibilityMode legendVisibilityMode() const;
105  void setLegendVisibilityMode(LegendVisibilityMode legendVisibilityMode);
106  Color3f legendTextColor() const;
107  void setLegendTextColor(const Color3f& color);
108  Color3f legendLineColor() const;
109  void setLegendLineColor(const Color3f& color);
110  unsigned int legendLineWidth() const;
111  void setLegendLineWidth(unsigned int lineWidth);
112  unsigned int legendBarWidth() const;
113  void setLegendBarWidth(unsigned int widthInPixels);
114  Str customLegendTitle() const;
115  void setCustomLegendTitle(const Str& title);
116  bool forceTickMarkLinesToCoverLegend() const;
117  void setForceTickMarkLinesToCoverLegend(bool alwaysCover);
118  bool drawLegendWithMinimumValueOnTop() const;
119  void setDrawLegendWithMinimumValueOnTop(bool minOnTop);
120  bool skipOverlappingTickMarkLabels() const;
121  void setSkipOverlappingTickMarkLabels(bool skip);
122  LegendVisibilityMode aboveBelowRangeColorMarkerVisibilityMode() const;
123  void setAboveBelowRangeColorMarkerVisibilityMode(LegendVisibilityMode mode);
124  TickMarksPosition tickMarksPosition() const;
125  void setTickMarksPosition(TickMarksPosition position);
126  LegendDirection legendDirection() const;
127  void setLegendDirection(LegendDirection direction);
128 
129  bool isSingleColorZeroRangeModeEnabled(Color3f* color = NULL) const;
130  void setSingleColorZeroRangeMode(const Color3f& color);
131  void disableSingleColorZeroRangeMode();
132 
133  bool forceUniformTickMarkSpacing() const;
134  void setForceUniformTickMarkSpacing(bool forceUniformSpacing);
135 
136  bool forceUniformTextureLevels() const;
137  void setForceUniformTextureLevels(bool forceUniformLevels);
138 
139  char numericFormat() const;
140  void setNumericFormat(char format);
141  int numericPrecision() const;
142  void setNumericPrecision(int precision);
143 
144  double numericScalingConstant() const;
145  double numericScalingFirstDegreeFactor() const;
146  void setNumericScaling(double constantTerm, double firstDegreeTerm);
147 
148  void addColorMarker(MarkerPosition position, const Color3f& color, const Str& description);
149  size_t colorMarkerCount() const;
150  MarkerPosition colorMarkerPosition(size_t index) const;
151  Color3f colorMarkerColor(size_t index) const;
152  Str colorMarkerDescription(size_t index) const;
153  void clearColorMarkers();
154 
155  float colorMarkerBoxHeight() const;
156  void setColorMarkerBoxHeight(float height);
157  float colorMarkerMargin() const;
158  void setColorMarkerMargin(float margin);
159 
160  bool isFringesElementFilteringEnabled() const;
161  void disableFringesElementFiltering();
162  double fringesElementFilteringVisibleRangeMinimum() const;
163  double fringesElementFilteringVisibleRangeMaximum() const;
164  void setFringesElementFilteringVisibleRange(double min, double max);
165  bool filterUndefinedElements() const;
166  void setFilterUndefinedElements(bool filter);
167 
168 private:
169  ScalarSettings();
170  CEE_PRIVATE_F(UnstructGridModel);
171  CEE_PRIVATE_IMPL(ScalarSettings);
172  CEE_DISALLOW_COPY_AND_ASSIGN(ScalarSettings);
173 };
174 
175 } // namespace ug
176 } // namespace cee
177 
AutoRangeMode
Extent of the automatic range computation.
Definition: ScalarSettings.h:45
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Draw a horizontal legend.
Definition: ScalarSettings.h:78
Draw tick marks on the right side of the color legend.
Definition: ScalarSettings.h:67
Draw tick marks on the left side of the color legend.
Definition: ScalarSettings.h:66
LegendDirection
Select the orientation of the legend.
Definition: ScalarSettings.h:76
Scalar range is not computed automatically.
Definition: ScalarSettings.h:47
Draw tick marks below the color legend.
Definition: ScalarSettings.h:69
A general unicode based string class.
Definition: Str.h:28
MarkerPosition
Position of the custom markers to show above/below the color legend.
Definition: ScalarSettings.h:38
Show the color legend for this result if used by any visible parts in the view (default) ...
Definition: ScalarSettings.h:56
Draw tick marks above the color legend.
Definition: ScalarSettings.h:68
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Class for storing an RGB color triplet.
Definition: Color3f.h:25
Controlling how the contour lines are drawn.
Definition: ContourLines.h:30
Always hide the color legend for this result.
Definition: ScalarSettings.h:55
Controlling the color mapping and the color setup of the legend.
Definition: ColorMapper.h:30
Settings for a specific scalar result.
Definition: ScalarSettings.h:34
LegendVisibilityMode
Control the visibility of the color legend.
Definition: ScalarSettings.h:53
Show the marker above the color legend.
Definition: ScalarSettings.h:40
UnstructGridModel is a subclass of Model which adds specific model structure and functionality for re...
Definition: UnstructGridModel.h:72
TickMarksPosition
Position of the legend tick marks.
Definition: ScalarSettings.h:64
Scalar range is computed automatically from scalar result values of all items in the model...
Definition: ScalarSettings.h:48