atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
curve.h File Reference

Variable declarations for the curve widget
Functions for interactions with the curve widget. More...

#include "global.h"
Include dependency graph for curve.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  curve_dash

Macros

#define GRIDSIZE   0.1
#define LEGX   0.65
#define LEGY   0.15
#define RED   1.0
#define GREEN   0.0
#define BLUE   0.0
#define DTHICK   1.0
#define NDASHS   11
#define NGLYPHS   37
#define MARGX   100
#define MARGY   70

Typedefs

typedef struct curve_dash curve_dash

Functions

int get_curve_shift (Curve *this_curve)
 get cruve window size shift
curve_dashselectdash (int iddash)
 setup dash pointer
double scale (double axe)
 find appropriate major tick spacing based on axis length
Curveget_curve_from_pointer (gpointer data)
 get Curve pointer from pointer
void prep_plot (Curve *this_curve)
 prepare curve plot (setting up variables for the plot)
void hide_curves (project *this_proj, int c)
 for project hide all curves for a calculation
void erase_curves (project *this_proj, int c)
 free all curve(s) data
void update_curves ()
 update all curve(s) rendering for all project(s) in the workspace
void update_curve (gpointer curve)
 update curve rendering
void show_curve (GtkDrawingArea *area, cairo_t *cr, int width, int height, gpointer curve)
 show curve callback GTK3
void hide_curve (gpointer data)
 hide curve
G_MODULE_EXPORT gboolean to_hide_curve (GtkWindow *thecurve, gpointer data)
void clean_curves_data (int calc, int start, int end)
 clean curve data on a range of curve id
void initcurve (project *pid, int rid, int cid)
 initialize curve widget
void init_curve_title (project *this_proj, int rid, int cid)
 init curve title and axis titles
void add_curve_widgets (project *this_proj, int rid)
 add curve widgets to the project
void allocextra (int a, int b, int c)
void label_curve (cairo_t *cr, double val, int axe, int p, Curve *this_curve)
 draw axis label
void show_frame (cairo_t *cd, int tf, int da, int res[2], double ti, double x[2], double y[2], ColRGBA dcol)
 draw frame
void prep_frame (cairo_t *fr, int da, double ti, ColRGBA dcol)
 draw frame line
void draw_frame (cairo_t *cr, Curve *this_curve, int rid, int cid)
 draw frame and axis data
void draw_glyph (cairo_t *in, int theglyph, double x, double y, ColRGBA gcolor, double size)
 draw glyph at (x,y)
const gchar * default_title (int ax, gpointer data)
 default title string
void show_title (cairo_t *cr, Curve *this_curve)
 draw title
void autoscale_axis (project *this_proj, Curve *this_curve, int rid, int cid, int aid)
 autoscale axis
void setup_xaxis_linear (cairo_t *cr, Curve *this_curve)
 setup x axis using a linear scale
void setup_xaxis_log (cairo_t *cr, Curve *this_curve, int rid, int cid, gboolean draw_it)
 setup x axis using a log scale
void setup_yaxis_linear (cairo_t *cr, Curve *this_curve)
 setup y axis using a linear scale
void setup_yaxis_log (cairo_t *cr, Curve *this_curve, gboolean draw_it)
 setup y axis using a log scale
void write_curve (gpointer idata)
 save curve data - creating the dialog
void save_image (gpointer cdata)
 export curve window plot to image - creating the dialog
void remove_extra (ExtraSets *sets, CurveExtra *ctmp)
 remove data from extra set(s)
void curve_window_add_menu_bar (tint *data)
 add menu bar to the curve window
GtkWidget * curve_popup_menu (gpointer data)
 create curve popup menu
void show_curve_popup_menu (GdkEvent *event, gpointer data)
void draw_curve (cairo_t *cr, int cid, int rid, project *this_proj, int points, ColRGBA withcolor, int xscale, int yscale, int asp, int vdash, double thick, int glyp, double gize, int freq, double hwidth, double hopac, int hpos, int extra, int pid)
 draw target curve to the cairo drawing context
