File: qwt3d_drawable.h

package info (click to toggle)
qtiplot 0.9.8.9-15
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,196 kB
  • ctags: 15,690
  • sloc: cpp: 129,846; ansic: 5,781; python: 861; makefile: 56
file content (66 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (5)
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
#ifndef __DRAWABLE_H__
#define __DRAWABLE_H__


#include <list>
#include "qwt3d_global.h"
#include "qwt3d_types.h"
#include "qwt3d_io_gl2ps.h"

namespace Qwt3D
{

//! ABC for Drawables
class QWT3D_EXPORT Drawable 
{

public:
	Drawable(Plot3D *plot = 0){d_plot = plot;};
	virtual ~Drawable() = 0;
	virtual void draw();

	virtual void saveGLState();
	virtual void restoreGLState();

	void attach(Drawable*);
	void detach(Drawable*);
	void detachAll();

	virtual void setColor(double r, double g, double b, double a = 1);	
	virtual void setColor(Qwt3D::RGBA rgba);	
	Qwt3D::Triple relativePosition(Qwt3D::Triple rel);

	Plot3D *plot(){return d_plot;};
	virtual void setPlot(Plot3D *plot){d_plot = plot;};

protected:
	Plot3D *d_plot;
	Qwt3D::RGBA color;
	void Enable(GLenum what, GLboolean val);
	Qwt3D::Triple ViewPort2World(Qwt3D::Triple win, bool* err = 0);
	Qwt3D::Triple World2ViewPort(Qwt3D::Triple obj, bool* err = 0);

	GLdouble modelMatrix[16];
	GLdouble projMatrix[16];
	GLint viewport[4];

private:
	GLboolean	ls;
	GLboolean	pols;
	GLint		polmode[2];
	GLfloat		lw;
	GLint		blsrc, bldst;
	GLdouble	col[4];
	GLint		pattern, factor;
	GLboolean	sallowed;
	GLboolean	tex2d;
	GLint		matrixmode;
	GLfloat		poloffs[2];
	GLboolean	poloffsfill;

	std::list<Drawable*> dlist;
};

} // ns

#endif