NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
gl2d_line_interface.h
Go to the documentation of this file.
1 #ifndef SDK_GL2D_LINE_INTERFACE_H_
11 #define SDK_GL2D_LINE_INTERFACE_H_
12 #pragma once
13 
14 #include <base/inc/platform.h>
15 #include <base/inc/base_types.h>
16 #include <base/inc/sdk_component_base.h>
18 #include <visualizationlayer/inc/vis_const.h>
19 
20 SDK_GL2D_BEGIN_NAMESPACE
21 
24 
28 {
29  // In case line supports Miter Join style, given parameter defines
30  // miter limit to use
31  kGL2DLinePropertyID_MiterLimit = 0, // kSDKAnyType_Float
32 
33  // In case line has pattern (dash/texture), smooth angle criteria
34  // can be specified, in case line joins angle is less than defined
35  // value, pattern will be used instead of any specific connection lines
36  // In degrees, 0 - 180
37  kGL2DLinePropertyID_SmoothAngle = 1, // kSDKAnyType_Float
38 
39  // Round angle for textured lines
40  // In case join angle between two line segments <= given angle -
41  // round join will be used, if join angle > given angle - butt join will be used
42  // In degrees, 0 - 180
43  kGL2DLinePropertyID_RoundAngle = 2, // kSDKAnyType_Float
44 };
45 
49 {
50  // Unknown line type
51  kGL2DLineType_Unknown = 0,
52 
53  // Simple solid only line, mostly for debugging purposes,
54  // uses native OpenGL GL_LINE_STRIP primitive
55  kGL2DLineType_Simple = 1,
56 
57  // Solid line without caps/join styles, but with anti-aliasing and
58  // very fast GPU based drawing algorithm, thick lines are ugly,
59  // but hair lines are pretty good
60  // Based on https://www.mapbox.com/blog/drawing-antialiased-lines/
61  kGL2DLineType_Fast_Solid = 2,
62 
63  // Same as kGL2DLineType_Fast_Solid, but can be
64  // projected via any perspective projection during rendering
65  kGL2DLineType_Fast_Solid_ForPerspProj = 3,
66 
67  // Same as kGL2DLineType_Fast_Solid, but in addition line vertex data contains
68  // information about color and width. Width and color, specified for
69  // IGL2DCanvas::DrawLine will be ignored, data from line will be used instead
70  kGL2DLineType_Fast_Solid_ColoredWithWidth = 4,
71 
72  // Same as kGL2DLineType_Fast_Solid_ColoredWithWidth, but can be
73  // projected via any perspective projection during rendering
74  kGL2DLineType_Fast_Solid_ColoredWithWidth_ForPerspProj = 5,
75 
76  // Dash line without caps/join styles, but with anti-aliasing and
77  // very fast GPU based drawing algorithm, thick lines are ugly,
78  // but hair lines are pretty good
79  // Based on https://www.mapbox.com/blog/drawing-antialiased-lines/
80  kGL2DLineType_Fast_Dash = 6,
81 
82  // Same as kGL2DLineType_Fast_Dash, but in addition line vertex data contains
83  // information about color/width/dash pattern. Width and color, specified for
84  // IGL2DCanvas::DrawLine will be ignored, data from line will be used instead
85  kGL2DLineType_Fast_Dash_ColoredWithWidthAndDash = 7,
86 
87  // Solid line, supports caps/join styles, anti-aliasing,
88  // gives better quality but performance reduced
89  // Based on http://jcgt.org/published/0002/02/08/paper.pdf
90  kGL2DLineType_Rougier_Solid = 8,
91 
92  // Same as kGL2DLineType_Rougier_Solid, but in addition line vertex data contains
93  // information about color/width/caps style for each of sublines in
94  // given multiline. Width and color, specified for IGL2DCanvas::DrawLine
95  // will be ignored, data from multiline will be used instead
96  kGL2DLineType_Rougier_Solid_MultiLine = 9,
97 
98  // Dash line, supports caps/join styles, anti-aliasing.
99  // Based on http://jcgt.org/published/0002/02/08/paper.pdf
100  kGL2DLineType_Rougier_Dash = 10,
101 
102  // Same as kGL2DLineType_Rougier_Dash, but in addition line vertex data contains
103  // information about color/width/caps style for each of sublines in
104  // given multiline. Width and color, specified for IGL2DCanvas::DrawLine
105  // will be ignored, data from multiline will be used instead
106  kGL2DLineType_Rougier_Dash_MultiLine = 11,
107 
108  // Textured line, mostly for S-52 elements presentation (complex lines),
109  // no width/color/caps/join styles, only textures along the line
110  kGL2DLineType_Textured = 12,
111 
112  // Solid line with geometry based on pivot point, means line length is always
113  // same, even if scaling matrix is applied.
114  // Depending of parameters, each multiline vertex can have information
115  // about colors and widths, in case they are different for each of lines
116  // in given multiline
117  // Drawing algorithm mostly based on Fast Solid line, means given line does
118  // not supports caps/join styles, but with anti-aliasing and
119  // very fast GPU based drawing algorithm, thick lines are ugly,
120  // but hair lines are pretty good
121  kGL2DLineType_Thin_Solid_PivotPoint_MultiLine = 13,
122 
123  // Scalebar - vertical fast solid line, each of segments colored with color
124  // 1 or color 2
125  kGL2DLineType_Scalebar = 14,
126 };
127 
131 {
132  // Unknown line cap style
133  kGL2DLineCapStyle_Unknown = 0,
134 
135  // Default line cap style
136  kGL2DLineCapStyle_Default = 1,
137 
138  // Butt line cap style
139  // Empty cap, line/dash is not extended, no additional cap will be drawn
140  // Each dash will start/end at same position, no matter which line width
141  // is specified
142  kGL2DLineCapStyle_Butt = 2,
143 
144  // Square line cap style
145  // Line/dash is extended by (Line Width / 2.0f) in start/end direction
146  kGL2DLineCapStyle_Square = 3,
147 
148  // Square line cap style
149  // Line/dash is extended by half of circle with radius (Line Width / 2.0f)
150  // in start/end direction
151  kGL2DLineCapStyle_Round = 4,
152 };
153 
157 {
158  kGL2DLineJoinStyle_Unknown = 0, // Unknown line join style
159  kGL2DLineJoinStyle_Default = 1, // Default line join style
160  kGL2DLineJoinStyle_None = 2, // None line join style
161  kGL2DLineJoinStyle_Miter = 3, // Miter line join style
162  kGL2DLineJoinStyle_Bevel = 4, // Bevel line join style
163  kGL2DLineJoinStyle_Round = 5, // Round line join style
164 };
165 
168 class IGL2DLine : public ISDKProperties
169 {
170 public:
172  virtual void SDK_CALLTYPE Dump() const throw() = 0;
173 
175  virtual IGL2DCanvasSP SDK_CALLTYPE GetParent() const throw() = 0;
176 
178  virtual GL2DLineType SDK_CALLTYPE GetType() const throw() = 0;
180  virtual SDKUInt32 SDK_CALLTYPE GetVertexCount() const throw() = 0;
182  virtual SDKUInt32 SDK_CALLTYPE GetMemSize() const throw() = 0;
183 
185  virtual float SDK_CALLTYPE GetAntiAliasingWidth() const throw() = 0;
187  virtual SDKResult SDK_CALLTYPE SetAntiAliasingWidth(
188  const float& aa_width) throw() = 0;
189 
191  virtual GL2DLineCapStyle SDK_CALLTYPE GetStartCapStyle() const throw() = 0;
193  virtual SDKResult SDK_CALLTYPE SetStartCapStyle(
194  const GL2DLineCapStyle& style) throw() = 0;
195 
197  virtual GL2DLineCapStyle SDK_CALLTYPE GetEndCapStyle() const throw() = 0;
199  virtual SDKResult SDK_CALLTYPE SetEndCapStyle(
200  const GL2DLineCapStyle& style) throw() = 0;
201 
203  virtual GL2DLineJoinStyle SDK_CALLTYPE GetJoinStyle() const throw() = 0;
205  virtual SDKResult SDK_CALLTYPE SetJoinStyle(
206  const GL2DLineJoinStyle& style) throw() = 0;
207 
208  SDK_IMPLEMENT_IID(IGL2DLine)
209  SDK_END_INTERFACE(IGL2DLine)
210 };
211 SDK_DECLARE_IID(IGL2DLine)
212 
213 SDK_GL2D_END_NAMESPACE
214 
215 #endif // SDK_GL2D_LINE_INTERFACE_H_
IGL2DLine::SetJoinStyle
virtual SDKResult SDK_CALLTYPE SetJoinStyle(const GL2DLineJoinStyle &style)=0
Sets new line join style.
IGL2DLine::SetEndCapStyle
virtual SDKResult SDK_CALLTYPE SetEndCapStyle(const GL2DLineCapStyle &style)=0
Sets new line end cap style.
IGL2DLine::GetJoinStyle
virtual GL2DLineJoinStyle SDK_CALLTYPE GetJoinStyle() const =0
Returns current line join style.
GL2DLineCapStyle
GL2DLineCapStyle
GL2D line cap/dash cap style.
Definition: gl2d_line_interface.h:130
IGL2DLine
GL2D Line object.
Definition: gl2d_line_interface.h:168
GL2DLineJoinStyle
GL2DLineJoinStyle
GL2D line join style.
Definition: gl2d_line_interface.h:156
base_types.h
SDK base types.
IGL2DLine::GetType
virtual GL2DLineType SDK_CALLTYPE GetType() const =0
Returns line type.
properties_interface.h
Object generic properties interface.
IGL2DLine::Dump
virtual void SDK_CALLTYPE Dump() const =0
Dumps given object.
IGL2DLine::GetEndCapStyle
virtual GL2DLineCapStyle SDK_CALLTYPE GetEndCapStyle() const =0
Returns current line/dash end cap style.
IGL2DLine::SetStartCapStyle
virtual SDKResult SDK_CALLTYPE SetStartCapStyle(const GL2DLineCapStyle &style)=0
Sets new line start cap style.
IGL2DLine::GetAntiAliasingWidth
virtual float SDK_CALLTYPE GetAntiAliasingWidth() const =0
Returns current anti-aliasing width.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
IGL2DLine::GetParent
virtual IGL2DCanvasSP SDK_CALLTYPE GetParent() const =0
Returns parent canvas object.
IGL2DLine::SetAntiAliasingWidth
virtual SDKResult SDK_CALLTYPE SetAntiAliasingWidth(const float &aa_width)=0
Sets new anti-aliasing width.
IGL2DLine::GetVertexCount
virtual SDKUInt32 SDK_CALLTYPE GetVertexCount() const =0
Returns number of vertexes in line.
platform.h
Describes the platform constants.
GL2DLineType
GL2DLineType
GL2D Line type.
Definition: gl2d_line_interface.h:48
IGL2DCanvas
GL2D Canvas to use to drawing NOTE! Create/Draw functionality was moved to appropriate GL2D Canvas Fu...
Definition: gl2d_canvas_interface.h:435
IGL2DLine::GetStartCapStyle
virtual GL2DLineCapStyle SDK_CALLTYPE GetStartCapStyle() const =0
Returns current line/dash start cap style.
GL2DLinePropertyIDs
GL2DLinePropertyIDs
Generic GL2D Line properties.
Definition: gl2d_line_interface.h:27
IGL2DLine::GetMemSize
virtual SDKUInt32 SDK_CALLTYPE GetMemSize() const =0
Returns line memory size.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.