DSSquare.h

Classes

DSSquare -- Implementation of a square. (full description)

class DSSquare : public DSRectangle

Interface

Public Members
DSSquare()
DSSquare(const Float& xPos, const Float& yPos, const Float& size, const Bool& handles = False, const Bool& drawHandles = False)
DSSquare(const DSSquare& other)
virtual ~DSSquare()
virtual void setSize(const Float& size)
virtual void changePoint(const Vector<Float>& pos)
virtual void changePoint(const Vector<Float>& pos, const Int nPoint)
virtual Bool setOptions(const Record& settings)
virtual Record getOptions()

Description

Prerequisite

Etymology

DSSquare is a method of managing the drawing of a square onto a PixelCanvas.

Synopsis

DSSquare simple extends DSRectangle, and takes much of its functionality from there. It also overrides some functions to ensure that during manipulation of the shape, it remains a square.

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 enable the drawing of squares onto a pixel canvas

Example

Member Description

DSSquare()

Default constructor

DSSquare(const Float& xPos, const Float& yPos, const Float& size, const Bool& handles = False, const Bool& drawHandles = False)

Constructor. Accepts the centre (xPos, yPos), the size (height/width in pixels), and whether or not it will ever have handles and if so, whether to draw them now.

DSSquare(const DSSquare& other)

Copy cons.

virtual ~DSSquare()

Destructor

virtual void setSize(const Float& size)

Copy constructor

Set the size of the square in pixels

virtual void changePoint(const Vector<Float>& pos)
virtual void changePoint(const Vector<Float>& pos, const Int nPoint)

Change the points, while maintaining the shape as a square

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

Get and set options