NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
gl2d_mesh_interface.h
Go to the documentation of this file.
1 #ifndef SDK_GL2D_MESH_INTERFACE_H_
11 #define SDK_GL2D_MESH_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 #include <visualizationlayer/inc/gl2d/gl2d_projection_interface.h>
20 
21 SDK_GL2D_BEGIN_NAMESPACE
22 
25 
29 {
30 };
31 
35 {
36  // Unknown mesh type
37  kGL2DMeshType_Unknown = 0,
38 
39  // Following meshes can't be used with projection
40 
41  // Pure mesh without any extra info, like vertex color, etc.
42  kGL2DMeshType_Pure = 1,
43 
44  // Mesh with color information for each of vertex
45  kGL2DMeshType_Colored = 2,
46 
47  // Following meshes can be used with any of perspective projections
48  // (see GL2DProjectionType)
49 
50  // Pure mesh, similar to kGL2DMeshType_Pure, but can be
51  // projected via any perspective projection during rendering
52  kGL2DMeshType_Pure_ForPerspProj = 3,
53 
54  // Colored mesh, similar to kGL2DMeshType_Colored, but can be
55  // projected via any perspective projection during rendering
56  kGL2DMeshType_Colored_ForPerspProj = 4,
57 
58  // 3D mesh with vertex and triangle normal coordinates
59  kGL2DMeshType_3D = 5,
60 
61 };
62 
66 {
67  kGL2DMeshPrimitiveType_Triangles = 0, // (0,1,2) - (3,4,5) - (6,7,8) - ...
68  kGL2DMeshPrimitiveType_TriangleStrip = 1, // (0,1,2) - (1,2,3) - (2,3,4) - ...
69  kGL2DMeshPrimitiveType_TriangleFan = 2, // (0,1,2) - (0,2,3) - (0,3,4) - ...
70 };
71 
74 class IGL2DMesh : public ISDKProperties
75 {
76 public:
78  virtual void SDK_CALLTYPE Dump() const throw() = 0;
79 
81  virtual IGL2DCanvasSP SDK_CALLTYPE GetParent() const throw() = 0;
82 
84  inline bool SDK_CALLTYPE IsIndexed() const
85  { return 0UL != GetElementsCount(); }
86 
88  virtual GL2DMeshType SDK_CALLTYPE GetType() const throw() = 0;
90  virtual GL2DMeshPrimitiveType SDK_CALLTYPE GetPrimitiveType() const throw() = 0;
92  virtual SDKUInt32 SDK_CALLTYPE GetVertexCount() const throw() = 0;
94  virtual SDKUInt32 SDK_CALLTYPE GetElementsCount() const throw() = 0;
96  virtual SDKUInt32 SDK_CALLTYPE GetMemSize() const throw() = 0;
97 
100  virtual bool SDK_CALLTYPE SupportsProjection(
101  const GL2DProjectionType& projection_type) const throw() = 0;
102  inline bool SDK_CALLTYPE SupportsProjection(
103  const IGL2DProjectionSP& projection) const
104  {
105  const GL2DProjectionType type = projection
106  ? projection->GetType() : kGL2DProjectionType_Unknown;
107  return SupportsProjection(type);
108  }
109 
110  SDK_IMPLEMENT_IID(IGL2DMesh)
111  SDK_END_INTERFACE(IGL2DMesh)
112 };
113 SDK_DECLARE_IID(IGL2DMesh)
114 
115 SDK_GL2D_END_NAMESPACE
116 
117 #endif // SDK_GL2D_MESH_INTERFACE_H_
GL2DMeshPropertyIDs
GL2DMeshPropertyIDs
Generic GL2D Mesh properties.
Definition: gl2d_mesh_interface.h:28
IGL2DMesh::GetMemSize
virtual SDKUInt32 SDK_CALLTYPE GetMemSize() const =0
Returns mesh memory size.
IGL2DMesh::GetParent
virtual IGL2DCanvasSP SDK_CALLTYPE GetParent() const =0
Returns parent canvas object.
base_types.h
SDK base types.
IGL2DMesh::GetElementsCount
virtual SDKUInt32 SDK_CALLTYPE GetElementsCount() const =0
Returns number of elements (indices) in mesh.
IGL2DMesh::GetPrimitiveType
virtual GL2DMeshPrimitiveType SDK_CALLTYPE GetPrimitiveType() const =0
Returns mesh primitive type.
IGL2DMesh::IsIndexed
bool SDK_CALLTYPE IsIndexed() const
Checks, if given mesh is indexed.
Definition: gl2d_mesh_interface.h:84
IGL2DMesh::SupportsProjection
virtual bool SDK_CALLTYPE SupportsProjection(const GL2DProjectionType &projection_type) const =0
Checks, if given mesh supports given projection (can be rendered via given projection)
properties_interface.h
Object generic properties interface.
GL2DMeshType
GL2DMeshType
Available mesh type.
Definition: gl2d_mesh_interface.h:34
GL2DMeshPrimitiveType
GL2DMeshPrimitiveType
Available mesh primitive type.
Definition: gl2d_mesh_interface.h:65
IGL2DMesh::GetType
virtual GL2DMeshType SDK_CALLTYPE GetType() const =0
Returns mesh type.
IGL2DMesh
GL2D Mesh object.
Definition: gl2d_mesh_interface.h:74
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
IGL2DMesh::Dump
virtual void SDK_CALLTYPE Dump() const =0
Dumps given object.
IGL2DMesh::GetVertexCount
virtual SDKUInt32 SDK_CALLTYPE GetVertexCount() const =0
Returns number of vertexes in mesh.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.