Files
cgal/GraphicsView/include/CGAL/Qt/DemosMainWindow.h
T
Maxime Gimeno a0e7a60973 Merge remote-tracking branch 'cgal/master' into CGAL-Qt5_support-GF
Conflicts:
	Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt
	Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp
	Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h
	GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt
	GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt
	GraphicsView/demo/Bounding_volumes/CMakeLists.txt
	GraphicsView/demo/Circular_kernel_2/CMakeLists.txt
	GraphicsView/demo/Generator/CMakeLists.txt
	GraphicsView/demo/GraphicsView/CMakeLists.txt
	GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt
	GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt
	GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt
	GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt
	GraphicsView/demo/Snap_rounding_2/CMakeLists.txt
	GraphicsView/demo/Spatial_searching_2/CMakeLists.txt
	GraphicsView/demo/Stream_lines_2/CMakeLists.txt
	GraphicsView/demo/Triangulation_2/CMakeLists.txt
	Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt
	Mesh_3/demo/Mesh_3/CMakeLists.txt
	Mesh_3/demo/Mesh_3/include/CGAL_demo/Scene_item_with_display_list.h
	Mesh_3/demo/Mesh_3/src/CGAL_demo/Scene.cpp
	Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt
	Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp
	Polyhedron/demo/Polyhedron/CMakeLists.txt
	Polyhedron/demo/Polyhedron/Polyhedron_demo_join_and_split_polyhedra_plugin.cpp
	Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_3_plugin.cpp
	Polyhedron/demo/Polyhedron/Polyhedron_demo_trivial_plugin.cpp
	Polyhedron/demo/Polyhedron/Scene.cpp
	Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h
	Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h
	Polyhedron/demo/Polyhedron/Scene_plane_item.h
	Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp
	Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp
	Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h
	Polyhedron/demo/Polyhedron/Scene_polyhedron_transform_item.h
	Polyhedron/demo/Polyhedron/Scene_polylines_item.h
	Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt
	Surface_mesher/demo/Surface_mesher/CMakeLists.txt
	Triangulation_3/demo/Triangulation_3/CMakeLists.txt
	Triangulation_3/demo/Triangulation_3/MainWindow.cpp
2015-06-30 09:17:26 +02:00

131 lines
3.3 KiB
C++

// Copyright (c) 2008 GeometryFactory Sarl (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Andreas Fabri <Andreas.Fabri@geometryfactory.com>
// Laurent Rineau <Laurent.Rineau@geometryfactory.com>
#ifndef CGAL_QT_DEMOS_MAIN_WINDOW_H
#define CGAL_QT_DEMOS_MAIN_WINDOW_H
#include <iostream>
#include <QVector>
#include <QMainWindow>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <CGAL/auto_link/Qt.h>
#include <CGAL/export/Qt.h>
#include <CGAL/Qt/resources.h>
// forward declaration
class QLabel;
class QGraphicsView;
class QAction;
class QMenu;
namespace CGAL {
namespace Qt {
// forward declaration
class GraphicsViewNavigation;
class CGAL_QT_EXPORT DemosMainWindow : public QMainWindow
{
Q_OBJECT
public:
enum Option { NoOption = 0x0,
Size = 0x1,
Position = 0x2,
State = 0x4};
Q_DECLARE_FLAGS(Options, Option)
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
virtual void open(QString)
{
std::cerr << "You should implement open(QString);" << std::endl;
}
public:
unsigned int maxNumberOfRecentFiles() const ;
public Q_SLOTS:
void setMaxNumberOfRecentFiles(const unsigned int);
private:
QMenu* getMenu(QString objectName, QString title);
void popupAboutBox(QString title, QString html_resource_name);
QMenu* getHelpMenu();
protected:
DemosMainWindow (QWidget * parent = 0, ::Qt::WindowFlags flags = 0 );
~DemosMainWindow();
void setupStatusBar();
void addNavigation(QGraphicsView*);
void setupOptionsMenu(QMenu* menu = 0);
void addAboutCGAL(QMenu* menu = 0);
void addAboutDemo(QString htmlResourceName, QMenu* menu = 0);
void setupExportSVG(QAction*, QGraphicsView*);
void addRecentFiles(QMenu* menu, QAction* insertBefore = 0);
void writeState(QString groupname = "MainWindow");
void readState(QString groupname = "MainWindow",
Options what_to_save = Options(Size|State));
protected Q_SLOTS:
void setUseAntialiasing(bool checked);
void setUseOpenGL(bool checked);
void popupAboutCGAL();
void popupAboutDemo();
void exportSVG();
void openRecentFile_aux();
void addToRecentFiles(QString fileName);
void updateRecentFileActions();
Q_SIGNALS:
void openRecentFile(QString filename);
protected:
QGraphicsView* view;
GraphicsViewNavigation* navigation;
QLabel* xycoord ;
QAction *actionUse_OpenGL;
QAction *actionUse_Antialiasing;
QAction *actionAbout;
QAction *actionAboutCGAL;
QString aboutHtmlResource;
QAction* recentFilesSeparator;
unsigned int maxNumRecentFiles;
QVector<QAction*> recentFileActs;
}; // end class DemosMainWindow
} // namespace Qt
} // namespace CGAL
Q_DECLARE_OPERATORS_FOR_FLAGS(CGAL::Qt::DemosMainWindow::Options)
#endif // CGAL_QT_DEMOS_MAIN_WINDOW_H