Public Member Functions | Protected Member Functions

fawkes::LineSegment Class Reference

A line segment. More...

#include <>>

Inheritance diagram for fawkes::LineSegment:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 LineSegment (const HomPoint &a, const HomPoint &b)
 Constructor.
 LineSegment (const HomPoint &p, const HomVector &v)
 Constructor.
 LineSegment (const LineSegment &l)
 Copy constructor.
virtual ~LineSegment ()
 Destructor.
float length () const
 Get the length of the line segment.
const HomPointp1 () const
 Get the starting point.
const HomPointp2 () const
 Get the endpoint.

Protected Member Functions

virtual void register_primitives ()
virtual void post_transform ()
virtual std::ostream & print (std::ostream &stream) const
 This method is called by the overloaded <<-operator.

Detailed Description

A line segment.

Author:
Daniel Beck

Definition at line 34 of file line_segment.h.


Constructor & Destructor Documentation

fawkes::LineSegment::LineSegment ( const HomPoint a,
const HomPoint b 
)

Constructor.

Parameters:
a the starting point of the line segment
b the endpoint of of the line segment

Definition at line 37 of file line_segment.cpp.

fawkes::LineSegment::LineSegment ( const HomPoint p,
const HomVector v 
)

Constructor.

Parameters:
p the starting point of the line segment
v a vector defining orientation and length of the line segment

Definition at line 49 of file line_segment.cpp.

fawkes::LineSegment::LineSegment ( const LineSegment l  ) 

Copy constructor.

Parameters:
l another line segment

Definition at line 59 of file line_segment.cpp.

References fawkes::Transformable::clear_primitives().

fawkes::LineSegment::~LineSegment (  )  [virtual]

Destructor.

Definition at line 68 of file line_segment.cpp.


Member Function Documentation

float fawkes::LineSegment::length (  )  const

Get the length of the line segment.

Returns:
the length of the line segment

Definition at line 76 of file line_segment.cpp.

References fawkes::HomVector::length().

const HomPoint & fawkes::LineSegment::p1 (  )  const

Get the starting point.

Returns:
the starting point

Definition at line 87 of file line_segment.cpp.

Referenced by fawkes::LineSegmentDrawer::draw().

const HomPoint & fawkes::LineSegment::p2 (  )  const

Get the endpoint.

Returns:
the endpoint

Definition at line 96 of file line_segment.cpp.

Referenced by fawkes::LineSegmentDrawer::draw().

std::ostream & fawkes::LineSegment::print ( std::ostream &  stream  )  const [protected, virtual]

This method is called by the overloaded <<-operator.

Parameters:
stream the output stream
Returns:
reference to the output stream

Implements fawkes::Printable.

Definition at line 114 of file line_segment.cpp.


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