changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / internal / GeoOpenGlRenderer.h
1 /*
2  * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3  * This software, including documentation, is protected by copyright controlled by
4  * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5  * storing, adapting or translating, any or all of this material requires the prior
6  * written consent of HERE Global B.V. You may use this
7  * Software in accordance with the terms and conditions defined in the
8  * HERE Location Platform Services Terms and Conditions, available at
9  * http://developer.here.com/terms-conditions-base
10  *
11  * As an additional permission to the above, you may distribute Software,
12  * in object code format as part of an Application, according to, and subject to, terms and
13  * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14  * You may distribute such object code format Application under terms of your choice,
15  * provided that the header and source files of the Software have not been modified.
16  */
17
18 #ifndef GEOOPENGLRENDERER_H
19 #define GEOOPENGLRENDERER_H
20
21 #include "common/HereMaps_global.h"
22
23 #include <vector>
24
25 #ifdef TIZEN_MIGRATION
26 #include "graphic/FloatRectangle.h"
27 #include "graphic/Color.h"
28 #include "internal/DoublePoint3.h"
29 #else
30 #include <FGraphics.h>
31 #endif
32
33 HERE_MAPS_BEGIN_NAMESPACE
34
35 class GlTexture;
36 class GeoTiledMap;
37 class GeoMapObjectMarker;
38 class GeoProjectionNode;
39 class DrawableBitmap;
40
41 /**
42  * This class encapsulates an Open GL renderer used to render map tiles.
43  * 
44  * \ingroup maps
45  */
46 class GeoOpenGlRenderer
47 {
48 public:
49     /**
50      * This method is the default constructor.
51      */
52     GeoOpenGlRenderer();
53
54     /**
55      * This method is the default destructor.
56      */
57     ~GeoOpenGlRenderer();
58
59     /**
60      * This method creates an EGL texture from the image associated with the
61      * caller-supplied bitmap drawable.
62      * 
63      * @param rDrawableBitmap A reference to a bitmap object that contains the
64      *        image to be drawn.
65      * 
66      * @return <code>true</code> if the image has been made drawable,
67      *        <code>false</code> if a texture could not be associated with the supplied
68      *        bitmap object.
69      */
70     bool MakeDrawable(DrawableBitmap& rDrawableBitmap);
71
72     /**
73      * This method renders the image(s) provided by the caller. The caller can
74      * specify the size of the area to render (the visible map area).
75      * 
76      * @param nodes A list of objects containing images to render.
77      * 
78      * @param width A value indicating the width of the area to render.
79      * 
80      * @param height A value indicating the height of the area to render.
81      */
82     bool Render(const std::vector<GeoProjectionNode*>& nodes,
83                 unsigned int width,
84                 unsigned int height);
85
86 #ifdef TIZEN_MIGRATION
87     /**
88      * This method renders a square, using the rectangle and texture specified
89      * by the caller.
90      *
91      * @param aRect A constant reference to the double points to render.
92      *
93      * @param uTexture A value of the id of the texture object to apply.
94      *
95      * @param sx0 A value providing the x coordinate of the top left corner of
96      *        the rectangle in the tile grid.
97      *
98      * @param sy0 A value providing the y coordinate of the top left corner of
99      *        the rectangle in the tile grid.
100      *
101      * @param sx1 A value providing the x coordinate of the bottom right corner of
102      *        the rectangle in the tile grid.
103      *
104      * @param sy1 A value providing the y coordinate of the bottom right corner of
105      *        the rectangle in the tile grid.
106      */
107     bool RenderQuad(const std::vector<DoublePoint3>& aRect, unsigned int uTextureId,  float sx0=0.f, float sy0=1.f, float sx1=1.f, float sy1=0.f);
108 #endif
109
110     /**
111      * This method renders a square, using the rectangle and texture specified
112      * by the caller.
113      *
114      * @param aRect A constant reference to the rectangle to render.
115      *
116      * @param rTexture A constant reference to the texture object to apply.
117      *
118      * @param sx0 A value providing the x coordinate of the top left corner of
119      *        the rectangle in the tile grid.
120      *
121      * @param sy0 A value providing the y coordinate of the top left corner of
122      *        the rectangle in the tile grid.
123      *
124      * @param sx1 A value providing the x coordinate of the bottom right corner of
125      *        the rectangle in the tile grid.
126      *
127      * @param sy1 A value providing the y coordinate of the bottom right corner of
128      *        the rectangle in the tile grid.
129      */
130     bool RenderQuad(const Tizen::Maps::FloatRectangle& aRect, const GlTexture& rTexture, float sx0=0.f, float sy0=1.f, float sx1=1.f, float sy1=0.f);
131
132     /**
133      * This method renders a square, using the rectangle and texture specified
134      * by the caller.
135      *
136      * @param aRect A constant reference to the rectangle to render.
137      *
138      * @param uTexture A value of the id of the texture object to apply.
139      *
140      * @param sx0 A value providing the x coordinate of the top left corner of
141      *        the rectangle in the tile grid.
142      *
143      * @param sy0 A value providing the y coordinate of the top left corner of
144      *        the rectangle in the tile grid.
145      *
146      * @param sx1 A value providing the x coordinate of the bottom right corner of
147      *        the rectangle in the tile grid.
148      *
149      * @param sy1 A value providing the y coordinate of the bottom right corner of
150      *        the rectangle in the tile grid.
151      */
152     bool RenderQuad(const Tizen::Maps::FloatRectangle& aRect, unsigned int uTextureId, float sx0=0.f, float sy0=1.f, float sx1=1.f, float sy1=0.f);
153
154     /**
155      * This method changes the color that will be used by the gl clear method.
156      */
157     void SetClearColor(const Tizen::Maps::Color& color);
158
159     /**
160      * This method clears the screen.
161      */
162     void Clear();
163
164 private:
165     bool Initialize();
166     
167 private:
168     HERE_MAPS_NO_COPY_NO_ASSIGN(GeoOpenGlRenderer);
169     class GeoOpenGlRendererImpl;
170     GeoOpenGlRendererImpl* m_pImpl;
171 };
172
173 HERE_MAPS_END_NAMESPACE
174
175 #endif // GEOOPENGLRENDERER_P_H