HstFunction

HstFunction — a GObject to evaluate a 1D function in a given range

Synopsis

#include <gtk-hst/function.h>


                    HstFunction;
                    HstFunctionClass;
typedef             Tuple;
typedef             PointList;


Object Hierarchy

  GObject
   +----HstFunction
         +----HstGraph
         +----HstHistogram
         +----HstFunction2D

Properties

  "func"                     gpointer              : Read / Write
  "name"                     gchararray            : Read / Write
  "nx"                       gint                  : Read / Write
  "range"                    gpointer              : Read / Write
  "xmax"                     gdouble               : Read / Write
  "xmin"                     gdouble               : Read / Write
  "xstep"                    gdouble               : Read / Write

Signals

  "range-changed"                                  : Run First

Description

This is an object that wraps a 1D function and a range of validity for that function. The range is defined as an interval of evaluation and the number of points in which the function is evaluated. The range is the basis for defining an axis in a Histogram.

Details

HstFunction

typedef struct _HstFunction HstFunction;

The HstFunction struct contains the following fields. (These fields should be considered read-only. They should never be set by an application.)

double (*func)(double) A pointer to a 1D function
int nbin Number of bins
gdouble xmin Minimum value of the X range
gdouble xmax Maximum value of the X range
gdouble step Step
gchar *name Name of the function


HstFunctionClass

typedef struct _HstFunctionClass HstFunctionClass;

A HstFunction implements three methods which are used to evaluate the function, to return an array of points in order to draw the function


Tuple

typedef struct Tuple_ Tuple;


PointList

typedef struct PointList_ PointList;

Property Details

The "func" property

  "func"                     gpointer              : Read / Write

A pointer to a double Hst1DFunction function that is to be evaluated by HstFunction


The "name" property

  "name"                     gchararray            : Read / Write

The name of the function.

Default value: "<unnamed>"


The "nx" property

  "nx"                       gint                  : Read / Write

The number of bins in the X axis

Allowed values: [1,999999]

Default value: 10


The "range" property

  "range"                    gpointer              : Read / Write

The range of the funtion represents any of nx, xmin, xmax. If any of those change, there will be a range-change notification.


The "xmax" property

  "xmax"                     gdouble               : Read / Write

The maximum value of X definig the range of validity of the function

Default value: 1


The "xmin" property

  "xmin"                     gdouble               : Read / Write

The minimum value of X definig the range of validity of the function

Default value: 0


The "xstep" property

  "xstep"                    gdouble               : Read / Write

step en X.

Default value: 1

Signal Details

The "range-changed" signal

void                user_function                      (HstFunction *arg0,
                                                        gpointer     user_data)      : Run First

This signal is emitted whenever any of the properties that define the range of the histogram change. That applies to nx, xmin or xmax.

user_data :

user data set when the signal handler was connected.