Eclipse SUMO - Simulation of Urban MObility
NBPTPlatform.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 // The representation of a pt platform
15 /****************************************************************************/
16 #include "NBPTPlatform.h"
17 NBPTPlatform::NBPTPlatform(Position position, double d): myPos(position), myLength(d) {
18 }
19 
20 
21 const Position&
23  return myPos;
24 }
25 
26 
27 void
28 NBPTPlatform::reshiftPosition(const double offsetX, const double offsetY) {
29  myPos.add(offsetX, offsetY, 0);
30 }
31 
32 
33 double
35  return myLength;
36 }
NBPTPlatform.h
NBPTPlatform::getPos
const Position & getPos() const
Definition: NBPTPlatform.cpp:22
NBPTPlatform::reshiftPosition
void reshiftPosition(const double offsetX, const double offsetY)
Definition: NBPTPlatform.cpp:28
NBPTPlatform::myLength
double myLength
Definition: NBPTPlatform.h:31
NBPTPlatform::NBPTPlatform
NBPTPlatform(Position position, double d)
Definition: NBPTPlatform.cpp:17
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
NBPTPlatform::myPos
Position myPos
Definition: NBPTPlatform.h:30
Position::add
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:126
NBPTPlatform::getLength
double getLength() const
Definition: NBPTPlatform.cpp:34