# PlotMM::Symbol Class Reference

List of all members.

## Detailed Description

A class for drawing symbols.

Symbols are used by Curve to draw individual data points. There are various kinds of symbols that can be used like ellipses, rectangles, triangles (with different orientations) and crosses. Additional symbols can be implemented by overloading draw_vfunc_().

See also:
  Curve::set_symbol()

## Public Member Functions

| Symbol (SymbolStyleID st=SYMBOL_NONE, int size=1, int sizeb=-1)
virtual | ~Symbol ()
bool | operator!= (const Symbol &) const
bool | operator== (const Symbol &) const
void | set_size (int a, int b=-1)
void | set_style (SymbolStyleID s)
Glib::RefPtr< Paint > | paint () const
int | size () const
int | size_aux () const
SymbolStyleID | style () const
void | draw (const Glib::RefPtr< Gdk::Drawable > &p, const Gdk::Point &pt) const
void | draw (const Glib::RefPtr< Gdk::Drawable > &p, const Gdk::Rectangle &r) const
void | draw (const Glib::RefPtr< Gdk::Drawable > &p, int x, int y, int w=-1, int h=-1) const

## Protected Member Functions

virtual void | draw_vfunc_ (const Glib::RefPtr< Gdk::Drawable > &p, int x, int y, int w, int h) const

## Constructor & Destructor Documentation

Symbol::Symbol | ( | SymbolStyleID | style = `SYMBOL_NONE`,
|  | int | size = `1`,
|  | int | sizeb = `-1`
| ) |

Constructor.

Parameters:

  | style | Symbol Style
  | size | horizontal size
  | sizeb | optional vertical size (defaults to horizontal size)

Symbol::~Symbol | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

void Symbol::draw | ( | const Glib::RefPtr< Gdk::Drawable > & | p,
|  | int | x,
|  | int | y,
|  | int | w = `-1`,
|  | int | h = `-1`
| ) | const

| Draw the symbol at the specified position with optionally specified size.

void Symbol::draw | ( | const Glib::RefPtr< Gdk::Drawable > & | p,
|  | const Gdk::Rectangle & | r
| ) | const

| Draw the symbol at a point (x,y).

void Symbol::draw | ( | const Glib::RefPtr< Gdk::Drawable > & | painter,
|  | const Gdk::Point & | pos
| ) | const

Draw the symbol at a specified point.

Parameters:

  | painter | Painter
  | pos | Center of the symbol

void Symbol::draw_vfunc_ | ( | const Glib::RefPtr< Gdk::Drawable > & | painter,
|  | int | x1,
|  | int | y1,
|  | int | w,
|  | int | h
| ) | const`[protected, virtual]`

| overload this function to provide additional symbol styles To draw the symbol this function makes use of paint() - the pen is used to draw outlines whilst the brush is used to fill the symbol.

bool Symbol::operator!= | ( | const Symbol & |  | ) | const

| != operator

bool Symbol::operator== | ( | const Symbol & |  | ) | const

| == operator

Glib::RefPtr< Paint > Symbol::paint | ( |  | ) | const

| Return a reference to the Paint the symbol is drawn with

void Symbol::set_size | ( | int | w,
|  | int | h = `-1`
| ) |

Specify the symbol's size.

In most cases, the vertical size is the same as the horizontal size. It is perfectly sufficient to set the horizontal size. size() and size_aux() will return the same value, then.

Parameters:

  | w | horizontal size
  | h | optional vertical size (defaults to horizontal size)

void Symbol::set_style | ( | SymbolStyleID | s | ) |

Specify the symbol style.

The following styles are defined:

SYMBOL_NONE
  No Style. The symbol cannot be drawn.
SYMBOL_ELLIPSE
  Ellipse or circle
SYMBOL_RECTANGLE
  Rectangle
SYMBOL_DIAMOND
  Diamond
SYMBOL_TRIANGLE
  Triangle pointing upwards
SYMBOL_D_TRIANGLE
  Triangle pointing downwards
SYMBOL_U_TRIANGLE
  Triangle pointing upwards
SYMBOL_L_TRIANGLE
  Triangle pointing left
SYMBOL_R_TRIANGLE
  Triangle pointing right
SYMBOL_CROSS
  Cross
SYMBOL_XCROSS
  Diagonal cross

Parameters:

  | s | style

int PlotMM::Symbol::size | ( |  | ) | const

| Return Size.

int PlotMM::Symbol::size_aux | ( |  | ) | const

| Return auxiliary size or, if unset, size().

SymbolStyleID PlotMM::Symbol::style | ( |  | ) | const

| Return SymbolStyle.