AfriGIS Map SDK (BB10)  v 1.0.0
Provides easy integration of AfriGIS Maps into BB10 platform.
ImageItem.hpp
1 /*
2  * ImageItem.hpp
3  *
4  * Created on: Aug 19, 2013
5  * Author: sdsl
6  */
7 
8 #ifndef IMAGEITEM_HPP_
9 #define IMAGEITEM_HPP_
10 
11 #include "Item.hpp"
12 #include "OpenGLUtil.hpp"
13 
14 class AnnotationView;
15 class ViewManager;
16 class AGMapTextureImageInfo;
17 class QNetworkReply;
18 class QWaitCondition;
19 class QMutex;
20 namespace bb
21 {
22  namespace cascades
23  {
24  class TouchEvent;
25  }
26 }
27 
35 class ImageItem: public Item
36 {
37  Q_OBJECT
38 
39 public:
40 
45  ImageItem(QList<AGLocationCoordinate2D> *imageCenter, QByteArray *image, int imageWidth, int imageHeight, ViewManager *viewManager, AGOffsetInPixel offset);
46 
51  ~ImageItem();
52 
53 public:
54 
59  void render();
60 
66  void updateLocation(QList<AGLocationCoordinate2D> *updatedGeoLocationCoordinates);
67 
72  void addItemInCluster(Item* item);
73 
78  QList<Item*> getItemListInCluster();
79 
84  void clearCluster();
85 
90  int getClusterSize();
91 
96  bool isClusterItem();
97 
103  QList<AGLocationCoordinate2D>* getLocation();
104 
110  QPair<int, int> getSize();
111 
116  void setView(AnnotationView *annotationView);
117 
123 
128  bool isTouched(bb::cascades::TouchEvent *event);
129 
136  bool isTouched(double localX, double localY);
137 
142  bool isBubbleEnabled();
143 
148  void setBubbleEnabled(bool bubbleStatus);
149 
155  QVariant getAssociatedData();
156 
162  void setAssociatedData(QVariant associatedData);
163 
164 private:
165 
170  void renderNow();
171 
172 // void changeRGBAlpha(GLfloat &R,GLfloat &G,GLfloat &B,GLfloat &Alpha,GLfloat r,GLfloat g,GLfloat b,GLfloat alpha);
173 
178  void animateImageDrop();
179 
184  void loadBubbleText();
185 
186 private slots:
187 
192  void onReply();
193 
194 private:
195 
200  bool bubbleEnabled;
201 
206  int imageWidth,imageHeight;
207 
212  int screenHeight,screenWidth;
213 
218  float scaleX,scaleY;
219 
224  QString bubbleText;
225 
230  QString description,longitude,latitude,temp;
231 
236  QByteArray *image;
237 
242  QList<AGLocationCoordinate2D> *imageCenter;
243 
248  QList<QPair<float,float> > *relativeCoordinates;
249 
254  AGMapTextureImageInfo *imageInfo;
255 
260  AnnotationView *annotationView;
261 
266  AGOffsetInPixel offset;
267 
272  QNetworkReply *reply;
273 
278  ViewManager *viewManager;
279 
284  QList<Item*> itemListInCluster;
285 
290  QColor *circleBorderColor;
291 
296  float borderRadius;
297 
302  QColor *circleColor;
303 
308  float radius;
309 
314  bool isBubbleTextLoaded;
315 };
316 
317 #endif /* IMAGEITEM_HPP_ */
void setView(AnnotationView *annotationView)
private.
Definition: ImageItem.cpp:124
QPair< int, int > getSize()
get width and height.
Definition: ImageItem.cpp:116
bool isTouched(bb::cascades::TouchEvent *event)
private.
Definition: ImageItem.cpp:241
ImageItem(QList< AGLocationCoordinate2D > *imageCenter, QByteArray *image, int imageWidth, int imageHeight, ViewManager *viewManager, AGOffsetInPixel offset)
private.
Definition: ImageItem.cpp:20
void updateLocation(QList< AGLocationCoordinate2D > *updatedGeoLocationCoordinates)
update location of the image annotation.
Definition: ImageItem.cpp:66
void render()
private.
Definition: ImageItem.cpp:174
QList< AGLocationCoordinate2D > * getLocation()
get location of image annotation.
Definition: ImageItem.cpp:107
Item interface that need to be implemented by all annotation item object. Currently CircleItem...
Definition: Item.hpp:25
View responsible for presenting annotations visually in map. Annotation view are loosely coupled to a...
Definition: AnnotationView.hpp:29
bool isBubbleEnabled()
private.
Definition: ImageItem.cpp:381
AGOffsetInPixel Move offset pixel to draw annotation item.
Definition: AGMapDataStruct.hpp:102
QVariant associatedData
private.
Definition: Item.hpp:99
QVariant getAssociatedData()
get the data associated with this circle.
Definition: ImageItem.cpp:402
QList< Item * > getItemListInCluster()
private.
Definition: ImageItem.cpp:81
Definition: AfrigisMapSDK.hpp:24
Annotation Item object representing a rectangle area on map which is filled with provided image...
Definition: ImageItem.hpp:35
int getClusterSize()
private.
Definition: ImageItem.cpp:92
void addItemInCluster(Item *item)
private.
Definition: ImageItem.cpp:76
bool isClusterItem()
private.
Definition: ImageItem.cpp:97
void setBubbleEnabled(bool bubbleStatus)
private.
Definition: ImageItem.cpp:387
~ImageItem()
destructor.
Definition: ImageItem.cpp:52
void clearCluster()
private.
Definition: ImageItem.cpp:86
void setAssociatedData(QVariant associatedData)
set any type of data associated with this circle.
Definition: ImageItem.cpp:397
AnnotationView * getView()
private.
Definition: ImageItem.cpp:131