File: qwt3d_drawable.h

package info (click to toggle)
qwtplot3d 0.2.7%2Bsvn191-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 1,304 kB
  • ctags: 1,968
  • sloc: cpp: 8,913; ansic: 5,078; python: 95; makefile: 66; sh: 1
file content (66 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (7)
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:

	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); 

protected:
	
	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