Eclipse SUMO - Simulation of Urban MObility
GUITexturesHelper.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2006-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Global storage for textures; manages and draws them
17 /****************************************************************************/
18 #ifndef GUITexturesHelper_h
19 #define GUITexturesHelper_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <fx.h>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 public:
41  static int getMaxTextureSize();
42 
44  static GUIGlID add(FXImage* i);
45 
47  static void drawTexturedBox(int which, double size);
48 
50  static void drawTexturedBox(int which, double sizeX1, double sizeY1, double sizeX2, double sizeY2);
51 
55  static int getTextureID(const std::string& filename, const bool mirrorX = false);
56 
58  static void clearTextures();
59 
61  static void allowTextures(const bool val) {
62  myAllowTextures = val;
63  }
64 
66  static bool texturesAllowed() {
67  return myAllowTextures;
68  }
69 
70 private:
72  static std::map<std::string, int> myTextures;
73 
75  static bool myAllowTextures;
76 };
77 
78 
79 #endif
80 
81 /****************************************************************************/
GUIGlObject.h
GUITexturesHelper::myAllowTextures
static bool myAllowTextures
whether textures are drawn
Definition: GUITexturesHelper.h:75
GUITexturesHelper::drawTexturedBox
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Definition: GUITexturesHelper.cpp:72
GUITexturesHelper::getMaxTextureSize
static int getMaxTextureSize()
return maximum number of pixels in x and y direction
Definition: GUITexturesHelper.cpp:47
GUITexturesHelper::allowTextures
static void allowTextures(const bool val)
switch texture drawing on and off
Definition: GUITexturesHelper.h:61
GUITexturesHelper::add
static GUIGlID add(FXImage *i)
Adds a texture to use.
Definition: GUITexturesHelper.cpp:55
GUITexturesHelper::texturesAllowed
static bool texturesAllowed()
ask whether texture drawing is enabled
Definition: GUITexturesHelper.h:66
GUIGlID
unsigned int GUIGlID
Definition: GUIGlObject.h:42
GUITexturesHelper::myTextures
static std::map< std::string, int > myTextures
mapping from image paths to decals (initialization on first use)
Definition: GUITexturesHelper.h:72
config.h
GUITexturesHelper::clearTextures
static void clearTextures()
clears loaded textures
Definition: GUITexturesHelper.cpp:136
GUITexturesHelper::getTextureID
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
Definition: GUITexturesHelper.cpp:112
GUITexturesHelper
Global storage for textures; manages and draws them.
Definition: GUITexturesHelper.h:38