NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
gl2d_clip_rule_interface.h
Go to the documentation of this file.
1 #ifndef SDK_GL2D_CLIP_RULE_INTERFACE_H_
11 #define SDK_GL2D_CLIP_RULE_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>
19 #include <visualizationlayer/inc/vis_const.h>
21 #include <visualizationlayer/inc/triang2d/gl2d_mesh_coll_interface.h>
22 
23 #include "gl2d_mesh_interface.h"
24 
25 SDK_GL2D_BEGIN_NAMESPACE
26 
31 
35 {
36 };
37 
41 {
42  // Clip rule - Unknown
43  kGL2DClipRuleType_Unknown = 0,
44 
45  // Clip rule - Intersect:
46  // Resulting no-clip area is an intersection (common part) of all of
47  // pushed clip meshes. Only given area will be filled with pixels data during
48  // rendering of further primitives, every pixel outside given area will
49  // be clipped out.
50  //
51  // Mesh 1 - labeled with '1':
52  // +----+
53  // |1111|
54  // |1111|
55  // |1111|
56  // |0001|
57  // +----+
58  //
59  // Mesh 2 - labeled with '2':
60  // +----+
61  // |0022|
62  // |2002|
63  // |2222|
64  // |2020|
65  // +----+
66  //
67  // No-clip area - result of intersection of mesh 1 with 2, labeled with X:
68  // +----+
69  // |00XX|
70  // |X00X|
71  // |XXXX|
72  // |0000|
73  // +----+
74  //
75  // See IGL2DIntersectClipRule interface
76  kGL2DClipRuleType_Intersect = 1,
77 
78  // Clip rule - Exclude:
79  // Resulting no-clip area is main mesh minus all of exclude meshes
80  // Only given area will be filled with pixels data during rendering of further
81  // primitives, every pixel outside given area will be clipped out
82  //
83  // Main mesh - labeled with 'M':
84  // +----+
85  // |M00M|
86  // |MMMM|
87  // |MMMM|
88  // |00MM|
89  // +----+
90  //
91  // Exclude mesh 1 - labeled with '1':
92  // +----+
93  // |0011|
94  // |0011|
95  // |0000|
96  // |1010|
97  // +----+
98  //
99  // Exclude mesh 2 - labeled with '2':
100  // +----+
101  // |0000|
102  // |2000|
103  // |2200|
104  // |0000|
105  // +----+
106  //
107  // No-clip area = Main mesh - (Exclude mesh 1 + Exclude mesh 2), labeled with X:
108  // +----+
109  // |X000|
110  // |0X00|
111  // |00XX|
112  // |000X|
113  // +----+
114  //
115  // See IGL2DExcludeClipRule interface
116  kGL2DClipRuleType_Exclude = 2,
117 };
118 
121 class IGL2DClipRule : public ISDKProperties
122 {
123 public:
125  virtual void SDK_CALLTYPE Dump() const throw() = 0;
126 
128  virtual IGL2DCanvasSP SDK_CALLTYPE GetParent() const throw() = 0;
129 
131  virtual GL2DClipRuleType SDK_CALLTYPE GetType() const throw() = 0;
132 
134  virtual bool SDK_CALLTYPE IsEmpty() const throw() = 0;
135 
136  SDK_IMPLEMENT_IID(IGL2DClipRule)
137  SDK_END_INTERFACE(IGL2DClipRule)
138 };
139 SDK_DECLARE_IID(IGL2DClipRule)
140 
144 {
145 public:
152  virtual SDKResult SDK_CALLTYPE PushClippingMesh(
153  const IGL2DMeshSP& mesh, const SDKMatrix3X2& objects_transformation,
154  const SDKMatrix3X2& canvas_transformation) throw() = 0;
155  virtual SDKResult SDK_CALLTYPE PushClippingMeshColl(
156  const SDK_TRIANG2D_NAMESPACE::IGL2DMeshCollSP& mesh_coll,
157  const SDKMatrix3X2& objects_transformation,
158  const SDKMatrix3X2& canvas_transformation) throw() = 0;
159 
175  virtual SDKResult SDK_CALLTYPE PushClippingMesh(const IGL2DMeshSP& mesh) throw() = 0;
176  virtual SDKResult SDK_CALLTYPE PushClippingMeshColl(
177  const SDK_TRIANG2D_NAMESPACE::IGL2DMeshCollSP& mesh_coll) throw() = 0;
178 
180  virtual SDKResult SDK_CALLTYPE PopClippingMesh() throw() = 0;
182  virtual SDKResult SDK_CALLTYPE Clear() throw() = 0;
183 
185  virtual SDKUInt32 SDK_CALLTYPE GetNumberOfAppliedClippingMeshes() const throw() = 0;
186 
187  SDK_IMPLEMENT_IID(IGL2DIntersectClipRule)
188  SDK_END_INTERFACE(IGL2DIntersectClipRule)
189 };
190 SDK_DECLARE_IID(IGL2DIntersectClipRule)
191 
195 {
196 public:
202  virtual SDKResult SDK_CALLTYPE SetMesh(const IGL2DMeshSP& mesh_to_clip,
203  const SDKMatrix3X2& objects_transformation,
204  const SDKMatrix3X2& canvas_transformation) throw() = 0;
205  virtual SDKResult SDK_CALLTYPE SetMeshColl(
206  const SDK_TRIANG2D_NAMESPACE::IGL2DMeshCollSP& mesh_coll_to_clip,
207  const SDKMatrix3X2& objects_transformation,
208  const SDKMatrix3X2& canvas_transformation) throw() = 0;
209 
225  virtual SDKResult SDK_CALLTYPE SetMesh(
226  const IGL2DMeshSP& mesh_to_clip) throw() = 0;
227  virtual SDKResult SDK_CALLTYPE SetMeshColl(
228  const SDK_TRIANG2D_NAMESPACE::IGL2DMeshCollSP& mesh_coll_to_clip) throw() = 0;
229 
231  inline SDKResult SDK_CALLTYPE ResetMesh()
232  { return SetMesh(IGL2DMeshSP()); }
233 
238  virtual SDKResult SDK_CALLTYPE PushExcludeMesh(const IGL2DMeshSP& exclude_mesh,
239  const SDKMatrix3X2& objects_transformation,
240  const SDKMatrix3X2& canvas_transformation) throw() = 0;
241  virtual SDKResult SDK_CALLTYPE PushExcludeMeshColl(
242  const SDK_TRIANG2D_NAMESPACE::IGL2DMeshCollSP& exclude_mesh_coll,
243  const SDKMatrix3X2& objects_transformation,
244  const SDKMatrix3X2& canvas_transformation) throw() = 0;
245 
250  virtual SDKResult SDK_CALLTYPE PushExcludeMesh(
251  const IGL2DMeshSP& exclude_mesh) throw() = 0;
252  virtual SDKResult SDK_CALLTYPE PushExcludeMeshColl(
253  const SDK_TRIANG2D_NAMESPACE::IGL2DMeshCollSP& exclude_mesh_coll) throw() = 0;
254 
257  virtual SDKResult SDK_CALLTYPE PopExcludeMesh() throw() = 0;
259  virtual SDKResult SDK_CALLTYPE ResetExcludeMeshes() throw() = 0;
260 
262  virtual SDKUInt32 SDK_CALLTYPE GetExcludeMeshesCount() const throw() = 0;
263 
265  virtual SDKResult SDK_CALLTYPE Clear() throw() = 0;
266 
267  SDK_IMPLEMENT_IID(IGL2DExcludeClipRule)
268  SDK_END_INTERFACE(IGL2DExcludeClipRule)
269 };
270 SDK_DECLARE_IID(IGL2DExcludeClipRule)
271 
272 SDK_GL2D_END_NAMESPACE
273 
274 #endif // SDK_GL2D_CLIP_RULE_INTERFACE_H_
IGL2DIntersectClipRule::PushClippingMesh
virtual SDKResult SDK_CALLTYPE PushClippingMesh(const IGL2DMeshSP &mesh, const SDKMatrix3X2 &objects_transformation, const SDKMatrix3X2 &canvas_transformation)=0
Adds new clipping mesh (or meshes collection) to clipping meshes stack. objects_transformation matrix...
IGL2DClipRule::GetType
virtual GL2DClipRuleType SDK_CALLTYPE GetType() const =0
Returns clip rule type.
base_types.h
SDK base types.
gl2d_mesh_interface.h
GL2D Mesh object.
IGL2DClipRule::GetParent
virtual IGL2DCanvasSP SDK_CALLTYPE GetParent() const =0
Returns parent canvas object.
properties_interface.h
Object generic properties interface.
GL2DClipRulePropertyIDs
GL2DClipRulePropertyIDs
Generic GL2D Clip Rule properties.
Definition: gl2d_clip_rule_interface.h:34
IGL2DIntersectClipRule::PopClippingMesh
virtual SDKResult SDK_CALLTYPE PopClippingMesh()=0
Removes latest clipping mesh (or meshes collection) from clipping mesh stack.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
GL2DClipRuleType
GL2DClipRuleType
Available clip rule types.
Definition: gl2d_clip_rule_interface.h:40
IGL2DIntersectClipRule
Implementation of "Intersect" clip rule.
Definition: gl2d_clip_rule_interface.h:143
platform.h
Describes the platform constants.
IGL2DCanvas
GL2D Canvas to use to drawing NOTE! Create/Draw functionality was moved to appropriate GL2D Canvas Fu...
Definition: gl2d_canvas_interface.h:435
matrix_base_types.h
Matrix base definitions.
IGL2DExcludeClipRule
Implementation of "Exclude" clip rule.
Definition: gl2d_clip_rule_interface.h:194
IGL2DClipRule::IsEmpty
virtual bool SDK_CALLTYPE IsEmpty() const =0
Checks, if given clip rule is empty (does not have any clip entries)
IGL2DIntersectClipRule::GetNumberOfAppliedClippingMeshes
virtual SDKUInt32 SDK_CALLTYPE GetNumberOfAppliedClippingMeshes() const =0
Returns number of clipping meshes applied so far.
IGL2DIntersectClipRule::Clear
virtual SDKResult SDK_CALLTYPE Clear()=0
Removes all of clipping meshes from clipping stack.
IGL2DClipRule::Dump
virtual void SDK_CALLTYPE Dump() const =0
Dumps given object.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.
IGL2DClipRule
Generic clip rule.
Definition: gl2d_clip_rule_interface.h:121