GlobeEngine
Tile.hpp
Go to the documentation of this file.
1 //
2 // Tile.hpp
3 // GlobeEngine
4 //
5 // Created by Alireza Amiraghdam on 18/05/16.
6 //
7 //
8 
9 #ifndef Tile_hpp
10 #define Tile_hpp
11 
12 #include <stdio.h>
13 #include "SpatialKey.h"
14 #include "GlobeEngineGeoTiff.h"
15 #include <vmmlib/vmmlib.hpp>
16 #include <iostream>
17 #include <fstream>
18 
19 namespace geTerrainPreprocess{
20 
21  class TileMapService;
22  class Tile;
23 
24  struct TiePoints{
25  double tiePoints[6];
26  };
27 
28  typedef std::shared_ptr<Tile> TilePtr;
29  class Tile{
30  private:
31  bool fileCreated = false;
32  geSpatial::SpatialKey2ui spatialKey;
33  TileMapService *tms;
34  geoTiffIo::GlobeEngineGeoTiff gTif;
35  geoTiffIo::GeoInfo geoInfo;
36  std::string extension;
37  std::string endFileName;
38  unsigned int currentRow;
39  std::fstream dataFile;
40  int tileSize;
41  int bitPerSample;
42  int samplePerPixel;
43  int sampleFormat;
44  std::string location;
45  TilePtr oldTile;
46  unsigned short ifReplace = 0;
47  public:
49  ~Tile();
50  void createFile();
51  void close();
52  void writeScanline(geoTiffIo::ScanLineBufferPtr _scanline, uint32_t row);
53  void load();
54  geoTiffIo::ScanLineBufferPtr readScanline(uint32_t row);
55  bool isZero();
56  std::string getFullPath();
57  vmml::Vector4d getPCSBound();
58 
59  public:
60  uint32_t getSize(){ return tileSize; };
61  void setSizeX(uint32_t _sizeX){ tileSize = _sizeX; };
62  std::shared_ptr<TiePoints> calculateTiePoints();
63  void setGeoInfo(geoTiffIo::GeoInfo _info);
64  bool isFileCreated(){ return fileCreated; };
65  geoTiffIo::GeoInfo getGeoInfo(){ return geoInfo; };
66  int getBitPerSample(){ return bitPerSample; };
67  int getColorSpace() { return 1; };
68  int getSampleFormat(){ return sampleFormat; };
69  int getSamplePerPixel(){ return samplePerPixel; };
70  void setEndFileName(std::string _endFileName){ endFileName = _endFileName; };
71  std::string getEndFileName(){ return endFileName; };
72  void setIfReplace(unsigned short _ifr){ ifReplace = _ifr; };
73  };
74 }
75 #endif /* Tile_hpp */
std::shared_ptr< Tile > TilePtr
Definition: Tile.hpp:28
void setGeoInfo(geoTiffIo::GeoInfo _info)
Definition: Tile.cpp:142
int getColorSpace()
Definition: Tile.hpp:67
std::string getFullPath()
Definition: Tile.cpp:218
void writeScanline(geoTiffIo::ScanLineBufferPtr _scanline, uint32_t row)
Definition: Tile.cpp:95
void setIfReplace(unsigned short _ifr)
Definition: Tile.hpp:72
Tile(TileMapService *_tms, geSpatial::SpatialKey2ui _key)
Definition: Tile.cpp:125
void setEndFileName(std::string _endFileName)
Definition: Tile.hpp:70
std::string getEndFileName()
Definition: Tile.hpp:71
int getSamplePerPixel()
Definition: Tile.hpp:69
void createFile()
Definition: Tile.cpp:42
geoTiffIo::GeoInfo getGeoInfo()
Definition: Tile.hpp:65
Definition: Tile.hpp:29
int getBitPerSample()
Definition: Tile.hpp:66
Definition: Tile.hpp:24
void setSizeX(uint32_t _sizeX)
Definition: Tile.hpp:61
std::shared_ptr< TiePoints > calculateTiePoints()
Definition: Tile.cpp:18
void close()
Definition: Tile.cpp:81
double tiePoints[6]
Definition: Tile.hpp:25
Definition: NormalCommand.h:14
void load()
Definition: Tile.cpp:146
Definition: SpatialKey.h:137
Definition: TileMapService.hpp:39
uint32_t getSize()
Definition: Tile.hpp:60
bool isFileCreated()
Definition: Tile.hpp:64
geoTiffIo::ScanLineBufferPtr readScanline(uint32_t row)
Definition: Tile.cpp:179
vmml::Vector4d getPCSBound()
Definition: Tile.cpp:222
~Tile()
Definition: Tile.cpp:138
int getSampleFormat()
Definition: Tile.hpp:68
bool isZero()
Definition: Tile.cpp:203