SUMO - Simulation of Urban MObility
GUITransportableControl.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // GUI-version of the person control for building gui persons
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2012-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <vector>
34 #include <algorithm>
35 #include "GUINet.h"
36 #include "GUIContainer.h"
37 #include "GUIPerson.h"
39 
40 
41 // ===========================================================================
42 // method definitions
43 // ===========================================================================
45 
46 
48 }
49 
50 
53  return new GUIPerson(pars, vtype, plan);
54 }
55 
56 
59  return new GUIContainer(pars, vtype, plan);
60 }
61 
62 
63 void
64 GUITransportableControl::insertPersonIDs(std::vector<GUIGlID>& into) {
65  into.reserve(myTransportables.size());
66  for (std::map<std::string, MSTransportable*>::const_iterator it = myTransportables.begin(); it != myTransportables.end(); ++it) {
67  if (it->second->getCurrentStageType() != MSTransportable::WAITING_FOR_DEPART) {
68  into.push_back(static_cast<const GUIPerson*>(it->second)->getGlID());
69  }
70  }
71 }
72 
73 
74 /****************************************************************************/
virtual ~GUITransportableControl()
destructor
virtual MSTransportable * buildContainer(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
Builds a new container.
virtual MSTransportable * buildPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
Builds a new person.
std::map< std::string, MSTransportable * > myTransportables
all currently created transportables by id
The car-following model and parameter.
Definition: MSVehicleType.h:74
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
void insertPersonIDs(std::vector< GUIGlID > &into)
Returns the list of all known persons by gl-id.
Structure representing possible vehicle parameter.