vdk 2.4.0
|
Databox widget. More...
#include <vdkdatabox.h>
Databox widget.
This is a simple (almost 1:1) wrapper of GtkDatabox 0.1.11.0 widget. Some of the functions have been modified in order to return a value, instead to change the value sent as parameter, as I have thought this is more in the VDK spirit. Also, wherever the case, I used a VDKColor instead of GdkColor, for the same reason: VDK spirit.
The data box has the following styles (but check GtkDataboxDataType for other styles):
Public Members
Properties
Static Table Signals
Dynamic Table Signals
Dynamic table signals are different from the equivalent databox signals in that that they do not send values of the marked point or selection, for instance. These values can be read using the read-only properties.
gint VDKDataBox::AddX | ( | guint | length, |
gfloat * | X, | ||
guint | indexSharedY, | ||
VDKColor * | color, | ||
GtkDataboxDataType | type = GTK_DATABOX_POINTS , |
||
guint | dotSize = 1 |
||
) |
Add a dataset.
You must supply a X vector of data and an index to an existent Y vector. Also the number of points and a color to be used for ploting the dataset. If the number of points of X and shared Y vector are different, an error is generated.
length | number of points from the dataset. |
X | pointer to x vector of data. |
indexSharedY | index to a shared y vector of data. |
color | color for the ploting the dataset |
type | type of points. |
dotsize | size of the dots used. |
gint VDKDataBox::AddXY | ( | guint | length, |
gfloat * | X, | ||
gfloat * | Y, | ||
VDKColor * | color, | ||
GtkDataboxDataType | type = GTK_DATABOX_POINTS , |
||
guint | dotSize = 1 |
||
) |
Add a dataset.
Both X and Y must be supplied. Also the number of points and a color to be used for ploting the dataset.
length | number of points from the dataset. |
X | pointer to x vector of data. |
Y | pointer to y vector of data. |
color | color for the ploting the dataset |
type | type of points. |
dotsize | size of the dots used. |
gint VDKDataBox::AddY | ( | guint | length, |
gfloat * | Y, | ||
guint | indexSharedX, | ||
VDKColor * | color, | ||
GtkDataboxDataType | type = GTK_DATABOX_POINTS , |
||
guint | dotSize = 1 |
||
) |
Add a dataset.
You must supply a Y vector of data and an index to an existent X vector. Also the number of points and a color to be used for ploting the dataset. If the number of points of X and shared Y vector are different, an error is generated.
length | number of points from the dataset. |
Y | pointer to y vector of data. |
indexSharedX | index to a shared x vector of data. |
color | color for the ploting the dataset |
type | type of points. |
dotsize | size of the dots used. |
gint VDKDataBox::DestroyData | ( | gint | index | ) |
Remove a single dataset and destroy data associated with it.
index | index of dataset to be destroyed. |
gint VDKDataBox::DestroyData | ( | ) |
Remove all datasets and destroy data associated with them.
VDKColor * VDKDataBox::GetColor | ( | int | index | ) |
Get the color of a dataset.
index | dataset index |
void VDKDataBox::GetExtrema | ( | GtkDataboxValue & | min, |
GtkDataboxValue & | max, | ||
bool | visible = true |
||
) |
Get the extreme values.
min | returns the minimum x and y values of the databox. |
max | returns the maximum x and y values of the databox. |
visible | if true, then min and max are computed for the visible window; otherwise, they are computed for the whole databox. |
GtkDataboxValue VDKDataBox::GetValue | ( | GtkDataboxCoord | coord | ) |
Get data value.
coord | screen coordinates of a point. |
gint VDKDataBox::RemoveData | ( | gint | index | ) |
Remove a single dataset.
index | index of dataset to be removed. |
gint VDKDataBox::RemoveData | ( | ) |
Remove all datasets.
void VDKDataBox::Rescale | ( | GtkDataboxValue | min, |
GtkDataboxValue | max | ||
) |
Rescale the databox using given minimum and maximum values.
min | the minimum x and y values. |
max | the maximum x and y values. |
void VDKDataBox::SetBackground | ( | VDKRgb | color, |
GtkStateType | state | ||
) | [virtual] |
void VDKDataBox::SetColor | ( | int | index, |
VDKColor * | color, | ||
bool | redraw = true |
||
) |
Set the color of a dataset.
index | dataset index |
color | new color for the dataset |
redraw | constrols if we call or not a subsequent Redraw(). Set to false if you don't want a redraw. |