45# pragma warning(disable: 4267 4311)
50#include <OpenMesh/Tools/Utils/getopt.h>
51#include <qapplication.h>
52#include <qmessagebox.h>
53#include <QOpenGLContext>
55#include "DecimaterViewerWidget.hh"
57void usage_and_exit(
int xcode);
60int main(
int argc,
char **argv)
62#if defined(OM_USE_OSG) && OM_USE_OSG
63 osg::osgInit(argc, argv);
67 QApplication app(argc,argv);
69#if QT_VERSION_MAJOR < 6
70 if ( !QGLFormat::hasOpenGL() ) {
72 if ( QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL ) {
74 QString msg =
"System has no OpenGL support!";
75 QMessageBox::critical(
nullptr,
"OpenGL", msg + argv[1] );
83 while ( (c=getopt(argc,argv,
"s"))!=-1 )
105 if ( ! w.open_mesh(argv[optind], opt) )
107 QString msg =
"Cannot read mesh from file:\n '";
110 QMessageBox::critical(
nullptr, w.windowTitle(), msg );
115 if ( ++optind < argc )
117 if ( ! w.open_texture( argv[optind] ) )
119 QString msg =
"Cannot load texture image from file:\n '";
121 msg +=
"'\n\nPossible reasons:\n";
122 msg +=
"- Mesh file didn't provide texture coordinates\n";
123 msg +=
"- Texture file does not exist\n";
124 msg +=
"- Texture file is not accessible.\n";
125 QMessageBox::warning(
nullptr, w.windowTitle(), msg );
132void usage_and_exit(
int xcode)
134 std::cout <<
"Usage: DecimaterGui [-s] [mesh] [texture]\n" << std::endl;
135 std::cout <<
"Options:\n"
137 <<
" Reverse byte order, when reading binary files.\n"
138 <<
" Press 'h' when the application is running for more options.\n"
Set options for reader/writer modules.
@ Swap
Swap byte order in binary mode.