00001 #ifndef GSGL_SG_EVENT_H 00002 #define GSGL_SG_EVENT_H 00003 00004 // 00005 // $Id: event.hpp 2 2008-03-01 20:58:50Z kulibali $ 00006 // 00007 // Copyright (c) 2008, The Periapsis Project. All rights reserved. 00008 // 00009 // Redistribution and use in source and binary forms, with or without 00010 // modification, are permitted provided that the following conditions are 00011 // met: 00012 // 00013 // * Redistributions of source code must retain the above copyright notice, 00014 // this list of conditions and the following disclaimer. 00015 // 00016 // * Redistributions in binary form must reproduce the above copyright 00017 // notice, this list of conditions and the following disclaimer in the 00018 // documentation and/or other materials provided with the distribution. 00019 // 00020 // * Neither the name of the The Periapsis Project nor the names of its 00021 // contributors may be used to endorse or promote products derived from 00022 // this software without specific prior written permission. 00023 // 00024 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 00025 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00026 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00027 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 00028 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00029 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00030 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00031 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00032 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00033 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00034 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 // 00036 00037 #include "scenegraph/scenegraph.hpp" 00038 00039 namespace gsgl 00040 { 00041 00042 namespace scenegraph 00043 { 00044 00045 class SCENEGRAPH_API sg_event 00046 : public scenegraph_object 00047 { 00048 public: 00049 enum event_code { 00050 NULL_EVENT = 0, 00051 00052 SIM_QUIT, 00053 00054 VIEW_ROT_X_POS, 00055 VIEW_ROT_X_NEG, 00056 VIEW_ROT_Y_POS, 00057 VIEW_ROT_Y_NEG, 00058 VIEW_ROT_Z_POS, 00059 VIEW_ROT_Z_NEG, 00060 VIEW_TOGGLE_ROT_MODE, 00061 VIEW_ZOOM_IN, 00062 VIEW_ZOOM_OUT, 00063 VIEW_RESET, 00064 00065 TIME_INC_SCALE, 00066 TIME_DEC_SCALE, 00067 TIME_RESET_SCALE, 00068 TIME_PAUSE, 00069 00070 RENDER_TOGGLE_LABELS, 00071 RENDER_TOGGLE_COORD_SYSTEMS, 00072 00073 NUM_EVENT_CODES 00074 }; // enum event_code 00075 00076 private: 00077 event_code code; 00078 00079 union 00080 { 00081 void *param; 00082 int n; 00083 short a[2]; 00084 }; 00085 00086 public: 00087 sg_event(); 00088 sg_event(event_code code, void *param); 00089 sg_event(event_code code, int n); 00090 sg_event(event_code code, short a[2]); 00091 00092 event_code & get_code(); 00093 }; // class sg_event 00094 00095 } // namespace scenegraph 00096 00097 } // namespace gsgl 00098 00099 #endif