void show_legend (cairo_t *cr, project *this_proj, int rid, int cid)
 draw legend

Variables

GtkWidget * axischoice
GtkWidget * vmin
GtkWidget * vmax
GtkWidget * majt
GtkWidget * nmi [2]
GtkWidget * xyp [2]
int resol [2]
int originp
int ndash
int nglyph
double back_alpha
gint32 etime
double XDRAW
double YDRAW
double DXDRAW
double DYDRAW
double xmax
double ymax
double x_min
double x_max
double y_max
double y_min
double ax
double ay
double cxy [2]
double mticks
int nticks
int xlog
int ylog
int dxlog
int dylog
char * sca
PangoLayout * layout
gboolean dogrid
int x_shift
int y_shift
int amint
int amajt
int tickpos
int labpos
int xmarge
int ymarge
char * curve_image_file
const double dashed1 []
int len1
const double pdashed []
int lenp

Detailed Description

Variable declarations for the curve widget
Functions for interactions with the curve widget.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file curve.h.

Macro Definition Documentation

◆ BLUE

#define BLUE   0.0

Definition at line 46 of file curve.h.

◆ DTHICK

#define DTHICK   1.0

Definition at line 48 of file curve.h.

◆ GREEN

#define GREEN   0.0

Definition at line 45 of file curve.h.

◆ GRIDSIZE

#define GRIDSIZE   0.1

Definition at line 39 of file curve.h.

◆ LEGX

#define LEGX   0.65

Definition at line 41 of file curve.h.

◆ LEGY

#define LEGY   0.15

Definition at line 42 of file curve.h.

◆ MARGX

#define MARGX   100

Definition at line 54 of file curve.h.

◆ MARGY

#define MARGY   70

Definition at line 55 of file curve.h.

◆ NDASHS

#define NDASHS   11

Definition at line 50 of file curve.h.

◆ NGLYPHS

#define NGLYPHS   37

Definition at line 52 of file curve.h.

◆ RED

#define RED   1.0

Definition at line 44 of file curve.h.

Typedef Documentation

◆ curve_dash

typedef struct curve_dash curve_dash

Definition at line 68 of file curve.h.

Function Documentation

◆ add_curve_widgets()

void add_curve_widgets ( project * this_proj,
int rid )
extern

add curve widgets to the project

Parameters
this_projthe target project
ridthe analysis id

Definition at line 283 of file cwidget.c.

◆ allocextra()

void allocextra ( int a,
int b,
int c )
extern

◆ autoscale_axis()

void autoscale_axis ( project * this_proj,
Curve * this_curve,
int rid,
int cid,
int aid )
extern

autoscale axis

Parameters
this_projthe target project
this_curvethe target curve
ridthe analysis id
cidthe curve id
aidthe axis id

Definition at line 56 of file yaxis.c.

◆ clean_curves_data()

void clean_curves_data ( int calc,
int start,
int end )
extern

clean curve data on a range of curve id

Parameters
calcthe calculation
startthe starting value
endthe ending value

Definition at line 61 of file initc.c.

◆ curve_popup_menu()

GtkWidget * curve_popup_menu ( gpointer data)
extern

create curve popup menu

Parameters
datathe associated data pointer

Definition at line 719 of file m_curve.c.

◆ curve_window_add_menu_bar()

void curve_window_add_menu_bar ( tint * data)
extern

add menu bar to the curve window

Parameters
datathe associated data pointer

Definition at line 625 of file m_curve.c.

◆ default_title()

const gchar * default_title ( int ax,
gpointer data )
extern

default title string

Parameters
axaxis
datathe associated data pointer

Definition at line 54 of file title.c.

◆ draw_curve()

