Added documentation
authorSami Rämö <sami.ramo@ixonos.com>
Wed, 9 Jun 2010 05:49:45 +0000 (08:49 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Wed, 9 Jun 2010 05:49:45 +0000 (08:49 +0300)
src/map/baselocationitem.h
src/map/mapengine.h
src/map/mapscene.h

index 533ba5d..319f102 100644 (file)
@@ -53,7 +53,11 @@ public:
       *
       * Because of using ItemIgnoresTransformations, and not scaling the item, the default
       * sceneBoundingRect does always return the lowest map tile level scene bounding rect which
-      * must be scaled to current zoom level.
+      * is scaled to current zoom level.
+      *
+      * Left side of the returned rect is always inside the world coordinates, so collision
+      * detection based on this rect does work also when items are spanned outside the
+      * world coordinates.
       *
       * @param zoomLevel Zoom level for which the sceneBoundingRect should be transformed
       * @return sceneBoundingRect transformed to given zoom level
index 1633b5d..319d5d9 100644 (file)
@@ -122,6 +122,17 @@ public:
     */
     void init();
 
+    /**
+      * @brief Return given value translated between min and max
+      *
+      * If given value is not inside the given range (min <= value <= max), then the allowed range
+      * is adder or subtracted until the value does fit in the range.
+      *
+      * @param value Value to be normalized
+      * @param min Minimum allowed value
+      * @param max Maximum allowed value
+      * @return value which is moved to be inside the given limits
+      */
     static int normalize(int value, int min, int max);
 
     /**
@@ -261,9 +272,19 @@ private:
     */
     void updateViewTilesSceneRect();
 
+    /**
+      * @brief This method is ran always when the map is zoomed
+      *
+      * This method is the right place for all actions which must be done when ever map is zoomed.
+      */
     void zoomed();
 
 private slots:
+    /**
+      * @brief This slot is called after friend items position have been updated
+      *
+      * Does run MapScene::spanItems()
+      */
     void friendsPositionsUpdated();
 
     /**
index 16fa8d5..3873f46 100644 (file)
@@ -55,8 +55,10 @@ public:
     * If there is a tile with same parameter already in the scene, it will be removed
     * before adding the new tile.
     *
-    * @param mapTile Map tile item to be added
-    * @param hashKey Hash key for the tile
+    * @param zoomLevel Zoom level of the new tile
+    * @param tileNumber X & Y indexes of the tile
+    * @param image Map tile picture
+    * @param viewZoomLevel Current view zoom level (for setting the zValue)
     */
     void addTile(int zoomLevel, QPoint tileNumber, const QPixmap &image, int viewZoomLevel);
 
@@ -105,6 +107,15 @@ public:
     */
     void removeTile(MapTile *tile);
 
+    /**
+      * @brief Set allowed amount of exceeding the world vertical limits
+      *
+      * Limit is set so that vertical limits of the world can be scrolled to middle of
+      * the view.
+      *
+      * @param viewHeight Height of the view
+      * @param zoomLevel Current zoom level
+      */
     void setSceneVerticalOverlap(int viewHeight, int zoomLevel);
 
     /**
@@ -130,6 +141,16 @@ public:
     void tilesSceneRectUpdated(QRect tilesSceneRect);
 
 private:
+    /**
+      * @brief Move map items horizontally in the scene (not MapTile items)
+      *
+      * MapTile items are not moved!
+      *
+      * Move items which intersect the given rect.
+      *
+      * @param from Items colliding given rect are moved
+      * @param distance How much to move each item
+      */
     void moveIntersectingItemsHorizontally(QRect from, int distance);
 
 private slots: