diff options
author | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-04-16 07:44:05 +0000 |
---|---|---|
committer | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-04-16 07:44:05 +0000 |
commit | 4a88c2b8532ab2ebeeccb76b488abeecd4a4a658 (patch) | |
tree | 6c61c4bb9e0db78d6434639ce20db1eba35e8b3f /src/GudhUI | |
parent | 351059be74b4f613d798ca4364a0e37202c3f378 (diff) |
Less CRLF line endings.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1135 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 83328005a983668b00961f069672e97493e42a34
Diffstat (limited to 'src/GudhUI')
-rw-r--r-- | src/GudhUI/gui/MenuEdgeContraction.ui | 236 | ||||
-rw-r--r-- | src/GudhUI/gui/gudhui.cpp | 76 | ||||
-rw-r--r-- | src/GudhUI/view/Viewer.h | 240 | ||||
-rw-r--r-- | src/GudhUI/view/Viewer_instructor.h | 234 |
4 files changed, 393 insertions, 393 deletions
diff --git a/src/GudhUI/gui/MenuEdgeContraction.ui b/src/GudhUI/gui/MenuEdgeContraction.ui index da2e5c82..b1696431 100644 --- a/src/GudhUI/gui/MenuEdgeContraction.ui +++ b/src/GudhUI/gui/MenuEdgeContraction.ui @@ -1,118 +1,118 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MenuEdgeContraction</class>
- <widget class="QDialog" name="MenuEdgeContraction">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>362</width>
- <height>209</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Edge contraction</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="5" column="2">
- <widget class="QSpinBox" name="spinBox_nb_remaining_vertices">
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>999999999</number>
- </property>
- <property name="value">
- <number>1</number>
- </property>
- </widget>
- </item>
- <item row="7" column="2">
- <widget class="QCheckBox" name="checkBox_link_condition">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Link condition</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="2" alignment="Qt::AlignRight">
- <widget class="QLabel" name="txt_nb_collapses">
- <property name="text">
- <string>1</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Policy</string>
- </property>
- </widget>
- </item>
- <item row="6" column="2">
- <widget class="QComboBox" name="m_simplificationMethod">
- <item>
- <property name="text">
- <string>Length_midpoint</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="2" column="2" alignment="Qt::AlignRight">
- <widget class="QLabel" name="txt_nb_vertices">
- <property name="text">
- <string>0</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Number of vertices</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="2">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Number of contractions</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0" colspan="2">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Number of vertices after </string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QSlider" name="horizontalSlider">
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QPushButton" name="pushButton_collapse">
- <property name="text">
- <string>Perform collapse</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MenuEdgeContraction</class> + <widget class="QDialog" name="MenuEdgeContraction"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>362</width> + <height>209</height> + </rect> + </property> + <property name="windowTitle"> + <string>Edge contraction</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="5" column="2"> + <widget class="QSpinBox" name="spinBox_nb_remaining_vertices"> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>999999999</number> + </property> + <property name="value"> + <number>1</number> + </property> + </widget> + </item> + <item row="7" column="2"> + <widget class="QCheckBox" name="checkBox_link_condition"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Link condition</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="3" column="2" alignment="Qt::AlignRight"> + <widget class="QLabel" name="txt_nb_collapses"> + <property name="text"> + <string>1</string> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Policy</string> + </property> + </widget> + </item> + <item row="6" column="2"> + <widget class="QComboBox" name="m_simplificationMethod"> + <item> + <property name="text"> + <string>Length_midpoint</string> + </property> + </item> + </widget> + </item> + <item row="2" column="2" alignment="Qt::AlignRight"> + <widget class="QLabel" name="txt_nb_vertices"> + <property name="text"> + <string>0</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Number of vertices</string> + </property> + </widget> + </item> + <item row="3" column="0" colspan="2"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Number of contractions</string> + </property> + </widget> + </item> + <item row="5" column="0" colspan="2"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Number of vertices after </string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QSlider" name="horizontalSlider"> + <property name="minimum"> + <number>0</number> + </property> + <property name="maximum"> + <number>100</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QPushButton" name="pushButton_collapse"> + <property name="text"> + <string>Perform collapse</string> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/src/GudhUI/gui/gudhui.cpp b/src/GudhUI/gui/gudhui.cpp index 377cd2f2..276c4a5f 100644 --- a/src/GudhUI/gui/gudhui.cpp +++ b/src/GudhUI/gui/gudhui.cpp @@ -1,38 +1,38 @@ -/* 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/>.
- *
- */
-
-#include "MainWindow.h"
-#include <QApplication>
-#include <CGAL/Qt/resources.h>
-
-int main(int argc, char** argv) {
- QApplication application(argc, argv);
- application.setOrganizationDomain("inria.fr");
- application.setOrganizationName("INRIA");
- application.setApplicationName("GudhUI");
-
- MainWindow mw;
- application.setQuitOnLastWindowClosed(false);
- mw.show();
- return application.exec();
-}
+/* 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/>. + * + */ + +#include "MainWindow.h" +#include <QApplication> +#include <CGAL/Qt/resources.h> + +int main(int argc, char** argv) { + QApplication application(argc, argv); + application.setOrganizationDomain("inria.fr"); + application.setOrganizationName("INRIA"); + application.setApplicationName("GudhUI"); + + MainWindow mw; + application.setQuitOnLastWindowClosed(false); + mw.show(); + return application.exec(); +} diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h index 276ccd3c..319c8e04 100644 --- a/src/GudhUI/view/Viewer.h +++ b/src/GudhUI/view/Viewer.h @@ -1,120 +1,120 @@ -/* 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"
-#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 // VIEW_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" +#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 // VIEW_VIEWER_H_ diff --git a/src/GudhUI/view/Viewer_instructor.h b/src/GudhUI/view/Viewer_instructor.h index 82c8e346..1da28009 100644 --- a/src/GudhUI/view/Viewer_instructor.h +++ b/src/GudhUI/view/Viewer_instructor.h @@ -1,117 +1,117 @@ -/* 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_INSTRUCTOR_H_
-#define VIEW_VIEWER_INSTRUCTOR_H_
-
-// todo do a viewer instructor that have directely a pointer to a QGLviewer and buffer ot not triangles
-
-// Workaround for moc-qt4 not parsing boost headers
-#include <CGAL/config.h>
-
-#include <QFileDialog>
-#include <QKeyEvent>
-#include <QGLViewer/camera.h>
-
-#include <memory>
-#include <utility> // for pair<>
-
-#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 Simplex;
-
- Viewer* viewer_;
- View_parameter view_params_;
- const Complex& mesh_;
- std::unique_ptr<Projector3D> projector_;
-
- public:
- Viewer_instructor(QWidget* parent, Viewer* viewer, const Complex& mesh);
-
- void initialize_bounding_box();
-
- std::pair<Point, Point> 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& 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 // VIEW_VIEWER_INSTRUCTOR_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_INSTRUCTOR_H_ +#define VIEW_VIEWER_INSTRUCTOR_H_ + +// todo do a viewer instructor that have directely a pointer to a QGLviewer and buffer ot not triangles + +// Workaround for moc-qt4 not parsing boost headers +#include <CGAL/config.h> + +#include <QFileDialog> +#include <QKeyEvent> +#include <QGLViewer/camera.h> + +#include <memory> +#include <utility> // for pair<> + +#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 Simplex; + + Viewer* viewer_; + View_parameter view_params_; + const Complex& mesh_; + std::unique_ptr<Projector3D> projector_; + + public: + Viewer_instructor(QWidget* parent, Viewer* viewer, const Complex& mesh); + + void initialize_bounding_box(); + + std::pair<Point, Point> 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& 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 // VIEW_VIEWER_INSTRUCTOR_H_ |