casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::DSSquare Class Reference

Implementation of a square. More...

#include <DSSquare.h>

Inheritance diagram for casa::DSSquare:
casa::DSRectangle casa::DSPoly casa::DSClosed casa::DSBasic casa::DisplayShape

List of all members.

Public Member Functions

 DSSquare ()
 Default constructor.
 DSSquare (const Float &xPos, const Float &yPos, const Float &size, const Bool &handles=False, const Bool &drawHandles=False)
 Constructor.
 DSSquare (const DSSquare &other)
 Copy cons.
virtual ~DSSquare ()
 Destructor.
virtual void setSize (const Float &size)
 Copy constructor.
virtual void changePoint (const Vector< Float > &pos)
 Change the points, while maintaining the shape as a square.
virtual void changePoint (const Vector< Float > &pos, const Int nPoint)
 Changes the nth point making up the DisplayShape ot the specified location.
virtual Bool setOptions (const Record &settings)
 Get and set options.
virtual Record getOptions ()
 Get and set options.

Detailed Description

Implementation of a square.

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

Definition at line 72 of file DSSquare.h.


Constructor & Destructor Documentation

Default constructor.

casa::DSSquare::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.

casa::DSSquare::DSSquare ( const DSSquare other)

Copy cons.

virtual casa::DSSquare::~DSSquare ( ) [virtual]

Destructor.


Member Function Documentation

virtual void casa::DSSquare::changePoint ( const Vector< Float > &  pos) [virtual]

Change the points, while maintaining the shape as a square.

Reimplemented from casa::DSRectangle.

virtual void casa::DSSquare::changePoint ( const Vector< Float > &  newPoint,
const Int  nPoint 
) [virtual]

Changes the nth point making up the DisplayShape ot the specified location.

Reimplemented from casa::DSRectangle.

virtual Record casa::DSSquare::getOptions ( ) [virtual]

Get and set options.

Reimplemented from casa::DSRectangle.

virtual Bool casa::DSSquare::setOptions ( const Record settings) [virtual]

Get and set options.

Reimplemented from casa::DSRectangle.

virtual void casa::DSSquare::setSize ( const Float size) [virtual]

Copy constructor.

Set the size of the square in pixels


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