casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
casa::RegionShapeLabel Class Reference

Text label associated with a RegionShape. More...

#include <RegionShape.h>

Public Member Functions

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

Static Public Attributes

static const casacore::String DEFAULT_FONT
 Static Members //. More...
 
static const int DEFAULT_POINTSIZE
 

Private Attributes

casacore::String m_text
 
casacore::String m_font
 
int m_pointSize
 
casacore::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

casa::RegionShapeLabel::RegionShapeLabel ( casacore::String  text = "")

Constructor.

casa::RegionShapeLabel::~RegionShapeLabel ( )

Destructor.

Member Function Documentation

double casa::RegionShapeLabel::angle ( ) const

Returns this label's angle.

const casacore::String& casa::RegionShapeLabel::color ( ) const

Returns the color for this label.

bool casa::RegionShapeLabel::draw ( PixelCanvas pc,
int  x,
int  y,
bool  bottom = false,
casacore::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.

const casacore::String& casa::RegionShapeLabel::font ( ) const

Returns the font family for this label.

int casa::RegionShapeLabel::height ( PixelCanvas pc) const

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

bool casa::RegionShapeLabel::isBold ( ) const

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

bool casa::RegionShapeLabel::isEmpty ( ) const

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

bool casa::RegionShapeLabel::isItalic ( ) const

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 casacore::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 casacore::String font)

Sets this label's font family to the given.

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

void casa::RegionShapeLabel::setFont ( PixelCanvas pc) const

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 casacore::String text)

Sets this label's text to the given.

int casa::RegionShapeLabel::size ( ) const

Returns the point size for this label.

const casacore::String& casa::RegionShapeLabel::text ( ) const

Returns the text for this label.

int casa::RegionShapeLabel::width ( PixelCanvas pc) const

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

Member Data Documentation

const casacore::String casa::RegionShapeLabel::DEFAULT_FONT
static

Static Members //.

Defaults.

Definition at line 51 of file RegionShape.h.

const int casa::RegionShapeLabel::DEFAULT_POINTSIZE
static

Definition at line 52 of file RegionShape.h.

double casa::RegionShapeLabel::m_angle
private

Definition at line 140 of file RegionShape.h.

bool casa::RegionShapeLabel::m_bold
private

Definition at line 139 of file RegionShape.h.

casacore::String casa::RegionShapeLabel::m_color
private

Definition at line 137 of file RegionShape.h.

casacore::String casa::RegionShapeLabel::m_font
private

Definition at line 135 of file RegionShape.h.

bool casa::RegionShapeLabel::m_italic
private

Definition at line 138 of file RegionShape.h.

int casa::RegionShapeLabel::m_pointSize
private

Definition at line 136 of file RegionShape.h.

casacore::String casa::RegionShapeLabel::m_text
private

Definition at line 134 of file RegionShape.h.


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