casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
casa::DSEllipse Class Reference

Implementation of a ellipse. More...

#include <DSEllipse.h>

Inheritance diagram for casa::DSEllipse:
casa::DSClosed casa::DSBasic casa::DisplayShape casa::DSCircle casa::DSPixelEllipse casa::DSScreenEllipse casa::DSWorldEllipse

List of all members.

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< FloatgetCenter ()
 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< FloatitsCenter
Float itsAngle
Float itsMajorAxis
Float itsMinorAxis
Bool itsValid
Bool itsOneHandle
Matrix< FloatitsHandleLocation

Detailed Description

Implementation of a ellipse.

Prerequisite

Etymology

DSEllipse is a method of managing the drawing of a ellipse onto a PixelCanvas.

Synopsis

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 .

Motivation

To allow the management of ellipses being draw to a pixel canvas.

Example

Definition at line 71 of file DSEllipse.h.


Constructor & Destructor Documentation

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 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]

Member Function Documentation

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]

Member Data Documentation

Definition at line 122 of file DSEllipse.h.

Definition at line 121 of file DSEllipse.h.

Definition at line 126 of file DSEllipse.h.

Definition at line 123 of file DSEllipse.h.

Definition at line 123 of file DSEllipse.h.

Definition at line 124 of file DSEllipse.h.

Definition at line 124 of file DSEllipse.h.


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