void draw_curve ( cairo_t * cr,
int cid,
int rid,
project * this_proj,
int points,
ColRGBA withcolor,
int xscale,
int yscale,
int asp,
int vdash,
double thick,
int glyp,
double gize,
int freq,
double hwidth,
double hopac,
int hpos,
int extra,
int pid )

draw target curve to the cairo drawing context

Parameters
crthe cairo drawing context to use for the draw
cidthe target curve id
ridthe target calculation id
this_projthe target project
pointsthe number of data point(s)
withcolorthe data color
xscalex axis scale type (0 = linear, 1 = log)
yscaley axis scale type (0 = linear, 1 = log)
aspdata aspect (0 = x/y normal, 1 = historgram)
vdashdash type
thickline tthickness
glypglyph type
gizeglyph size
freqglyph frequency
hwidthhistogram bar width
hopachistogram bar opacity value
hposhistogram opacity treatment (0 = no opacity, 1 = use opacity)
extrathe number of extra data sets
pid0 (x/y plot) or plot id number (historgram)

Definition at line 85 of file draw.c.

◆ draw_frame()

void draw_frame ( cairo_t * cr,
Curve * this_curve,
int rid,
int cid )
extern

draw frame and axis data

Parameters
crthe cairo drawing context to use for the draw
this_curvethe target curve
ridthe calculation id
cidthe curve id

Definition at line 163 of file frame.c.

◆ draw_glyph()

void draw_glyph ( cairo_t * in,
int theglyph,
double x,
double y,
ColRGBA gcolor,
double size )
extern

draw glyph at (x,y)

Parameters
inthe cairo drawing context to use for the draw
theglyphthe type of glyph
xx position
yy position
gcolorthe glyph color
sizethe glyph size

Definition at line 88 of file glyph.c.

◆ erase_curves()

void erase_curves ( project * this_proj,
int c )
extern

free all curve(s) data

Parameters
this_projthe target project
cthe target calculation

Definition at line 552 of file curve.c.

◆ get_curve_from_pointer()

Curve * get_curve_from_pointer ( gpointer data)
extern

get Curve pointer from pointer

Parameters
datathe target pointer

Definition at line 313 of file curve.c.

◆ get_curve_shift()

int get_curve_shift ( Curve * this_curve)
extern

get cruve window size shift

Parameters
this_curvethe target curve

Definition at line 555 of file w_curve.c.

◆ hide_curve()

void hide_curve ( gpointer data)
extern

hide curve

Parameters
datathe associated data pointer

Definition at line 312 of file show.c.

◆ hide_curves()

void hide_curves ( project * this_proj,
int c )
extern

for project hide all curves for a calculation

Parameters
this_projthe target project
cthe target calculation

Definition at line 472 of file curve.c.

◆ init_curve_title()

void init_curve_title ( project * this_proj,
int rid,
int cid )
extern

init curve title and axis titles

Parameters
this_projthe target project
ridthe analysis id
cidthe curve id

Definition at line 260 of file cwidget.c.

◆ initcurve()

void initcurve ( project * pid,
int rid,
int cid )
extern

initialize curve widget

Parameters
pidthe target project
ridthe analysis id
cidthe curve id

Definition at line 159 of file cwidget.c.

◆ label_curve()

void label_curve ( cairo_t * cr,
double val,
int axe,
int p,
Curve * this_curve )
extern

draw axis label

Parameters
crthe cairo drawing context to use for the draw
valthe value to display
axeaxis (0 = x, 1 = y)
plabel position (0 = bottom, 1 = top)
this_curvethe target curve

Definition at line 56 of file labels.c.

◆ prep_frame()

void prep_frame ( cairo_t * fr,
int da,
double ti,
ColRGBA dcol )
extern

draw frame line

Parameters
frthe cairo drawing context to use for the draw
dadash type
tiline width
dcolcolor

Definition at line 56 of file frame.c.

◆ prep_plot()

void prep_plot ( Curve * this_curve)
extern

prepare curve plot (setting up variables for the plot)

Parameters
this_curvethe target curve

