GenGeo  1.1
LineSegment2D Class Reference

class for a line in 2D More...

#include <LineSegment.h>

Inheritance diagram for LineSegment2D:
Collaboration diagram for LineSegment2D:

Public Member Functions

 LineSegment2D ()
 LineSegment2D (const Vector3 &, const Vector3 &)
virtual ~LineSegment2D ()
virtual double getDist (const Vector3 &) const
 LineSegment2D ()
 LineSegment2D (const Vector3 &, const Vector3 &)
virtual ~LineSegment2D ()
virtual double getDist (const Vector3 &) const
- Public Member Functions inherited from Line2D
 Line2D ()
 Line2D (const Vector3 &, const Vector3 &)
Vector3 intersect (const Line2D &)
Line2D parallel (double)
Vector3 getOrig () const
Vector3 getNormal () const
- Public Member Functions inherited from AGeometricObject
virtual ~AGeometricObject ()

Friends

ostream & operator<< (ostream &, const LineSegment2D &)
ostream & operator<< (ostream &, const LineSegment2D &)

Additional Inherited Members

- Protected Attributes inherited from Line2D
Vector3 m_p1
Vector3 m_p2
Vector3 m_normal

Detailed Description

class for a line in 2D

Constructor & Destructor Documentation

LineSegment2D::LineSegment2D ( )

default constructor -> zero all data

LineSegment2D::LineSegment2D ( const Vector3 p1,
const Vector3 p2 
)

Construct a line segment from 2 points. The order of the points determines the direction of the normal.

Parameters
p11st point
p22nd point
Warning
doesn't check p1!=p2
virtual LineSegment2D::~LineSegment2D ( )
virtual
LineSegment2D::LineSegment2D ( )
LineSegment2D::LineSegment2D ( const Vector3 ,
const Vector3  
)
virtual LineSegment2D::~LineSegment2D ( )
inlinevirtual

Member Function Documentation

double LineSegment2D::getDist ( const Vector3 p) const
virtual

Get the distance of a point from the line segment

Parameters
pthe point

Reimplemented from Line2D.

References Line2D::m_normal, Line2D::m_p1, and Line2D::m_p2.

virtual double LineSegment2D::getDist ( const Vector3 p) const
virtual

Get the distance of a point from the line

Parameters
pthe point

Reimplemented from Line2D.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const LineSegment2D L 
)
friend

output line segment

ostream& operator<< ( ostream &  ost,
const LineSegment2D L 
)
friend

output line segment


The documentation for this class was generated from the following files: