Eclipse SUMO - Simulation of Urban MObility
MSDynamicShapeUpdater.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2019-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 /****************************************************************************/
14 //
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 #include "MSDynamicShapeUpdater.h"
22 
23 //#define DEBUG_DYNAMIC_SHAPES
24 
25 void
26 MSDynamicShapeUpdater::vehicleStateChanged(const SUMOVehicle* const vehicle, MSNet::VehicleState to, const std::string& /* info */) {
27 
29  switch (to) {
32 #ifdef DEBUG_DYNAMIC_SHAPES
33  std::cout << "MSDynamicShapeUpdater: Vehicle '" << vehicle->getID() << "' has arrived. Informing ShapeContainer." << std::endl;
34 #endif
36  }
37  break;
40  // TODO: can this lead to removal without calling arrived?
41  break;
42  default:
43  {}
44  }
45 }
ShapeContainer::removeTrackers
virtual void removeTrackers(std::string objectID)
Remove all tracking polygons for the given object.
Definition: ShapeContainer.cpp:286
SUMOTrafficObject::getID
virtual const std::string & getID() const =0
Get the vehicle's ID.
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSNet::VEHICLE_STATE_ARRIVED
The vehicle arrived at his destination (is deleted)
Definition: MSNet.h:545
MSDynamicShapeUpdater.h
SUMOVehicle.h
MSNet::VehicleState
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:535
MSNet::VEHICLE_STATE_COLLISION
The vehicle is involved in a collision.
Definition: MSNet.h:557
MSDynamicShapeUpdater::myShapeContainer
ShapeContainer & myShapeContainer
Definition: MSDynamicShapeUpdater.h:34
MSDynamicShapeUpdater::vehicleStateChanged
void vehicleStateChanged(const SUMOVehicle *const vehicle, MSNet::VehicleState to, const std::string &info="") override
Constructor.
Definition: MSDynamicShapeUpdater.cpp:26