|
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. | |
| void | add (SUMOReal dx, SUMOReal dy, SUMOReal dz) |
| Adds the given position to this one. | |
| void | add (SUMOReal dx, SUMOReal dy) |
| Adds the given position to this one. | |
| 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 | |
| SUMOReal | distanceSquaredTo (const Position &p2) const |
| SUMOReal | distanceTo (const Position &p2) const |
| SUMOReal | dotProduct (const Position &pos) |
| returns the dot product (scalar product) between this point and the second one | |
| void | mul (SUMOReal mx, SUMOReal my) |
| Multiplies position with the given values. | |
| void | mul (SUMOReal mx, SUMOReal my, SUMOReal mz) |
| Multiplies position with the given values. | |
| void | mul (SUMOReal val) |
| Multiplies both positions with the given value. | |
| 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 | |
| Position (SUMOReal x, SUMOReal y) | |
| parametrised constructor | |
| Position (SUMOReal x, SUMOReal y, SUMOReal z) | |
| parametrised constructor | |
| 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 (const Position &pos) |
| Substracts the given position from this one. | |
| void | sub (SUMOReal dx, SUMOReal dy) |
| Substracts the given position from this one. | |
| void | sub (SUMOReal dx, SUMOReal dy, SUMOReal dz) |
| Substracts the given position from this one. | |
| SUMOReal | x () const |
| Returns the x-position. | |
| SUMOReal | y () const |
| Returns the y-position. | |
| SUMOReal | z () const |
| Returns the z-position. | |
| ~Position () | |
| Destructor. | |
Private Attributes | |
| SUMOReal | myX |
| The x-position. | |
| SUMOReal | myY |
| The y-position. | |
| SUMOReal | myZ |
| The z-position. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Position &p) |
| Prints to the output. | |
A point in 2D or 3D with translation and scaling methods.
Definition at line 42 of file Position.h.
| Position::Position | ( | ) | [inline] |
default constructor
Definition at line 45 of file Position.h.
Referenced by crossProduct(), operator*(), operator+(), and operator-().
| Position::Position | ( | SUMOReal | x, |
| SUMOReal | y | ||
| ) | [inline] |
parametrised constructor
Definition at line 48 of file Position.h.
| Position::Position | ( | SUMOReal | x, |
| SUMOReal | y, | ||
| SUMOReal | z | ||
| ) | [inline] |
parametrised constructor
Definition at line 52 of file Position.h.
| Position::~Position | ( | ) | [inline] |
Destructor.
Definition at line 56 of file Position.h.
| void Position::add | ( | const Position & | pos | ) | [inline] |
Adds the given position to this one.
Definition at line 115 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(), Line::rotateAround(), Line::rotateAtP1(), GUISUMOAbstractView::showToolTipFor(), GeomHelper::transfer_to_side(), and GeoConvHelper::x2cartesian().
| void Position::add | ( | SUMOReal | dx, |
| SUMOReal | dy | ||
| ) | [inline] |
Adds the given position to this one.
Definition at line 122 of file Position.h.
| void Position::add | ( | SUMOReal | dx, |
| SUMOReal | dy, | ||
| SUMOReal | dz | ||
| ) | [inline] |
Adds the given position to this one.
Definition at line 128 of file Position.h.
Definition at line 198 of file Position.h.
Referenced by NBNode::computeInternalLaneShape(), PositionVector::push_back_noDoublePos(), and PositionVector::push_front_noDoublePos().
returns the cross product between this point and the second one
Definition at line 213 of file Position.h.
References myX, myY, myZ, and Position().
| SUMOReal Position::distanceSquaredTo | ( | const Position & | p2 | ) | const [inline] |
Definition at line 208 of file Position.h.
Referenced by GeomHelper::distancePointLine(), distanceTo(), and GeomHelper::nearest_position_on_line_to_point().
| SUMOReal Position::distanceTo | ( | const Position & | p2 | ) | const [inline] |
Definition at line 203 of file Position.h.
References distanceSquaredTo().
Referenced by NBEdge::buildInnerEdges(), GeomHelper::closestDistancePointLine(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), NBNode::computeInternalLaneShape(), NIVissimEdge::dict_checkEdges2Join(), NBHelpers::distance(), GeomHelper::distancePointLine(), GLHelper::drawBoxLines(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), Line::extrapolateBy(), NBNodeCont::generateNodeClusters(), Line::getPositionAtDistance(), GUIBusStop::GUIBusStop(), GUILaneWrapper::GUILaneWrapper(), PositionVector::indexOfClosest(), GeomHelper::interpolate(), PositionVector::intersectsAtLengths(), Line::intersectsAtLengths(), PositionVector::move2side(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), PositionVector::nearest_position_on_line_to_point(), GeomHelper::nearest_position_on_line_to_point(), GUIViewTraffic::onGamingClick(), PositionVector::positionAtLengthPosition(), NIVissimEdge::remapOneOfNodes(), GUIVehicle::setFunctionalColor(), and PositionVector::splitAt().
| SUMOReal Position::dotProduct | ( | const Position & | pos | ) | [inline] |
returns the dot product (scalar product) between this point and the second one
Definition at line 221 of file Position.h.
| void Position::mul | ( | SUMOReal | mx, |
| SUMOReal | my, | ||
| SUMOReal | mz | ||
| ) | [inline] |
Multiplies position with the given values.
Definition at line 108 of file Position.h.
| void Position::mul | ( | SUMOReal | val | ) | [inline] |
Multiplies both positions with the given value.
Definition at line 95 of file Position.h.
Referenced by NIXMLNodesHandler::addNode(), NBNodeCont::analyzeCluster(), AGPosition::compute2dPosition(), NBNodeShapeComputer::computeContinuationNodeShape(), GUIEdge::drawGL(), and NBNode::getEmptyDir().
| void Position::mul | ( | SUMOReal | mx, |
| SUMOReal | my | ||
| ) | [inline] |
Multiplies position with the given values.
Definition at line 102 of file Position.h.
| void Position::norm2d | ( | ) | [inline] |
Definition at line 154 of file Position.h.
References myX, myY, and SUMOReal.
Referenced by NBNode::getEmptyDir().
Definition at line 193 of file Position.h.
| Position Position::operator* | ( | SUMOReal | scalar | ) | const [inline] |
Definition at line 185 of file Position.h.
References myX, myY, myZ, and Position().
Definition at line 177 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 189 of file Position.h.
| void Position::reshiftRotate | ( | SUMOReal | xoff, |
| SUMOReal | yoff, | ||
| SUMOReal | rot | ||
| ) | [inline] |
Definition at line 160 of file Position.h.
References myX, myY, SUMOReal, x(), and y().
Referenced by NBNode::reshiftPosition(), NBDistrict::reshiftPosition(), and Line::rotateAtP1().
| void Position::set | ( | SUMOReal | x, |
| SUMOReal | y, | ||
| SUMOReal | z | ||
| ) | [inline] |
| void Position::set | ( | SUMOReal | x, |
| SUMOReal | y | ||
| ) | [inline] |
Definition at line 74 of file Position.h.
References myX, myY, x(), and y().
Referenced by NIXMLNodesHandler::addNode(), GeoConvHelper::cartesian2geo(), GeomHelper::closestDistancePointLine(), TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), NGNode::setX(), NGNode::setY(), and GeoConvHelper::x2cartesian().
| void Position::set | ( | const Position & | pos | ) | [inline] |
Definition at line 87 of file Position.h.
| void Position::sub | ( | const Position & | pos | ) | [inline] |
Substracts the given position from this one.
Definition at line 148 of file Position.h.
| void Position::sub | ( | SUMOReal | dx, |
| SUMOReal | dy, | ||
| SUMOReal | dz | ||
| ) | [inline] |
Substracts the given position from this one.
Definition at line 141 of file Position.h.
| void Position::sub | ( | SUMOReal | dx, |
| SUMOReal | dy | ||
| ) | [inline] |
Substracts the given position from this one.
Definition at line 135 of file Position.h.
Referenced by GeoConvHelper::cartesian2geo(), AGPosition::compute2dPosition(), NBNode::computeInternalLaneShape(), GLHelper::drawTextBox(), Line::extrapolateBy(), NBNode::getEmptyDir(), Line::rotateAtP1(), and Line::sub().
| SUMOReal Position::x | ( | ) | const [inline] |
Returns the x-position.
Definition at line 59 of file Position.h.
References myX.
Referenced by Line::add(), Boundary::add(), NIXMLNodesHandler::addNode(), PositionVector::around(), Boundary::around(), Line::atan2Angle(), Line::atan2DegreeAngle(), GeoConvHelper::cartesian2geo(), GUIDanielPerspectiveChanger::centerTo(), NGRandomNetBuilder::checkAngles(), GeomHelper::closestDistancePointLine(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), GeomHelper::distancePointLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIEdge::drawGL(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GLHelper::drawTextBox(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), GeoConvHelper::getOffsetBase(), GUIDanielPerspectiveChanger::getXPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), NIXMLEdgesHandler::insertNodeChecking(), GeomHelper::interpolate(), GeomHelper::intersection_position(), GeomHelper::intersects(), PositionVector::isLeft(), isLeft(), Line::length(), main(), PositionVector::move2side(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GeomHelper::nearest_position_on_line_to_point(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), PositionVector::increasing_x_y_sorter::operator()(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::positionAtLengthPosition(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Junction::processGet(), NIImporter_SUMO::reconstructEdgeShape(), reshiftRotate(), NBNodeCont::retrieve(), Line::rotateAround(), GUILaneWrapper::ROWdrawAction_drawArrows(), GUILaneWrapper::ROWdrawAction_drawLane2LaneConnections(), GUILaneWrapper::ROWdrawAction_drawLinkNo(), GUILaneWrapper::ROWdrawAction_drawLinkRules(), GUILaneWrapper::ROWdrawAction_drawTLSLinkNo(), set(), GUIVehicle::setFunctionalColor(), NIXMLEdgesHandler::setNodes(), NGNode::setY(), GeomHelper::transfer_to_side(), NILoader::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), NWWriter_OpenDrive::writePlanView(), NWFrame::writePositionLong(), GeoConvHelper::x2cartesian(), and GUIDanielPerspectiveChanger::zoom().
| SUMOReal Position::y | ( | ) | const [inline] |
Returns the y-position.
Definition at line 64 of file Position.h.
References myY.
Referenced by Line::add(), Boundary::add(), NIXMLNodesHandler::addNode(), PositionVector::around(), Boundary::around(), Line::atan2Angle(), Line::atan2DegreeAngle(), GeoConvHelper::cartesian2geo(), GUIDanielPerspectiveChanger::centerTo(), NGRandomNetBuilder::checkAngles(), GeomHelper::closestDistancePointLine(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), GeomHelper::distancePointLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIEdge::drawGL(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GLHelper::drawTextBox(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), GeoConvHelper::getOffsetBase(), GUIDanielPerspectiveChanger::getYPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), NIXMLEdgesHandler::insertNodeChecking(), GeomHelper::interpolate(), GeomHelper::intersection_position(), GeomHelper::intersects(), PositionVector::isLeft(), isLeft(), Line::length(), main(), PositionVector::move2side(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GeomHelper::nearest_position_on_line_to_point(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), PositionVector::increasing_x_y_sorter::operator()(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::positionAtLengthPosition(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Junction::processGet(), NIImporter_SUMO::reconstructEdgeShape(), reshiftRotate(), NBNodeCont::retrieve(), Line::rotateAround(), GUILaneWrapper::ROWdrawAction_drawArrows(), GUILaneWrapper::ROWdrawAction_drawLane2LaneConnections(), GUILaneWrapper::ROWdrawAction_drawLinkNo(), GUILaneWrapper::ROWdrawAction_drawLinkRules(), GUILaneWrapper::ROWdrawAction_drawTLSLinkNo(), set(), GUIVehicle::setFunctionalColor(), NIXMLEdgesHandler::setNodes(), NGNode::setX(), GeomHelper::transfer_to_side(), NILoader::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), NWWriter_OpenDrive::writePlanView(), NWFrame::writePositionLong(), GeoConvHelper::x2cartesian(), and GUIDanielPerspectiveChanger::zoom().
| SUMOReal Position::z | ( | ) | const [inline] |
Returns the z-position.
Definition at line 69 of file Position.h.
References myZ.
Referenced by NBEdge::computeLaneShape(), set(), and NWFrame::writePositionLong().
| std::ostream& operator<< | ( | std::ostream & | os, |
| const Position & | p | ||
| ) | [friend] |
Prints to the output.
Definition at line 169 of file Position.h.
SUMOReal Position::myX [private] |
The x-position.
Definition at line 228 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator==(), reshiftRotate(), set(), sub(), and x().
SUMOReal Position::myY [private] |
The y-position.
Definition at line 231 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator==(), reshiftRotate(), set(), sub(), and y().
SUMOReal Position::myZ [private] |
The z-position.
Definition at line 234 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), dotProduct(), mul(), operator!=(), operator*(), operator+(), operator-(), operator==(), set(), sub(), and z().