summaryrefslogtreecommitdiffstats
path: root/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.h
blob: 2dd79b198a20291dda3583b29a3808dcb8e4bb35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef lightingdlg_h__2004_03_07_13_35_begin_guarded_code
#define lightingdlg_h__2004_03_07_13_35_begin_guarded_code

#include <math.h>
#include <qapplication.h>
#include "../../../include/qwt3d_parametricsurface.h"
#include "../../../include/qwt3d_surfaceplot.h"
#include "../../../include/qwt3d_enrichment.h"
#include "../../../include/qwt3d_color.h"

#if QT_VERSION < 0x040000
#include "lightingdlgbase.h"
#else
#include "ui_lightingdlgbase4.h"
#endif

class Pointer : public Qwt3D::VertexEnrichment
{
public:
  Pointer(double rad);
  ~Pointer();

  Qwt3D::Enrichment* clone() const {return new Pointer(*this);}
  
  void configure(double rad);
  void drawBegin();
  void draw(Qwt3D::Triple const&){}
  void setPos(double x, double y, double z) {pos_ = Qwt3D::Triple(x,y,z);}

private:
  double radius_;
  Qwt3D::Triple pos_;
};

struct SColor : public Qwt3D::Color
{
  Qwt3D::RGBA operator()(double, double, double) const {return Qwt3D::RGBA(0.8,0,0,0.5);}
};

typedef Qwt3D::SurfacePlot SPlot; // moc/VC6 issue in Qt 4.0.0

class Plot : public SPlot
{
  Q_OBJECT
    
public:
  Plot(QWidget* parent);
  Pointer* stick;
  void reset();
};

//MOC_SKIP_BEGIN
#if QT_VERSION < 0x040000
  class LightingBase : public LightingDlgBase
  {
  public:
    LightingBase(QWidget* parent = 0) 
      : LightingDlgBase(parent) 
    {
    } 
  };
#else
  class LightingBase : public QDialog, protected Ui::Dialog
  {
  public:
    LightingBase(QWidget* parent = 0) 
      : QDialog(parent) 
    {
    } 
  };
#endif
//MOC_SKIP_END



class LightingDlg : public LightingBase
{
	Q_OBJECT
    
public:
  LightingDlg(QWidget *parent=0);
  ~LightingDlg();

  void assign(Qwt3D::Plot3D* pl);
  
  Plot* plot;
  Qwt3D::Plot3D* dataPlot;

public slots:
	void setDistance(int);
	void setEmission(int);
	void setDiff(int);
	void setSpec(int);
	void setShin(int);
  void reset();
  void setRotation(double x, double y, double z);
};

    
#endif /* include guarded */