DSEllipse.h

Classes

DSEllipse -- Implementation of a ellipse. (full description)

class DSEllipse : public DSClosed

Interface

Public Members
DSEllipse(const Bool& onlyShowOneHandle = False)
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)
virtual void move(const Float& dX, const Float& dY)
virtual Bool inObject(const Float& xPos, const Float& yPos)
virtual void rotate(const Float& angle)
virtual void rotateAbout(const Float& angle, const Float& aboutX, const Float& aboutY)
virtual void setCenter(const Float& xPos, const Float& yPos)
virtual Vector<Float> getCenter()
virtual void changePoint(const Vector<Float>& newPoint)
virtual void changePoint(const Vector<Float>& newPoint, const Int nPoint)
virtual void scale(const Float& scaleFactor)
virtual Float getMinorAxis()
virtual Float getMajorAxis()
virtual void setMajorAxis(const Float& newMajor)
virtual void setMinorAxis(const Float& newMinor)
virtual Record getOptions()
virtual Bool setOptions(const Record& settings)
Protected Members
virtual void calculateHandlePositions()
Private Members
virtual void setDefaultOptions()

Description

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

Member Description

DSEllipse(const Bool& onlyShowOneHandle = False)
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()

Constructors and destructors. the 'onlyShowOneHandle' flag is primarily for use if the ellipse is intended to remain symmetrical i.e. a circle.

virtual void draw(PixelCanvas *pix)
virtual void move(const Float& dX, const Float& dY)
virtual Bool inObject(const Float& xPos, const Float& yPos)
virtual void rotate(const Float& angle)
virtual void rotateAbout(const Float& angle, const Float& aboutX, const Float& aboutY)
virtual void setCenter(const Float& xPos, const Float& yPos)
virtual Vector<Float> getCenter()
virtual void changePoint(const Vector<Float>& newPoint)
virtual void changePoint(const Vector<Float>& newPoint, const Int nPoint)
virtual void scale(const Float& scaleFactor)

General DisplayShape functions.

virtual Float getMinorAxis()
virtual Float getMajorAxis()
virtual void setMajorAxis(const Float& newMajor)
virtual void setMinorAxis(const Float& newMinor)

Functions to set / get the minor and major axis of the ellipse (in pixels).

virtual Record getOptions()
virtual Bool setOptions(const Record& settings)

Get and set options

virtual void calculateHandlePositions()

Required on update

virtual void setDefaultOptions()

Called when def. constructor used