NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
scene_2d_interface.h File Reference

Definition of 2D Scene interfaces. More...

#include <base/inc/platform.h>
#include <base/inc/base_types.h>
#include <base/inc/forward_declarations.h>
#include <base/inc/sdk_component_interface.h>
#include <base/inc/sdk_ref_ptr.h>
#include <base/inc/interfaces/properties/properties_interface.h>
#include <base/inc/interfaces/edit/lock_interface.h>
#include "layer_interface.h"
#include "scene_viewports_interface.h"

Go to the source code of this file.

Data Structures

class  IScene2D
 Main 2D Scene component which contains a tree of layers and backend. More...
 
class  IScene2DCallbacks
 2D Scene callbacks interface. More...
 

Enumerations

enum  CreateLayerFlags { kCreateLayerFlag_NoFlags = 0x00 }
 Layer flags. More...
 
enum  Scene2DPropertyIDs {
  kScene2DProperty_SingleThreaded = 0x00, kScene2DProperty_UseThreadsForRendering = 0x01, kScene2DProperty_RenderingThreadsNumber = 0x02, kScene2DProperty_InternalLayersGraphicContextType = 0x03,
  kScene2DProperty_LayersInRenderingList = 0x04, kScene2DProperty_CacheDisplay = 0x05, kScene2DProperty_DebugLoggingOn = 0x06, kScene2DProperty_SceneName = 0x07,
  kScene2DProperty_DisplayLock = 0x08, kScene2DProperty_MinLayersNumToUseBlitter = 0x09
}
 Generic scene properties. More...
 
enum  Scene2DEventID {
  kScene2DEvent_LayerRenderingTaskInQueue = 0, kScene2DEvent_LayerRenderingStarted = 1, kScene2DEvent_LayerRenderingFinished = 2, kScene2DEvent_LayerResourceBeforeSwap = 3,
  kScene2DEvent_IsLayerResourceSwapNeeded = 4, kScene2DEvent_LayerResourceSwapped = 5, kScene2DEvent_BeforeDisplayLock = 6, kScene2DEvent_AfterDisplayLock = 7,
  kScene2DEvent_LayerRenderingStopped = 8
}
 Generic scene event IDs: More...
 

Variables

static const LayerID kSceneRootLayerID = 1
 Scene root layer ID.
 

Detailed Description

Definition of 2D Scene interfaces.

Copyright (c) 2011 The NAVTOR SDK. All Rights Reserved.

Author
The NAVTOR SDK authors.
Date
02/2012
Maintenance:
The NAVTOR SDK authors.

Enumeration Type Documentation

◆ CreateLayerFlags

enum CreateLayerFlags

Layer flags.

Enumerator
kCreateLayerFlag_NoFlags 

No flags.

◆ Scene2DPropertyIDs

enum Scene2DPropertyIDs

Generic scene properties.

Enumerator
kScene2DProperty_SingleThreaded 

Flag which shows if the scene is used from a single-threaded environment, i.e. if ALL of calls to the scene like Scene::Render and Scene::Display are performed from the same thread.
If the parameter is set to 'true', no layer rendering protection will be used.
If the parameter is set to 'false', double buffering for layer rendering will be used.
The property can be set only before the first call to the Scene::AddLayer method!
The default parameters value is 'true', the value type is kSDKAnyType_Bool.

kScene2DProperty_UseThreadsForRendering 

Flag, which tells if separate worker threads should be used for layer rendering.
If the flag is set to 'true', layer will be rendered by using a separate worker threads, which is not same, as a thread from which the Render call was performed.
If the flag is set to 'false', layer will be rendered in the same thread, as the one from which the Render call was performed.
This flag can be set to 'true' only if the kScene2DProperty_SingleThreaded flag is 'false'.
The property can be set only before the first call to the Scene::Render method!
The default parameters value is 'false', the value type is kSDKAnyType_Bool.

kScene2DProperty_RenderingThreadsNumber 

