45 # pragma warning(disable: 4267 4311) 50 #include <OpenMesh/Tools/Utils/getopt.h> 51 #include <qapplication.h> 52 #include <qmessagebox.h> 54 #include "DecimaterViewerWidget.hh" 56 void usage_and_exit(
int xcode);
59 int main(
int argc,
char **argv)
61 #if defined(OM_USE_OSG) && OM_USE_OSG 62 osg::osgInit(argc, argv);
66 QApplication::setColorSpec( QApplication::CustomColor );
67 QApplication app(argc,argv);
69 if ( !QGLFormat::hasOpenGL() ) {
70 QString msg =
"System has no OpenGL support!";
71 QMessageBox::critical( NULL,
"OpenGL", msg + argv[1] );
79 while ( (c=getopt(argc,argv,
"s"))!=-1 )
101 if ( ! w.open_mesh(argv[optind], opt) )
103 QString msg =
"Cannot read mesh from file:\n '";
106 QMessageBox::critical( NULL, w.windowTitle(), msg );
111 if ( ++optind < argc )
113 if ( ! w.open_texture( argv[optind] ) )
115 QString msg =
"Cannot load texture image from file:\n '";
117 msg +=
"'\n\nPossible reasons:\n";
118 msg +=
"- Mesh file didn't provide texture coordinates\n";
119 msg +=
"- Texture file does not exist\n";
120 msg +=
"- Texture file is not accessible.\n";
121 QMessageBox::warning( NULL, w.windowTitle(), msg );
128 void usage_and_exit(
int xcode)
130 std::cout <<
"Usage: DecimaterGui [-s] [mesh] [texture]\n" << std::endl;
131 std::cout <<
"Options:\n" 133 <<
" Reverse byte order, when reading binary files.\n" 134 <<
" Press 'h' when the application is running for more options.\n"
Swap byte order in binary mode.
Set options for reader/writer modules.