GlobeEngine
Tile.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_Tile_h
10 #define GlobeEngine_Tile_h
11 
12 #include "OpenGL_Includes.h"
13 #include "CullableSpatialKey.h"
14 #include "Texture.h"
15 #include <memory>
16 
17 namespace geSpatial {
18  struct TileError
19  {
21  geometric_errors = 0;// NULL;
22  propagated_errors = 0; //NULL;
23  }
24 
26  delete [] geometric_errors;
27  delete [] propagated_errors;
28  }
29 
32  float max_error;
33  };
34 
35  class Tile
36  {
37  public:
38  Tile();
39  ~Tile();
40  void clear();
41  void calculateSaturatedErrors(Tile* _tile, int _width, int _height);
42 
43  std::shared_ptr<geSpatial::CullableSpatialKey> getKey() const;
44  void setKey(std::shared_ptr<geSpatial::CullableSpatialKey> _key);
45  void setKey(short _lod, int _x, int _y);
46  int getTiletype();
47  void setTiletype(int _in);
48 
49  void setTexture(std::shared_ptr<ge::Texture2Df> _tex);
50 
51  //__declspec(align(16)) union {
52  union {
53  float* alpha;
54  unsigned short* alpha16;
55  unsigned char* alpha8;
56  unsigned char* rgba;
57  } data;
58 
59  std::shared_ptr<geSpatial::CullableSpatialKey> key;
60  std::shared_ptr<ge::Texture2Df> tex;
63 
64  int tiletype;
65  private:
66  void deleteMemory();
67 
68  };
69 }
70 #endif
unsigned short * alpha16
Definition: Tile.h:54
Definition: Texture.h:105
float * propagated_errors
Definition: Tile.h:31
void clear()
Definition: Tile.cpp:29
union geSpatial::Tile::@4 data
void setTiletype(int _in)
Definition: Tile.cpp:191
unsigned char * rgba
Definition: Tile.h:56
unsigned char * alpha8
Definition: Tile.h:55
~TileError()
Definition: Tile.h:25
Definition: Tile.h:18
std::shared_ptr< geSpatial::CullableSpatialKey > getKey() const
Definition: Tile.cpp:183
Definition: Tile.h:35
std::shared_ptr< ge::Texture2Df > tex
Definition: Tile.h:60
Tile()
Definition: Tile.cpp:13
void setKey(std::shared_ptr< geSpatial::CullableSpatialKey > _key)
Definition: Tile.cpp:165
float * geometric_errors
Definition: Tile.h:30
int getTiletype()
Definition: Tile.cpp:187
int tiletype
Definition: Tile.h:64
TileError error_data
Definition: Tile.h:61
ge::TextureTypeInternals texInternals
Definition: Tile.h:62
float max_error
Definition: Tile.h:32
void setTexture(std::shared_ptr< ge::Texture2Df > _tex)
Definition: Tile.cpp:169
void calculateSaturatedErrors(Tile *_tile, int _width, int _height)
Definition: Tile.cpp:34
Definition: Cache.h:17
~Tile()
Definition: Tile.cpp:19
float * alpha
Definition: Tile.h:53
TileError()
Definition: Tile.h:20
std::shared_ptr< geSpatial::CullableSpatialKey > key
Definition: Tile.h:59