summaryrefslogtreecommitdiffstats
path: root/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindow.h
blob: 435a325cf85294255789b70faed8c291724cc762 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef mesh2mainwindow_h__2004_03_07_13_38_begin_guarded_code
#define mesh2mainwindow_h__2004_03_07_13_38_begin_guarded_code

#include "../../../include/qwt3d_surfaceplot.h"


#if QT_VERSION < 0x040000
#include "mesh2mainwindowbase.h"
#else
#include "ui_mesh2mainwindowbase4.h"
#include "designerworkaround.h"
#endif



//MOC_SKIP_BEGIN
#if QT_VERSION < 0x040000
  class DummyBase : public Mesh2MainWindowBase
  {
  public:
    DummyBase(QWidget* parent = 0) 
      : Mesh2MainWindowBase(parent) 
    {
    } 
  };
#else
  class DummyBase : public QMainWindow, protected Ui::MainWindow, protected DesignerWorkaround
  {
  public:
    DummyBase(QWidget* parent = 0) 
      : QMainWindow(parent) 
    {
    } 
  };
#endif
//MOC_SKIP_END

class QLabel;
class QTimer;
class QAction;
class QFileDialog;
class LightingDlg;
class ColorMapPreview;

class Mesh2MainWindow : public DummyBase
{
	Q_OBJECT
public:
	Mesh2MainWindow( QWidget* parent = 0 );
	~Mesh2MainWindow();

  Qwt3D::SurfacePlot* dataWidget;
	
public slots:
	void open();
	void openMesh();

	void createFunction(QString const& name);
	void createPSurface(QString const& name);
	void setFileType(QString const& name);

	void pickCoordSystem( QAction* );
	void pickPlotStyle( QAction* );
	void pickFloorStyle( QAction* );
	void pickAxesColor();
	void pickBgColor();
	void pickMeshColor();
	void pickNumberColor();
	void pickLabelColor();
	void pickTitleColor();
	void pickDataColor();
	void pickLighting();
	void resetColors();
	void pickNumberFont();
	void pickLabelFont();
	void pickTitleFont();
	void resetFonts();
 	void setStandardView();
	void dumpImage();
	void toggleAnimation(bool);
	void toggleProjectionMode(bool);
	void toggleColorLegend(bool);
	void toggleAutoScale(bool val);
	void toggleShader(bool val);
	void rotate();
	void setPolygonOffset(int);

	void showRotate(double x, double y, double z);
	void showShift(double x, double y);
	void showScale(double x, double y, double z);
	void showZoom(double z);
	void showNormals(bool val);
	void setNormalQuality(int);
	void setNormalLength(int);
	bool openColorMap(Qwt3D::ColorVector& cv, QString fname);
	void adaptDataColors(const QString&);
	void updateColorLegend(int majors, int minors);

	void setLeftGrid( bool b );
	void setRightGrid( bool b );
	void setCeilGrid( bool b );
	void setFloorGrid( bool b );
	void setFrontGrid( bool b );
	void setBackGrid( bool b );
  void setGrid( Qwt3D::SIDE, bool );

  void enableLighting(bool val);

private:
	QLabel *filenameWidget, *dimWidget,
		*rotateLabel, *shiftLabel, *scaleLabel, *zoomLabel;
	
	QTimer* timer;
	int redrawWait;

	QAction* activeCoordSystem;

	bool legend_;
	Qwt3D::StandardColor* col_;

	QFileDialog* datacolordlg_;
    LightingDlg* lightingdlg_;
	QString filetype_;

    // convenience compatib. code
    bool connectA (const QObject* sender, const char * slot);
    bool connectAG (const QObject* sender, const char * slot);

#if QT_VERSION < 0x040000
	ColorMapPreview* colormappv_;
#endif
};

#endif /* include guarded */