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

VDKColor * VDKDataBox::GetColor ( int  index  ) 

Get the color of a dataset.

Parameters:
index dataset 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::SetColor ( int  index,
VDKColor color,
bool  redraw = true 
)

Set the color of a dataset.

Parameters:
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.

GtkDataboxValue VDKDataBox::GetValue ( GtkDataboxCoord  coord  ) 

Get data value.

Parameters:
coord screen coordinates of a point.
Returns:
data value associated with the coord.

void VDKDataBox::GetExtrema ( GtkDataboxValue &  min,
GtkDataboxValue &  max,
bool  visible = true 
)

Get the extreme values.

Parameters:
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.

void VDKDataBox::Rescale ( GtkDataboxValue  min,
GtkDataboxValue  max 
)

Rescale the databox using given minimum and maximum values.

Parameters:
min the minimum x and y values.
max the maximum x and y values.

gint VDKDataBox::RemoveData ( gint  index  ) 

Remove a single dataset.

Parameters:
index index of dataset to be removed.
Returns:
0 on success.

gint VDKDataBox::RemoveData (  ) 

Remove all datasets.

Returns:
0 on success.

gint VDKDataBox::DestroyData ( gint  index  ) 

Remove a single dataset and destroy data associated with it.

Parameters:
index index 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)

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:
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.
Returns:
index of the dataset added, on success, or -1, on error.

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:
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.
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:
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.
Returns:
index of the dataset added, on success, or -1, on error.

void VDKDataBox::SetBackground ( VDKRgb  color,
GtkStateType  state 
) [virtual]

Sets object background

Parameters:
color a VDKRgb object
state can be one of the gtk+ widget states

Reimplemented from VDKObject.


The documentation for this class was generated from the following files:
Generated on Fri Nov 10 15:11:25 2006 for vdk 2.4.0 by  doxygen 1.5.1