Some modification of CGAL Graphic view to a better compatibility of Windows with the Qt5 version of CGAL (especially about dll import and export stuff).

This commit is contained in:
Aurelien Vialon 2014-07-17 01:55:07 +02:00
parent a3a84ce2e8
commit c3aaf0bffe
14 changed files with 79 additions and 53 deletions

View File

@ -20,8 +20,6 @@ if(USE_QT5)
find_package(Qt5)
else (USE_QT5)
find_package(CGAL COMPONENTS Core Qt4 )
@ -45,13 +43,14 @@ if ( CGAL_FOUND AND (QT4 OR QT5) )
# Arrangement package includes
include_directories( BEFORE ../../include )
if(QT4)
qt_wrap_ui( arrangement_2_uis
ArrangementDemoWindow.ui
# NewTabDialog.ui
NewTabDialog.ui
OverlayDialog.ui
ArrangementDemoPropertiesDialog.ui
)
if(QT4)
qt_wrap_cpp( arrangement_2_mocs
ArrangementDemoWindow.h
ArrangementDemoTab.h
@ -64,7 +63,7 @@ if ( CGAL_FOUND AND (QT4 OR QT5) )
PropertyValueDelegate.h
# PropertyValueDelegate.cpp
)
endif(QT4)
endif()
qt_add_resources( arrangement_2_resources
ArrangementDemoWindow.qrc

View File

@ -17,20 +17,20 @@
//
// Author(s) : Laurent Rineau
#ifndef CGAL_QT4_CONFIG_H
#define CGAL_QT4_CONFIG_H
#ifndef CGAL_QT_CONFIG_H
#define CGAL_QT_CONFIG_H
#include <QtCore/qglobal.h>
#if defined(CGAL_Qt4_DLL) || defined(CGAL_Qt5_DLL)
# if defined(CGAL_Qt4_EXPORTS) || defined(CGAL_Qt5_EXPORTS)
# define CGAL_QT4_EXPORT Q_DECL_EXPORT
# define CGAL_QT_EXPORT Q_DECL_EXPORT
# else
# define CGAL_QT4_EXPORT Q_DECL_IMPORT
# define CGAL_QT_EXPORT Q_DECL_IMPORT
# endif
#else
// empty definition
# define CGAL_QT4_EXPORT
# define CGAL_QT_EXPORT
#endif
#endif // CGAL_QT4_CONFIG_H
#endif // CGAL_QT_CONFIG_H

View File

@ -28,7 +28,7 @@
#include <list>
#include <CGAL/intersection_2.h>
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/auto_link/Qt.h>
#include <boost/mpl/has_xxx.hpp>
@ -182,6 +182,6 @@ public:
};
} // namesapce Qt
} // namespace Qt
} // namespace CGAL
#endif // CGAL_QT_CONVERTER_H

View File

@ -26,8 +26,9 @@
#include <QMainWindow>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt.h>
#include <CGAL/export/Qt.h>
#include <CGAL/Qt/resources.h>
// forward declaration
@ -42,7 +43,7 @@ namespace Qt {
// forward declaration
class GraphicsViewNavigation;
class CGAL_QT4_EXPORT DemosMainWindow : public QMainWindow
class CGAL_QT_EXPORT DemosMainWindow : public QMainWindow
{
Q_OBJECT

View File

@ -22,8 +22,9 @@
#ifndef CGAL_QT_GRAPHICS_ITEM_H
#define CGAL_QT_GRAPHICS_ITEM_H
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt.h>
#include <CGAL/auto_link/Qt.h>
#include <QObject>
#include <QGraphicsItem>
#ifndef Q_MOC_RUN
@ -35,7 +36,7 @@
namespace CGAL {
namespace Qt {
class CGAL_QT4_EXPORT GraphicsItem : public QObject, public QGraphicsItem {
class CGAL_QT_EXPORT GraphicsItem : public QObject, public QGraphicsItem {
Q_OBJECT
#if QT_VERSION >= 0x040600

View File

@ -22,8 +22,10 @@
#ifndef CGAL_QT_GRAPHICS_VIEW_INPUT_H
#define CGAL_QT_GRAPHICS_VIEW_INPUT_H
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt.h>
#include <CGAL/auto_link/Qt.h>
#ifndef Q_MOC_RUN
# include <CGAL/Object.h>
#endif
@ -31,7 +33,7 @@
namespace CGAL {
namespace Qt {
class CGAL_QT4_EXPORT GraphicsViewInput : public QObject
class CGAL_QT_EXPORT GraphicsViewInput : public QObject
{
Q_OBJECT

View File

@ -22,8 +22,9 @@
#ifndef CGAL_QT_GRAPHICS_VIEW_NAVIGATION_H
#define CGAL_QT_GRAPHICS_VIEW_NAVIGATION_H
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt.h>
#include <CGAL/export/Qt.h>
#include <QObject>
#include <QPointF>
#include <QString>
@ -39,7 +40,7 @@ class QGraphicsRectItem;
namespace CGAL {
namespace Qt {
class CGAL_QT4_EXPORT GraphicsViewNavigation: public QObject {
class CGAL_QT_EXPORT GraphicsViewNavigation: public QObject {
Q_OBJECT

View File

@ -22,8 +22,9 @@
#ifndef CGAL_QT_GRAPHICS_VIEW_POLYLINE_INPUT_H
#define CGAL_QT_GRAPHICS_VIEW_POLYLINE_INPUT_H
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt.h>
#include <CGAL/export/Qt.h>
#include <QPolygonF>
#include <QPointF>
@ -41,7 +42,7 @@ class QObject;
namespace CGAL {
namespace Qt {
class CGAL_QT4_EXPORT GraphicsViewPolylineInput_non_templated_base : public GraphicsViewInput
class CGAL_QT_EXPORT GraphicsViewPolylineInput_non_templated_base : public GraphicsViewInput
{
public:
void setNumberOfVertices(int n)

View File

@ -22,8 +22,9 @@
#ifndef CGAL_QT_DEBUG_H
#define CGAL_QT_DEBUG_H
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt.h>
#include <CGAL/export/Qt.h>
#include <QString>
namespace CGAL {
@ -36,7 +37,7 @@ namespace Qt {
* CGAL::Qt:traverse_resources(":"); // view all resources
* and displays the resources tree on std::cerr.
*/
CGAL_QT4_EXPORT void traverse_resources(const QString& name,
CGAL_QT_EXPORT void traverse_resources(const QString& name,
const QString& dirname = QString(),
int indent = 0);

View File

@ -21,11 +21,11 @@
#ifndef CGAL_QT_RESOURCES_H
#define CGAL_QT_RESOURCES_H
#include <CGAL/export/Qt4.h>
#include <CGAL/export/Qt.h>
// cannot use namespaces because of the Q_INIT_RESOURCE macro
//New for Qt5 version !
CGAL_QT4_EXPORT void CGAL_Qt_init_resources();
CGAL_QT_EXPORT void CGAL_Qt_init_resources();
//New for Qt5 version !
#define CGAL_QT_INIT_RESOURCES do { CGAL_Qt_init_resources(); } while(0)

View File

@ -24,8 +24,9 @@
#include <QRectF>
#include <QRect>
#include <CGAL/auto_link/Qt4.h>
#include <CGAL/export/Qt4.h>
#include <CGAL/auto_link/Qt.h>
#include <CGAL/export/Qt.h>
class QGraphicsScene;
class QGraphicsView;
@ -33,8 +34,8 @@ class QGraphicsView;
namespace CGAL {
namespace Qt {
CGAL_QT4_EXPORT QRectF mapToScene(const QGraphicsView* v, const QRect rect);
CGAL_QT4_EXPORT QRectF viewportsBbox(const QGraphicsScene*);
CGAL_QT_EXPORT QRectF mapToScene(const QGraphicsView* v, const QRect rect);
CGAL_QT_EXPORT QRectF viewportsBbox(const QGraphicsScene*);
} // namespace Qt
} // namespace CGAL

View File

@ -17,16 +17,17 @@
//
// Author(s) : Laurent Rineau
#ifndef CGAL_AUTO_LINK_QT4_H
#define CGAL_AUTO_LINK_QT4_H
#ifndef CGAL_AUTO_LINK_QT_H
#define CGAL_AUTO_LINK_QT_H
#include <CGAL/config.h>
#include <QtCore/qglobal.h>
#ifndef CGAL_NO_AUTOLINK_QT4
#if (! defined (CGAL_NO_AUTOLINK_QT4)) && ((!defined CGAL_NO_AUTOLINK_QT5))
#if ( ! defined( CGAL_EXPORTS ) ) && (! defined ( CGAL_Qt4_EXPORTS ) && (! defined (CGAL_Qt5_EXPORTS) ) )
// If CGAL_EXPORTS is defined it means that we are building the CGAL
// library as a DLL. The CGAL.dll does not really depend on CGAL_Qt4,
// library as a DLL. The CGAL.dll does not really depend on CGAL_Qt,
// whatever the header inclusion graph says.
//New for Qt5 version !
@ -39,6 +40,6 @@
#include <CGAL/auto_link/auto_link.h>
#endif // CGAL_EXPORTS
#endif // CGAL_NO_AUTOLINK_QT4
#endif // CGAL_NO_AUTOLINK_QT
#endif // CGAL_AUTO_LINK_QT4_H
#endif // CGAL_AUTO_LINK_QT_H

View File

@ -17,9 +17,8 @@
//
// Author(s) : Andreas Fabri
#ifndef CGAL_QT4_EXPORT_H
#define CGAL_QT4_EXPORT_H
#ifndef CGAL_QT_EXPORT_H
#define CGAL_QT_EXPORT_H
#include <CGAL/config.h>
#include <CGAL/export/helpers.h>
@ -28,20 +27,20 @@
# if defined(CGAL_Qt4_EXPORTS) || defined(CGAL_Qt5_EXPORTS) // defined by CMake or in cpp files of the dll
# define CGAL_QT4_EXPORT CGAL_DLL_EXPORT
# define CGAL_QT4_EXPIMP_TEMPLATE
# define CGAL_QT_EXPORT CGAL_DLL_EXPORT
# define CGAL_QT_EXPIMP_TEMPLATE
# else // not CGAL_Qt4_EXPORTS
# define CGAL_QT4_EXPORT CGAL_DLL_IMPORT
# define CGAL_QT4_EXPIMP_TEMPLATE extern
# define CGAL_QT_EXPORT CGAL_DLL_IMPORT
# define CGAL_QT_EXPIMP_TEMPLATE extern
# endif // not CGAL_QT4_EXPORTS
#else // not CGAL_BUILD_SHARED_LIBS
# define CGAL_QT4_EXPORT
# define CGAL_QT4_EXPIMP_TEMPLATE
# define CGAL_QT_EXPORT
# define CGAL_QT_EXPIMP_TEMPLATE
#endif // not CGAL_BUILD_SHARED_LIBS

View File

@ -334,13 +334,23 @@ if(QT4)
target_link_libraries(${IO_IMPLICIT_FUNCTION_PLUGIN_LIB} ${SCENE_IMPLICIT_FUNCTION_ITEM_LIB})
set(MESH_3_PLUGIN_LIB "${MESH_3_LIB_PREFIX}mesh_3_plugin")
if(QT5)
polyhedron_demo_plugin(${MESH_3_PLUGIN_LIB} Mesh_3_plugin
Mesh_3_plugin_polyhedron_cgal_code.cpp
Mesh_3_plugin_image_cgal_code.cpp
Mesh_3_plugin_implicit_function_cgal_code.cpp
Meshing_thread.cpp
${meshingUI_FILES})
elseif(QT4)
polyhedron_demo_plugin(${MESH_3_PLUGIN_LIB} Mesh_3_plugin
Mesh_3_plugin_polyhedron_cgal_code.cpp
Mesh_3_plugin_image_cgal_code.cpp
Mesh_3_plugin_implicit_function_cgal_code.cpp
Meshing_thread.cpp
Scene_c3t3_item.moc
${meshingUI_FILES})
endif()
target_link_libraries(${MESH_3_PLUGIN_LIB}
${SCENE_C3T3_ITEM_LIB}
@ -352,11 +362,20 @@ if(QT4)
${OPENGL_glu_LIBRARY})
set(MESH_3_OPTIMIZATION_PLUGIN_LIB "${MESH_3_LIB_PREFIX}mesh_3_optimization_plugin")
polyhedron_demo_plugin(${MESH_3_OPTIMIZATION_PLUGIN_LIB} Mesh_3_optimization_plugin
if(QT5)
polyhedron_demo_plugin(${MESH_3_OPTIMIZATION_PLUGIN_LIB} Mesh_3_optimization_plugin
Mesh_3_optimization_plugin_cgal_code.cpp
Optimizer_thread.cpp
${optimUI_FILES})
elseif(QT4)
polyhedron_demo_plugin(${MESH_3_OPTIMIZATION_PLUGIN_LIB} Mesh_3_optimization_plugin
Mesh_3_optimization_plugin_cgal_code.cpp
Optimizer_thread.cpp
Scene_c3t3_item.moc
${optimUI_FILES})
endif()
target_link_libraries(${MESH_3_OPTIMIZATION_PLUGIN_LIB}
${SCENE_C3T3_ITEM_LIB}