summaryrefslogtreecommitdiff
path: root/src/GudhUI/view/Viewer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/GudhUI/view/Viewer.h')
-rw-r--r--src/GudhUI/view/Viewer.h129
1 files changed, 75 insertions, 54 deletions
diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h
index 00f9b245..99bd63e4 100644
--- a/src/GudhUI/view/Viewer.h
+++ b/src/GudhUI/view/Viewer.h
@@ -1,10 +1,36 @@
-#ifndef VIEWER_H
-#define VIEWER_H
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): David Salinas
+ *
+ * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef VIEW_VIEWER_H
+#define VIEW_VIEWER_H
// Workaround for moc-qt4 not parsing boost headers
#include <CGAL/config.h>
#include <QGLViewer/qglviewer.h>
+
+#include <vector>
+
#include "View_parameter.h"
#include "model/Complex_typedefs.h"
#include "Color.h"
@@ -13,87 +39,82 @@
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);
+ Q_OBJECT
- void set_instructor(Viewer_instructor* instructor_);
+ Viewer_instructor * instructor;
- void show_entire_scene();
+ /**
+ * light angles
+ */
+ double theta, phi;
+ typedef Complex::GT Gudhi_kernel;
+ typedef Gudhi_kernel::Point_3 Point_3;
- void draw();
+ public:
+ Viewer(QWidget* parent);
+ void set_instructor(Viewer_instructor* instructor_);
- void set_bounding_box(const Point_3 & lower_left,const Point_3 & upper_right);
+ void show_entire_scene();
- void update_GL();
+ void draw();
- void init_scene();
+ void set_bounding_box(const Point_3 & lower_left, const Point_3 & upper_right);
- void init_light();
+ void update_GL();
- void set_light();
+ void init_scene();
- void set_light_direction(double theta,double phi);
+ void init_light();
- /**
- * set the light in the direction of the observer
- */
- void set_light_direction();
+ void set_light();
+ void set_light_direction(double theta, double phi);
-protected:
- virtual void postSelection(const QPoint& point);
+ /**
+ * set the light in the direction of the observer
+ */
+ void set_light_direction();
+ protected:
+ virtual void postSelection(const QPoint& point);
-public:
+ public:
+ ////////////////////////
+ // draw
+ ////////////////////////
+ void set_size_point(double size_points);
- ////////////////////////
- // draw
- ////////////////////////
- void set_size_point(double size_points);
+ void set_color(const Color& color);
- void set_color(const Color& color);
+ void draw_point(const Point_3& p, const Color& color, double size_points);
- void draw_point(const Point_3& p,const Color& color,double size_points);
+ void begin_draw_points(double size, bool light = false);
- void begin_draw_points(double size,bool light=false);
+ void draw_points(const Point_3 & point);
- void draw_points(const Point_3 & point);
+ void end_draw_points();
- void end_draw_points();
+ void draw_edge(const Point_3 &a, const Point_3 &b, const Color& color, double size);
- 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 begin_draw_edges(double size,bool light=false);
+ void draw_edges(const Point_3 &a, const Point_3 &b);
- void draw_edges(const Point_3 &a,const Point_3 &b);
+ void end_draw_edges();
- void end_draw_edges();
+ void begin_draw_triangles(double size, bool light, bool transparent = false);
- 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);
- 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);
- //todo remove
- void draw_triangles(const std::vector<Point_3*>& points);
+ void end_draw_triangles();
- void end_draw_triangles();
-
- signals:
- void click(const Point_3& position);
+ signals:
+ void click(const Point_3& position);
};
-
-
-#endif
+#endif // VIEW_VIEWER_H