vdk 2.4.0
Public Member Functions | Public Attributes
VDKDataBox Class Reference

Databox widget. More...

#include <vdkdatabox.h>

Inheritance diagram for VDKDataBox:
VDKObject VDKNotCopyAble

List of all members.

Public Member Functions

Public Attributes


Detailed Description

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.

Author:
Ionutz Borcoman <borco@borco-ei.eng.hokudai.ac.jp>
Date:
March 1999
Author:
Mario Motta <mmotta@guest.net> that have done the porting to vdk 2.x
Date:
May 2002

Member Function Documentation

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.

Parameters:
lengthnumber of points from the dataset.
Xpointer to x vector of data.
indexSharedYindex to a shared y vector of data.
colorcolor for the ploting the dataset
typetype of points.
dotsizesize of the dots used.
Returns:
index of the dataset added, on success, or -1, on error.
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.

Parameters:
lengthnumber of points from the dataset.
Xpointer to x vector of data.
Ypointer to y vector of data.
colorcolor for the ploting the dataset
typetype of points.
dotsizesize of the dots used.
Returns:
index of the dataset added, on success, or -1, on error.
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.

Parameters:
lengthnumber of points from the dataset.
Ypointer to y vector of data.
indexSharedXindex to a shared x vector of data.
colorcolor for the ploting the dataset
typetype of points.
dotsizesize of the dots used.
Returns:
index of the dataset added, on success, or -1, on error.
gint VDKDataBox::DestroyData ( gint  index)

Remove a single dataset and destroy data associated with it.

Parameters:
indexindex of dataset to be destroyed.
Returns:
0 on success.
Bug:
this function destroys data associated using g_free(). Do not use it, unless you have used g_new() to allocate the memory for your data.
gint VDKDataBox::DestroyData ( )

Remove all datasets and destroy data associated with them.

Returns:
0 on success.
See also:
Destroy(gint)
VDKColor * VDKDataBox::GetColor ( int  index)

Get the color of a dataset.

Parameters:
indexdataset index
Returns:
pointer to a VDKColor identical with the one of the dataset.
Bug:
The returned value is a pointer to a new allocated VDKColor. Therefore, it will not reflect furthure changes in the color of the index dataset. You can free memory associated with it using Destroy() method.
void VDKDataBox::GetExtrema ( GtkDataboxValue &  min,
GtkDataboxValue &  max,
bool  visible = true 
)

Get the extreme values.

Parameters:
minreturns the minimum x and y values of the databox.
maxreturns the maximum x and y values of the databox.
visibleif 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.

Parameters:
coordscreen coordinates of a point.
Returns:
data value associated with the coord.
gint VDKDataBox::RemoveData ( gint  index)

Remove a single dataset.

Parameters:
indexindex of dataset to be removed.
Returns:
0 on success.
gint VDKDataBox::RemoveData ( )

Remove all datasets.

Returns:
0 on success.
void VDKDataBox::Rescale ( GtkDataboxValue  min,
GtkDataboxValue  max 
)

Rescale the databox using given minimum and maximum values.

Parameters:
minthe minimum x and y values.
maxthe maximum x and y values.
void VDKDataBox::SetBackground ( VDKRgb  color,
GtkStateType  state 
) [virtual]

Sets object background

Parameters:
colora VDKRgb object
statecan be one of the gtk+ widget states

Reimplemented from VDKObject.

void VDKDataBox::SetColor ( int  index,
VDKColor color,
bool  redraw = true 
)

Set the color of a dataset.

Parameters:
indexdataset index
colornew color for the dataset
redrawconstrols if we call or not a subsequent Redraw(). Set to false if you don't want a redraw.

The documentation for this class was generated from the following files: