SUMO - Simulation of Urban MObility
|
A point in 2D or 3D with translation and scaling methods. More...
#include <Position.h>
Public Member Functions | |
void | add (const Position &pos) |
Adds the given position to this one. More... | |
void | add (SUMOReal dx, SUMOReal dy) |
Adds the given position to this one. More... | |
void | add (SUMOReal dx, SUMOReal dy, SUMOReal dz) |
Adds the given position to this one. More... | |
bool | almostSame (const Position &p2, SUMOReal maxDiv=POSITION_EPS) const |
Position | crossProduct (const Position &pos) |
returns the cross product between this point and the second one More... | |
SUMOReal | distanceSquaredTo (const Position &p2) const |
SUMOReal | distanceSquaredTo2D (const Position &p2) const |
SUMOReal | distanceTo (const Position &p2) const |
returns the euclidean distance in 3 dimension More... | |
SUMOReal | distanceTo2D (const Position &p2) const |
returns the euclidean distance in the x-y-plane More... | |
SUMOReal | dotProduct (const Position &pos) |
returns the dot product (scalar product) between this point and the second one More... | |
void | mul (SUMOReal val) |
Multiplies both positions with the given value. More... | |
void | mul (SUMOReal mx, SUMOReal my) |
Multiplies position with the given values. More... | |
void | mul (SUMOReal mx, SUMOReal my, SUMOReal mz) |
Multiplies position with the given values. More... | |
void | norm2d () |
bool | operator!= (const Position &p2) const |
Position | operator* (SUMOReal scalar) const |
keep the direction but modify the length of the (location) vector to length * scalar More... | |
Position | operator+ (const Position &p2) const |
Position | operator+ (SUMOReal offset) const |
keep the direction but modify the length of the (location) vector to length + scalar More... | |
Position | operator- (const Position &p2) const |
bool | operator< (const Position &p2) const |
lexicographical sorting for use in maps and sets More... | |
bool | operator== (const Position &p2) const |
Position () | |
default constructor More... | |
Position (SUMOReal x, SUMOReal y) | |
parametrised constructor More... | |
Position (SUMOReal x, SUMOReal y, SUMOReal z) | |
parametrised constructor More... | |
void | reshiftRotate (SUMOReal xoff, SUMOReal yoff, SUMOReal rot) |
void | set (SUMOReal x, SUMOReal y) |
void | set (SUMOReal x, SUMOReal y, SUMOReal z) |
void | set (const Position &pos) |
void | sub (SUMOReal dx, SUMOReal dy) |
Substracts the given position from this one. More... | |
void | sub (SUMOReal dx, SUMOReal dy, SUMOReal dz) |
Substracts the given position from this one. More... | |
void | sub (const Position &pos) |
Substracts the given position from this one. More... | |
SUMOReal | x () const |
Returns the x-position. More... | |
SUMOReal | y () const |
Returns the y-position. More... | |
SUMOReal | z () const |
Returns the z-position. More... | |
~Position () | |
Destructor. More... | |
Static Public Attributes | |
static const Position | INVALID |
Private Attributes | |
SUMOReal | myX |
The x-position. More... | |
SUMOReal | myY |
The y-position. More... | |
SUMOReal | myZ |
The z-position. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Position &p) |
Prints to the output. More... | |
A point in 2D or 3D with translation and scaling methods.
Definition at line 46 of file Position.h.
|
inline |
default constructor
Definition at line 49 of file Position.h.
Referenced by crossProduct(), GUIPointOfInterest::drawGL(), operator*(), operator+(), and operator-().
parametrised constructor
Definition at line 52 of file Position.h.
parametrised constructor
Definition at line 56 of file Position.h.
|
inline |
Destructor.
Definition at line 60 of file Position.h.
|
inline |
Adds the given position to this one.
Definition at line 119 of file Position.h.
Referenced by Line::add(), NBNodeCont::analyzeCluster(), AGPosition::compute2dPosition(), NBNodeShapeComputer::computeNodeShapeDefault(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), GUIEdge::drawGL(), GLHelper::drawTextBox(), Line::extrapolateBy(), Line::extrapolateBy2D(), NBNode::getEmptyDir(), Line::move2side(), GeoConvHelper::moveConvertedBy(), NBNode::reshiftPosition(), Line::rotateAtP1(), GUISUMOAbstractView::showToolTipFor(), GeomHelper::transfer_to_side(), and GeoConvHelper::x2cartesian_const().
Adds the given position to this one.
Definition at line 126 of file Position.h.
Adds the given position to this one.
Definition at line 132 of file Position.h.
|
inline |
Definition at line 223 of file Position.h.
Referenced by NBNode::computeSmoothShape(), AGPosition::operator==(), PositionVector::push_back_noDoublePos(), and PositionVector::push_front_noDoublePos().
returns the cross product between this point and the second one
Definition at line 250 of file Position.h.
References myX, myY, myZ, and Position().
Referenced by NBHeightMapper::Triangle::normalVector().
Definition at line 234 of file Position.h.
Referenced by GeomHelper::distancePointLine(), and distanceTo().
returns the euclidean distance in 3 dimension
Definition at line 229 of file Position.h.
References distanceSquaredTo().
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), NBNode::computeSmoothShape(), NIVissimEdge::dict_checkEdges2Join(), NBHelpers::distance(), GeomHelper::distancePointLine(), AGPosition::distanceTo(), GLHelper::drawBoxLines(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), Line::extrapolateBy(), Line::getPositionAtDistance(), GUIBusStop::GUIBusStop(), GUIContainerStop::GUIContainerStop(), PositionVector::indexOfClosest(), NBEdge::init(), GeomHelper::interpolate(), Line::length(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIViewTraffic::onGamingClick(), operator+(), PositionVector::positionAtOffset(), NIVissimEdge::remapOneOfNodes(), GUIVehicle::setFunctionalColor(), and MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility().
returns the euclidean distance in the x-y-plane
Definition at line 240 of file Position.h.
References distanceSquaredTo2D().
Referenced by Line::atan2DegreeSlope(), NBNode::buildWalkingAreas(), NBNode::checkCrossing(), GeomHelper::closestDistancePointLine2D(), PositionVector::distance(), GUIVehicle::drawAction_drawRailCarriages(), Line::extrapolateBy2D(), ROEdge::getDistanceTo(), MSEdge::getDistanceTo(), GeomHelper::getNormal90D_CW(), Line::getPositionAtDistance2D(), GUILane::GUILane(), MSPModel_Striping::initWalkingAreaPaths(), Line::intersectsAtLengths2D(), PositionVector::intersectsAtLengths2D(), Line::length2D(), PositionVector::move2side(), GeomHelper::nearest_offset_on_line_to_point2D(), PositionVector::nearest_offset_to_point2D(), PositionVector::positionAtOffset2D(), PositionVector::transformToVectorCoordinates(), and TraCIServerAPI_Vehicle::vtdMap().
returns the dot product (scalar product) between this point and the second one
Definition at line 258 of file Position.h.
Referenced by NBHeightMapper::Triangle::getZ().
|
inline |
Multiplies both positions with the given value.
Definition at line 99 of file Position.h.
Referenced by NIXMLNodesHandler::addNode(), NBNodeCont::analyzeCluster(), AGPosition::compute2dPosition(), NBNodeShapeComputer::computeNodeShapeDefault(), GUIEdge::drawGL(), NBNode::getEmptyDir(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and NWWriter_DlrNavteq::writeTrafficSignals().
Multiplies position with the given values.
Definition at line 106 of file Position.h.
Multiplies position with the given values.
Definition at line 112 of file Position.h.
|
inline |
Definition at line 158 of file Position.h.
References myX, myY, and SUMOReal.
Referenced by NBNode::getEmptyDir().
Definition at line 208 of file Position.h.
keep the direction but modify the length of the (location) vector to length * scalar
Definition at line 190 of file Position.h.
References myX, myY, myZ, and Position().
Definition at line 181 of file Position.h.
References myX, myY, myZ, and Position().
keep the direction but modify the length of the (location) vector to length + scalar
Definition at line 195 of file Position.h.
References distanceTo(), myX, myY, myZ, Position(), and SUMOReal.
Definition at line 185 of file Position.h.
References myX, myY, myZ, and Position().
lexicographical sorting for use in maps and sets
Definition at line 213 of file Position.h.
Definition at line 204 of file Position.h.
Definition at line 164 of file Position.h.
References myX, myY, SUMOReal, x(), and y().
Referenced by NBDistrict::reshiftPosition(), and Line::rotateAtP1().
Definition at line 78 of file Position.h.
References myX, myY, x(), and y().
Referenced by NIXMLNodesHandler::addNode(), ShapeHandler::addPOI(), GeoConvHelper::cartesian2geo(), GeomHelper::closestDistancePointLine2D(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), GeomHelper::FindLineCircleIntersections(), GUICompleteSchemeStorage::init(), NBHeightMapper::loadTiff(), GUISettingsHandler::myStartElement(), NLJunctionControlBuilder::openJunction(), operator>>(), TraCIServerAPI_GUI::processSet(), TraCIServer::readTypeCheckingPosition2D(), GUICompleteSchemeStorage::saveViewport(), NGNode::setX(), NGNode::setY(), GeoConvHelper::x2cartesian(), and GeoConvHelper::x2cartesian_const().
|
inline |
Definition at line 91 of file Position.h.
Substracts the given position from this one.
Definition at line 139 of file Position.h.
Referenced by GeoConvHelper::cartesian2geo(), AGPosition::compute2dPosition(), NBNode::computeSmoothShape(), GLHelper::drawTextBox(), Line::extrapolateBy(), Line::extrapolateBy2D(), NBNode::getEmptyDir(), NBHeightMapper::Triangle::getZ(), Line::rotateAtP1(), and Line::sub().
Substracts the given position from this one.
Definition at line 145 of file Position.h.
|
inline |
Substracts the given position from this one.
Definition at line 152 of file Position.h.
|
inline |
Returns the x-position.
Definition at line 63 of file Position.h.
References myX.
Referenced by Boundary::add(), Line::add(), NIXMLNodesHandler::addNode(), Boundary::around(), PositionVector::around(), Line::atan2Angle(), Line::atan2DegreeAngle(), NIImporter_OpenDrive::calculateStraightEndPoint(), GeoConvHelper::cartesian2geo(), GUIDanielPerspectiveChanger::centerTo(), NGRandomNetBuilder::checkAngles(), GUISUMOAbstractView::checkGDALImage(), TraCIServerAPI_Simulation::commandPositionConversion(), NBEdge::computeAngle(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), NBNode::computeSmoothShape(), NGRandomNetBuilder::createNewNode(), GeomHelper::distancePointLine(), GUIVehicle::drawAction_drawRailCarriages(), GUILane::drawArrows(), GLHelper::drawBoxLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GUIPointOfInterest::drawGL(), GUIVehicle::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawLane2LaneConnections(), GLHelper::drawLine(), GUIVehicle::drawLinkItem(), GUILane::drawLinkRule(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GUILane::drawTextAtEnd(), GLHelper::drawTextBox(), MSVTypeProbe::execute(), NBNodeCont::extract(), GeomHelper::FindLineCircleIntersections(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), MSPModel_Striping::getNextLaneObstacles(), GeomHelper::getNormal90D_CW(), MSVTKExport::getPositions(), TraCIServerAPI_InductionLoop::getTree(), GUIDanielPerspectiveChanger::getXPos(), NBHeightMapper::getZ(), GUIBusStop::GUIBusStop(), GUIContainerStop::GUIContainerStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILane::GUILane(), NBNodeCont::insert(), GeomHelper::intersection_position2D(), GeomHelper::intersects(), isLeft(), PositionVector::isLeft(), NBHeightMapper::loadTiff(), PositionVector::move2side(), MSPModel_Striping::moveInDirection(), GUISettingsHandler::myStartElement(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GeomHelper::nearest_offset_on_line_to_point2D(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::increasing_x_y_sorter::operator()(), GeomHelper::pointOnLine(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_GUI::processSet(), NIImporter_SUMO::reconstructEdgeShape(), reshiftRotate(), NBNodeCont::retrieve(), PCPolyContainer::save(), set(), GUIVehicle::setFunctionalColor(), GUIDialog_EditViewport::setValues(), GUISUMOAbstractView::setViewport(), NGNode::setY(), NBEdge::startShapeAt(), GeomHelper::transfer_to_side(), NBNetBuilder::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), MSFCDExport::write(), MSEmissionExport::write(), NBSign::writeAsPOI(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writePlanView(), BinaryFormatter::writePosition(), NWFrame::writePositionLong(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFullExport::writeVehicles(), GeoConvHelper::x2cartesian(), GeoConvHelper::x2cartesian_const(), and GUIDanielPerspectiveChanger::zoom().
|
inline |
Returns the y-position.
Definition at line 68 of file Position.h.
References myY.
Referenced by Boundary::add(), Line::add(), NIXMLNodesHandler::addNode(), Boundary::around(), PositionVector::around(), Line::atan2Angle(), Line::atan2DegreeAngle(), NIImporter_OpenDrive::calculateStraightEndPoint(), GeoConvHelper::cartesian2geo(), GUIDanielPerspectiveChanger::centerTo(), NGRandomNetBuilder::checkAngles(), GUISUMOAbstractView::checkGDALImage(), TraCIServerAPI_Simulation::commandPositionConversion(), NBEdge::computeAngle(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), NBNode::computeSmoothShape(), NGRandomNetBuilder::createNewNode(), GeomHelper::distancePointLine(), GUIVehicle::drawAction_drawRailCarriages(), GUILane::drawArrows(), GLHelper::drawBoxLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GUIPointOfInterest::drawGL(), GUIVehicle::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawLane2LaneConnections(), GLHelper::drawLine(), GUIVehicle::drawLinkItem(), GUILane::drawLinkRule(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GUILane::drawTextAtEnd(), GLHelper::drawTextBox(), MSVTypeProbe::execute(), NBNodeCont::extract(), GeomHelper::FindLineCircleIntersections(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), MSPModel_Striping::getNextLaneObstacles(), GeomHelper::getNormal90D_CW(), MSVTKExport::getPositions(), TraCIServerAPI_InductionLoop::getTree(), GUIDanielPerspectiveChanger::getYPos(), NBHeightMapper::getZ(), GUIBusStop::GUIBusStop(), GUIContainerStop::GUIContainerStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILane::GUILane(), NBNodeCont::insert(), GeomHelper::intersection_position2D(), GeomHelper::intersects(), isLeft(), PositionVector::isLeft(), NBHeightMapper::loadTiff(), PositionVector::move2side(), MSPModel_Striping::moveInDirection(), GUISettingsHandler::myStartElement(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GeomHelper::nearest_offset_on_line_to_point2D(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::relative_incoming_edge_sorter::operator()(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::increasing_x_y_sorter::operator()(), GeomHelper::pointOnLine(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_GUI::processSet(), NIImporter_SUMO::reconstructEdgeShape(), reshiftRotate(), NBNodeCont::retrieve(), PCPolyContainer::save(), set(), GUIVehicle::setFunctionalColor(), GUIDialog_EditViewport::setValues(), GUISUMOAbstractView::setViewport(), NGNode::setX(), NBEdge::startShapeAt(), GeomHelper::transfer_to_side(), NBNetBuilder::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), MSFCDExport::write(), MSEmissionExport::write(), NBSign::writeAsPOI(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writePlanView(), BinaryFormatter::writePosition(), NWFrame::writePositionLong(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFullExport::writeVehicles(), GeoConvHelper::x2cartesian(), GeoConvHelper::x2cartesian_const(), and GUIDanielPerspectiveChanger::zoom().
|
inline |
Returns the z-position.
Definition at line 73 of file Position.h.
References myZ.
Referenced by Line::add(), Line::atan2DegreeSlope(), TraCIServerAPI_Simulation::commandPositionConversion(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), NBNode::computeSmoothShape(), GUILane::getPopUpMenu(), MSVTKExport::getPositions(), GeomHelper::intersection_position2D(), GUIDialog_ViewSettings::loadSettings(), PositionVector::move2side(), GUISettingsHandler::myStartElement(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), set(), GUIDialog_EditViewport::setValues(), GUISettingsHandler::setViewport(), GUISUMOAbstractView::setViewport(), GUICompleteSchemeStorage::setViewport(), NBEdge::startShapeAt(), BinaryFormatter::writePosition(), and NWFrame::writePositionLong().
|
friend |
Prints to the output.
Definition at line 173 of file Position.h.
|
static |
Definition at line 262 of file Position.h.
Referenced by MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSVehicle::executeMove(), MSVehicle::fixPosition(), NLShapeHandler::getLanePos(), MSPModel_Striping::PState::getPosition(), MSVehicle::getPosition(), GeomHelper::intersection_position2D(), PositionVector::intersectsAtPoint(), MSPModel_Striping::moveInDirection(), GUIDialog_EditViewport::onCmdChanged(), GUIDialog_EditViewport::onCmdOk(), PositionVector::positionAtOffset(), PositionVector::positionAtOffset2D(), GUISUMOAbstractView::showViewportEditor(), and PositionVector::transformToVectorCoordinates().
|
private |
The x-position.
Definition at line 266 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), distanceSquaredTo2D(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator<(), operator==(), reshiftRotate(), set(), sub(), and x().
|
private |
The y-position.
Definition at line 269 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), distanceSquaredTo2D(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator<(), operator==(), reshiftRotate(), set(), sub(), and y().
|
private |
The z-position.
Definition at line 272 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), dotProduct(), mul(), operator!=(), operator*(), operator+(), operator-(), operator<(), operator==(), set(), sub(), and z().