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

Implementation of a marker. More...

#include <DSMarker.h>

Inheritance diagram for casa::DSMarker:
casa::DSBasic casa::DisplayShape casa::DSPixelMarker casa::DSScreenMarker casa::DSWorldMarker

List of all members.

Public Member Functions

 DSMarker ()
 Constructors and destructor.
 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)
 Standard DisplayShape functions.
virtual void setCenter (const Float &xPos, const Float &yPos)
 Sets the center of the DisplayShape.
virtual Vector< FloatgetCenter ()
 Returns the center of the DisplayShape (x,y).
virtual void scale (const Float &scaleFactor)
 Scale the shape about its center by the scaleFactor.
virtual void draw (PixelCanvas *pc)
 Standard fns.
virtual Bool inObject (const Float &xPos, const Float &yPos)
 Is the supplied point within the DisplayShape?
virtual void setSize (const uInt newSize)
 
   

virtual Bool setOptions (const Record &settings)
 Get and set options.
virtual Record getOptions ()
 Settings.
virtual Bool whichHandle (const Float &, const Float &, Int &)
 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.
virtual void rotate (const Float &)
 These functions do not apply for DSMarkers.
virtual void changePoint (const Vector< Float > &)
 Changes the closest point to the supplied location to that location.
virtual void changePoint (const Vector< Float > &, const Int)
 Changes the nth point making up the DisplayShape ot the specified location.

Private Member Functions

virtual void setDefaultOptions ()
 virtual void recalculateScreenPosition();
void updateHandle ()
 Update location of single handle.

Private Attributes

Vector< FloatitsCenter
Matrix< FloatitsHandle
Bool itsBuiltHandle
DParameterRange< Int > * itsSize
Display::Marker itsMarkerStyle
Bool itsValid

Detailed Description

Implementation of a marker.

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

Definition at line 87 of file DSMarker.h.


Constructor & Destructor Documentation

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.

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

Member Function Documentation

virtual void casa::DSMarker::changePoint ( const Vector< Float > &  newPos) [inline, virtual]

Changes the closest point to the supplied location to that location.

Implements casa::DisplayShape.

Definition at line 141 of file DSMarker.h.

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

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

Implements casa::DisplayShape.

Definition at line 142 of file DSMarker.h.

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

Standard fns.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSWorldMarker.

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

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

Implements casa::DisplayShape.

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

Settings.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSWorldMarker, casa::DSScreenMarker, and casa::DSPixelMarker.

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

Is the supplied point within the DisplayShape?

Implements casa::DisplayShape.

virtual void casa::DSMarker::move ( const Float dX,
const Float dY 
) [virtual]

Standard DisplayShape functions.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSScreenMarker, and casa::DSWorldMarker.

virtual void casa::DSMarker::rotate ( const Float ) [inline, virtual]

These functions do not apply for DSMarkers.

They are here to ensure no strange behavior

Implements casa::DisplayShape.

Definition at line 140 of file DSMarker.h.

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

Scale the shape about its center by the scaleFactor.

Implements casa::DisplayShape.

virtual void casa::DSMarker::setCenter ( const Float xPos,
const Float yPos 
) [virtual]

Sets the center of the DisplayShape.

Implements casa::DisplayShape.

Reimplemented in casa::DSScreenMarker, and casa::DSWorldMarker.

virtual void casa::DSMarker::setDefaultOptions ( ) [private, virtual]

virtual void recalculateScreenPosition();

Set the default options. Called by default constructor.

Reimplemented from casa::DisplayShape.

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

Get and set options.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSWorldMarker, casa::DSScreenMarker, and casa::DSPixelMarker.

virtual void casa::DSMarker::setSize ( const uInt  newSize) [virtual]

   

void casa::DSMarker::updateHandle ( ) [private]

Update location of single handle.

virtual Bool casa::DSMarker::whichHandle ( const Float ,
const Float ,
Int  
) [inline, virtual]

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.

Reimplemented from casa::DisplayShape.

Definition at line 132 of file DSMarker.h.

References casa::False.


Member Data Documentation

Definition at line 157 of file DSMarker.h.

Definition at line 155 of file DSMarker.h.

Definition at line 156 of file DSMarker.h.

Definition at line 160 of file DSMarker.h.

Definition at line 158 of file DSMarker.h.

Definition at line 161 of file DSMarker.h.


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