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>
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
This class allows you to specify plot specifications 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");
NOTE: in the future there are plans to allow the user to specify their own colours.
- Examples:
- CairoBoxTest.C, CairoCircleTest.C, MessageDialogTest.C, PangoTest.C, and PlotTest2.C.
Definition at line 61 of file ColourLineSpec.H.
◆ ColourLineSpec() [1/2]
ColourLineSpec::ColourLineSpec |
( |
void |
| ) |
|
|
inline |
default constructor with blue colour Initiates the defaul blue line type of size 1
Definition at line 81 of file ColourLineSpec.H.
◆ ColourLineSpec() [2/2]
ColourLineSpec::ColourLineSpec |
( |
const char * |
clsChar | ) |
|
|
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 90 of file ColourLineSpec.H.
◆ getColour() [1/2]
GdkColor ColourLineSpec::getColour |
( |
void |
| ) |
|
|
inline |
◆ getColour() [2/2]
static const char* ColourLineSpec::getColour |
( |
uint |
i | ) |
|
|
inlinestatic |
Given an integer, find the matching short colour name. If the number given is larger then the number of available colours, then find the modulus and return that colour.
- Parameters
-
i | The desired colour index into shortColoursPrivate. |
- Returns
- A shortColoursPrivate char array pointer which is indexed by i, and if i > colourCntPrivate, then find the index from the modulus [icolourCntPrivate].
Definition at line 274 of file ColourLineSpec.H.
◆ getColourLabels()
static const char** ColourLineSpec::getColourLabels |
( |
void |
| ) |
|
|
inlinestatic |
Get the pointer to the short colour names.
- Returns
- A pointer to shortColoursPrivate.
Definition at line 266 of file ColourLineSpec.H.
◆ getColourString()
gchar* ColourLineSpec::getColourString |
( |
void |
| ) |
|
|
inline |
Request the colour string
- Returns
- the Gdk colour as a newly allocated string
Definition at line 181 of file ColourLineSpec.H.
◆ getSize()
float ColourLineSpec::getSize |
( |
void |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator>>()
Sets the cairo drawing colour and width.
- Parameters
-
cr | The cairo context to set the colour and width in. |
- Returns
- A reference to this class.
Definition at line 282 of file ColourLineSpec.H.
◆ setColour() [1/2]
void ColourLineSpec::setColour |
( |
GdkColor |
c | ) |
|
|
inline |
◆ setColour() [2/2]
void ColourLineSpec::setColour |
( |
const char * |
c | ) |
|
|
inline |
Manually specify the colour
- Parameters
-
c | the char* color (could be something like "red" or "#b2b2b2") |
Definition at line 158 of file ColourLineSpec.H.
◆ setColourAndLinesOrPoints()
void ColourLineSpec::setColourAndLinesOrPoints |
( |
const char * |
clsChar | ) |
|
|
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 194 of file ColourLineSpec.H.
◆ setRGBA()
Set the RGBA for the cairo context .
- Parameters
-
cr | The cairo context to set the colour and width in. |
alpha | The number to scale by. 0.0 <= alpha <= 1.0 |
Definition at line 296 of file ColourLineSpec.H.
◆ setSize() [1/2]
void ColourLineSpec::setSize |
( |
int |
s | ) |
|
|
inline |
◆ setSize() [2/2]
void ColourLineSpec::setSize |
( |
float |
s | ) |
|
|
inline |
◆ wasColourSpecified()
bool ColourLineSpec::wasColourSpecified |
( |
void |
| ) |
|
|
inline |
Enquire whether the colour was specified as well as the size For example:
cls.wasColourSpecified();
- Returns
- true if the colour was specified, false otherwise
Definition at line 117 of file ColourLineSpec.H.
◆ wasSizeSpecified()
bool ColourLineSpec::wasSizeSpecified |
( |
void |
| ) |
|
|
inline |
Enquire whether the size was specified as well as the colour. For example:
- Returns
- true if the size was specified, false otherwise
Definition at line 105 of file ColourLineSpec.H.
◆ colour
GdkColor ColourLineSpec::colour |
|
private |
◆ colourNotSpecified
bool ColourLineSpec::colourNotSpecified |
|
private |
Set to true if the colour was not specified ... i.e. "12" for size 12 with no colour.
Definition at line 63 of file ColourLineSpec.H.
◆ linePlot
bool ColourLineSpec::linePlot |
The indication for lines or points plotting.
Definition at line 76 of file ColourLineSpec.H.
◆ shortColours
vector<string> ColourLineSpec::shortColours |
◆ size
float ColourLineSpec::size |
|
private |
◆ sizeNotSpecified
bool ColourLineSpec::sizeNotSpecified |
|
private |
Set to true if the size was not specified ... i.e. "r" for red with no size.
Definition at line 62 of file ColourLineSpec.H.
◆ X11Colours
vector<string> ColourLineSpec::X11Colours |
The documentation for this class was generated from the following file: