CGAL demo in Qt5

Viewed 36

I am trying to compile a cgal demo called AABB_tree. I am not very good with Cmake so I have tried-

  1. created a QtWidget project in QtCreator in D:\CC++\Qt\demo with qmake.
  2. deleted the default generated files(mainwindow.h, mainwindow.ui, etc....)
  3. Added the given demo files in my project and copied the Resources folder to demo directory.
  4. copied the necessary third party libraries to demo directory.
  5. After that my demo directory looks like this

My .pro files contains

QT       += core gui opengl svg

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++14

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

INCLUDEPATH += boost_1_80_0 \
               gmp_x64-windows-static\include \
               mpfr_x64-windows-static\include \
               CGAL-5.5\include


SOURCES += \
    main.cpp \
    MainWindow.cpp \
    Scene.cpp \
    Viewer.cpp \
    benchmarks.cpp

LIBS += -LD:\CC++\Qt\demo\gmp_x64-windows-static\lib -lgmp \
        -LD:\CC++\Qt\demo\mpfr_x64-windows-static\lib -lmpfr

HEADERS += \
    Color_ramp.h \
    MainWindow.h \
    Refiner.h \
    Scene.h \
    Viewer.h \
    types.h

FORMS += \
    MainWindow.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
    AABB_demo.qrc

The main file contains

#include "MainWindow.h"
#include <QApplication>
#include <CGAL/Qt/resources.h>
#include <QMimeData>
#include <CGAL/Qt/init_ogl_context.h>

int main(int argc, char **argv)
{

  CGAL::Qt::init_ogl_context(4,3);
  QApplication app(argc, argv);
  app.setOrganizationDomain("inria.fr");
  app.setOrganizationName("INRIA");
  app.setApplicationName("AABB tree demo");

  // Import resources from libCGALQt (Qt5).
  CGAL_QT_INIT_RESOURCES;

  MainWindow mainWindow;
  mainWindow.show();
  QStringList args = app.arguments();
  args.removeAt(0);

  if(!args.empty() && args[0] == "--use-meta")
  {
    mainWindow.setAddKeyFrameKeyboardModifiers(::Qt::MetaModifier);
    args.removeAt(0);
  }

  Q_FOREACH(QString filename, args)
    mainWindow.open(filename);

  return app.exec();
}

#include "Scene.cpp"
#include "Scene_moc.cpp"
#include "benchmarks.cpp"
#include "Viewer.cpp"
#include "Viewer_moc.cpp"
#include "MainWindow.cpp"
#include "MainWindow_moc.cpp"

The problem is that the demo does not include the following source files

  1. Scene_moc.cpp
  2. Viewer_moc.cpp
  3. MainWindow_moc.cpp
  4. ui_ImageInterface.h

Is it on the user to construct those files? Is there any complete demo or example available?

0 Answers
Related