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) |
Adds the given position to this one. | |
void | add (SUMOReal dx, SUMOReal dy, SUMOReal dz) |
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 | distanceSquaredTo2D (const Position &p2) const |
SUMOReal | distanceTo (const Position &p2) const |
returns the euclidean distance in 3 dimension | |
SUMOReal | distanceTo2D (const Position &p2) const |
returns the euclidean distance in the x-y-plane | |
SUMOReal | dotProduct (const Position &pos) |
returns the dot product (scalar product) between this point and the second one | |
void | mul (SUMOReal val) |
Multiplies both positions with the given value. | |
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 | 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 (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. | |
void | sub (const Position &pos) |
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 46 of file Position.h.
Position::Position | ( | ) | [inline] |
default constructor
Definition at line 49 of file Position.h.
Referenced by crossProduct(), GUIPointOfInterest::drawGL(), operator*(), operator+(), and operator-().
Position::Position | ( | SUMOReal | x, |
SUMOReal | y | ||
) | [inline] |
parametrised constructor
Definition at line 52 of file Position.h.
Position::Position | ( | SUMOReal | x, |
SUMOReal | y, | ||
SUMOReal | z | ||
) | [inline] |
parametrised constructor
Definition at line 56 of file Position.h.
Position::~Position | ( | ) | [inline] |
Destructor.
Definition at line 60 of file Position.h.
void Position::add | ( | const Position & | pos | ) | [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().
void Position::add | ( | SUMOReal | dx, |
SUMOReal | dy | ||
) | [inline] |
Adds the given position to this one.
Definition at line 126 of file Position.h.
void Position::add | ( | SUMOReal | dx, |
SUMOReal | dy, | ||
SUMOReal | dz | ||
) | [inline] |
Adds the given position to this one.
Definition at line 132 of file Position.h.
bool Position::almostSame | ( | const Position & | p2, |
SUMOReal | maxDiv = POSITION_EPS |
||
) | const [inline] |
Definition at line 202 of file Position.h.
Referenced by NBNode::computeInternalLaneShape(), AGPosition::operator==(), PositionVector::push_back_noDoublePos(), and PositionVector::push_front_noDoublePos().
Position Position::crossProduct | ( | const Position & | pos | ) | [inline] |
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().
SUMOReal Position::distanceSquaredTo | ( | const Position & | p2 | ) | const [inline] |
Definition at line 213 of file Position.h.
Referenced by GeomHelper::distancePointLine(), and distanceTo().
SUMOReal Position::distanceSquaredTo2D | ( | const Position & | p2 | ) | const [inline] |
SUMOReal Position::distanceTo | ( | const Position & | p2 | ) | const [inline] |
returns the euclidean distance in 3 dimension
Definition at line 208 of file Position.h.
References distanceSquaredTo().
Referenced by NBEdge::buildInnerEdges(), 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(), NBNodeCont::generateNodeClusters(), Line::getPositionAtDistance(), GUIBusStop::GUIBusStop(), PositionVector::indexOfClosest(), NBEdge::init(), GeomHelper::interpolate(), Line::length(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIViewTraffic::onGamingClick(), PositionVector::positionAtLengthPosition(), NIVissimEdge::remapOneOfNodes(), GUIVehicle::setFunctionalColor(), and PositionVector::splitAt().
SUMOReal Position::distanceTo2D | ( | const Position & | p2 | ) | const [inline] |
returns the euclidean distance in the x-y-plane
Definition at line 219 of file Position.h.
References distanceSquaredTo2D().
Referenced by GeomHelper::closestDistancePointLine(), ROEdge::getDistanceTo(), GeomHelper::getNormal90D_CW(), Line::getPositionAtDistance2D(), GUILaneWrapper::GUILaneWrapper(), Line::intersectsAtLengths2D(), PositionVector::intersectsAtLengths2D(), Line::length2D(), PositionVector::move2side(), GeomHelper::nearest_position_on_line_to_point2D(), PositionVector::nearest_position_on_line_to_point2D(), and PositionVector::positionAtLengthPosition2D().
SUMOReal Position::dotProduct | ( | const Position & | pos | ) | [inline] |
returns the dot product (scalar product) between this point and the second one
Definition at line 237 of file Position.h.
void Position::mul | ( | SUMOReal | val | ) | [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(), and NBNode::getEmptyDir().
void Position::mul | ( | SUMOReal | mx, |
SUMOReal | my | ||
) | [inline] |
Multiplies position with the given values.
Definition at line 106 of file Position.h.
void Position::mul | ( | SUMOReal | mx, |
SUMOReal | my, | ||
SUMOReal | mz | ||
) | [inline] |
Multiplies position with the given values.
Definition at line 112 of file Position.h.
void Position::norm2d | ( | ) | [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.
void Position::reshiftRotate | ( | SUMOReal | xoff, |
SUMOReal | yoff, | ||
SUMOReal | rot | ||
) | [inline] |
Definition at line 164 of file Position.h.
References myX, myY, SUMOReal, x(), and y().
Referenced by NBDistrict::reshiftPosition(), and Line::rotateAtP1().
void Position::set | ( | SUMOReal | x, |
SUMOReal | y | ||
) | [inline] |
Definition at line 78 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(), GeoConvHelper::x2cartesian(), and GeoConvHelper::x2cartesian_const().
void Position::set | ( | SUMOReal | x, |
SUMOReal | y, | ||
SUMOReal | z | ||
) | [inline] |
void Position::set | ( | const Position & | pos | ) | [inline] |
Definition at line 91 of file Position.h.
void Position::sub | ( | SUMOReal | dx, |
SUMOReal | dy | ||
) | [inline] |
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().
void Position::sub | ( | SUMOReal | dx, |
SUMOReal | dy, | ||
SUMOReal | dz | ||
) | [inline] |
Substracts the given position from this one.
Definition at line 145 of file Position.h.
void Position::sub | ( | const Position & | pos | ) | [inline] |
Substracts the given position from this one.
Definition at line 152 of file Position.h.
SUMOReal Position::x | ( | ) | const [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(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NGRandomNetBuilder::createNewNode(), GeomHelper::distancePointLine(), GLHelper::drawBoxLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIPointOfInterest::drawGL(), GUITriggeredRerouter::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), GUIEdge::drawGL(), GUIVehicle::drawGLAdditional(), GLHelper::drawLine(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GLHelper::drawTextBox(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), GeoConvHelper::getOffsetBase(), GUIDanielPerspectiveChanger::getXPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), NBEdge::init(), NIXMLEdgesHandler::insertNodeChecking(), GeomHelper::intersection_position2D(), GeomHelper::intersects(), isLeft(), PositionVector::isLeft(), main(), PositionVector::move2side(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GeomHelper::nearest_position_on_line_to_point2D(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::increasing_x_y_sorter::operator()(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Vehicle::processGet(), NIImporter_SUMO::reconstructEdgeShape(), reshiftRotate(), NBNodeCont::retrieve(), 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(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writePlanView(), NWFrame::writePositionLong(), GeoConvHelper::x2cartesian(), GeoConvHelper::x2cartesian_const(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Position::y | ( | ) | const [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(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NGRandomNetBuilder::createNewNode(), GeomHelper::distancePointLine(), GLHelper::drawBoxLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIPointOfInterest::drawGL(), GUITriggeredRerouter::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), GUIEdge::drawGL(), GUIVehicle::drawGLAdditional(), GLHelper::drawLine(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GLHelper::drawText(), GLHelper::drawTextBox(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), MSVehicle::getAngle(), GUIPointOfInterest::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), GeoConvHelper::getOffsetBase(), GUIDanielPerspectiveChanger::getYPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), NBEdge::init(), NIXMLEdgesHandler::insertNodeChecking(), GeomHelper::intersection_position2D(), GeomHelper::intersects(), isLeft(), PositionVector::isLeft(), main(), PositionVector::move2side(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), GUIInstantInductLoop::MyWrapper::MyWrapper(), GUI_E2_ZS_Collector::MyWrapper::MyWrapper(), GUIInductLoop::MyWrapper::MyWrapper(), GeomHelper::nearest_position_on_line_to_point2D(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), PositionVector::as_poly_cw_sorter::operator()(), PositionVector::increasing_x_y_sorter::operator()(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Vehicle::processGet(), NIImporter_SUMO::reconstructEdgeShape(), reshiftRotate(), NBNodeCont::retrieve(), 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(), BinaryFormatter::writeAttr(), NWWriter_OpenDrive::writePlanView(), NWFrame::writePositionLong(), GeoConvHelper::x2cartesian(), GeoConvHelper::x2cartesian_const(), and GUIDanielPerspectiveChanger::zoom().
SUMOReal Position::z | ( | ) | const [inline] |
Returns the z-position.
Definition at line 73 of file Position.h.
References myZ.
Referenced by Line::add(), NBEdge::computeLaneShape(), GeomHelper::intersection_position2D(), PositionVector::move2side(), set(), BinaryFormatter::writeAttr(), and NWFrame::writePositionLong().
std::ostream& operator<< | ( | std::ostream & | os, |
const Position & | p | ||
) | [friend] |
Prints to the output.
Definition at line 173 of file Position.h.
SUMOReal Position::myX [private] |
The x-position.
Definition at line 244 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), distanceSquaredTo2D(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator==(), reshiftRotate(), set(), sub(), and x().
SUMOReal Position::myY [private] |
The y-position.
Definition at line 247 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), distanceSquaredTo2D(), dotProduct(), mul(), norm2d(), operator!=(), operator*(), operator+(), operator-(), operator==(), reshiftRotate(), set(), sub(), and y().
SUMOReal Position::myZ [private] |
The z-position.
Definition at line 250 of file Position.h.
Referenced by add(), almostSame(), crossProduct(), distanceSquaredTo(), dotProduct(), mul(), operator!=(), operator*(), operator+(), operator-(), operator==(), set(), sub(), and z().