|
Fawkes API
Fawkes Development Version
|
A line segment. More...
#include <>>

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 HomPoint & | p1 () const |
| Get the starting point. | |
| const HomPoint & | p2 () const |
| Get the endpoint. | |
| HomPoint | project (const HomPoint &p) const |
| Project a point on this LineSegment. | |
Public Member Functions inherited from fawkes::Transformable | |
| Transformable () | |
| Constructor. | |
| virtual | ~Transformable () |
| Destructor. | |
Public Member Functions inherited from fawkes::Printable | |
| Printable () | |
| Constructor. | |
| virtual | ~Printable () |
| Destructor. | |
Protected Member Functions | |
| virtual void | register_primitives () |
| Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primitive for each of those. | |
| virtual void | post_transform () |
| This method is called after the primitives are transformed. | |
| virtual std::ostream & | print (std::ostream &stream) const |
| This method is called by the overloaded <<-operator. | |
Protected Member Functions inherited from fawkes::Transformable | |
| void | transform (const HomTransform &t) |
| Apply the transform to all registered primitives and call the post_transform() method. | |
| void | add_primitive (HomCoord *c) |
| Add a primitive to the list of primitives that is transformed. | |
| void | clear_primitives () |
| Clear the list of primitives. | |
A line segment.
Definition at line 34 of file line_segment.h.
Constructor.
| 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.
References register_primitives().
Constructor.
| 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.
References register_primitives().
| fawkes::LineSegment::LineSegment | ( | const LineSegment & | l | ) |
Copy constructor.
| l | another line segment |
Definition at line 59 of file line_segment.cpp.
References fawkes::Transformable::clear_primitives(), and register_primitives().
|
virtual |
Destructor.
Definition at line 68 of file line_segment.cpp.
| float fawkes::LineSegment::length | ( | ) | const |
Get the length of the line segment.
Definition at line 76 of file line_segment.cpp.
References fawkes::HomVector::length().
Referenced by project().
| const HomPoint & fawkes::LineSegment::p1 | ( | ) | const |
Get 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.
Definition at line 96 of file line_segment.cpp.
Referenced by fawkes::LineSegmentDrawer::draw().
|
protectedvirtual |
This method is called after the primitives are transformed.
Any additional updates that need to be done should be done here.
Implements fawkes::Transformable.
Definition at line 125 of file line_segment.cpp.
|
protectedvirtual |
This method is called by the overloaded <<-operator.
| stream | the output stream |
Implements fawkes::Printable.
Definition at line 130 of file line_segment.cpp.
Project a point on this LineSegment.
| p | a point |
Definition at line 106 of file line_segment.cpp.
References length().
|
protectedvirtual |
Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primitive for each of those.
Implements fawkes::Transformable.
Definition at line 118 of file line_segment.cpp.
References fawkes::Transformable::add_primitive().
Referenced by LineSegment().