vtdata library
Public Member Functions | Public Attributes | Protected Attributes | List of all members
TLink Class Reference
Inheritance diagram for TLink:
Inheritance graph
[legend]

Public Member Functions

 TLink (TLink &ref)
 
bool operator== (TLink &ref)
 
void CopyAttributesFrom (TLink *rhs)
 
void SetNode (int n, TNode *pNode)
 
void SetNodes (TNode *pNode0, TNode *pNode1)
 
void ConnectNodes (TNode *pNode0, TNode *pNode1)
 
TNodeGetNode (int n) const
 
double GetLinearCoordinates (const DPoint2 &p, double &a, double &b, DPoint2 &closest, int &linkpoint, float &fractional, bool bAllowEnds=true)
 
double DistanceToPoint (const DPoint2 &point, bool bAllowEnds=true)
 
bool IsLoop ()
 
virtual void SetFlag (int flag, bool value)
 
int GetFlag (int flag)
 
int GetSidewalk ()
 
int GetParking ()
 
float Length ()
 
void EstimateWidth (bool bIncludeSidewalk=true)
 
float GetTotalWidth () const
 
TLinkGetNext () const
 
void SetNext (TLink *next)
 
void SetIntersectionType (int n, IntersectionType t)
 
void SetIntersectionType (TNode *node, IntersectionType t)
 
IntersectionType GetIntersectionType (int n)
 
IntersectionType GetIntersectionType (TNode *node)
 
- Public Member Functions inherited from DLine2
 DLine2 (int size)
 
 DLine2 (const DLine2 &ref)
 
DLine2operator= (const DLine2 &v)
 
DLine2operator= (const FLine2 &v)
 
void Add (const DPoint2 &p)
 Add a given offset to all points.
 
void Mult (double factor)
 Multiply all points by a given factor.
 
void InsertPointAfter (int iInsertAfter, const DPoint2 &Point)
 
void RemovePoint (int i)
 
void ReverseOrder ()
 
int RemoveDegeneratePoints (double dEpsilon, bool bClosed)
 
int RemoveColinearPoints (double dEpsilon, bool bClosed)
 
bool ContainsPoint (const DPoint2 &p) const
 
double SegmentLength (uint i) const
 
void NearestPoint (const DPoint2 &Point, int &iIndex, double &dist) const
 
bool NearestSegment (const DPoint2 &Point, int &iIndex, double &dist, DPoint2 &Intersection) const
 
bool IsConvex () const
 
DPoint2GetSafePoint (int index) const
 
void SetSafePoint (int index, const DPoint2 &p)
 
double Length () const
 
DPoint2 Centroid () const
 
DPoint2 Centroid2 () const
 
double Area () const
 
- Public Member Functions inherited from vtArray< DPoint2 >
 vtArray (uint size=0)
 
 vtArray (const vtArray< DPoint2 > &)
 
uint GetSize () const
 
uint GetMaxSize () const
 
bool SetSize (uint)
 
bool SetMaxSize (uint)
 
uint GetElemSize () const
 
DPoint2GetData () const
 
void FreeData ()
 
bool IsEmpty () const
 
DPoint2GetAt (uint i) const
 
bool SetAt (uint i, DPoint2)
 
vtArray< DPoint2 > & operator= (const vtArray< DPoint2 > &)
 
DPoint2operator[] (uint i)
 
const DPoint2operator[] (uint i) const
 
void Clear ()
 
bool RemoveAt (uint i, int n=1)
 
int Append (const DPoint2 &)
 
int Append (const vtArray< DPoint2 > &)
 
int Find (const DPoint2 &) const
 

Public Attributes

float m_fLeftWidth
 
float m_fRightWidth
 
unsigned short m_iLanes
 
SurfaceType m_Surface
 
short m_iHwy
 
short m_iFlags
 
int m_id
 
float m_fSidewalkWidth
 
float m_fCurbHeight
 
float m_fMarginWidth
 
float m_fLaneWidth
 
float m_fParkingWidth
 

Protected Attributes

TLinkm_pNext
 
TNodem_pNode [2]
 
float m_fHeight [2]
 
IntersectionType m_eIntersection [2]
 
- Protected Attributes inherited from vtArray< DPoint2 >
uint m_Size
 
uint m_MaxSize
 
DPoint2m_Data
 

Additional Inherited Members

- Protected Member Functions inherited from vtArray< DPoint2 >
virtual bool Grow (uint)
 
virtual void DestructItems (uint first, uint last)
 

Detailed Description

A Transportation Link a series of points, connecting one node to another.

Member Function Documentation

double TLink::DistanceToPoint ( const DPoint2 point,
bool  bAllowEnds = true 
)

Find closest lateral distance from a given point to the link.

double TLink::GetLinearCoordinates ( const DPoint2 p,
double &  result_a,
double &  result_b,
DPoint2 closest,
int &  linkpoint,
float &  fractional,
bool  bAllowEnds = true 
)

Produces the "linear coordinates" a and b, where a is the distance along the link, and b is the signed lateral distance orthogonal to the link at that point.

Parameters
pThe input point.
result_aThe resulting distance along the link.
result_bThe signed lateral (or absolute) distance to the link.
closestThe closest point on the link.
linkpointIndex into the links points just before the closest point.
fractionalFractional distance between this link point and the next.
bAllowEndsIf true, then for cases where the the closest point is either end of the link, the distance to that point is returned. Otherwise, only laterial distances are returned.