Merge branch 'master' into tessellation

Conflicts:
	include/llmr/renderer/fill_bucket.hpp
	src/renderer/fill_bucket.cpp
	src/renderer/painter.cpp
This commit is contained in:
Konstantin Käfer
2014-02-28 12:25:45 +01:00
55 changed files with 1313 additions and 370 deletions

View File

@@ -20,7 +20,7 @@ public:
~Map();
/* setup */
void setup();
void setup(float pixelRatio = 1);
void loadStyle(const uint8_t *const data, uint32_t bytes);
void loadSprite(const std::string& url);
void loadSettings();
@@ -29,13 +29,13 @@ public:
/* callback */
bool render();
void cancelAnimations();
void tileLoaded(std::shared_ptr<Tile> tile);
void tileFailed(std::shared_ptr<Tile> tile);
/* position */
void moveBy(double dx, double dy, double duration = 0);
void setLonLat(double lon, double lat, double duration = 0);
void getLonLat(double &lon, double &lat) const;
void startPanning();
void stopPanning();
void resetPosition();
/* scale */
@@ -47,12 +47,16 @@ public:
void setLonLatZoom(double lon, double lat, double zoom, double duration = 0);
void getLonLatZoom(double &lon, double &lat, double &zoom) const;
void resetZoom();
void startScaling();
void stopScaling();
/* rotation */
void rotateBy(double cx, double cy, double sx, double sy, double ex, double ey, double duration = 0);
void setAngle(double angle, double cx = -1, double cy = -1, double duration = 0);
double getAngle() const;
void resetNorth();
void startRotating();
void stopRotating();
void toggleDebug();
@@ -75,6 +79,8 @@ private:
int32_t min_zoom;
int32_t max_zoom;
float pixel_ratio;
std::forward_list<std::shared_ptr<Tile>> tiles;
std::forward_list<std::shared_ptr<Tile>> historic_tiles;
};

View File

@@ -23,6 +23,7 @@ class VectorTile;
class VectorTileLayer;
class FillVertexBuffer;
class LineVertexBuffer;
class PointVertexBuffer;
class TriangleElementsBuffer;
class LineElementsBuffer;
class PointElementsBuffer;
@@ -59,6 +60,7 @@ public:
std::shared_ptr<Bucket> createBucket(const VectorTile& tile, const BucketDescription& bucket_desc);
std::shared_ptr<Bucket> createFillBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
std::shared_ptr<Bucket> createLineBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
std::shared_ptr<Bucket> createPointBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
void cancel();
@@ -77,6 +79,7 @@ public:
std::shared_ptr<FillVertexBuffer> fillVertexBuffer;
std::shared_ptr<LineVertexBuffer> lineVertexBuffer;
std::shared_ptr<PointVertexBuffer> pointVertexBuffer;
std::shared_ptr<TriangleElementsBuffer> triangleElementsBuffer;
std::shared_ptr<LineElementsBuffer> lineElementsBuffer;

View File

@@ -42,6 +42,14 @@ public:
void getLonLat(double& lon, double& lat) const;
void getLonLatZoom(double& lon, double& lat, double& zoom) const;
// Animations
void startPanning();
void stopPanning();
void startRotating();
void stopRotating();
void startScaling();
void stopScaling();
// Temporary
void mapCornersToBox(uint32_t z, box& b) const;
@@ -61,6 +69,10 @@ public:
float pixelRatio = 1;
bool rotating = false;
bool scaling = false;
bool panning = false;
private:
double x = 0, y = 0; // pixel values of the map center in the current scale
double angle = 0;
@@ -72,7 +84,10 @@ private:
// cache values for spherical mercator math
double zc, Bc, Cc;
std::forward_list<util::animation> animations;
std::forward_list<std::shared_ptr<util::animation>> animations;
std::shared_ptr<util::animation> scale_timeout;
std::shared_ptr<util::animation> rotate_timeout;
std::shared_ptr<util::animation> pan_timeout;
};
}