From f527cde6342c5b8109a20f0a6b483327c6569844 Mon Sep 17 00:00:00 2001 From: salinasd Date: Tue, 27 Jan 2015 10:20:13 +0000 Subject: 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 --- src/GudhUI/view/Viewer_instructor.h | 108 ++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 src/GudhUI/view/Viewer_instructor.h (limited to 'src/GudhUI/view/Viewer_instructor.h') diff --git a/src/GudhUI/view/Viewer_instructor.h b/src/GudhUI/view/Viewer_instructor.h new file mode 100755 index 00000000..9a2a236b --- /dev/null +++ b/src/GudhUI/view/Viewer_instructor.h @@ -0,0 +1,108 @@ +#ifndef VIEWER_INSTRUCTOR_H +#define VIEWER_INSTRUCTOR_H + +// todo do a viewer instructor that have directely a pointer to a QGLviewer and buffer ot not triangles + + +#include + +#include +#include +#include + + +#include "model/Complex_typedefs.h" + +#include "Projector3D.h" +#include "View_parameter.h" +#include "Viewer.h" + +class Viewer; +class Viewer_parameter; + +class Viewer_instructor : public QWidget{ + Q_OBJECT + + typedef Geometry_trait::Point_3 Point_3; + typedef Complex::Point Point; + typedef Complex::Vertex_handle Vertex_handle; + typedef Complex::Edge_handle Edge_handle; + typedef Complex::Simplex_handle Simplex_handle; + + + Viewer* viewer_; + View_parameter view_params_; + const Complex& mesh_; + std::unique_ptr projector_; + + +public: + + Viewer_instructor(QWidget* parent, + Viewer* viewer, + const Complex& mesh + ); + + + void initialize_bounding_box(); + + std::pair compute_bounding_box_corners(); + + void show_entire_scene(); + + const qglviewer::Camera* camera() const; + + int width() const; + int height() const; + + /** + * to change display parameters + */ + View_parameter& view_params(); + + +public: + + /** + * gives instructions to the viewer + */ + void give_instructions(); + + void draw_edges(); + void draw_triangles(); + void draw_points(); + + + void draw_edge(const Point&,const Point&); + + void draw_point(const Point&); + + + /** + * set the right color of vertex/edge/triangle considering the view_params choice + */ + void set_color_vertex(Vertex_handle vh); + void set_color_edge(Edge_handle eh); + + void set_color_triangle(const Simplex_handle& triangle); + +private: + /** + * Projection to 3D needed for the viewer. + */ + Point_3 proj(const Point& p) const; + + public slots : + + void sceneChanged(); + + void change_draw_vertices(); + void change_draw_edges(); + void change_draw_triangles(); + void change_light(); + + + +}; + +#endif //VIEWER_INSTRUCTOR_H -- cgit v1.2.3