casa
5.7.0-16
|
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::String & | text () const |
Returns the text for this label. More... | |
const casacore::String & | font () const |
Returns the font family for this label. More... | |
int | size () const |
Returns the point size for this label. More... | |
const casacore::String & | color () 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 |
Text label associated with a RegionShape.
Definition at line 45 of file RegionShape.h.
casa::RegionShapeLabel::RegionShapeLabel | ( | casacore::String | text = "" | ) |
Constructor.
casa::RegionShapeLabel::~RegionShapeLabel | ( | ) |
Destructor.
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.
|
static |
|
static |
Definition at line 52 of file RegionShape.h.
|
private |
Definition at line 140 of file RegionShape.h.
|
private |
Definition at line 139 of file RegionShape.h.
|
private |
Definition at line 137 of file RegionShape.h.
|
private |
Definition at line 135 of file RegionShape.h.
|
private |
Definition at line 138 of file RegionShape.h.
|
private |
Definition at line 136 of file RegionShape.h.
|
private |
Definition at line 134 of file RegionShape.h.