DSPolyLine.h

Classes

DSPolyLine -- Implementation of a polyline. (full description)

class DSPolyLine : public DSBasic

Interface

Public Members
DSPolyLine()
DSPolyLine(const DSPolyLine& other)
DSPolyLine(const Matrix<Float>& points, const Bool& handles, const Bool& drawHandles)
virtual ~DSPolyLine()
virtual void draw(PixelCanvas* pc)
virtual Bool inObject(const Float& xPos, const Float& yPos)
virtual void move(const Float& dX, const Float& dY)
virtual Vector<Float> getCenter()
virtual void setCenter(const Float& xPos, const Float& yPos)
virtual void scale(const Float& scaleFactor)
virtual void rotate(const Float& angle)
virtual void rotateAbout(const Float& angle, const Float& aboutX, const Float& aboutY)
virtual void changePoint(const Vector<Float>& pos)
virtual void changePoint(const Vector<Float>& pos, const Int n)
virtual void addPoint(const Vector<Float>& newPos)
virtual void setPoints(const Matrix<Float>& points)
virtual uInt nPoints()
virtual Bool setOptions(const Record& newSettings)
virtual Record getOptions()
Protected Members
virtual Matrix<Float> getPoints()
Private Members
virtual void setDefaultOptions()

Description

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


Member Description

DSPolyLine()
DSPolyLine(const DSPolyLine& other)
DSPolyLine(const Matrix<Float>& points, const Bool& handles, const Bool& drawHandles)
virtual ~DSPolyLine()

Constructors and Destructors

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

General DisplayShape functions

virtual void changePoint(const Vector<Float>& pos)
virtual void changePoint(const Vector<Float>& pos, const Int n)
virtual void addPoint(const Vector<Float>& newPos)
virtual void setPoints(const Matrix<Float>& points)

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

virtual uInt nPoints()

Return the number of points.

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

Get and set this shapes options.

virtual Matrix<Float> getPoints()

Return all my points.

virtual void setDefaultOptions()

Used when default constructor called.