Blender V2.61 - r43446

MyGlutKeyHandler.h

Go to the documentation of this file.
00001 
00028 #ifndef NAN_INCLUDED_MyGlutKeyHandler_h
00029 #define NAN_INCLUDED_MyGlutKeyHandler_h
00030 
00031 #include "common/GlutKeyboardManager.h"
00032 #include "LOD_decimation.h"
00033 
00034 class MyGlutKeyHandler : public GlutKeyboardHandler
00035 {
00036 public :
00037     static
00038         MyGlutKeyHandler *
00039     New(
00040         LOD_Decimation_InfoPtr info
00041     ) {
00042         return new MyGlutKeyHandler(info);
00043     }   
00044 
00045         void
00046     HandleKeyboard(
00047         GHOST_TKey key,
00048         int x,
00049         int y
00050     ){
00051         int steps = 0;
00052 
00053         switch (key) {
00054             case GHOST_kKeyD :
00055 
00056                 while (steps < 100 && LOD_CollapseEdge(m_info)) {
00057                     steps ++;
00058                 }
00059 
00060                 break;
00061 
00062             case GHOST_kKeyEsc :
00063 
00064                 // release all the handlers!                
00065                 exit(0);
00066         }
00067         
00068     }
00069         
00070     ~MyGlutKeyHandler(
00071     ) {
00072     };
00073 
00074 private :
00075 
00076     MyGlutKeyHandler(
00077         LOD_Decimation_InfoPtr info
00078     ):
00079         m_info (info)
00080     {
00081     }
00082 
00083 
00084     LOD_Decimation_InfoPtr m_info;
00085 };
00086 
00087 #endif
00088