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

Text label associated with a RegionShape. More...

#include <RegionShape.h>

List of all members.

Public Member Functions

 RegionShapeLabel (String text="")
 Constructor.
 ~RegionShapeLabel ()
 Destructor.
void setText (const String &text)
 Sets this label's text to the given.
void setFont (const String &font)
 Sets this label's font family to the given.
void setSize (int size)
 Sets the label's font point size to the given.
void setColor (const String &color)
 Sets the label's font color to the given.
void setItalic (bool italic=true)
 Sets whether the label's font is italic or not.
void setBold (bool bold=true)
 Sets whether the label's font is bold or not.
void setAngle (double angle)
 Sets the rotation angle to the given (in degrees).
bool isEmpty () const
 Returns true if this label has empty text, false otherwise.
const Stringtext () const
 Returns the text for this label.
const Stringfont () const
 Returns the font family for this label.
int size () const
 Returns the point size for this label.
const Stringcolor () const
 Returns the color for this label.
bool isItalic () const
 Returns true if this label's font is italic, false otherwise.
bool isBold () const
 Returns true if this label's font is bold, false otherwise.
double angle () const
 Returns this label's angle.
void setFont (PixelCanvas *pc) const
 Sets the font on the given PixelCanvas.
int width (PixelCanvas *pc) const
 Returns the result of pc->textWidth() after setting the font.
int height (PixelCanvas *pc) const
 Returns the result of pc->textHeight() after setting the font.
bool draw (PixelCanvas *pc, int x, int y, bool bottom=false, String *error=NULL)
 Draws itself on the given pixel canvas and returns whether the operation succeeded or not.

Static Public Attributes

static const String DEFAULT_FONT
 Static Members //.
static const int DEFAULT_POINTSIZE

Private Attributes

String m_text
String m_font
int m_pointSize
String m_color
bool m_italic
bool m_bold
double m_angle

Detailed Description

Text label associated with a RegionShape.

Definition at line 45 of file RegionShape.h.


Constructor & Destructor Documentation

Constructor.

Destructor.


Member Function Documentation

Returns this label's angle.

Returns the color for this label.

bool casa::RegionShapeLabel::draw ( PixelCanvas pc,
int  x,
int  y,
bool  bottom = false,
String error = NULL 
)

Draws itself on the given pixel canvas and returns whether the operation succeeded or not.

x and y are the screen pixel coordinates to draw the label. If bottom is false, the label is centered on (x, y); otherwise the label is drawn with (x, y) at its bottom center point.

Returns the font family for this label.

Returns the result of pc->textHeight() after setting the font.

Returns true if this label's font is bold, false otherwise.

Returns true if this label has empty text, false otherwise.

Returns true if this label's font is italic, false otherwise.

void casa::RegionShapeLabel::setAngle ( double  angle)

Sets the rotation angle to the given (in degrees).

This angle is in pixel coordinates. Rotation is counterclockwise.

void casa::RegionShapeLabel::setBold ( bool  bold = true)

Sets whether the label's font is bold or not.

Note: only QtPixelCanvas currently supports bold.

void casa::RegionShapeLabel::setColor ( const String color)

Sets the label's font color to the given.

Note: while there is no formal specification for color format, Strings should be accepted in common name format ("black") or hexadecimal format ("#000000").

void casa::RegionShapeLabel::setFont ( const String font)

Sets this label's font family to the given.

How it is handled when being drawn depends on the underlying PixelCanvas implementation.

Sets the font on the given PixelCanvas.

Note: bold/italic only work for QtPixelCanvas.

void casa::RegionShapeLabel::setItalic ( bool  italic = true)

Sets whether the label's font is italic or not.

Note: only QtPixelCanvas currently supports bold.

void casa::RegionShapeLabel::setSize ( int  size)

Sets the label's font point size to the given.

void casa::RegionShapeLabel::setText ( const String text)

Sets this label's text to the given.

Returns the point size for this label.

Returns the text for this label.

Returns the result of pc->textWidth() after setting the font.


Member Data Documentation

Static Members //.

Defaults.

Definition at line 51 of file RegionShape.h.

Definition at line 52 of file RegionShape.h.

Definition at line 140 of file RegionShape.h.

Definition at line 139 of file RegionShape.h.

Definition at line 137 of file RegionShape.h.

Definition at line 135 of file RegionShape.h.

Definition at line 138 of file RegionShape.h.

Definition at line 136 of file RegionShape.h.

Definition at line 134 of file RegionShape.h.


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