2012-06-02 14:17:01 +00:00
|
|
|
#ifndef _PAYSAGES_QT_PREVIEWMATERIAL_H_
|
|
|
|
#define _PAYSAGES_QT_PREVIEWMATERIAL_H_
|
|
|
|
|
|
|
|
#include "basepreview.h"
|
|
|
|
|
|
|
|
#include "../lib_paysages/lighting.h"
|
|
|
|
#include "../lib_paysages/renderer.h"
|
|
|
|
|
|
|
|
class SmallMaterialPreview:public QWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SmallMaterialPreview(QWidget* parent, SurfaceMaterial* material);
|
|
|
|
~SmallMaterialPreview();
|
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
QColor getColor(double x, double y);
|
2012-06-02 14:17:01 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void paintEvent(QPaintEvent* event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
SurfaceMaterial* _material;
|
|
|
|
LightingDefinition _lighting;
|
|
|
|
Renderer _renderer;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PreviewMaterial:public BasePreview
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PreviewMaterial(QWidget* parent, SurfaceMaterial* material);
|
|
|
|
~PreviewMaterial();
|
|
|
|
|
|
|
|
protected:
|
2012-06-17 09:40:40 +00:00
|
|
|
virtual QColor getColor(double x, double y);
|
2012-06-02 14:17:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SmallMaterialPreview* _small;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|