GTK+ IOStream
Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
|
encapsulates a method to specify colour and line or point plotting This class tries to encapsulate octave style colours and line type specification. See ColourLineSpec::ColourLineSpec for a description More...
#include <ColourLineSpec.H>
Public Member Functions | |
ColourLineSpec (void) | |
default constructor with blue colour Initiates the defaul blue line type of size 1 More... | |
ColourLineSpec (const char *clsChar) | |
use a octave like string to define the line/points or colour Speciy whether to use points or lines and the colour. For example, "r" means, plot red with lines, ":k" means plot black in points. Also you can specify size, eg : ":r10" means points, red, size 10 More... | |
bool | wasSizeSpecified (void) |
bool | wasColourSpecified (void) |
void | setSize (int s) |
int | getSize (void) |
void | setColour (GdkColor c) |
void | setColour (const char *c) |
GdkColor | getColour (void) |
gchar * | getColourString (void) |
void | setColourAndLinesOrPoints (const char *clsChar) |
interprets the octave style line/colour spec. By default implements lines specify points using the ':' character. Understands the default octave colours. More... | |
ColourLineSpec & | operator= (string &c) |
ColourLineSpec & | operator= (char *c) |
Static Public Member Functions | |
static const char ** | getColourLabels (void) |
Public Attributes | |
bool | linePlot |
The indication for lines or points plotting. More... | |
Private Attributes | |
bool | sizeNotSpecified |
Set to true if the size was not specified ... i.e. "r" for red with no size. More... | |
bool | colourNotSpecified |
Set to true if the colour was not specified ... i.e. "12" for size 12 with no colour. More... | |
int | size |
The size of the line or point. More... | |
GdkColor | colour |
The colour holder. More... | |
Static Private Attributes | |
static int | colourCnt =10 |
The number of colours defined in the following char ** variables. More... | |
static const char * | shortColours [] = {(char *)"y",(char *)"m",(char *)"c",(char *)"r",(char *)"g",(char *)"b",(char *)"w",(char *)"k",(char *)"o",(char *)"a"} |
Default octave colours which match ColourLineSpec::X11Colours. More... | |
static const char * | X11Colours [] = {(char *)"yellow", (char *)"magenta", (char *)"cyan", (char *)"red", (char *)"green", (char *)"blue", (char *)"white", (char *)"black", (char *)"orange", (char *)"gray"} |
Default X11 colours to match ColourLineSpec::shortColours. More... | |
encapsulates a method to specify colour and line or point plotting This class tries to encapsulate octave style colours and line type specification. See ColourLineSpec::ColourLineSpec for a description
Additionally, as this is only a header file, you must put something like the following into your C++ source file :
setup the possible plot colours ... NOTE: if you want to use the Plot::grid method, you HAVE TO make sure that "a" is mapped to a colour - in this case, gray. int ColourLineSpec::colourCnt=10; // match this number with the number of colours below const char *ColourLineSpec::shortColours[]= {(char *)"y",(char *)"m",(char *)"c",(char *)"r",(char *)"g",(char *)"b",(char *)"w",(char *)"k",(char *)"o",(char *)"a"}; // standard colours const char *ColourLineSpec::X11Colours[]= {(char *)"yellow", (char *)"magenta", (char *)"cyan", (char *)"red", (char *)"green", (char *)"blue", (char *)"white", (char *)"black", (char *)"orange", (char *)"gray"};
This class allows you to specify plot spcifications like so : "c1" for a cyan plot of line width 1. Or "y2:" for a yellow dotted plot of size 2. i.e. : plot(x,y,x.size(),"y2");
Definition at line 27 of file ColourLineSpec.H.
|
inline |
default constructor with blue colour Initiates the defaul blue line type of size 1
Definition at line 41 of file ColourLineSpec.H.
|
inline |
use a octave like string to define the line/points or colour Speciy whether to use points or lines and the colour. For example, "r" means, plot red with lines, ":k" means plot black in points. Also you can specify size, eg : ":r10" means points, red, size 10
Definition at line 50 of file ColourLineSpec.H.
|
inline |
Request the colour
Definition at line 115 of file ColourLineSpec.H.
|
inlinestatic |
Definition at line 182 of file ColourLineSpec.H.
|
inline |
Request the colour string
Definition at line 122 of file ColourLineSpec.H.
|
inline |
Request the size
Definition at line 92 of file ColourLineSpec.H.
|
inline |
Definition at line 165 of file ColourLineSpec.H.
|
inline |
Definition at line 173 of file ColourLineSpec.H.
|
inline |
Manually specify the colour
c | the GtkColor |
Definition at line 99 of file ColourLineSpec.H.
|
inline |
Manually specify the colour
c | the char* color (could be something like "red" or "#b2b2b2") |
Definition at line 107 of file ColourLineSpec.H.
|
inline |
interprets the octave style line/colour spec. By default implements lines specify points using the ':' character. Understands the default octave colours.
Definition at line 131 of file ColourLineSpec.H.
|
inline |
|
inline |
Enquire whether the colour was specified as well as the size
For example:
Definition at line 77 of file ColourLineSpec.H.
|
inline |
Enquire whether the size was specified as well as the colour.
For example:
Definition at line 65 of file ColourLineSpec.H.
|
private |
The colour holder.
Definition at line 34 of file ColourLineSpec.H.
|
staticprivate |
The number of colours defined in the following char ** variables.
Definition at line 28 of file ColourLineSpec.H.
|
private |
Set to true if the colour was not specified ... i.e. "12" for size 12 with no colour.
Definition at line 32 of file ColourLineSpec.H.
bool ColourLineSpec::linePlot |
The indication for lines or points plotting.
Definition at line 36 of file ColourLineSpec.H.
|
staticprivate |
Default octave colours which match ColourLineSpec::X11Colours.
Definition at line 29 of file ColourLineSpec.H.
|
private |
The size of the line or point.
Definition at line 33 of file ColourLineSpec.H.
|
private |
Set to true if the size was not specified ... i.e. "r" for red with no size.
Definition at line 31 of file ColourLineSpec.H.
|
staticprivate |
Default X11 colours to match ColourLineSpec::shortColours.
Definition at line 30 of file ColourLineSpec.H.