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  unsigned int tickMarkLabelsMinimumDistance() const;
127  void setTickMarkLabelsMinimumDistance(unsigned int distance);
128  LegendDirection legendDirection() const;
129  void setLegendDirection(LegendDirection direction);
130 
131  bool isSingleColorZeroRangeModeEnabled(Color3f* color = NULL) const;
132  void setSingleColorZeroRangeMode(const Color3f& color);
133  void disableSingleColorZeroRangeMode();
134 
135  bool forceUniformTickMarkSpacing() const;
136  void setForceUniformTickMarkSpacing(bool forceUniformSpacing);
137 
138  bool forceUniformTextureLevels() const;
139  void setForceUniformTextureLevels(bool forceUniformLevels);
140 
141  char numericFormat() const;
142  void setNumericFormat(char format);
143  int numericPrecision() const;
144  void setNumericPrecision(int precision);
145 
146  double numericScalingConstant() const;
147  double numericScalingFirstDegreeFactor() const;
148  void setNumericScaling(double constantTerm, double firstDegreeTerm);
149 
150  void addColorMarker(MarkerPosition position, const Color3f& color, const Str& description);
151  size_t colorMarkerCount() const;
152  MarkerPosition colorMarkerPosition(size_t index) const;
153  Color3f colorMarkerColor(size_t index) const;
154  Str colorMarkerDescription(size_t index) const;
155  void clearColorMarkers();
156 
157  unsigned int colorMarkerBoxHeight() const;
158  void setColorMarkerBoxHeight(unsigned int height);
159  unsigned int colorMarkerMargin() const;
160  void setColorMarkerMargin(unsigned int margin);
161 
162  bool isFringesElementFilteringEnabled() const;
163  void disableFringesElementFiltering();
164  double fringesElementFilteringVisibleRangeMinimum() const;
165  double fringesElementFilteringVisibleRangeMaximum() const;
166  void setFringesElementFilteringVisibleRange(double min, double max);
167  bool filterUndefinedElements() const;
168  void setFilterUndefinedElements(bool filter);
169 
170 private:
171  ScalarSettings();
172  CEE_PRIVATE_F(UnstructGridModel);
173  CEE_PRIVATE_IMPL(ScalarSettings);
174  CEE_DISALLOW_COPY_AND_ASSIGN(ScalarSettings);
175 };
176 
177 } // namespace ug
178 } // namespace cee
179 
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