Main Page   Class Hierarchy   Compound List   File List   Compound Members  

main.h

00001 // Mesh Algorithms: a library of algorithms to manipulate 3D meshes
00002 // Copyright (C) 2001 Tim Garthwaite and Jason Reposa
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 /* SET WINDOWS COMPILE OPTIONS */
00018 #ifdef _WIN32
00019 #define WIN32_LEAN_AND_MEAN
00020 #define NOWINRES
00021 #define NOSERVICE
00022 #define NOMCX
00023 #define NOIME
00024 #include <windows.h>
00025 #pragma comment (linker, "/ENTRY:mainCRTStartup")
00026 #pragma comment (linker, "/SUBSYSTEM:CONSOLE")
00027 #endif
00028 /* END WINDOWS COMPILE OPTIONS */
00029 
00030 #include "ViewportController.h"
00031 #include <iostream>
00032 #include <GL/glut.h>
00033 #include <sstream>
00034 
00035 #define ERR_CLEAN_EXIT 0x0001
00036 #define ERR_PRINT_USAGE 0x0002
00037 #define ERR_FILE_NOT_FOUND 0x003
00038 #define ERR_CONTINUE 0x004
00039 #define ERR_UNKNOWN 0x00F
00040 
00041 #define PROGRAM_TITLE "Mesh Simplification - Decimation (WPI)"
00042 
00043 #define DEC_20_PER 0x0101
00044 #define DEC_40_PER 0x0102
00045 #define DEC_60_PER 0x0103
00046 #define DEC_80_PER 0x0104
00047 #define DEC_90_PER 0x0105
00048 #define DEC_ONE_TENTH 0x0106
00049 #define DEC_ONE 0x0107
00050 #define DEC_TWO_HALF 0x0108
00051 #define DEC_FIVE 0x0109
00052 #define DEC_TEN 0x010A
00053 
00054 #define SHOW_LIGHTING 0x0201
00055 #define SHOW_NORMALS 0x0202
00056 #define SHOW_VERT_NORMALS 0x0203
00057 
00058 #define SHOW_POINTS 0x0204
00059 #define SHOW_EDGES 0x0205
00060 #define SHOW_TRIANGLES 0x0206
00061 
00062 #define ADD_VIEWPORT 0x0301
00063 #define REMOVE_VIEWPORT 0x0302
00064 
00065 #define MODEL_CONTROL 0x0401
00066 #define EYE_CONTROL 0x0402
00067 #define EXIT 9
00068 
00069 #define QUICK_SAVE 0
00070 #define DIALOG_SAVE 1
00071 #define MAX_VIEWPORTS 4
00072 
00073 // Extra definitions
00074 #define DEBUG false
00075 
00076 
00080 GLint windowID;
00081 
00082 /*
00083   The width and height of the entire window. These values change when
00084   viewports are created or removed.
00085 */
00086 GLint windowWidth; 
00087 GLint windowHeight; 
00088 
00089 /*
00090   The x and y values of the mouse. These values are taken when a user
00091   presses the left mouse button.
00092 */
00093 GLint mouseX; 
00094 GLint mouseY; 
00095 
00101 ViewportController * viewports;
00102 
00107 std::string outputfile;
00108 
00109 /*
00110   The menu ID's as returned by glutCreateMenu().
00111 */
00112 GLint menuID; 
00113 GLint viewportMenuID; 
00114 GLint modelMenuID; 
00115 GLint controlMenuID; 
00116 GLint decimationMenuID; 
00117 GLint decPerMenuID; 
00118 GLint decDisMenuID; 
00119 
00120 /*
00121   Settings for our light. Currently there are only three defined
00122   attributes. We may not need these at all.
00123 */
00124 GLfloat Light_Ambient[4]; 
00125 GLfloat Light_Diffuse[4]; 
00126 GLfloat Light_Position[4]; 
00127 
00128 /*
00129   Default settings: makes it less of a pain from the command line
00130 */
00131 bool percent; 
00132 bool count; 
00133 bool gui; 

Generated on Fri Dec 21 00:16:48 2001 for Mesh Decimation by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001