casa
$Rev:20696$
|
Implementation of a polyline. More...
#include <DSPolyLine.h>
Public Member Functions | |
DSPolyLine () | |
Constructors and Destructors. | |
DSPolyLine (const DSPolyLine &other) | |
DSPolyLine (const Matrix< Float > &points, const Bool &handles, const Bool &drawHandles) | |
virtual | ~DSPolyLine () |
virtual void | draw (PixelCanvas *pc) |
General DisplayShape functions. | |
virtual Bool | inObject (const Float &xPos, const Float &yPos) |
Is the supplied point within the DisplayShape? | |
virtual void | move (const Float &dX, const Float &dY) |
virtual Vector< Float > | getCenter () |
Returns the center of the DisplayShape (x,y). | |
virtual void | setCenter (const Float &xPos, const Float &yPos) |
Sets the center of the DisplayShape. | |
virtual void | scale (const Float &scaleFactor) |
Scale the shape about its center by the scaleFactor. | |
virtual void | rotate (const Float &angle) |
Rotate the shape about its center by a set angle (angle in degrees). | |
virtual void | rotateAbout (const Float &angle, const Float &aboutX, const Float &aboutY) |
virtual void | changePoint (const Vector< Float > &pos) |
Point manipulation functions. | |
virtual void | changePoint (const Vector< Float > &pos, const Int n) |
Changes the nth point making up the DisplayShape ot the specified location. | |
virtual void | addPoint (const Vector< Float > &newPos) |
If applicable, this function will add a point to the shape in the most meaningful location. | |
virtual void | setPoints (const Matrix< Float > &points) |
virtual uInt | nPoints () |
Return the number of points. | |
virtual Bool | setOptions (const Record &newSettings) |
Get and set this shapes options. | |
virtual Record | getOptions () |
Settings. | |
Protected Member Functions | |
virtual Matrix< Float > | getPoints () |
Private Member Functions | |
virtual void | setDefaultOptions () |
Used when default constructor called. | |
Private Attributes | |
Matrix< Float > | itsPoints |
Vector< Float > | itsCenter |
Bool | itsValidCenter |
Implementation of a polyline.
DSPolyLine is a method of managing the drawing of a polyline onto a PixelCanvas.
DSPolyLine manages a collection of points, which when called it draws. It also manages actions like the addition and removal of points from/to the line.
There are generally two ways to make DisplayShape(s); To create them in "one hit" by providing arguments to the constructor, or by using the default constructor and then the "setOptions" method. A simple interface for all classes inheriting from the DisplayShape class is provided by DisplayShapeInterface .
The need to draw, move and manipulate a polyline.
Definition at line 76 of file DSPolyLine.h.
Constructors and Destructors.
casa::DSPolyLine::DSPolyLine | ( | const DSPolyLine & | other | ) |
casa::DSPolyLine::DSPolyLine | ( | const Matrix< Float > & | points, |
const Bool & | handles, | ||
const Bool & | drawHandles | ||
) |
virtual casa::DSPolyLine::~DSPolyLine | ( | ) | [virtual] |
virtual void casa::DSPolyLine::addPoint | ( | const Vector< Float > & | ) | [virtual] |
If applicable, this function will add a point to the shape in the most meaningful location.
Reimplemented from casa::DisplayShape.
Reimplemented in casa::DSScreenPolyLine, and casa::DSWorldPolyLine.
virtual void casa::DSPolyLine::changePoint | ( | const Vector< Float > & | pos | ) | [virtual] |
Point manipulation functions.
The changePoint with only one argument moves the closest point to the location specified.
Implements casa::DisplayShape.
Reimplemented in casa::DSArrow, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, and casa::DSScreenPolyLine.
virtual void casa::DSPolyLine::changePoint | ( | const Vector< Float > & | newPoint, |
const Int | nPoint | ||
) | [virtual] |
Changes the nth point making up the DisplayShape ot the specified location.
Implements casa::DisplayShape.
Reimplemented in casa::DSArrow, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, and casa::DSScreenPolyLine.
virtual void casa::DSPolyLine::draw | ( | PixelCanvas * | pc | ) | [virtual] |
General DisplayShape functions.
Reimplemented from casa::DSBasic.
Reimplemented in casa::DSArrow, casa::DSWorldPolyLine, and casa::DSWorldArrow.
virtual Vector<Float> casa::DSPolyLine::getCenter | ( | ) | [virtual] |
Returns the center of the DisplayShape (x,y).
Implements casa::DisplayShape.
virtual Record casa::DSPolyLine::getOptions | ( | ) | [virtual] |
Settings.
Reimplemented from casa::DSBasic.
Reimplemented in casa::DSArrow, casa::DSLine, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, casa::DSScreenPolyLine, casa::DSPixelArrow, and casa::DSPixelPolyLine.
virtual Matrix<Float> casa::DSPolyLine::getPoints | ( | ) | [protected, virtual] |
Return all my points.
virtual Bool casa::DSPolyLine::inObject | ( | const Float & | xPos, |
const Float & | yPos | ||
) | [virtual] |
Is the supplied point within the DisplayShape?
Implements casa::DisplayShape.
virtual void casa::DSPolyLine::move | ( | const Float & | dX, |
const Float & | dY | ||
) | [virtual] |
Reimplemented from casa::DSBasic.
Reimplemented in casa::DSArrow, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSScreenPolyLine, and casa::DSWorldArrow.
virtual uInt casa::DSPolyLine::nPoints | ( | ) | [virtual] |
Return the number of points.
virtual void casa::DSPolyLine::rotate | ( | const Float & | angle | ) | [virtual] |
Rotate the shape about its center by a set angle (angle in degrees).
Implements casa::DisplayShape.
Reimplemented in casa::DSArrow, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSScreenPolyLine, and casa::DSWorldArrow.
virtual void casa::DSPolyLine::rotateAbout | ( | const Float & | angle, |
const Float & | aboutX, | ||
const Float & | aboutY | ||
) | [virtual] |
Reimplemented from casa::DSBasic.
Reimplemented in casa::DSArrow.
virtual void casa::DSPolyLine::scale | ( | const Float & | scaleFactor | ) | [virtual] |
Scale the shape about its center by the scaleFactor.
Implements casa::DisplayShape.
Reimplemented in casa::DSArrow, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSWorldArrow, and casa::DSScreenPolyLine.
virtual void casa::DSPolyLine::setCenter | ( | const Float & | xPos, |
const Float & | yPos | ||
) | [virtual] |
Sets the center of the DisplayShape.
Implements casa::DisplayShape.
Reimplemented in casa::DSArrow, casa::DSLine, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSWorldArrow, and casa::DSScreenPolyLine.
virtual void casa::DSPolyLine::setDefaultOptions | ( | ) | [private, virtual] |
Used when default constructor called.
Reimplemented from casa::DisplayShape.
Reimplemented in casa::DSArrow.
virtual Bool casa::DSPolyLine::setOptions | ( | const Record & | newSettings | ) | [virtual] |
Get and set this shapes options.
Reimplemented from casa::DSBasic.
Reimplemented in casa::DSArrow, casa::DSLine, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, casa::DSScreenPolyLine, casa::DSPixelArrow, and casa::DSPixelPolyLine.
virtual void casa::DSPolyLine::setPoints | ( | const Matrix< Float > & | points | ) | [virtual] |
Reimplemented in casa::DSScreenPolyLine, and casa::DSWorldPolyLine.
Vector<Float> casa::DSPolyLine::itsCenter [private] |
Definition at line 126 of file DSPolyLine.h.
Matrix<Float> casa::DSPolyLine::itsPoints [private] |
Definition at line 125 of file DSPolyLine.h.
Bool casa::DSPolyLine::itsValidCenter [private] |
Definition at line 127 of file DSPolyLine.h.