summaryrefslogtreecommitdiffstats
path: root/lib/tqwtplot3d/include/qwt3d_drawable.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tqwtplot3d/include/qwt3d_drawable.h')
-rw-r--r--lib/tqwtplot3d/include/qwt3d_drawable.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/tqwtplot3d/include/qwt3d_drawable.h b/lib/tqwtplot3d/include/qwt3d_drawable.h
new file mode 100644
index 0000000..4324d6c
--- /dev/null
+++ b/lib/tqwtplot3d/include/qwt3d_drawable.h
@@ -0,0 +1,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