2012-06-02 14:17:01 +00:00
|
|
|
#ifndef _PAYSAGES_QT_PREVIEWMATERIAL_H_
|
|
|
|
#define _PAYSAGES_QT_PREVIEWMATERIAL_H_
|
|
|
|
|
|
|
|
#include "basepreview.h"
|
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "../lib_paysages/tools/lighting.h"
|
2012-06-02 14:17:01 +00:00
|
|
|
#include "../lib_paysages/renderer.h"
|
|
|
|
|
|
|
|
class SmallMaterialPreview:public QWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SmallMaterialPreview(QWidget* parent, SurfaceMaterial* material);
|
|
|
|
~SmallMaterialPreview();
|
2013-01-16 14:26:46 +00:00
|
|
|
|
|
|
|
Color getColor(double x, double y);
|
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
protected:
|
|
|
|
virtual void paintEvent(QPaintEvent* event);
|
2013-01-16 14:26:46 +00:00
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
private:
|
|
|
|
SurfaceMaterial* _material;
|
2013-01-20 17:00:17 +00:00
|
|
|
LightDefinition _light;
|
2013-01-20 15:07:45 +00:00
|
|
|
Renderer* _renderer;
|
2012-06-02 14:17:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class PreviewMaterial:public BasePreview
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-01-16 14:26:46 +00:00
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
public:
|
|
|
|
PreviewMaterial(QWidget* parent, SurfaceMaterial* material);
|
|
|
|
~PreviewMaterial();
|
2013-01-16 14:26:46 +00:00
|
|
|
|
2012-06-02 14:17:01 +00:00
|
|
|
protected:
|
2013-01-16 14:26:46 +00:00
|
|
|
virtual Color getColor(double x, double y);
|
2012-06-02 14:17:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SmallMaterialPreview* _small;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|