#include <Position2D.h>

Definition at line 42 of file Position2D.h.
Public Member Functions | |
| void | add (SUMOReal dx, SUMOReal dy) |
| Adds the given position to this one. | |
| void | add (const Position2D &pos) |
| Adds the given position to this one. | |
| bool | almostSame (const Position2D &p2, SUMOReal maxDiv=POSITION_EPS) const |
| SUMOReal | distanceSquaredTo (const Position2D &p2) const |
| SUMOReal | distanceTo (const Position2D &p2) const |
| void | mul (SUMOReal mx, SUMOReal my) |
| Multiplies position with the given values. | |
| void | mul (SUMOReal val) |
| Multiplies both positions with the given value. | |
| void | norm () |
| bool | operator!= (const Position2D &p2) const |
| bool | operator== (const Position2D &p2) const |
| Position2D (SUMOReal x, SUMOReal y) | |
| parametrised constructor | |
| Position2D () | |
| default constructor | |
| void | reshiftRotate (SUMOReal xoff, SUMOReal yoff, SUMOReal rot) |
| void | set (const Position2D &pos) |
| void | set (SUMOReal x, SUMOReal y) |
| void | sub (const Position2D &pos) |
| Substracts the given position from this one. | |
| void | sub (SUMOReal dx, SUMOReal dy) |
| Substracts the given position from this one. | |
| SUMOReal | x () const |
| Returns the x-position. | |
| SUMOReal | y () const |
| Returns the y-position. | |
| ~Position2D () | |
| Destructor. | |
Private Attributes | |
| SUMOReal | myX |
| The x-position. | |
| SUMOReal | myY |
| The y-position. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Position2D &p) |
| Prints to the output. | |
| Position2D::Position2D | ( | ) | [inline] |
| Position2D::Position2D | ( | SUMOReal | x, | |
| SUMOReal | y | |||
| ) | [inline] |
| Position2D::~Position2D | ( | ) | [inline] |
| void Position2D::add | ( | SUMOReal | dx, | |
| SUMOReal | dy | |||
| ) | [inline] |
| void Position2D::add | ( | const Position2D & | pos | ) | [inline] |
Adds the given position to this one.
Definition at line 90 of file Position2D.h.
Referenced by Line2D::add(), NBNodeShapeComputer::computeContinuationNodeShape(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), Position2DVector::distancesExt(), GUIEdge::drawGL(), NBNode::getEmptyDir(), GUIDanielPerspectiveChanger::move(), Line2D::move2side(), GeoConvHelper::moveConvertedBy(), Line2D::rotateAround(), Line2D::rotateAtP1(), GeomHelper::transfer_to_side(), and GeoConvHelper::x2cartesian().
| bool Position2D::almostSame | ( | const Position2D & | p2, | |
| SUMOReal | maxDiv = POSITION_EPS | |||
| ) | const [inline] |
Definition at line 142 of file Position2D.h.
Referenced by NBNode::computeInternalLaneShape(), Position2DVector::push_back_noDoublePos(), and Position2DVector::push_front_noDoublePos().
| SUMOReal Position2D::distanceSquaredTo | ( | const Position2D & | p2 | ) | const [inline] |
Definition at line 152 of file Position2D.h.
Referenced by GeomHelper::distancePointLine(), distanceTo(), and GeomHelper::nearest_position_on_line_to_point().
| SUMOReal Position2D::distanceTo | ( | const Position2D & | p2 | ) | const [inline] |
Definition at line 147 of file Position2D.h.
References distanceSquaredTo().
Referenced by GeomHelper::closestDistancePointLine(), traci::TraCIServer::commandDistanceRequest(), NBNode::computeInternalLaneShape(), traci::TraCIServer::convertCartesianToRoadMap(), NIVissimEdge::dict_checkEdges2Join(), Position2DVector::distance(), NBHelpers::distance(), GeomHelper::distancePointLine(), GLHelper::drawBoxLines(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), Line2D::extrapolateBy(), NBNodeCont::generateNodeClusters(), Line2D::getPositionAtDistance(), NBNodeCont::guessRamps(), GUIBusStop::GUIBusStop(), GUILaneWrapper::GUILaneWrapper(), traci::TraCIServer::handleVehicleDomain(), NBEdge::init(), GeomHelper::interpolate(), Position2DVector::intersectsAtLengths(), Line2D::intersectsAtLengths(), Position2DVector::move2side(), GUI_E2_ZS_Collector::MyWrapper::myConstruct(), Position2DVector::nearest_position_on_line_to_point(), GeomHelper::nearest_position_on_line_to_point(), GUIViewTraffic::onGamingClick(), Position2DVector::positionAtLengthPosition(), NIVissimEdge::remapOneOfNodes(), GUIVehicle::Colorer::setFunctionalColor(), and Position2DVector::splitAt().
00147 { 00148 return sqrt(distanceSquaredTo(p2)); 00149 }
| void Position2D::mul | ( | SUMOReal | mx, | |
| SUMOReal | my | |||
| ) | [inline] |
| void Position2D::mul | ( | SUMOReal | val | ) | [inline] |
Multiplies both positions with the given value.
Definition at line 78 of file Position2D.h.
Referenced by GUIDanielPerspectiveChanger::centerTo(), NBNodeShapeComputer::computeContinuationNodeShape(), Position2DVector::distancesExt(), GUIEdge::drawGL(), NBNode::getEmptyDir(), and NIXMLNodesHandler::myStartElement().
| void Position2D::norm | ( | ) | [inline] |
| bool Position2D::operator!= | ( | const Position2D & | p2 | ) | const [inline] |
| bool Position2D::operator== | ( | const Position2D & | p2 | ) | const [inline] |
| void Position2D::reshiftRotate | ( | SUMOReal | xoff, | |
| SUMOReal | yoff, | |||
| SUMOReal | rot | |||
| ) | [inline] |
Definition at line 119 of file Position2D.h.
References myX, myY, SUMOReal, x(), and y().
Referenced by NBNode::reshiftPosition(), and Line2D::rotateAtP1().
00119 { 00120 SUMOReal x = myX * cos(rot) -myY * sin(rot) + xoff; 00121 SUMOReal y = myX * sin(rot) + yoff + myY * cos(rot); 00122 myX = x; 00123 myY = y; 00124 }
| void Position2D::set | ( | const Position2D & | pos | ) | [inline] |
| void Position2D::set | ( | SUMOReal | x, | |
| SUMOReal | y | |||
| ) | [inline] |
Definition at line 65 of file Position2D.h.
References myX, myY, x(), and y().
Referenced by GeoConvHelper::cartesian2geo(), GUIDanielPerspectiveChanger::centerTo(), GeomHelper::closestDistancePointLine(), traci::TraCIServer::commandDistanceRequest(), NIXMLNodesHandler::myStartElement(), NLJunctionControlBuilder::openJunction(), GUIDanielPerspectiveChanger::recenterView(), GUIDanielPerspectiveChanger::setViewport(), NGNode::setX(), NGNode::setY(), and GeoConvHelper::x2cartesian().
| void Position2D::sub | ( | const Position2D & | pos | ) | [inline] |
| void Position2D::sub | ( | SUMOReal | dx, | |
| SUMOReal | dy | |||
| ) | [inline] |
Substracts the given position from this one.
Definition at line 102 of file Position2D.h.
Referenced by GeoConvHelper::cartesian2geo(), GUIDanielPerspectiveChanger::centerTo(), NBNode::computeInternalLaneShape(), NBNode::getEmptyDir(), Line2D::rotateAtP1(), and Line2D::sub().
| SUMOReal Position2D::x | ( | ) | const [inline] |
Returns the x-position.
Definition at line 55 of file Position2D.h.
References myX.
Referenced by Line2D::add(), Boundary::add(), GUISUMOAbstractView::applyChanges(), Position2DVector::around(), Boundary::around(), Line2D::atan2Angle(), Line2D::atan2DegreeAngle(), GeoConvHelper::cartesian2geo(), NGRandomNetBuilder::checkAngles(), GeomHelper::closestDistancePointLine(), traci::TraCIServer::commandPositionConversion(), traci::TraCIServer::commandSimulationParameter(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), traci::TraCIServer::convertCartesianToRoadMap(), GeomHelper::distancePointLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUIPointOfInterest::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIJunctionWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIEmitter::drawGL(), GUIEdge::drawGL(), GUIBusStop::drawGL(), GUIGlObject_AbstractAdd::drawGLName(), GUIE3Collector::MyWrapper::drawSingleCrossing(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), Line2D::extrapolateBy(), GUIPointOfInterest::getCenteringBoundary(), GUIEmitter::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), GeoConvHelper::getOffsetBase(), Line2D::getPositionAtDistance(), GUISUMOAbstractView::getPositionInformation(), GUIDanielPerspectiveChanger::getXPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), traci::TraCIServer::handlePoiDomain(), traci::TraCIServer::handlePolygonDomain(), traci::TraCIServer::handleTrafficLightDomain(), traci::TraCIServer::handleVehicleDomain(), NBEdge::init(), NIXMLEdgesHandler::insertNodeChecking(), GeomHelper::interpolate(), GeomHelper::intersection_position(), GeomHelper::intersects(), Position2DVector::isLeft(), isLeft(), Line2D::length(), main(), Position2DVector::move2side(), MSVehicle::moveFirstChecked(), MSVehicle::moveRegardingCritical(), GUI_E2_ZS_Collector::MyWrapper::myConstruct(), NIXMLNodesHandler::myStartElement(), GeomHelper::nearest_position_on_line_to_point(), Position2DVector::increasing_x_y_sorter::operator()(), Position2DVector::as_poly_cw_sorter::operator()(), Position2DVector::positionAtLengthPosition(), traci::TraCIServer::postProcessSimulationStep(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Junction::processGet(), reshiftRotate(), NBNodeCont::retrieve(), Line2D::rotateAround(), ROWdrawAction_drawArrows(), ROWdrawAction_drawLane2LaneConnections(), ROWdrawAction_drawLinkNo(), ROWdrawAction_drawLinkRules(), ROWdrawAction_drawTLSLinkNo(), NBNodeCont::savePlain(), set(), GUIVehicle::Colorer::setFunctionalColor(), NIXMLEdgesHandler::setNodes(), NGNode::setY(), NBNode::sortNodesEdges(), TEST(), TEST_F(), GeomHelper::transfer_to_side(), GUISUMOAbstractView::updatePositionInformation(), NBNode::writeXML(), NBNode::writeXMLInternalNodes(), and GeoConvHelper::x2cartesian().
00055 { 00056 return myX; 00057 }
| SUMOReal Position2D::y | ( | ) | const [inline] |
Returns the y-position.
Definition at line 60 of file Position2D.h.
References myY.
Referenced by Line2D::add(), Boundary::add(), GUISUMOAbstractView::applyChanges(), Position2DVector::around(), Boundary::around(), Line2D::atan2Angle(), Line2D::atan2DegreeAngle(), GeoConvHelper::cartesian2geo(), NGRandomNetBuilder::checkAngles(), GeomHelper::closestDistancePointLine(), traci::TraCIServer::commandPositionConversion(), traci::TraCIServer::commandSimulationParameter(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShape(), NBNodeShapeComputer::computeNodeShapeByCrosses(), traci::TraCIServer::convertCartesianToRoadMap(), GeomHelper::distancePointLine(), GLHelper::drawBoxLines(), GLHelper::drawFilledPoly(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUIPointOfInterest::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIJunctionWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIEmitter::drawGL(), GUIEdge::drawGL(), GUIBusStop::drawGL(), GUIGlObject_AbstractAdd::drawGLName(), GUIE3Collector::MyWrapper::drawSingleCrossing(), MSVehicle::enterLaneAtLaneChange(), MSVTypeProbe::execute(), GeomHelper::extrapolate_first(), GeomHelper::extrapolate_second(), Line2D::extrapolateBy(), GUIPointOfInterest::getCenteringBoundary(), GUIEmitter::getCenteringBoundary(), NBNode::getEmptyDir(), GeomHelper::getNormal90D_CW(), GeoConvHelper::getOffsetBase(), Line2D::getPositionAtDistance(), GUISUMOAbstractView::getPositionInformation(), GUIDanielPerspectiveChanger::getYPos(), GUIBusStop::GUIBusStop(), GUIJunctionWrapper::GUIJunctionWrapper(), GUILaneWrapper::GUILaneWrapper(), traci::TraCIServer::handlePoiDomain(), traci::TraCIServer::handlePolygonDomain(), traci::TraCIServer::handleTrafficLightDomain(), traci::TraCIServer::handleVehicleDomain(), NBEdge::init(), NIXMLEdgesHandler::insertNodeChecking(), GeomHelper::interpolate(), GeomHelper::intersection_position(), GeomHelper::intersects(), Position2DVector::isLeft(), isLeft(), Line2D::length(), main(), Position2DVector::move2side(), MSVehicle::moveFirstChecked(), MSVehicle::moveRegardingCritical(), GUI_E2_ZS_Collector::MyWrapper::myConstruct(), NIXMLNodesHandler::myStartElement(), GeomHelper::nearest_position_on_line_to_point(), Position2DVector::increasing_x_y_sorter::operator()(), Position2DVector::as_poly_cw_sorter::operator()(), Position2DVector::positionAtLengthPosition(), traci::TraCIServer::postProcessSimulationStep(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Junction::processGet(), reshiftRotate(), NBNodeCont::retrieve(), Line2D::rotateAround(), ROWdrawAction_drawArrows(), ROWdrawAction_drawLane2LaneConnections(), ROWdrawAction_drawLinkNo(), ROWdrawAction_drawLinkRules(), ROWdrawAction_drawTLSLinkNo(), NBNodeCont::savePlain(), set(), GUIVehicle::Colorer::setFunctionalColor(), NIXMLEdgesHandler::setNodes(), NGNode::setX(), NBNode::sortNodesEdges(), TEST(), TEST_F(), GeomHelper::transfer_to_side(), GUISUMOAbstractView::updatePositionInformation(), NBNode::writeXML(), NBNode::writeXMLInternalNodes(), and GeoConvHelper::x2cartesian().
00060 { 00061 return myY; 00062 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Position2D & | p | |||
| ) | [friend] |
SUMOReal Position2D::myX [private] |
The x-position.
Definition at line 159 of file Position2D.h.
Referenced by add(), almostSame(), distanceSquaredTo(), mul(), norm(), operator!=(), operator==(), reshiftRotate(), set(), sub(), and x().
SUMOReal Position2D::myY [private] |
The y-position.
Definition at line 162 of file Position2D.h.
Referenced by add(), almostSame(), distanceSquaredTo(), mul(), norm(), operator!=(), operator==(), reshiftRotate(), set(), sub(), and y().
1.5.6