GUITriggerBuilder.cpp

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Builds trigger objects for guisim
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 
00020 
00021 // ===========================================================================
00022 // included modules
00023 // ===========================================================================
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029 
00030 #include <string>
00031 #include <fstream>
00032 #include <guisim/GUILaneSpeedTrigger.h>
00033 #include <guisim/GUIEmitter.h>
00034 #include <guisim/GUITriggeredRerouter.h>
00035 #include <guisim/GUIBusStop.h>
00036 #include "GUITriggerBuilder.h"
00037 
00038 #ifdef CHECK_MEMORY_LEAKS
00039 #include <foreign/nvwa/debug_new.h>
00040 #endif // CHECK_MEMORY_LEAKS
00041 
00042 
00043 // ===========================================================================
00044 // method definitions
00045 // ===========================================================================
00046 GUITriggerBuilder::GUITriggerBuilder() throw() {}
00047 
00048 
00049 GUITriggerBuilder::~GUITriggerBuilder() throw() {}
00050 
00051 
00052 MSLaneSpeedTrigger*
00053 GUITriggerBuilder::buildLaneSpeedTrigger(MSNet &net,
00054         const std::string &id, const std::vector<MSLane*> &destLanes,
00055         const std::string &file) throw(ProcessError) {
00056     return new GUILaneSpeedTrigger(id, destLanes, file);
00057 }
00058 
00059 
00060 void
00061 GUITriggerBuilder::buildLaneEmitTrigger(MSNet &net,
00062                                         const std::string &id,
00063                                         MSLane *destLane,
00064                                         SUMOReal pos,
00065                                         const std::string &file) throw() {
00066     new GUIEmitter(id, net, destLane, pos, file);
00067 }
00068 
00069 
00070 void
00071 GUITriggerBuilder::buildRerouter(MSNet &, const std::string &id,
00072                                  std::vector<MSEdge*> &edges,
00073                                  SUMOReal prob, const std::string &file, bool off) throw() {
00074     new GUITriggeredRerouter(id, edges, prob, file, off);
00075 }
00076 
00077 
00078 void
00079 GUITriggerBuilder::buildBusStop(MSNet &net, const std::string &id,
00080                                 const std::vector<std::string> &lines,
00081                                 MSLane *lane,
00082                                 SUMOReal frompos, SUMOReal topos) throw() {
00083     net.addBusStop(new GUIBusStop(id, net, lines, *lane, frompos, topos));
00084 }
00085 
00086 
00087 /****************************************************************************/
00088 

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