GUIGlObject.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Base class for all objects that may be displayed within the openGL-gui
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef GUIGlObject_h
00020 #define GUIGlObject_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include "GUIGlObjectTypes.h"
00034 #include <utils/geom/Boundary.h>
00035 
00036 #ifdef _WIN32
00037 #include <windows.h>
00038 #endif
00039 
00040 #include <GL/gl.h>
00041 
00042 
00043 // ===========================================================================
00044 // class declarations
00045 // ===========================================================================
00046 class GUIGlObjectStorage;
00047 class GUIParameterTableWindow;
00048 class GUIMainWindow;
00049 class GUIGLObjectPopupMenu;
00050 class GUISUMOAbstractView;
00051 class GUIVisualizationSettings;
00052 
00053 
00054 // ===========================================================================
00055 // class definitions
00056 // ===========================================================================
00057 class GUIGlObject {
00058 public:
00068     GUIGlObject(GUIGlObjectStorage &idStorage,
00069                 std::string fullName) throw();
00070 
00071 
00081     GUIGlObject(std::string fullName, GLuint glID) throw();
00082 
00083 
00085     virtual ~GUIGlObject() throw();
00086 
00087 
00088 
00091 
00095     const std::string &getFullName() const throw() {
00096         return myFullName;
00097     }
00098 
00099 
00103     GLuint getGlID() const throw() {
00104         return myGlID;
00105     }
00107 
00108 
00109 
00111     friend class GUIGlObjectStorage;
00112 
00113 
00114 
00116 
00117 
00124     virtual GUIGLObjectPopupMenu *getPopUpMenu(
00125         GUIMainWindow &app, GUISUMOAbstractView &parent) throw() = 0;
00126 
00127 
00134     virtual GUIParameterTableWindow *getParameterWindow(
00135         GUIMainWindow &app, GUISUMOAbstractView &parent) throw() = 0;
00136 
00137 
00142     virtual const std::string &getMicrosimID() const throw() = 0;
00143 
00144 
00149     virtual GUIGlObjectType getType() const throw() = 0;
00150 
00151 
00156     virtual Boundary getCenteringBoundary() const throw() = 0;
00157 
00158 
00162     virtual void drawGL(const GUIVisualizationSettings &s) const throw() = 0;
00164 
00165 
00166 
00171     virtual bool active() const throw() {
00172         return true;
00173     }
00174 
00175 
00176 protected:
00178 
00179 
00185     void buildPopupHeader(GUIGLObjectPopupMenu *ret,
00186                           GUIMainWindow &app, bool addSeparator=true) throw();
00187 
00188 
00194     void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw();
00195 
00196 
00202     void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret,
00203                                  bool addSeparator=true) throw();
00204 
00205 
00211     void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret,
00212                                   bool addSeparator=true) throw();
00213 
00214 
00220     void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret,
00221                                    bool addSeparator=true) throw();
00222 
00223 
00229     void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret,
00230                                 bool addSeparator=true) throw();
00231 
00232 
00238     void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu *ret,
00239                                         bool addSeparator=true) throw();
00241 
00242 private:
00248     void setGlID(GLuint id) throw();
00249 
00250 
00251 private:
00253     GLuint myGlID;
00254 
00256     std::string myFullName;
00257 
00258 };
00259 
00260 
00261 #endif
00262 
00263 /****************************************************************************/
00264 

Generated on Wed May 5 00:06:29 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6