2012-06-08 12:28:46 +00:00
|
|
|
#ifndef _PAYSAGES_QT_BASEEXPLORERCHUNK_H_
|
|
|
|
#define _PAYSAGES_QT_BASEEXPLORERCHUNK_H_
|
|
|
|
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QGLWidget>
|
|
|
|
#include "../lib_paysages/renderer.h"
|
|
|
|
|
|
|
|
class BaseExplorerChunk
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~BaseExplorerChunk();
|
|
|
|
|
|
|
|
bool maintain();
|
|
|
|
void updatePriority(CameraDefinition* camera);
|
|
|
|
void render(QGLWidget* widget);
|
2013-01-18 10:31:13 +00:00
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
double priority;
|
2012-06-08 12:28:46 +00:00
|
|
|
protected:
|
|
|
|
BaseExplorerChunk(Renderer* renderer);
|
2013-01-18 10:31:13 +00:00
|
|
|
|
2012-06-08 12:28:46 +00:00
|
|
|
inline Renderer* renderer() {return _renderer;};
|
|
|
|
|
|
|
|
void askReset();
|
|
|
|
void setMaxTextureSize(int size);
|
2013-01-18 10:31:13 +00:00
|
|
|
|
2012-06-08 12:28:46 +00:00
|
|
|
virtual void onCameraEvent(CameraDefinition* camera);
|
|
|
|
virtual void onResetEvent();
|
|
|
|
virtual bool onMaintainEvent();
|
|
|
|
virtual void onRenderEvent(QGLWidget* widget);
|
2012-06-17 09:40:40 +00:00
|
|
|
virtual double getDisplayedSizeHint(CameraDefinition* camera);
|
|
|
|
virtual Color getTextureColor(double x, double y);
|
2013-01-18 10:31:13 +00:00
|
|
|
|
2012-06-08 12:28:46 +00:00
|
|
|
QMutex _lock_data;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Renderer* _renderer;
|
2013-01-18 10:31:13 +00:00
|
|
|
ColorProfile* _color_profile;
|
2012-06-08 12:28:46 +00:00
|
|
|
|
|
|
|
bool _reset_needed;
|
|
|
|
|
|
|
|
QImage* _texture;
|
|
|
|
GLuint _texture_id;
|
|
|
|
bool _texture_changed;
|
|
|
|
int _texture_current_size;
|
|
|
|
int _texture_max_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|