Flag which specifies the number of worker threads for multi-threaded rendering.
Can be set only if the kScene2DProperty_UseThreadsForRendering flag is set to 'true'.
The property can be set only before the first call to the Scene::Render method!
The default parameter value is '4', the value type is kSDKAnyType_Uint32.

kScene2DProperty_InternalLayersGraphicContextType 

Property, which specifies, which graphic context should be used to render
layers, i.e. the internal layers can be rendered by using software renderer
but backend can be based on DirectX or OpenGL renderer.
Available values are listed in GraphicContextType.
By default Auto graphic context will be used, which means, that graphic
context will be same, as backend uses
This property can be changed only before first call to Scene::AddLayer!
For now allowed values for property are: kGraphicContextType_Auto - Graphic Context for layers rendering will be same type, as backend has kGraphicContextType_Software - Graphic context for layers rendering will be software based, BackEnd graphic context can be DirectX or OpenGL based

kScene2DProperty_LayersInRenderingList 

Property, which allows to get list of layer ids currently being rendered.
NB! Actually useful only in multi-threaded mode with working threads pool. In other cases (single-threaded or no threads pool) returns empty value.

kScene2DProperty_CacheDisplay 

Property, which allows to switch on caching of display operations.
Every call to the Display leads to merging of all available layer textures, and if content of some of them is not changed their merged result can be cached. For Direct2D/OpenGL based backend given feature is always disabled

kScene2DProperty_DebugLoggingOn 

Property, which allows to switch on debug logging.

kScene2DProperty_SceneName 

Property, which allows to set scene name.

kScene2DProperty_DisplayLock 

Allows to obtain component, which locks/unlocks Scene::Display method and layer textures swap operations (Multi-threaded usage only !!!)
This component should be used very carefully due of in case Display can't be locked now call will hang until Display can be locked In case unlock can't be performed for given thread, this can cause application crash. Given limitations are due of this component simply wraps critical section instance, which protects Scene::Display and layer resources swap methods Returns ISDKLock interface

kScene2DProperty_MinLayersNumToUseBlitter 

Property, which allows to define minimum number of layers to display
by using hardware based blitter, instead of default backend engine.

◆ Scene2DEventID

enum Scene2DEventID

Generic scene event IDs:

In case layer contains same single resource for front and back buffers, the events set will be as follows:
kScene2DEvent_LayerRenderingTaskInQueue
kScene2DEvent_LayerRenderingStarted
kScene2DEvent_LayerRenderingFinished
kScene2DEvent_BeforeDisplayLock
kScene2DEvent_LayerResourceSwapped
kScene2DEvent_AfterDisplayLock
In case layer contains different resources for front and back buffers, the events set will be as follows:
kScene2DEvent_LayerRenderingTaskInQueue
kScene2DEvent_LayerRenderingStarted
kScene2DEvent_LayerRenderingFinished
kScene2DEvent_BeforeDisplayLock
kScene2DEvent_LayerResourceBeforeSwap
kScene2DEvent_IsLayerResourceSwapNeeded
kScene2DEvent_LayerResourceSwapped kScene2DEvent_AfterDisplayLock

Enumerator
kScene2DEvent_LayerRenderingTaskInQueue 

Layer rendering task added in tasks queue, but not started.

kScene2DEvent_LayerRenderingStarted 

Layer rendering task started.

kScene2DEvent_LayerRenderingFinished 

Layer rendering task finished.

kScene2DEvent_LayerResourceBeforeSwap 

Layer resource will be swapped now.

kScene2DEvent_IsLayerResourceSwapNeeded 

Confirmation about layer resource should be swapped: return kSDKResult_True to swap layer resource return kSDKResult_False to skip layer resource swapping

kScene2DEvent_LayerResourceSwapped 

Layer resource swapped and is ready to be displayed.

kScene2DEvent_BeforeDisplayLock 

Event about Scene::Display method will be locked i.e. call to given method will hang, till lock will no be released

kScene2DEvent_AfterDisplayLock 

Event about Scene::Display method is unlocked now.

kScene2DEvent_LayerRenderingStopped 

Rendering was stopped inside Render call.