qt - polyhedron viewer showing nothing
up vote
0
down vote
favorite
I'm a newbie in using cgal , I tried the following example :
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/draw_polyhedron.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
int main(int argc, char *argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
Polyhedron P;
std::ifstream in1((argc>1)?argv[1]:"data/bones.off");
in1 >> P;
CGAL::draw(P);
return app.exec();
}
.pro file :
QT += quick opengl
CONFIG += c++11
QT +=xml widgets
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES +=
main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Core
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Qt5
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
QMAKE_CXXFLAGS +=-DCGAL_USE_BASIC_VIEWER
LIBS+=-DCGAL_USE_BASIC_VIEWER
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_ImageIO
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5Xml
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5OpenGL
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lgmp
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lboost_system
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
the source of example : https://doc.cgal.org/latest/Polyhedron/Polyhedron_2draw_polyhedron_8cpp-example.html#a2
the problem is it shows black viewer , I don't know what's the problem
I'm using qt-creator on Fedora OS
any help ,please?
c++ qt computational-geometry cgal
add a comment |
up vote
0
down vote
favorite
I'm a newbie in using cgal , I tried the following example :
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/draw_polyhedron.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
int main(int argc, char *argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
Polyhedron P;
std::ifstream in1((argc>1)?argv[1]:"data/bones.off");
in1 >> P;
CGAL::draw(P);
return app.exec();
}
.pro file :
QT += quick opengl
CONFIG += c++11
QT +=xml widgets
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES +=
main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Core
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Qt5
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
QMAKE_CXXFLAGS +=-DCGAL_USE_BASIC_VIEWER
LIBS+=-DCGAL_USE_BASIC_VIEWER
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_ImageIO
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5Xml
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5OpenGL
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lgmp
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lboost_system
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
the source of example : https://doc.cgal.org/latest/Polyhedron/Polyhedron_2draw_polyhedron_8cpp-example.html#a2
the problem is it shows black viewer , I don't know what's the problem
I'm using qt-creator on Fedora OS
any help ,please?
c++ qt computational-geometry cgal
It might be an opengl issue. Could you give some detail on your config and your graphic card driver ?
– sloriot
Nov 7 at 11:11
I tried the following opengl example:opengl.org/archives/resources/code/samples/simple/bitmap1.c and it works properly
– n.m
Nov 7 at 12:18
@sloriot my graphics card :NVIDIA
– n.m
Nov 7 at 12:27
2
I just realized that you have too many code in your example. Look at the minimal example here. Thedraw()
function is already taking care of creating a Qt windows.
– sloriot
Nov 7 at 16:05
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm a newbie in using cgal , I tried the following example :
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/draw_polyhedron.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
int main(int argc, char *argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
Polyhedron P;
std::ifstream in1((argc>1)?argv[1]:"data/bones.off");
in1 >> P;
CGAL::draw(P);
return app.exec();
}
.pro file :
QT += quick opengl
CONFIG += c++11
QT +=xml widgets
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES +=
main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Core
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Qt5
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
QMAKE_CXXFLAGS +=-DCGAL_USE_BASIC_VIEWER
LIBS+=-DCGAL_USE_BASIC_VIEWER
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_ImageIO
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5Xml
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5OpenGL
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lgmp
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lboost_system
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
the source of example : https://doc.cgal.org/latest/Polyhedron/Polyhedron_2draw_polyhedron_8cpp-example.html#a2
the problem is it shows black viewer , I don't know what's the problem
I'm using qt-creator on Fedora OS
any help ,please?
c++ qt computational-geometry cgal
I'm a newbie in using cgal , I tried the following example :
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/draw_polyhedron.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
int main(int argc, char *argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
Polyhedron P;
std::ifstream in1((argc>1)?argv[1]:"data/bones.off");
in1 >> P;
CGAL::draw(P);
return app.exec();
}
.pro file :
QT += quick opengl
CONFIG += c++11
QT +=xml widgets
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES +=
main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Core
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_Qt5
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
QMAKE_CXXFLAGS +=-DCGAL_USE_BASIC_VIEWER
LIBS+=-DCGAL_USE_BASIC_VIEWER
unix:!macx: LIBS += -L$$PWD/../../CGAL-4.13/lib/ -lCGAL_ImageIO
INCLUDEPATH += $$PWD/../../CGAL-4.13/include
DEPENDPATH += $$PWD/../../CGAL-4.13/include
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5Xml
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lQt5OpenGL
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lgmp
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
unix:!macx: LIBS += -L$$PWD/../../../../lib64/ -lboost_system
INCLUDEPATH += $$PWD/../../../../lib64
DEPENDPATH += $$PWD/../../../../lib64
the source of example : https://doc.cgal.org/latest/Polyhedron/Polyhedron_2draw_polyhedron_8cpp-example.html#a2
the problem is it shows black viewer , I don't know what's the problem
I'm using qt-creator on Fedora OS
any help ,please?
c++ qt computational-geometry cgal
c++ qt computational-geometry cgal
asked Nov 7 at 10:35
n.m
348
348
It might be an opengl issue. Could you give some detail on your config and your graphic card driver ?
– sloriot
Nov 7 at 11:11
I tried the following opengl example:opengl.org/archives/resources/code/samples/simple/bitmap1.c and it works properly
– n.m
Nov 7 at 12:18
@sloriot my graphics card :NVIDIA
– n.m
Nov 7 at 12:27
2
I just realized that you have too many code in your example. Look at the minimal example here. Thedraw()
function is already taking care of creating a Qt windows.
– sloriot
Nov 7 at 16:05
add a comment |
It might be an opengl issue. Could you give some detail on your config and your graphic card driver ?
– sloriot
Nov 7 at 11:11
I tried the following opengl example:opengl.org/archives/resources/code/samples/simple/bitmap1.c and it works properly
– n.m
Nov 7 at 12:18
@sloriot my graphics card :NVIDIA
– n.m
Nov 7 at 12:27
2
I just realized that you have too many code in your example. Look at the minimal example here. Thedraw()
function is already taking care of creating a Qt windows.
– sloriot
Nov 7 at 16:05
It might be an opengl issue. Could you give some detail on your config and your graphic card driver ?
– sloriot
Nov 7 at 11:11
It might be an opengl issue. Could you give some detail on your config and your graphic card driver ?
– sloriot
Nov 7 at 11:11
I tried the following opengl example:opengl.org/archives/resources/code/samples/simple/bitmap1.c and it works properly
– n.m
Nov 7 at 12:18
I tried the following opengl example:opengl.org/archives/resources/code/samples/simple/bitmap1.c and it works properly
– n.m
Nov 7 at 12:18
@sloriot my graphics card :NVIDIA
– n.m
Nov 7 at 12:27
@sloriot my graphics card :NVIDIA
– n.m
Nov 7 at 12:27
2
2
I just realized that you have too many code in your example. Look at the minimal example here. The
draw()
function is already taking care of creating a Qt windows.– sloriot
Nov 7 at 16:05
I just realized that you have too many code in your example. Look at the minimal example here. The
draw()
function is already taking care of creating a Qt windows.– sloriot
Nov 7 at 16:05
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187721%2fqt-polyhedron-viewer-showing-nothing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It might be an opengl issue. Could you give some detail on your config and your graphic card driver ?
– sloriot
Nov 7 at 11:11
I tried the following opengl example:opengl.org/archives/resources/code/samples/simple/bitmap1.c and it works properly
– n.m
Nov 7 at 12:18
@sloriot my graphics card :NVIDIA
– n.m
Nov 7 at 12:27
2
I just realized that you have too many code in your example. Look at the minimal example here. The
draw()
function is already taking care of creating a Qt windows.– sloriot
Nov 7 at 16:05