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 |
Position | operator+ (const Position &p2) const |
Position | operator- (const Position &p2) const |
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::computeContinuationNodeShape(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), GUIEdge::drawGL(), GLHelper::drawTextBox(), Line::extrapolateBy(), 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 202 of file Position.h.
Referenced by NBNode::computeInternalLaneShape(), 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 229 of file Position.h.
References myX, myY, myZ, and Position().
Definition at line 213 of file Position.h.
Referenced by GeomHelper::distancePointLine(), and distanceTo().
returns the euclidean distance in 3 dimension
Definition at line 208 of file Position.h.
References distanceSquaredTo().
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), NBNode::computeInternalLaneShape(), NIVissimEdge::dict_checkEdges2Join(), NBHelpers::distance(), GeomHelper::distancePointLine(), AGPosition::distanceTo(), GLHelper::drawBoxLines(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), Line::extrapolateBy(), Line::getPositionAtDistance(), GUIBusStop::GUIBusStop(), PositionVector::indexOfClosest(), NBEdge::init(), GeomHelper::interpolate(), Line::length(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIViewTraffic::onGamingClick(), PositionVector::positionAtOffset(), NIVissimEdge::remapOneOfNodes(), and GUIVehicle::setFunctionalColor().
returns the euclidean distance in the x-y-plane
Definition at line 219 of file Position.h.
References distanceSquaredTo2D().
Referenced by Line::atan2DegreeSlope(), GeomHelper::closestDistancePointLine(), ROEdge::getDistanceTo(), GeomHelper::getNormal90D_CW(), Line::getPositionAtDistance2D(), GUILaneWrapper::GUILaneWrapper(), Line::intersectsAtLengths2D(), PositionVector::intersectsAtLengths2D(), Line::length2D(), PositionVector::move2side(), GeomHelper::nearest_offset_on_line_to_point2D(), PositionVector::nearest_offset_to_point2D(), and PositionVector::positionAtOffset2D().
returns the dot product (scalar product) between this point and the second one
Definition at line 237 of file Position.h.
|
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::computeContinuationNodeShape(), GUIEdge::drawGL(), NBNode::getEmptyDir(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
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 197 of file Position.h.
Definition at line 189 of file Position.h.
References myX, myY, myZ, and Position().
Definition at line 181 of file Position.h.
References myX, myY, myZ, and Position().
Definition at line 185 of file Position.h.
References myX, myY, myZ, and Position().
Definition at line 193 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(), NLHandler::addPOI(), GeoConvHelper::cartesian2geo(), GeomHelper::closestDistancePointLine(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNodeShapeComputer::computeContinuationNodeShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), GUICompleteSchemeStorage::init(), GUISettingsHandler::myStartElement(), NLJunctionControlBuilder::openJunction(), operator>>(), TraCIServerAPI_GUI::processSet(), traci::TraCIServer::readTypeCheckingPosition2D(), GUICompleteSchemeStorage::saveViewport(), NGNode::setX(), NGNode::setY(), 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::computeInternalLaneShape(), GLHelper::drawTextBox(), Line::extrapolateBy(), NBNode::getEmptyDir(), 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(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNodeShapeComputer::computeContinuationNodeShape(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), NGRandomNetBuilder::createNewNode(), GeomHelper::distancePointLine(), GUIVehicle::drawAction_drawRailCarriages(), GUILaneWrapper::drawArrows(), GLHelper::drawBoxLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIPerson::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIPointOfInterest::drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), GUIEdge::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILaneWrapper::drawLane2LaneConnections(), GLHelper::drawLine(), GUIVehicle::drawLinkItem(), GUILaneWrapper::drawLinkNo(), GUILaneWrapper::drawLinkRules(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GLHelper::drawTextBox(), GUILaneWrapper::drawTLSLinkNo(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), MSVTKExport::getPositions(), GUIDanielPerspectiveChanger::getXPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), NBEdge::init(), GeomHelper::intersection_position2D(), GeomHelper::intersects(), isLeft(), PositionVector::isLeft(), PositionVector::move2side(), GUISettingsHandler::myStartElement(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GeomHelper::nearest_offset_on_line_to_point2D(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::increasing_x_y_sorter::operator()(), MSVehicle::planMove(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Vehicle::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(), NILoader::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), MSFCDExport::write(), MSEmissionExport::write(), NBSign::writeAsPOI(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writePlanView(), BinaryFormatter::writePosition(), NWFrame::writePositionLong(), 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(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNodeShapeComputer::computeContinuationNodeShape(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), NGRandomNetBuilder::createNewNode(), GeomHelper::distancePointLine(), GUIVehicle::drawAction_drawRailCarriages(), GUILaneWrapper::drawArrows(), GLHelper::drawBoxLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIPerson::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIPointOfInterest::drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), GUIEdge::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILaneWrapper::drawLane2LaneConnections(), GLHelper::drawLine(), GUIVehicle::drawLinkItem(), GUILaneWrapper::drawLinkNo(), GUILaneWrapper::drawLinkRules(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GLHelper::drawTextBox(), GUILaneWrapper::drawTLSLinkNo(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), MSVTKExport::getPositions(), GUIDanielPerspectiveChanger::getYPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), NBEdge::init(), GeomHelper::intersection_position2D(), GeomHelper::intersects(), isLeft(), PositionVector::isLeft(), PositionVector::move2side(), GUISettingsHandler::myStartElement(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GeomHelper::nearest_offset_on_line_to_point2D(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::increasing_x_y_sorter::operator()(), MSVehicle::planMove(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Vehicle::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(), NILoader::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), MSEmissionExport::write(), MSFCDExport::write(), NBSign::writeAsPOI(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writePlanView(), BinaryFormatter::writePosition(), NWFrame::writePositionLong(), MSFullExport::writeVehicles(), 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(), NBNodeShapeComputer::computeContinuationNodeShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), MSVTKExport::getPositions(), GeomHelper::intersection_position2D(), PositionVector::move2side(), GUISettingsHandler::myStartElement(), 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 241 of file Position.h.
Referenced by MSVehicle::getPosition(), GUIDialog_EditViewport::onCmdChanged(), GUIDialog_EditViewport::onCmdOk(), and GUISUMOAbstractView::showViewportEditor().
|
private |
The x-position.
Definition at line 245 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), distanceSquaredTo2D(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator==(), reshiftRotate(), set(), sub(), and x().
|
private |
The y-position.
Definition at line 248 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), distanceSquaredTo2D(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator==(), reshiftRotate(), set(), sub(), and y().
|
private |
The z-position.
Definition at line 251 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), dotProduct(), mul(), operator!=(), operator*(), operator+(), operator-(), operator==(), set(), sub(), and z().