Definition at line 326 of file curve.c.

◆ remove_extra()

void remove_extra ( ExtraSets * sets,
CurveExtra * ctmp )
extern

remove data from extra set(s)

Parameters
setsthe extra set(s)
ctmpthe data set to remove from the extra set(s)

Definition at line 159 of file m_curve.c.

◆ save_image()

void save_image ( gpointer cdata)
extern

export curve window plot to image - creating the dialog

Parameters
cdatathe associated data pointer

Definition at line 309 of file w_img.c.

◆ scale()

double scale ( double axe)
extern

find appropriate major tick spacing based on axis length

Parameters
axeaxis length

Definition at line 205 of file curve.c.

◆ selectdash()

curve_dash * selectdash ( int iddash)
extern

setup dash pointer

Parameters
iddashthe target dash

Definition at line 135 of file curve.c.

◆ setup_xaxis_linear()

void setup_xaxis_linear ( cairo_t * cr,
Curve * this_curve )
extern

setup x axis using a linear scale

Parameters
crthe cairo drawing context
this_curvethe target curve

Definition at line 52 of file xaxis.c.

◆ setup_xaxis_log()

void setup_xaxis_log ( cairo_t * cr,
Curve * this_curve,
int rid,
int cid,
gboolean draw_it )
extern

setup x axis using a log scale

Parameters
crthe cairo drawing context
this_curvethe target curve
ridthe analysis id
cidthe curve id
draw_it1/0 draw or not

Definition at line 159 of file xaxis.c.

◆ setup_yaxis_linear()

void setup_yaxis_linear ( cairo_t * cr,
Curve * this_curve )
extern

setup y axis using a linear scale

Parameters
crthe cairo drawing context
this_curvethe target curve

Definition at line 118 of file yaxis.c.

◆ setup_yaxis_log()

void setup_yaxis_log ( cairo_t * cr,
Curve * this_curve,
gboolean draw_it )
extern

setup y axis using a log scale

Parameters
crthe cairo drawing context
this_curvethe target curve
draw_it1/0 draw or not

Definition at line 224 of file yaxis.c.

◆ show_curve()

void show_curve ( GtkDrawingArea * area,
cairo_t * cr,
int width,
int height,
gpointer curve )
extern

show curve callback GTK3

Parameters
areathe GtkDrawingArea sending the signal
crthe cairo drawing context to use for the draw
widthdrawing area width
heightdrawing area height
curvethe associated pointer data

Definition at line 77 of file show.c.

◆ show_curve_popup_menu()

void show_curve_popup_menu ( GdkEvent * event,
gpointer data )
extern

◆ show_frame()

void show_frame ( cairo_t * cd,
int tf,
int da,
int res[2],
double ti,
double x[2],
double y[2],
ColRGBA dcol )
extern

draw frame

Parameters
cdthe cairo drawing context to use for the draw
tfframe type
dadash type
resimage size
tiline width
xx positions (right, left)
yy positions (top, bottom)
dcolcolor

Definition at line 81 of file frame.c.

◆ show_legend()

void show_legend ( cairo_t * cr,
project * this_proj,
int rid,
int cid )
extern

draw legend

Parameters
crthe cairo drawing context to use for the draw
this_projthe target project
ridthe calculation id
cidthe curve id

Definition at line 56 of file legend.c.

◆ show_title()

void show_title ( cairo_t * cr,
Curve * this_curve )
extern

draw title

Parameters
crthe cairo drawing context to use for the draw
this_curvethe target curve

Definition at line 104 of file title.c.

◆ to_hide_curve()

G_MODULE_EXPORT gboolean to_hide_curve ( GtkWindow * thecurve,
gpointer data )
extern

◆ update_curve()

void update_curve ( gpointer data)
extern

update curve rendering

Parameters
datathe associated data pointer

Definition at line 635 of file curve.c.

◆ update_curves()

void update_curves ( )
extern

