casa
$Rev:20696$
|
Implementation of a ellipse. More...
#include <DSEllipse.h>
Public Member Functions | |
DSEllipse (const Bool &onlyShowOneHandle=False) | |
Constructors and destructors. | |
DSEllipse (const DSEllipse &other) | |
DSEllipse (const Float &xPos, const Float &yPos, const Float &major, const Float &minor, const Bool &hasHandles=False, const Bool &drawHandles=False, const Bool &onlyShowOneHandle=False) | |
virtual | ~DSEllipse () |
virtual void | draw (PixelCanvas *pix) |
General DisplayShape functions. | |
virtual void | move (const Float &dX, const Float &dY) |
virtual Bool | inObject (const Float &xPos, const Float &yPos) |
Is the supplied point within the DisplayShape? | |
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 | setCenter (const Float &xPos, const Float &yPos) |
Sets the center of the DisplayShape. | |
virtual Vector< Float > | getCenter () |
Returns the center of the DisplayShape (x,y). | |
virtual void | changePoint (const Vector< Float > &newPoint) |
Changes the closest point to the supplied location to that location. | |
virtual void | changePoint (const Vector< Float > &newPoint, const Int nPoint) |
Changes the nth point making up the DisplayShape ot the specified location. | |
virtual void | scale (const Float &scaleFactor) |
Scale the shape about its center by the scaleFactor. | |
virtual Float | getMinorAxis () |
Functions to set / get the minor and major axis of the ellipse (in pixels). | |
virtual Float | getMajorAxis () |
virtual void | setMajorAxis (const Float &newMajor) |
virtual void | setMinorAxis (const Float &newMinor) |
virtual Record | getOptions () |
Get and set options. | |
virtual Bool | setOptions (const Record &settings) |
Protected Member Functions | |
virtual void | calculateHandlePositions () |
Private Member Functions | |
virtual void | setDefaultOptions () |
Called when def. | |
Private Attributes | |
Vector< Float > | itsCenter |
Float | itsAngle |
Float | itsMajorAxis |
Float | itsMinorAxis |
Bool | itsValid |
Bool | itsOneHandle |
Matrix< Float > | itsHandleLocation |
Implementation of a ellipse.
DSEllipse is a method of managing the drawing of a ellipse onto a PixelCanvas.
DSEllipse is the DisplayShape implementation of the primitive ellipse.
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 .
To allow the management of ellipses being draw to a pixel canvas.
Definition at line 71 of file DSEllipse.h.
casa::DSEllipse::DSEllipse | ( | const Bool & | onlyShowOneHandle = False | ) |
Constructors and destructors.
the 'onlyShowOneHandle' flag is primarily for use if the ellipse is intended to remain symmetrical i.e. a circle.
casa::DSEllipse::DSEllipse | ( | const DSEllipse & | other | ) |
casa::DSEllipse::DSEllipse | ( | const Float & | xPos, |
const Float & | yPos, | ||
const Float & | major, | ||
const Float & | minor, | ||
const Bool & | hasHandles = False , |
||
const Bool & | drawHandles = False , |
||
const Bool & | onlyShowOneHandle = False |
||
) |
virtual casa::DSEllipse::~DSEllipse | ( | ) | [virtual] |
virtual void casa::DSEllipse::calculateHandlePositions | ( | ) | [protected, virtual] |
Required on update
virtual void casa::DSEllipse::changePoint | ( | const Vector< Float > & | newPos | ) | [virtual] |
Changes the closest point to the supplied location to that location.
Implements casa::DisplayShape.
Reimplemented in casa::DSCircle, casa::DSWorldEllipse, and casa::DSScreenEllipse.
virtual void casa::DSEllipse::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::DSCircle, casa::DSWorldEllipse, and casa::DSScreenEllipse.
virtual void casa::DSEllipse::draw | ( | PixelCanvas * | pix | ) | [virtual] |
General DisplayShape functions.
Reimplemented from casa::DSClosed.
Reimplemented in casa::DSWorldEllipse.
virtual Vector<Float> casa::DSEllipse::getCenter | ( | ) | [virtual] |
Returns the center of the DisplayShape (x,y).
Implements casa::DisplayShape.
virtual Float casa::DSEllipse::getMajorAxis | ( | ) | [virtual] |
virtual Float casa::DSEllipse::getMinorAxis | ( | ) | [virtual] |
Functions to set / get the minor and major axis of the ellipse (in pixels).
virtual Record casa::DSEllipse::getOptions | ( | ) | [virtual] |
Get and set options.
Reimplemented from casa::DSClosed.
Reimplemented in casa::DSCircle, casa::DSWorldEllipse, casa::DSPixelEllipse, and casa::DSScreenEllipse.
virtual Bool casa::DSEllipse::inObject | ( | const Float & | xPos, |
const Float & | yPos | ||
) | [virtual] |
Is the supplied point within the DisplayShape?
Implements casa::DisplayShape.
Reimplemented in casa::DSCircle.
virtual void casa::DSEllipse::move | ( | const Float & | dX, |
const Float & | dY | ||
) | [virtual] |
Reimplemented from casa::DSClosed.
Reimplemented in casa::DSWorldEllipse, and casa::DSScreenEllipse.
virtual void casa::DSEllipse::rotate | ( | const Float & | angle | ) | [virtual] |
Rotate the shape about its center by a set angle (angle in degrees).
Implements casa::DisplayShape.
Reimplemented in casa::DSCircle, casa::DSWorldEllipse, and casa::DSScreenEllipse.
virtual void casa::DSEllipse::rotateAbout | ( | const Float & | angle, |
const Float & | aboutX, | ||
const Float & | aboutY | ||
) | [virtual] |
Reimplemented from casa::DSClosed.
virtual void casa::DSEllipse::scale | ( | const Float & | scaleFactor | ) | [virtual] |
Scale the shape about its center by the scaleFactor.
Implements casa::DisplayShape.
virtual void casa::DSEllipse::setCenter | ( | const Float & | xPos, |
const Float & | yPos | ||
) | [virtual] |
Sets the center of the DisplayShape.
Implements casa::DisplayShape.
Reimplemented in casa::DSCircle, casa::DSWorldEllipse, and casa::DSScreenEllipse.
virtual void casa::DSEllipse::setDefaultOptions | ( | ) | [private, virtual] |
Called when def.
constructor used
Reimplemented from casa::DSClosed.
Reimplemented in casa::DSCircle.
virtual void casa::DSEllipse::setMajorAxis | ( | const Float & | newMajor | ) | [virtual] |
Reimplemented in casa::DSCircle.
virtual void casa::DSEllipse::setMinorAxis | ( | const Float & | newMinor | ) | [virtual] |
Reimplemented in casa::DSCircle.
virtual Bool casa::DSEllipse::setOptions | ( | const Record & | settings | ) | [virtual] |
Reimplemented from casa::DSClosed.
Reimplemented in casa::DSCircle, casa::DSWorldEllipse, casa::DSPixelEllipse, and casa::DSScreenEllipse.
Float casa::DSEllipse::itsAngle [private] |
Definition at line 122 of file DSEllipse.h.
Vector<Float> casa::DSEllipse::itsCenter [private] |
Definition at line 121 of file DSEllipse.h.
Matrix<Float> casa::DSEllipse::itsHandleLocation [private] |
Definition at line 126 of file DSEllipse.h.
Float casa::DSEllipse::itsMajorAxis [private] |
Definition at line 123 of file DSEllipse.h.
Float casa::DSEllipse::itsMinorAxis [private] |
Definition at line 123 of file DSEllipse.h.
Bool casa::DSEllipse::itsOneHandle [private] |
Definition at line 124 of file DSEllipse.h.
Bool casa::DSEllipse::itsValid [private] |
Definition at line 124 of file DSEllipse.h.