GLHelper.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Some methods which help to draw certain geometrical objects in openGL
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 GLHelper_h
00020 #define GLHelper_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 <vector>
00033 #include <utility>
00034 #include <utils/geom/Position2DVector.h>
00035 #include <utils/geom/Line2D.h>
00036 
00037 
00038 // ===========================================================================
00039 // class definitions
00040 // ===========================================================================
00047 class GLHelper {
00048 public:
00054     static void drawFilledPoly(const Position2DVector &v, bool close) throw();
00055 
00056 
00066     static void drawBoxLine(const Position2D &beg, SUMOReal rot,
00067                             SUMOReal visLength, SUMOReal width) throw();
00068 
00069 
00080     static void drawBoxLine(const Position2D &beg1, const Position2D &beg2,
00081                             SUMOReal rot, SUMOReal visLength, SUMOReal width) throw();
00082 
00083 
00094     static void drawBoxLines(const Position2DVector &geom,
00095                              const std::vector<SUMOReal> &rots, const std::vector<SUMOReal> &lengths,
00096                              SUMOReal width) throw();
00097 
00098 
00110     static void drawBoxLines(const Position2DVector &geom1,
00111                              const Position2DVector &geom2,
00112                              const std::vector<SUMOReal> &rots, const std::vector<SUMOReal> &lengths,
00113                              SUMOReal width) throw();
00114 
00115 
00125     static void drawBoxLines(const Position2DVector &geom, SUMOReal width) throw();
00126 
00127 
00136     static void drawLine(const Position2D &beg, SUMOReal rot,
00137                          SUMOReal visLength) throw();
00138 
00139 
00149     static void drawLine(const Position2D &beg1, const Position2D &beg2,
00150                          SUMOReal rot, SUMOReal visLength) throw();
00151 
00152 
00159     static void drawLine(const Position2DVector &v) throw();
00160 
00161 
00169     static void drawLine(const Position2D &beg, const Position2D &end) throw();
00170 
00171 
00179     static void drawFilledCircle(SUMOReal width, int steps=8) throw();
00180 
00181 
00191     static void drawFilledCircle(SUMOReal width, int steps,
00192                                  SUMOReal beg, SUMOReal end) throw();
00193 
00194 
00203     static void drawOutlineCircle(SUMOReal width, SUMOReal iwidth,
00204                                   int steps=8) throw();
00205 
00206 
00217     static void drawOutlineCircle(SUMOReal width, SUMOReal iwidth,
00218                                   int steps, SUMOReal beg, SUMOReal end) throw();
00219 
00220 
00227     static void drawTriangleAtEnd(const Line2D &l, SUMOReal tLength,
00228                                   SUMOReal tWidth) throw();
00229 
00230 private:
00232     static std::vector<std::pair<SUMOReal, SUMOReal> > myCircleCoords;
00233 
00234 };
00235 
00236 
00237 #endif
00238 
00239 /****************************************************************************/
00240 

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