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

Public Member Functions

 DLine3 (const DLine3 &ref)
 
DLine3operator= (const DLine3 &v)
 
void Add (const DPoint2 &p)
 
bool NearestSegment2D (const DPoint2 &Point, int &iIndex, double &dist, DPoint3 &Intersection) const
 
void NearestPoint2D (const DPoint2 &Point, int &iIndex, double &dist) const
 
bool ContainsPoint2D (const DPoint2 &p) const
 
- Public Member Functions inherited from vtArray< DPoint3 >
 vtArray (uint size=0)
 
 vtArray (const vtArray< DPoint3 > &)
 
uint GetSize () const
 
uint GetMaxSize () const
 
bool SetSize (uint)
 
bool SetMaxSize (uint)
 
uint GetElemSize () const
 
DPoint3GetData () const
 
void FreeData ()
 
bool IsEmpty () const
 
DPoint3GetAt (uint i) const
 
bool SetAt (uint i, DPoint3)
 
vtArray< DPoint3 > & operator= (const vtArray< DPoint3 > &)
 
DPoint3operator[] (uint i)
 
const DPoint3operator[] (uint i) const
 
void Clear ()
 
bool RemoveAt (uint i, int n=1)
 
int Append (const DPoint3 &)
 
int Append (const vtArray< DPoint3 > &)
 
int Find (const DPoint3 &) const
 

Additional Inherited Members

- Protected Member Functions inherited from vtArray< DPoint3 >
virtual bool Grow (uint)
 
virtual void DestructItems (uint first, uint last)
 
- Protected Attributes inherited from vtArray< DPoint3 >
uint m_Size
 
uint m_MaxSize
 
DPoint3m_Data
 

Detailed Description

A series of 3D points. This is useful for representing either a series of points, line segments or a closed polygon. Double-precision.

Member Function Documentation

bool DLine3::ContainsPoint2D ( const DPoint2 p) const

With the assumption that this set of points defines a closed polygon, test whether the polygon contains a given point. Since a simple array of points being interpreted as a polygon, this means the data may be concave or convex, but not contains holes. The third (Z) coordinate is ignored.

void DLine3::NearestPoint2D ( const DPoint2 Point,
int &  iIndex,
double &  dClosest 
) const

Return the nearest (2D distance) point (of the points which make up the line). This is not the same as the closest place on the line, which may lie between the defining points.

Parameters
PointThe input point.
iIndexIndex of the first point of the nearest line segment.
dClosestDistance from the DLine2 to the input point.
bool DLine3::NearestSegment2D ( const DPoint2 Point,
int &  iIndex,
double &  dist,
DPoint3 Intersection 
) const

Returns the location of the horizontally closest point on the line to a given 2D point.

Parameters
PointThe input point.
iIndexIndex of the first point of the nearest line segment.
distDistance from the DLine2 to the input point.
IntersectionThe closest point on the DLine2.
Returns
True if a closest point was found.