tile_set_layer.h
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2014, 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 MULTIRES_IMAGE_TILE_SET_LAYER_H_
31 #define MULTIRES_IMAGE_TILE_SET_LAYER_H_
32 
33 // C++ standard libraries
34 #include <string>
35 #include <vector>
36 
37 #include <tf/transform_datatypes.h>
38 
40 
41 #include <multires_image/tile.h>
42 
43 namespace multires_image
44 {
46  {
47  public:
50  const std::string& path,
51  int tileSize, int layer);
52 
53  ~TileSetLayer(void);
54 
55  bool Load();
56  bool Load(const std::string extension);
57 
58  Tile* GetTile(int column, int row) { return m_tiles[column][row]; }
59 
60  void GetTileIndex(const tf::Point& position, int& row, int& column) const;
61  void GetTileIndex(double x, double y, int& row, int& column) const;
62  void GetTileRange(
63  const tf::Point& top_left,
64  const tf::Point& bottom_right,
65  int& startRow, int& startColumn,
66  int& endRow, int& endColumn) const;
67 
68  int RowCount() { return m_rows; }
69  int ColumnCount() { return m_columns; }
70 
71  private:
73  const std::string m_path;
74  const int m_tileSize;
75  const int m_layer;
76  const double m_scale;
77 
79 
80  int m_columns;
81  int m_rows;
82 
83  std::vector<std::vector<Tile*> > m_tiles;
84  };
85 }
86 
87 #endif // MULTIRES_IMAGE_TILE_SET_LAYER_H_
multires_image
Definition: multires_view_node.h:51
multires_image::TileSetLayer::~TileSetLayer
~TileSetLayer(void)
Definition: tile_set_layer.cpp:67
multires_image::TileSetLayer::GetTileIndex
void GetTileIndex(const tf::Point &position, int &row, int &column) const
Definition: tile_set_layer.cpp:144
multires_image::TileSetLayer
Definition: tile_set_layer.h:45
multires_image::TileSetLayer::m_rows
int m_rows
Definition: tile_set_layer.h:81
swri_transform_util::GeoReference
multires_image::TileSetLayer::m_layer
const int m_layer
Definition: tile_set_layer.h:75
multires_image::Tile
Definition: tile.h:50
multires_image::TileSetLayer::m_tiles
std::vector< std::vector< Tile * > > m_tiles
Definition: tile_set_layer.h:83
multires_image::TileSetLayer::TileSetLayer
TileSetLayer(const swri_transform_util::GeoReference &geo, const std::string &path, int tileSize, int layer)
Definition: tile_set_layer.cpp:41
multires_image::TileSetLayer::m_scale
const double m_scale
Definition: tile_set_layer.h:76
multires_image::TileSetLayer::GetTile
Tile * GetTile(int column, int row)
Definition: tile_set_layer.h:58
multires_image::TileSetLayer::m_tileSize
const int m_tileSize
Definition: tile_set_layer.h:74
tf::Point
tf::Vector3 Point
multires_image::TileSetLayer::m_geo
const swri_transform_util::GeoReference & m_geo
Definition: tile_set_layer.h:72
multires_image::TileSetLayer::GetTileRange
void GetTileRange(const tf::Point &top_left, const tf::Point &bottom_right, int &startRow, int &startColumn, int &endRow, int &endColumn) const
Definition: tile_set_layer.cpp:153
multires_image::TileSetLayer::Load
bool Load()
Definition: tile_set_layer.cpp:71
multires_image::TileSetLayer::m_columns
int m_columns
Definition: tile_set_layer.h:80
transform_datatypes.h
multires_image::TileSetLayer::m_path
const std::string m_path
Definition: tile_set_layer.h:73
multires_image::TileSetLayer::m_expectTiles
bool m_expectTiles
Definition: tile_set_layer.h:78
georeference.h
multires_image::TileSetLayer::RowCount
int RowCount()
Definition: tile_set_layer.h:68
tile.h
multires_image::TileSetLayer::ColumnCount
int ColumnCount()
Definition: tile_set_layer.h:69


multires_image
Author(s): Marc Alban
autogenerated on Sun Sep 8 2024 02:27:21