50 # pragma warning(disable: 4267 4311)
55 #include <OpenMesh/Tools/Utils/getopt.h>
56 #include <qapplication.h>
57 #include <qmessagebox.h>
59 #include "DecimaterViewerWidget.hh"
67 void usage_and_exit(
int xcode);
70 int main(
int argc,
char **argv)
72 #if defined(OM_USE_OSG) && OM_USE_OSG
73 osg::osgInit(argc, argv);
77 QApplication::setColorSpec( QApplication::CustomColor );
78 QApplication app(argc,argv);
80 #if !defined(__APPLE__)
84 if ( !QGLFormat::hasOpenGL() ) {
85 QString msg =
"System has no OpenGL support!";
86 QMessageBox::critical( NULL,
"OpenGL", msg + argv[1] );
94 while ( (c=getopt(argc,argv,
"s"))!=-1 )
115 if ( ! w.open_mesh(argv[optind], opt) )
117 QString msg =
"Cannot read mesh from file:\n '";
120 QMessageBox::critical( NULL, w.windowTitle(), msg );
125 if ( ++optind < argc )
127 if ( ! w.open_texture( argv[optind] ) )
129 QString msg =
"Cannot load texture image from file:\n '";
131 msg +=
"'\n\nPossible reasons:\n";
132 msg +=
"- Mesh file didn't provide texture coordinates\n";
133 msg +=
"- Texture file does not exist\n";
134 msg +=
"- Texture file is not accessible.\n";
135 QMessageBox::warning( NULL, w.windowTitle(), msg );
142 void usage_and_exit(
int xcode)
144 std::cout <<
"Usage: DecimaterGui [-s] [mesh] [texture]\n" << std::endl;
145 std::cout <<
"Options:\n"
147 <<
" Reverse byte order, when reading binary files.\n"
148 <<
" Press 'h' when the application is running for more options.\n"
Set options for reader/writer modules.
Swap byte order in binary mode.