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

Implementation of text. More...

#include <DSText.h>

Inheritance diagram for casa::DSText:
casa::DisplayShape casa::DSPixelText casa::DSScreenText casa::DSWorldText

List of all members.

Public Member Functions

 DSText ()
 Constructors and destructors.
 DSText (const DSText &other)
 DSText (const Float &xPos, const Float &yPos, const String &text="Label", const Bool &hasHandles=True, const Bool &drawHandles=True)
virtual ~DSText ()
virtual void draw (PixelCanvas *pix)
 Functions to ensure consistancy with the "DisplayShape" interface.
virtual void move (const Float &dX, const Float &dY)
virtual void rotate (const Float &angle)
 Rotate the shape about its center by a set angle (angle in degrees).
virtual Bool inObject (const Float &xPos, const Float &yPos)
 Is the supplied point within the DisplayShape?
virtual void changePoint (const Vector< Float > &newPos)
 Changes the closest point to the supplied location to that location.
virtual void changePoint (const Vector< Float > &newPos, const Int nPoint)
 Changes the nth point making up the DisplayShape ot the specified location.
virtual void scale (const Float &scaleFactor)
 Scale the shape about its center by the scaleFactor.
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 Record getOptions ()
 Get and set options.
virtual Bool setOptions (const Record &settings)

Private Member Functions

void makeAlignmentChoice ()
 
    

virtual void calculateHandlePositions ()
 Update handle positions.
Display::TextAlign toEnum (const Int fromInt)
 Cast from int to enum.
virtual void setDefaultOptions ()
 Set default options.

Private Attributes

DParameterStringitsString
 Text Parameter.
DParameterRange< Float > * itsAngle
 Angle Param.
DParameterMapKeyChoiceitsAlignment
DParameterFontChoiceitsFont
DParameterRange< Int > * itsFontSize
Vector< FloatitsCenter
 Rotate about a point.
Int itsPixHeight
Int itsPixWidth
Bool itsValid
Bool itsHandlesMade
Bool itsValidPositions
Float itsStringLength
Float itsStringHeight
Matrix< FloatitsHandleLocation
Display::TextAlign itsAlign

Detailed Description

Implementation of text.

Prerequisite

Etymology

DSText is a method of managing the drawing of text onto a PixelCanvas.

Synopsis

DSText is designed to have the same interface as any other 'shape' extending DisplayShape. Much of the functionality is exactly the same, and hence provides a usefull wrapper for text in an 'annotations' context.

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 create a text wrapper which behaved in the same was as any other DisplayShape

Example

Definition at line 82 of file DSText.h.


Constructor & Destructor Documentation

Constructors and destructors.

casa::DSText::DSText ( const DSText other)
casa::DSText::DSText ( const Float xPos,
const Float yPos,
const String text = "Label",
const Bool hasHandles = True,
const Bool drawHandles = True 
)
virtual casa::DSText::~DSText ( ) [virtual]

Member Function Documentation

virtual void casa::DSText::calculateHandlePositions ( ) [private, virtual]

Update handle positions.

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

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

Implements casa::DisplayShape.

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

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

Implements casa::DisplayShape.

virtual void casa::DSText::draw ( PixelCanvas pix) [virtual]

Functions to ensure consistancy with the "DisplayShape" interface.

Reimplemented from casa::DisplayShape.

Reimplemented in casa::DSWorldText.

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

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

Implements casa::DisplayShape.

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

Get and set options.

Reimplemented from casa::DisplayShape.

Reimplemented in casa::DSWorldText, casa::DSScreenText, and casa::DSPixelText.

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

Is the supplied point within the DisplayShape?

Implements casa::DisplayShape.

    

This is a bit messy, so seperate it out

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

Reimplemented from casa::DisplayShape.

Reimplemented in casa::DSScreenText, and casa::DSWorldText.

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

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

Implements casa::DisplayShape.

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

Scale the shape about its center by the scaleFactor.

Implements casa::DisplayShape.

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

Sets the center of the DisplayShape.

Implements casa::DisplayShape.

Reimplemented in casa::DSScreenText, and casa::DSWorldText.

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

Set default options.

Reimplemented from casa::DisplayShape.

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

Reimplemented from casa::DisplayShape.

Reimplemented in casa::DSWorldText, casa::DSScreenText, and casa::DSPixelText.

Display::TextAlign casa::DSText::toEnum ( const Int  fromInt) [private]

Cast from int to enum.


Member Data Documentation

Definition at line 143 of file DSText.h.

Definition at line 131 of file DSText.h.

Angle Param.

Definition at line 130 of file DSText.h.

Rotate about a point.

. overloaded but not used

Definition at line 136 of file DSText.h.

Definition at line 132 of file DSText.h.

Definition at line 133 of file DSText.h.

Definition at line 142 of file DSText.h.

Definition at line 139 of file DSText.h.

Definition at line 137 of file DSText.h.

Definition at line 137 of file DSText.h.

Text Parameter.

Definition at line 127 of file DSText.h.

Definition at line 141 of file DSText.h.

Definition at line 140 of file DSText.h.

Definition at line 138 of file DSText.h.

Definition at line 139 of file DSText.h.


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