SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 
SUMOReal atan2TiltDegree () 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 More...
 
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

Line::Line ( )

Definition at line 49 of file Line.cpp.

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

Definition at line 52 of file Line.cpp.

Line::~Line ( )

Definition at line 56 of file Line.cpp.

Member Function Documentation

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

Definition at line 189 of file Line.cpp.

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

Referenced by NBNodeShapeComputer::computeNodeShapeByCrosses().

void Line::add ( const Position p)

Definition at line 196 of file Line.cpp.

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

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

Definition at line 149 of file Line.cpp.

References atan2Angle(), PI, and SUMOReal.

SUMOReal Line::atan2TiltDegree ( ) const

Definition at line 159 of file Line.cpp.

References Position::distanceTo2D(), myP1, myP2, PI, SUMOReal, and Position::z().

Referenced by PositionVector::tiltDegreeAtLengthPosition().

void Line::extrapolateFirstBy ( SUMOReal  length)

Definition at line 69 of file Line.cpp.

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

Referenced by NBNode::computeInternalLaneShape().

void Line::extrapolateSecondBy ( SUMOReal  length)

Definition at line 75 of file Line.cpp.

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

Referenced by NBNode::computeInternalLaneShape().

Position Line::getPositionAtDistance ( SUMOReal  offset) const
Position Line::getPositionAtDistance2D ( SUMOReal  offset) const

Definition at line 105 of file Line.cpp.

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

Referenced by GUIVehicle::computeSeats(), and NBEdge::startShapeAt().

SUMOReal Line::intersectsAtLength2D ( const Line v)

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

Definition at line 220 of file Line.cpp.

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

std::vector< SUMOReal > Line::intersectsAtLengths2D ( const PositionVector v)
SUMOReal Line::length2D ( ) const

Definition at line 177 of file Line.cpp.

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

Referenced by GUIVehicle::computeSeats(), and PositionVector::intersectsAtLengths2D().

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

Definition at line 211 of file Line.cpp.

References myP1, and myP2.

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

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

Definition at line 203 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: