SUMO - Simulation of Urban MObility
Line Class Reference

#include <Line.h>

Public Member Functions

void add (SUMOReal x, SUMOReal y)
void add (const Position &p)
SUMOReal atan2Angle () const
SUMOReal atan2DegreeAngle () const
SUMOReal atan2PositiveAngle () const
void extrapolateBy (SUMOReal length)
void extrapolateFirstBy (SUMOReal length)
void extrapolateSecondBy (SUMOReal length)
Position getPositionAtDistance (SUMOReal offset) const
Position getPositionAtDistance2D (SUMOReal offset) const
bool intersects (const Line &l) const
Position intersectsAt (const Line &l) const
SUMOReal intersectsAtLength2D (const Line &v)
 returns distance between myP1 and intersection or -1 if line segments do not intersect
std::vector< SUMORealintersectsAtLengths2D (const PositionVector &v)
SUMOReal length () const
SUMOReal length2D () const
 Line ()
 Line (const Position &p1, const Position &p2)
void move2side (SUMOReal amount)
const Positionp1 () const
const Positionp2 () const
Linereverse ()
void rotateAtP1 (SUMOReal rot)
void sub (SUMOReal x, SUMOReal y)
 ~Line ()

Private Attributes

Position myP1
Position myP2

Detailed Description

Class for line segments

Definition at line 51 of file Line.h.


Constructor & Destructor Documentation

Definition at line 50 of file Line.cpp.

Line::Line ( const Position p1,
const Position p2 
)

Definition at line 53 of file Line.cpp.

Definition at line 57 of file Line.cpp.


Member Function Documentation

void Line::add ( SUMOReal  x,
SUMOReal  y 
)

Definition at line 183 of file Line.cpp.

References Position::add(), myP1, and myP2.

Referenced by NBNodeShapeComputer::computeNodeShapeByCrosses().

void Line::add ( const Position p)

Definition at line 190 of file Line.cpp.

References Position::add(), myP1, myP2, Position::x(), Position::y(), and Position::z().

Definition at line 150 of file Line.cpp.

References atan2Angle(), PI, and SUMOReal.

Definition at line 70 of file Line.cpp.

References GeomHelper::extrapolate_first(), myP1, and myP2.

Referenced by NBNode::computeInternalLaneShape().

Definition at line 76 of file Line.cpp.

References GeomHelper::extrapolate_second(), myP1, and myP2.

Referenced by NBNode::computeInternalLaneShape().

Definition at line 106 of file Line.cpp.

References Position::distanceTo2D(), length(), myP1, myP2, SUMOReal, and toString().

Referenced by NBEdge::startShapeAt().

returns distance between myP1 and intersection or -1 if line segments do not intersect

Definition at line 214 of file Line.cpp.

References GeomHelper::intersection_position2D(), myP1, myP2, and GeomHelper::nearest_position_on_line_to_point2D().

Definition at line 171 of file Line.cpp.

References Position::distanceTo2D(), myP1, and myP2.

Referenced by PositionVector::intersectsAtLengths2D().

Definition at line 205 of file Line.cpp.

References myP1, and myP2.

Referenced by NBContHelper::edge_opposite_direction_sorter::getEdgeAngleAt().

void Line::sub ( SUMOReal  x,
SUMOReal  y 
)

Definition at line 197 of file Line.cpp.

References myP1, myP2, and Position::sub().

Referenced by NBNode::computeInternalLaneShape().


Field Documentation


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines