Viewer_instructor.h
1 /* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
2  * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
3  * Author(s): David Salinas
4  *
5  * Copyright (C) 2014 Inria
6  *
7  * Modification(s):
8  * - YYYY/MM Author: Description of the modification
9  */
10 
11 #ifndef VIEW_VIEWER_INSTRUCTOR_H_
12 #define VIEW_VIEWER_INSTRUCTOR_H_
13 
14 // todo do a viewer instructor that have directely a pointer to a QGLviewer and buffer ot not triangles
15 
16 #include <QFileDialog>
17 #include <QKeyEvent>
18 #include <QGLViewer/camera.h>
19 
20 #include <memory>
21 #include <utility> // for pair<>
22 
23 #include "model/Complex_typedefs.h"
24 
25 #include "Projector3D.h"
26 #include "View_parameter.h"
27 #include "Viewer.h"
28 
29 class Viewer;
30 class Viewer_parameter;
31 
32 class Viewer_instructor : public QWidget {
33  Q_OBJECT
34 
35  typedef Geometry_trait::Point_3 Point_3;
36  typedef Complex::Point Point;
38  typedef Complex::Edge_handle Edge_handle;
39  typedef Complex::Simplex Simplex;
40 
41  Viewer* viewer_;
42  View_parameter view_params_;
43  const Complex& mesh_;
44  std::unique_ptr<Projector3D> projector_;
45 
46  public:
47  Viewer_instructor(QWidget* parent, Viewer* viewer, const Complex& mesh);
48 
49  void initialize_bounding_box();
50 
51  std::pair<Point, Point> compute_bounding_box_corners();
52 
53  void show_entire_scene();
54 
55  const qglviewer::Camera* camera() const;
56 
57  int width() const;
58  int height() const;
59 
63  View_parameter& view_params();
64 
65  public:
69  void give_instructions();
70 
71  void draw_edges();
72  void draw_triangles();
73  void draw_points();
74 
75  void draw_edge(const Point&, const Point&);
76 
77  void draw_point(const Point&);
78 
82  void set_color_vertex(Vertex_handle vh);
83  void set_color_edge(Edge_handle eh);
84 
85  void set_color_triangle(const Simplex& triangle);
86 
87  private:
91  Point_3 proj(const Point& p) const;
92 
93  public slots:
94  void sceneChanged();
95  void change_draw_vertices();
96  void change_draw_edges();
97  void change_draw_triangles();
98  void change_light();
99 };
100 
101 #endif // VIEW_VIEWER_INSTRUCTOR_H_
Abstract simplex used in Skeleton blockers data-structure.
Definition: Skeleton_blocker_simplex.h:38
Definition: View_parameter.h:20
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:15
GUDHIdev  Version 3.5.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : MIT Generated on Sun May 1 2022 09:19:32 for GUDHIdev by Doxygen 1.9.1