Main Page
Namespaces
Classes
Files
File List
include
tile_map
tile_map_view.h
Go to the documentation of this file.
1
// *****************************************************************************
2
//
3
// Copyright (c) 2015, Southwest Research Institute® (SwRI®)
4
// All rights reserved.
5
//
6
// Redistribution and use in source and binary forms, with or without
7
// modification, are permitted provided that the following conditions are met:
8
// * Redistributions of source code must retain the above copyright
9
// notice, this list of conditions and the following disclaimer.
10
// * Redistributions in binary form must reproduce the above copyright
11
// notice, this list of conditions and the following disclaimer in the
12
// documentation and/or other materials provided with the distribution.
13
// * Neither the name of Southwest Research Institute® (SwRI®) nor the
14
// names of its contributors may be used to endorse or promote products
15
// derived from this software without specific prior written permission.
16
//
17
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
// ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
//
28
// *****************************************************************************
29
30
#ifndef TILE_MAP_TILE_MAP_VIEW_H_
31
#define TILE_MAP_TILE_MAP_VIEW_H_
32
33
#include <string>
34
35
#include <boost/shared_ptr.hpp>
36
37
#include <
tile_map/tile_source.h
>
38
#include <
tile_map/texture_cache.h
>
39
40
#include <
swri_transform_util/transform.h
>
41
42
namespace
tile_map
43
{
44
class
TileSource;
45
46
struct
Tile
47
{
48
public
:
49
QString
url
;
50
size_t
url_hash
;
51
int32_t
level
;
52
int32_t
subdiv_count
;
53
double
subwidth
;
54
55
TexturePtr
texture
;
56
57
std::vector<tf::Vector3>
points
;
58
std::vector<tf::Vector3>
points_t
;
59
};
60
61
class
TileMapView
62
{
63
public
:
64
TileMapView
();
65
66
void
ResetCache();
67
68
void
SetTileSource(
const
boost::shared_ptr<TileSource>
& tile_source);
69
70
void
SetTransform(
const
swri_transform_util::Transform
& transform);
71
72
void
SetView(
73
double
latitude,
74
double
longitude,
75
double
scale,
76
int32_t width,
77
int32_t height);
78
79
void
Draw();
80
81
private
:
82
void
DrawTiles(std::vector<Tile> &tiles ,
int
priority);
83
84
boost::shared_ptr<TileSource>
tile_source_
;
85
86
swri_transform_util::Transform
transform_
;
87
88
int32_t
level_
;
89
90
int64_t
center_x_
;
91
int64_t
center_y_
;
92
93
int64_t
size_
;
94
95
int32_t
width_
;
96
int32_t
height_
;
97
98
std::vector<Tile>
tiles_
;
99
std::vector<Tile>
precache_
;
100
101
TextureCachePtr
tile_cache_
;
102
103
void
ToLatLon(int32_t
level
,
double
x,
double
y,
double
& latitude,
double
& longitude);
104
105
void
InitializeTile(int32_t
level
, int64_t x, int64_t y,
Tile
& tile,
int
priority);
106
};
107
}
108
109
#endif // TILE_MAP_TILE_MAP_VIEW_H_
swri_transform_util::Transform
tile_map::Tile::subdiv_count
int32_t subdiv_count
Definition:
tile_map_view.h:52
tile_map::TileMapView::precache_
std::vector< Tile > precache_
Definition:
tile_map_view.h:99
texture_cache.h
tile_map
Definition:
bing_source.h:45
tile_source.h
tile_map::Tile::texture
TexturePtr texture
Definition:
tile_map_view.h:55
tile_map::TileMapView::height_
int32_t height_
Definition:
tile_map_view.h:96
boost::shared_ptr< Texture >
tile_map::Tile
Definition:
tile_map_view.h:46
tile_map::Tile::url_hash
size_t url_hash
Definition:
tile_map_view.h:50
tile_map::Tile::subwidth
double subwidth
Definition:
tile_map_view.h:53
tile_map::TileMapView::transform_
swri_transform_util::Transform transform_
Definition:
tile_map_view.h:86
tile_map::TileMapView::tiles_
std::vector< Tile > tiles_
Definition:
tile_map_view.h:98
transform.h
tile_map::Tile::url
QString url
Definition:
tile_map_view.h:49
tile_map::TileMapView::center_y_
int64_t center_y_
Definition:
tile_map_view.h:91
tile_map::Tile::level
int32_t level
Definition:
tile_map_view.h:51
tile_map::TileMapView::tile_cache_
TextureCachePtr tile_cache_
Definition:
tile_map_view.h:101
tile_map::TileMapView::width_
int32_t width_
Definition:
tile_map_view.h:95
tile_map::Tile::points
std::vector< tf::Vector3 > points
Definition:
tile_map_view.h:57
tile_map::TileMapView::tile_source_
boost::shared_ptr< TileSource > tile_source_
Definition:
tile_map_view.h:84
tile_map::Tile::points_t
std::vector< tf::Vector3 > points_t
Definition:
tile_map_view.h:58
tile_map::TileMapView::level_
int32_t level_
Definition:
tile_map_view.h:88
tile_map::TileMapView::size_
int64_t size_
Definition:
tile_map_view.h:93
tile_map::TileMapView
Definition:
tile_map_view.h:61
tile_map::TileMapView::center_x_
int64_t center_x_
Definition:
tile_map_view.h:90
tile_map
Author(s): Marc Alban
autogenerated on Thu Jun 6 2019 19:25:35