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::DSPolyLine Class Reference

Implementation of a polyline. More...

#include <DSPolyLine.h>

Inheritance diagram for casa::DSPolyLine:
casa::DSBasic casa::DisplayShape casa::DSLine casa::DSPixelPolyLine casa::DSScreenPolyLine casa::DSWorldPolyLine casa::DSArrow casa::DSPixelArrow casa::DSScreenArrow casa::DSWorldArrow

List of all members.

Public Member Functions

 DSPolyLine ()
 Constructors and Destructors.
 DSPolyLine (const DSPolyLine &other)
 DSPolyLine (const Matrix< Float > &points, const Bool &handles, const Bool &drawHandles)
virtual ~DSPolyLine ()
virtual void draw (PixelCanvas *pc)
 General DisplayShape functions.
virtual Bool inObject (const Float &xPos, const Float &yPos)
 Is the supplied point within the DisplayShape?
virtual void move (const Float &dX, const Float &dY)
virtual Vector< FloatgetCenter ()
 Returns the center of the DisplayShape (x,y).
virtual void setCenter (const Float &xPos, const Float &yPos)
 Sets the center of the DisplayShape.
virtual void scale (const Float &scaleFactor)
 Scale the shape about its center by the scaleFactor.
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 changePoint (const Vector< Float > &pos)
 Point manipulation functions.
virtual void changePoint (const Vector< Float > &pos, const Int n)
 Changes the nth point making up the DisplayShape ot the specified location.
virtual void addPoint (const Vector< Float > &newPos)
 If applicable, this function will add a point to the shape in the most meaningful location.
virtual void setPoints (const Matrix< Float > &points)
virtual uInt nPoints ()
 Return the number of points.
virtual Bool setOptions (const Record &newSettings)
 Get and set this shapes options.
virtual Record getOptions ()
 Settings.

Protected Member Functions

virtual Matrix< FloatgetPoints ()
 
   

Private Member Functions

virtual void setDefaultOptions ()
 Used when default constructor called.

Private Attributes

Matrix< FloatitsPoints
Vector< FloatitsCenter
Bool itsValidCenter

Detailed Description

Implementation of a polyline.

Prerequisite

Etymology

DSPolyLine is a method of managing the drawing of a polyline onto a PixelCanvas.

Synopsis

DSPolyLine manages a collection of points, which when called it draws. It also manages actions like the addition and removal of points from/to the line.

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

The need to draw, move and manipulate a polyline.

Example

Definition at line 76 of file DSPolyLine.h.


Constructor & Destructor Documentation

Constructors and Destructors.

casa::DSPolyLine::DSPolyLine ( const Matrix< Float > &  points,
const Bool handles,
const Bool drawHandles 
)
virtual casa::DSPolyLine::~DSPolyLine ( ) [virtual]

Member Function Documentation

virtual void casa::DSPolyLine::addPoint ( const Vector< Float > &  ) [virtual]

If applicable, this function will add a point to the shape in the most meaningful location.

Reimplemented from casa::DisplayShape.

Reimplemented in casa::DSScreenPolyLine, and casa::DSWorldPolyLine.

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

Point manipulation functions.

The changePoint with only one argument moves the closest point to the location specified.

Implements casa::DisplayShape.

Reimplemented in casa::DSArrow, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, and casa::DSScreenPolyLine.

virtual void casa::DSPolyLine::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::DSArrow, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, and casa::DSScreenPolyLine.

virtual void casa::DSPolyLine::draw ( PixelCanvas pc) [virtual]

General DisplayShape functions.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSArrow, casa::DSWorldPolyLine, and casa::DSWorldArrow.

virtual Vector<Float> casa::DSPolyLine::getCenter ( ) [virtual]

Returns the center of the DisplayShape (x,y).

Implements casa::DisplayShape.

virtual Record casa::DSPolyLine::getOptions ( ) [virtual]
virtual Matrix<Float> casa::DSPolyLine::getPoints ( ) [protected, virtual]

   

Return all my points.

virtual Bool casa::DSPolyLine::inObject ( const Float xPos,
const Float yPos 
) [virtual]

Is the supplied point within the DisplayShape?

Implements casa::DisplayShape.

virtual void casa::DSPolyLine::move ( const Float dX,
const Float dY 
) [virtual]
virtual uInt casa::DSPolyLine::nPoints ( ) [virtual]

Return the number of points.

virtual void casa::DSPolyLine::rotate ( const Float angle) [virtual]

Rotate the shape about its center by a set angle (angle in degrees).

Implements casa::DisplayShape.

Reimplemented in casa::DSArrow, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSScreenPolyLine, and casa::DSWorldArrow.

virtual void casa::DSPolyLine::rotateAbout ( const Float angle,
const Float aboutX,
const Float aboutY 
) [virtual]

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSArrow.

virtual void casa::DSPolyLine::scale ( const Float scaleFactor) [virtual]

Scale the shape about its center by the scaleFactor.

Implements casa::DisplayShape.

Reimplemented in casa::DSArrow, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSWorldArrow, and casa::DSScreenPolyLine.

virtual void casa::DSPolyLine::setCenter ( const Float xPos,
const Float yPos 
) [virtual]
virtual void casa::DSPolyLine::setDefaultOptions ( ) [private, virtual]

Used when default constructor called.

Reimplemented from casa::DisplayShape.

Reimplemented in casa::DSArrow.

virtual Bool casa::DSPolyLine::setOptions ( const Record newSettings) [virtual]
virtual void casa::DSPolyLine::setPoints ( const Matrix< Float > &  points) [virtual]

Member Data Documentation

Definition at line 126 of file DSPolyLine.h.

Definition at line 125 of file DSPolyLine.h.

Definition at line 127 of file DSPolyLine.h.


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