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
enter image description here



I'm using qt-creator on Fedora OS
any help ,please?










share|improve this question






















  • 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















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
enter image description here



I'm using qt-creator on Fedora OS
any help ,please?










share|improve this question






















  • 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













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
enter image description here



I'm using qt-creator on Fedora OS
any help ,please?










share|improve this question













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
enter image description here



I'm using qt-creator on Fedora OS
any help ,please?







c++ qt computational-geometry cgal






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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. The draw() 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










  • 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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini