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_
void GetTileIndex(const tf::Point &position, int &row, int &column) const
const swri_transform_util::GeoReference & m_geo
void GetTileRange(const tf::Point &top_left, const tf::Point &bottom_right, int &startRow, int &startColumn, int &endRow, int &endColumn) const
tf::Vector3 Point
TileSetLayer(const swri_transform_util::GeoReference &geo, const std::string &path, int tileSize, int layer)
Tile * GetTile(int column, int row)
std::vector< std::vector< Tile * > > m_tiles


multires_image
Author(s): Marc Alban
autogenerated on Fri Dec 16 2022 03:59:39