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
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
DoubleVector intersectsAtLengths2D (const PositionVector &v)
SUMOReal length () const
SUMOReal length2D () const
 Line (const Position &p1, const Position &p2)
 Line ()
void move2side (SUMOReal amount)
const Position & p1 () const
const Position & p2 () const
Line & reverse ()
void rotateAround (const Position &at, SUMOReal rot)
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

Line::Line ( )

Definition at line 50 of file Line.cpp.

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

Definition at line 53 of file Line.cpp.

Line::~Line ( )

Definition at line 57 of file Line.cpp.


Member Function Documentation

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

Definition at line 170 of file Line.cpp.

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

Referenced by NBNodeShapeComputer::computeNodeShapeByCrosses().

void Line::add ( const Position &  p)

Definition at line 177 of file Line.cpp.

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

SUMOReal Line::atan2Angle ( ) const
SUMOReal Line::atan2PositiveAngle ( ) const

Definition at line 137 of file Line.cpp.

References atan2Angle(), PI, and SUMOReal.

void Line::extrapolateFirstBy ( SUMOReal  length)

Definition at line 70 of file Line.cpp.

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

Referenced by NBNode::computeInternalLaneShape().

void Line::extrapolateSecondBy ( SUMOReal  length)

Definition at line 76 of file Line.cpp.

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

Referenced by NBNode::computeInternalLaneShape().

Position Line::getPositionAtDistance ( SUMOReal  offset) const
SUMOReal Line::intersectsAtLength2D ( const Line &  v)

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

Definition at line 201 of file Line.cpp.

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

DoubleVector Line::intersectsAtLengths2D ( const PositionVector &  v)
SUMOReal Line::length ( ) const
SUMOReal Line::length2D ( ) const

Definition at line 158 of file Line.cpp.

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

Referenced by PositionVector::intersectsAtLengths2D().

void Line::move2side ( SUMOReal  amount)
Line & Line::reverse ( )

Definition at line 192 of file Line.cpp.

References myP1, and myP2.

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

void Line::rotateAround ( const Position &  at,
SUMOReal  rot 
)
void Line::rotateAtP1 ( SUMOReal  rot)

Definition at line 209 of file Line.cpp.

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

Referenced by NBNode::computeInternalLaneShape().

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

Field Documentation


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