Module gwy :: Class GraphCurveModel
[hide private]
[frames] | no frames]

Class GraphCurveModel

source code

Instance Methods [hide private]
 
__init__()
Creates a new graph curve model.
source code
 
new_alike()
Creates new graph curve model object that has the same settings as gcmodel.
source code
 
set_data(xdata, ydata, n)
Sets curve model data.
source code
 
set_data_from_dataline(dline, from_index, to_index)
Sets the curve data from DataLine.
source code
 
get_xdata()
Gets pointer to x data points.
source code
 
get_ydata()
Gets pointer to y data points.
source code
 
get_ndata()
Returns: number of data points within the curve data
source code
 
get_x_range(x_min, x_max)
Gets the abscissa range of a graph curve.
source code
 
get_y_range(y_min, y_max)
Gets the ordinate range of a graph curve.
source code
 
get_ranges(x_logscale, y_logscale, x_min, x_max, y_min, y_max) source code
 
UNIMPLEMENTED_get_calibration_data()
Get pointer to actual calibration data for curve.
source code
 
UNIMPLEMENTED_set_calibration_data(calibration)
Set calibration data for curve.
source code
Method Details [hide private]

__init__()
(Constructor)

source code 

Creates a new graph curve model.

Returns:
New empty graph curve model as a GObject.

new_alike()

source code 

Creates new graph curve model object that has the same settings as gcmodel.

Curve data are not duplicated.

Returns:
New graph curve model.

set_data(xdata, ydata, n)

source code 

Sets curve model data.

If there were calibration data in the former gcmodel, they are removed.

Parameters:
  • xdata - X data points (array of size n). (const-gdouble*)
  • ydata - Y data points (array of size n). (const-gdouble*)
  • n - Number of points, i.e. items in xdata and ydata. (int)

set_data_from_dataline(dline, from_index, to_index)

source code 

Sets the curve data from DataLine. The range of import can be modified using parameters from_index and to_index that are interpreted directly as data indices within the DataLine. In the case that from_index == to_index, the full DataLine is used.

If there were calibration data in the former gcmodel, they are removed.

Parameters:
  • dline - A DataLine (DataLine)
  • from_index - index where to start (int)
  • to_index - where to stop (int)

get_xdata()

source code 

Gets pointer to x data points.

Data are used within the graph and cannot be freed.

Returns:
X data points, owned by the curve model.

get_ydata()

source code 

Gets pointer to y data points.

Data are used within the graph and cannot be freed.

Returns:
Y data points, owned by the curve model.

get_ndata()

source code 
Returns:
number of data points within the curve data

get_x_range(x_min, x_max)

source code 

Gets the abscissa range of a graph curve.

The values are cached in the curve model therefore repeated calls to this function (with unchanged data) are cheap.

If there are no data points in the curve, x_min and x_max are untouched and the function returns False.

See also Graph.curve_model_get_ranges() for a more high-level function.

Parameters:
  • x_min - Location to store the minimum abscissa value, or NULL. (float)
  • x_max - Location to store the maximum abscissa value, or NULL. (float)
Returns:
True if there are any data points in the curve and x_min, x_max were set.

get_y_range(y_min, y_max)

source code 

Gets the ordinate range of a graph curve.

The values are cached in the curve model therefore repeated calls to this function (with unchanged data) are cheap.

If there are no data points in the curve, x_min and x_max are untouched and the function returns False.

See also Graph.curve_model_get_ranges() for a more high-level function.

Parameters:
  • y_min - Location to store the minimum ordinate value, or NULL. (float)
  • y_max - Location to store the maximum ordinate value, or NULL. (float)
Returns:
True if there are any data points in the curve and x_min, x_max were set.

UNIMPLEMENTED_get_calibration_data()

source code 

Get pointer to actual calibration data for curve.

Returns:
Pointer to the calibration data of present curve (NULL if none).

UNIMPLEMENTED_set_calibration_data(calibration)

source code 

Set calibration data for curve.

Parameters:
  • calibration - Curve calibration data (const-CurveCalibrationData*)