NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
layer_resource_interface.h
1 
10 #ifndef SDK_VIS_LAYER_RESOURCE_INTERFACE_H_
11 #define SDK_VIS_LAYER_RESOURCE_INTERFACE_H_
12 #pragma once
13 
14 #include <base/inc/platform.h>
15 #include <base/inc/base_types.h>
16 #include <base/inc/forward_declarations.h>
18 #include <base/inc/sdk_ref_ptr.h>
22 #include <visualizationlayer/inc/graphics/2d_graphics_objects.h>
23 
24 namespace sdk {
25 namespace vis {
26 namespace scene {
27 
28 FWD_DECL_INTERFACE(ILayerResource);
29 FWD_DECL_INTERFACE(ILayerResourceRenderTarget);
30 FWD_DECL_INTERFACE(ILayerResourceTexture);
31 FWD_DECL_INTERFACE(ILayerResourceSpriteList);
32 FWD_DECL_INTERFACE(ILayerResourceSpriteListEnum);
33 FWD_DECL_INTERFACE(ILayerResourceSpriteListTextureEnum);
34 FWD_DECL_INTERFACE(ITexture);
35 
39 {
40 public:
42  virtual SDKResult SDK_CALLTYPE GetSize(SDKSizeF& size) throw() = 0;
44  virtual SDKResult SDK_CALLTYPE SetSize(const SDKSizeF& size) throw() = 0;
45 
47  virtual SDKResult SDK_CALLTYPE CopyFrom(const ILayerResourceSP& resource) throw() = 0;
48 
50  //virtual SDKResult SDK_CALLTYPE SetProperty(const SDKPropertyID& id, const SDKAny& value) throw() = 0;
51  //virtual SDKResult SDK_CALLTYPE GetProperty(const SDKPropertyID& id, SDKAny& value) const throw() = 0;
52 
53  SDK_IMPLEMENT_IID(ILayerResource)
54  SDK_END_INTERFACE(ILayerResource)
55 };
56 SDK_DECLARE_IID(ILayerResource)
57 
62 {
63 public:
65  virtual SDKResult SDK_CALLTYPE GetRenderTarget(gfx::RenderTargetSP& render_target) throw() = 0;
66 
68  virtual SDKResult SDK_CALLTYPE GetTexture(ITextureSP& texture) throw() = 0;
69 
71  virtual SDKResult SDK_CALLTYPE ReinitializeResources() throw() = 0;
72 
74  //virtual SDKResult SDK_CALLTYPE GetSize(SDKSizeF& size) throw() = 0;
76  //virtual SDKResult SDK_CALLTYPE SetSize(const SDKSizeF& size) throw() = 0;
78  //virtual SDKResult SDK_CALLTYPE CopyFrom(const ILayerResourceSP& resource) throw() = 0;
79 
81  //virtual SDKResult SDK_CALLTYPE SetProperty(const SDKPropertyID& id, const SDKAny& value) throw() = 0;
82  //virtual SDKResult SDK_CALLTYPE GetProperty(const SDKPropertyID& id, SDKAny& value) const throw() = 0;
83 
84  SDK_IMPLEMENT_IID(ILayerResourceRenderTarget)
85  SDK_END_INTERFACE(ILayerResourceRenderTarget)
86 };
87 SDK_DECLARE_IID(ILayerResourceRenderTarget)
88 
89 
90 typedef SDKUInt32 SLTextureID;
91 typedef SDKUInt64 SLEntryID;
92 typedef SDKUInt32 SLEntryPriority;
93 
98 {
99 public:
101  virtual SDKResult SDK_CALLTYPE AddTexture(const SLTextureID& tex_id, const ITextureSP& texture,
102  const SDKRectF2D* viewport) throw() = 0;
104  virtual SDKResult SDK_CALLTYPE DeleteTexture(const SLTextureID& tex_id) throw() = 0;
106  virtual SDKResult SDK_CALLTYPE GetTexture(const SLTextureID& tex_id, ITextureSP& texture,
107  SDKRectF2D& viewport) throw() = 0;
108 
110  virtual SDKResult SDK_CALLTYPE EnumTextures(
111  ILayerResourceSpriteListTextureEnumSP& enumerator) throw() = 0;
112 
114  virtual SDKResult SDK_CALLTYPE AddEntry(const SLEntryID& id, const SLTextureID& tex_id,
115  const SLEntryPriority& priority, const SDKMatrix4X4& transform) throw() = 0;
117  virtual SDKResult SDK_CALLTYPE DeleteEntry(const SLEntryID& id) throw() = 0;
119  virtual SDKResult SDK_CALLTYPE DeleteEntries(const SLTextureID& tex_id) throw() = 0;
121  virtual SDKResult SDK_CALLTYPE DeleteAllEntries() throw() = 0;
122 
124  virtual SDKResult SDK_CALLTYPE GetEntry(const SLEntryID& id, SLTextureID& tex_id,
125  SLEntryPriority& priority, SDKMatrix4X4& transform) throw() = 0;
127  virtual SDKResult SDK_CALLTYPE EnumEntries(ILayerResourceSpriteListEnumSP& enumerator) throw() = 0;
129  virtual SDKResult SDK_CALLTYPE EnumEntries(const SLTextureID& tex_id,
130  ILayerResourceSpriteListEnumSP& enumerator) throw() = 0;
131 
133  virtual SDKResult SDK_CALLTYPE UpdateEntryPriority(const SLEntryID& id,
134  const SLEntryPriority& priority) throw() = 0;
136  virtual SDKResult SDK_CALLTYPE UpdateEntryTransform(const SLEntryID& id,
137  const SDKMatrix4X4& transform, bool multiply) throw() = 0;
138 
140  //virtual SDKResult SDK_CALLTYPE GetSize(SDKSizeF& size) throw() = 0;
142  //virtual SDKResult SDK_CALLTYPE SetSize(const SDKSizeF& size) throw() = 0;
144  //virtual SDKResult SDK_CALLTYPE CopyFrom(const ILayerResourceSP& resource) throw() = 0;
145 
147  //virtual SDKResult SDK_CALLTYPE SetProperty(const SDKPropertyID& id, const SDKAny& value) throw() = 0;
148  //virtual SDKResult SDK_CALLTYPE GetProperty(const SDKPropertyID& id, SDKAny& value) const throw() = 0;
149 
150  SDK_IMPLEMENT_IID(ILayerResourceSpriteList)
151  SDK_END_INTERFACE(ILayerResourceSpriteList)
152 };
153 SDK_DECLARE_IID(ILayerResourceSpriteList)
154 
158 {
159 public:
161  virtual SDKResult SDK_CALLTYPE Reset() throw() = 0;
163  virtual SDKResult SDK_CALLTYPE Next(SLEntryID& id, SLTextureID& tex_id,
164  SLEntryPriority& priority, SDKMatrix4X4& transform) const throw() = 0;
165 
166  SDK_IMPLEMENT_IID(ILayerResourceSpriteListEnum)
167  SDK_END_INTERFACE(ILayerResourceSpriteListEnum)
168 };
169 SDK_DECLARE_IID(ILayerResourceSpriteListEnum)
170 
174 {
175 public:
177  virtual SDKResult SDK_CALLTYPE Reset() throw() = 0;
179  virtual SDKResult SDK_CALLTYPE Next(SLTextureID& tex_id, ITextureSP& texture, RectF2D& viewport) const throw() = 0;
180 
181  SDK_IMPLEMENT_IID(ILayerResourceSpriteListTextureEnum)
182  SDK_END_INTERFACE(ILayerResourceSpriteListTextureEnum)
183 };
185 
190 {
191 public:
193  virtual SDKResult SDK_CALLTYPE GetTexture(ITextureSP& texture) throw() = 0;
194 
196  //virtual SDKResult SDK_CALLTYPE GetSize(SDKSizeF& size) throw() = 0;
198  //virtual SDKResult SDK_CALLTYPE SetSize(const SDKSizeF& size) throw() = 0;
200  //virtual SDKResult SDK_CALLTYPE CopyFrom(const ILayerResourceSP& resource) throw() = 0;
201 
203  //virtual SDKResult SDK_CALLTYPE SetProperty(const SDKPropertyID& id, const SDKAny& value) throw() = 0;
204  //virtual SDKResult SDK_CALLTYPE GetProperty(const SDKPropertyID& id, SDKAny& value) const throw() = 0;
205 
206  SDK_IMPLEMENT_IID(ILayerResourceTexture)
207  SDK_END_INTERFACE(ILayerResourceTexture)
208 };
209 SDK_DECLARE_IID(ILayerResourceTexture)
210 
211 } // namespace scene
212 } // namespace vis
213 } // namespace sdk
214 
215 #endif // SDK_VIS_LAYER_RESOURCE_INTERFACE_H_
base_types.h
SDK base types.
sdk::vis::scene::ILayerResource::SetSize
virtual SDKResult SDK_CALLTYPE SetSize(const SDKSizeF &size)=0
Sets size of the resource, ignored if not applicable.
sdk_ref_ptr.h
Interfaces wrapper with reference count control.
properties_interface.h
Object generic properties interface.
sdk::vis::scene::ILayerResource::GetSize
virtual SDKResult SDK_CALLTYPE GetSize(SDKSizeF &size)=0
Returns size of the resource texture or null size if not applicable.
sdk::vis::scene::ILayerResourceSpriteListEnum
Sprites enumerator.
Definition: layer_resource_interface.h:157
sdk::vis::scene::ILayerResourceRenderTarget
Extension of ILayerResource interface, used for kResourceType_RenderTarget resource type.
Definition: layer_resource_interface.h:61
SDKRectF2D
2D Rectangle
Definition: geometry_base_types.h:1295
sdk::vis::scene::ILayerResourceRenderTarget::GetTexture
virtual SDKResult SDK_CALLTYPE GetTexture(ITextureSP &texture)=0
Returns texture associated with render target.
sdk::vis::scene::ILayerResourceSpriteListTextureEnum
Sprite list textures enumerator.
Definition: layer_resource_interface.h:173
sdk::vis::scene::ILayerResource::CopyFrom
virtual SDKResult SDK_CALLTYPE CopyFrom(const ILayerResourceSP &resource)=0
Copies data from another resource.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
sdk::vis::scene::ILayerResourceTexture
Extension of ILayerResource interface, used for kResourceType_Texture resource type.
Definition: layer_resource_interface.h:189
matrix4x4.h
Matrix 4X4 implementation.
sdk::RectF2D
A 2-D Rectangle.
Definition: geometry_base_types_helpers.h:423
sdk::ISDKProperties
Provides access to members that control the properties.
Definition: properties_interface.h:32
sdk::vis::scene::ILayerResourceSpriteList
Extension of ILayerResource interface, used for kResourceType_SpritesList resource type.
Definition: layer_resource_interface.h:97
sdk_component_interface.h
Common base SDK interfaces.
sdk::vis::scene::ILayerResourceRenderTarget::GetRenderTarget
virtual SDKResult SDK_CALLTYPE GetRenderTarget(gfx::RenderTargetSP &render_target)=0
Retrieves render target to draw to.
platform.h
Describes the platform constants.
sdk::vis::scene::ILayerResourceRenderTarget::ReinitializeResources
virtual SDKResult SDK_CALLTYPE ReinitializeResources()=0
Reinitializes appropriate layer resources, like render target, etc.
ISDKComponent
Base interface for all SDK interfaces.
Definition: sdk_component_interface.h:41
geometry_base_types.h
Geometry base types.
sdk::vis::scene::ILayerResource
Base layer resource interface.
Definition: layer_resource_interface.h:38
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.
SDKSizeF
SizeF.
Definition: geometry_base_types.h:1111