update all curve(s) rendering for all project(s) in the workspace

Definition at line 605 of file curve.c.

◆ write_curve()

void write_curve ( gpointer idata)
extern

save curve data - creating the dialog

Parameters
idatathe associated data pointer

Definition at line 170 of file w_data.c.

Variable Documentation

◆ amajt

int amajt

Definition at line 92 of file curve.h.

◆ amint

int amint
extern

Definition at line 83 of file curve.c.

◆ ax

double ax
extern

Definition at line 71 of file curve.c.

◆ axischoice

GtkWidget* axischoice
extern

◆ ay

double ay

Definition at line 81 of file curve.h.

◆ back_alpha

double back_alpha
extern

Definition at line 58 of file w_img.c.

◆ curve_image_file

char* curve_image_file
extern

Definition at line 89 of file curve.c.

◆ cxy

double cxy[2]
extern

Definition at line 72 of file curve.c.

◆ dashed1

const double dashed1[]
extern

Definition at line 98 of file curve.c.

◆ dogrid

gboolean dogrid
extern

Definition at line 81 of file curve.c.

◆ DXDRAW

double DXDRAW
extern

Definition at line 67 of file curve.c.

◆ dxlog

int dxlog
extern

Definition at line 76 of file curve.c.

◆ DYDRAW

double DYDRAW

Definition at line 77 of file curve.h.

◆ dylog

int dylog

Definition at line 86 of file curve.h.

◆ etime

gint32 etime
extern

Definition at line 64 of file curve.c.

◆ labpos

int labpos

Definition at line 93 of file curve.h.

◆ layout

PangoLayout* layout
extern

Definition at line 80 of file curve.c.

◆ len1

int len1
extern

Definition at line 99 of file curve.c.

◆ lenp

int lenp
extern

Definition at line 126 of file curve.c.

◆ majt

GtkWidget* majt
extern

◆ mticks

double mticks
extern

Definition at line 73 of file curve.c.

◆ ndash

int ndash
extern

Definition at line 103 of file curve.h.

◆ nglyph

int nglyph
extern

Definition at line 104 of file curve.h.

◆ nmi

GtkWidget* nmi[2]
extern

◆ nticks

int nticks
extern

Definition at line 74 of file curve.c.

◆ originp

int originp
extern

Definition at line 78 of file curve.c.

◆ pdashed

const double pdashed[]
extern

Definition at line 125 of file curve.c.

◆ resol

int resol[2]
extern

Definition at line 65 of file curve.c.

◆ sca

char* sca
extern

Definition at line 77 of file curve.c.

◆ tickpos

int tickpos
extern

Definition at line 84 of file curve.c.

◆ vmax

GtkWidget * vmax

Definition at line 58 of file curve.h.

◆ vmin

GtkWidget* vmin
extern

◆ x_max

double x_max

Definition at line 79 of file curve.h.

◆ x_min

double x_min
extern

Definition at line 69 of file curve.c.

◆ x_shift

int x_shift
extern

Definition at line 82 of file curve.c.

◆ XDRAW

double XDRAW
extern

Definition at line 66 of file curve.c.

◆ xlog

int xlog
extern

Definition at line 75 of file curve.c.

◆ xmarge

int xmarge
extern

Definition at line 87 of file curve.c.

◆ xmax

double xmax
extern

Definition at line 68 of file curve.c.

◆ xyp

GtkWidget* xyp[2]
extern

◆ y_max

double y_max
extern

Definition at line 70 of file curve.c.

◆ y_min

double y_min

Definition at line 80 of file curve.h.

◆ y_shift

int y_shift

Definition at line 91 of file curve.h.

◆ YDRAW

double YDRAW

Definition at line 76 of file curve.h.

◆ ylog

int ylog

Definition at line 85 of file curve.h.

◆ ymarge

int ymarge
extern

Definition at line 88 of file curve.c.

◆ ymax

double ymax

Definition at line 78 of file curve.h.