summaryrefslogtreecommitdiff
path: root/src/GudhUI/view/Viewer.h
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-01-27 10:20:13 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-01-27 10:20:13 +0000
commitf527cde6342c5b8109a20f0a6b483327c6569844 (patch)
tree1c0464b56b21ef7767f814b9a35a6e5c68aa7613 /src/GudhUI/view/Viewer.h
parentdf6c26bdcb28805e8949d08dad5acd012e91ecb8 (diff)
Merge GudhUI, a UI for gudhi based on Qt
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@427 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 17fedd974f14a8225b27d94361e835964eeb5cba
Diffstat (limited to 'src/GudhUI/view/Viewer.h')
-rwxr-xr-xsrc/GudhUI/view/Viewer.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h
new file mode 100755
index 00000000..5639aa56
--- /dev/null
+++ b/src/GudhUI/view/Viewer.h
@@ -0,0 +1,96 @@
+#ifndef VIEWER_H
+#define VIEWER_H
+
+#include <QGLViewer/qglviewer.h>
+#include "View_parameter.h"
+#include "model/Complex_typedefs.h"
+#include "Color.h"
+#include "Viewer_instructor.h"
+
+class Viewer_instructor;
+
+class Viewer : public QGLViewer {
+ Q_OBJECT
+
+ Viewer_instructor * instructor;
+
+ /**
+ * light angles
+ */
+ double theta,phi;
+ typedef Complex::GT Gudhi_kernel;
+ typedef Gudhi_kernel::Point_3 Point_3;
+public:
+ Viewer(QWidget* parent);
+
+ void set_instructor(Viewer_instructor* instructor_);
+
+ void show_entire_scene();
+
+ void draw();
+
+
+ void set_bounding_box(const Point_3 & lower_left,const Point_3 & upper_right);
+
+ void update_GL();
+
+ void init_scene();
+
+ void init_light();
+
+ void set_light();
+
+ void set_light_direction(double theta,double phi);
+
+ /**
+ * set the light in the direction of the observer
+ */
+ void set_light_direction();
+
+
+protected:
+ virtual void postSelection(const QPoint& point);
+
+
+public:
+
+ ////////////////////////
+ // draw
+ ////////////////////////
+ void set_size_point(double size_points);
+
+ void set_color(const Color& color);
+
+ void draw_point(const Point_3& p,const Color& color,double size_points);
+
+ void begin_draw_points(double size,bool light=false);
+
+ void draw_points(const Point_3 & point);
+
+ void end_draw_points();
+
+ void draw_edge(const Point_3 &a,const Point_3 &b,const Color& color,double size);
+
+ void begin_draw_edges(double size,bool light=false);
+
+ void draw_edges(const Point_3 &a,const Point_3 &b);
+
+ void end_draw_edges();
+
+ void begin_draw_triangles(double size,bool light,bool transparent = false);
+
+ void draw_triangles(const Point_3& p1,const Point_3& p2,const Point_3& p3);
+
+ //todo remove
+ void draw_triangles(const std::vector<Point_3*>& points);
+
+ void end_draw_triangles();
+
+
+ signals:
+ void click(const Point_3& position);
+};
+
+
+
+#endif