DSMarker.h

Classes

DSMarker -- Implementation of a marker. (full description)

class DSMarker : public DSBasic

Interface

Public Members
DSMarker()
DSMarker(const Float& xPos, const Float& yPos, const Display::Marker& marker = Display::Square, const uInt pixelSize = 10)
DSMarker(const Record& settings)
DSMarker(const DSPCMarker& other)
DSMarker(const DSWCMarker& other)
DSMarker(const DSMarker& other)
virtual ~DSMarker()
virtual void move(const Float& dX, const Float& dY)
virtual void setCenter(const Float& xPos, const Float& yPos)
virtual Vector<Float> getCenter()
virtual void scale(const Float& scaleFactor)
virtual void draw(PixelCanvas* pc)
virtual Bool inObject(const Float& xPos, const Float& yPos)
virtual void setSize(const uInt newSize)
virtual Bool setOptions(const Record& settings)
virtual Record getOptions()
virtual Bool whichHandle(const Float& xPos, const Float& yPos, Int& active)
virtual void rotate(const Float& angle)
virtual void changePoint(const Vector<Float>& newPos)
virtual void changePoint(const Vector<Float>& newPoint, const Int nPoint)
Private Members
virtual void setDefaultOptions()
void updateHandle()

Description

Prerequisite

Etymology

DSMarker is a method of managind the drawing of a marker onto a pixel canvas.

Synopsis

DSArrow simply extends from DSLine, and adds the management of a polygon to it. The polygon is used to represent the arrow head, and various options regarding its apppearance can be changed.

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

A desire to have markers, similar to those used by PGPlot available as an annotation object. This wrapper is designed to make the management of drawing markers as primitives easier.

Example


 

Member Description

DSMarker()
DSMarker(const Float& xPos, const Float& yPos, const Display::Marker& marker = Display::Square, const uInt pixelSize = 10)
DSMarker(const Record& settings)
DSMarker(const DSPCMarker& other)
DSMarker(const DSWCMarker& other)
DSMarker(const DSMarker& other)
virtual ~DSMarker()

Constructors and destructor. See Display for a list of avaiable markers. Currently, all pixelHeights are changed to an even number, as odd sized markers tend to look funny. The pixelSize corresponds to the height of the marker in pixels.

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

Standard DisplayShape functions.

virtual void setSize(const uInt newSize)

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

Get and set options.

virtual Bool whichHandle(const Float& xPos, const Float& yPos, Int& active)

Overload, since we never want to click on a marker (Well actually we might, but as yet we have no use, and sometimes people think that have clicked on a marker when actually they are on a handle. This makes it appear as though the marker isn't moving.

virtual void rotate(const Float& angle)
virtual void changePoint(const Vector<Float>& newPos)
virtual void changePoint(const Vector<Float>& newPoint, const Int nPoint)

These functions do not apply for DSMarkers. They are here to ensure no strange behavior

virtual void setDefaultOptions()

Set the default options. Called by default constructor.

void updateHandle()

Update location of single handle