atomes 1.1.14
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 (project *this_proj, int b, int c)
 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
 
void prep_plot (project *this_proj, int rid, int cid)
 prepare curve plot (setting up variables for the plot)
 
void prep_axis_data (project *this_proj, int rid, int cid, int ax)
 prepare axis data
 
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 addcurwidgets (int pid, int rid, int st)
 add curve widgets to the project
 
void allocextra (int a, int b, int c)
 
void label (cairo_t *cr, double val, int axe, int p, project *this_proj)
 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, project *this_proj, 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, int c)
 default title string
 
void show_title (cairo_t *cr, project *this_proj, int rid, int cid)
 draw title
 
void autoscale_axis (project *this_proj, int rid, int cid, int aid)
 autoscale axis
 
void setup_xaxis_linear (cairo_t *cr, project *this_proj, int rid, int cid)
 setup x axis using a linear scale
 
void setup_xaxis_log (cairo_t *cr, project *this_proj, int rid, int cid, gboolean draw_it)
 setup x axis using a log scale
 
void setup_yaxis_linear (cairo_t *cr, project *this_proj, int rid, int cid)
 setup y axis using a linear scale
 
void setup_yaxis_log (cairo_t *cr, project *this_proj, int rid, int cid, 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
 
int activeg
 
int activec
 
int activer
 
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 71 of file curve.h.

Function Documentation

◆ addcurwidgets()

void addcurwidgets ( int pid,
int rid,
int str )
extern

add curve widgets to the project

Parameters
pidthe project id
ridthe analysis id
strat the project creation stage (1) or latter on (0)

Definition at line 259 of file cwidget.c.

◆ allocextra()

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

◆ autoscale_axis()

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

autoscale axis

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

Definition at line 55 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 55 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 664 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 570 of file m_curve.c.

◆ default_title()

const gchar * default_title ( int ax,
int c )
extern

default title string

Parameters
axaxis
ccurve id

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,
project * this_proj,
int rid,
int cid )
extern

draw frame and axis data

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

Definition at line 165 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 526 of file curve.c.

◆ get_curve_shift()

int get_curve_shift ( project * this_proj,
int b,
int c )
extern

get cruve window size shift

Parameters
this_projthe target project
bthe calculation id
cthe curve id

Definition at line 576 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 451 of file curve.c.

◆ initcurve()

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

initialize curve widget

Parameters
pidthe project id
ridthe analysis id
cidthe curve id

Definition at line 156 of file cwidget.c.

◆ label()

void label ( cairo_t * cr,
double val,
int axe,
int p,
project * this_proj )
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_projthe target project

Definition at line 56 of file labels.c.

◆ prep_axis_data()

void prep_axis_data ( project * this_proj,
int rid,
int cid,
int ax )
extern

prepare axis data

Parameters
this_projthe target project
ridthe calculation id
cidthe curve id
axthe axis

Definition at line 134 of file frame.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 ( project * this_proj,
int rid,
int cid )
extern

prepare curve plot (setting up variables for the plot)

Parameters
this_projthe target project
ridthe calculation id
cidthe curve id

Definition at line 315 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 142 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 326 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 204 of file curve.c.

◆ selectdash()

curve_dash * selectdash ( int iddash)
extern

setup dash pointer

Parameters
iddashthe target dash

Definition at line 134 of file curve.c.

◆ setup_xaxis_linear()

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

setup x axis using a linear scale

Parameters
crthe cairo drawing context
this_projthe target project
ridthe analysis id
cidthe curve id

Definition at line 54 of file xaxis.c.

◆ setup_xaxis_log()

void setup_xaxis_log ( cairo_t * cr,
project * this_proj,
int rid,
int cid,
gboolean draw_it )
extern

setup x axis using a log scale

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

Definition at line 163 of file xaxis.c.

◆ setup_yaxis_linear()

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

setup y axis using a linear scale

Parameters
crthe cairo drawing context
this_projthe target project
ridthe analysis id
cidthe curve id

Definition at line 121 of file yaxis.c.

◆ setup_yaxis_log()

void setup_yaxis_log ( cairo_t * cr,
project * this_proj,
int rid,
int cid,
gboolean draw_it )
extern

setup y axis using a log scale

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

Definition at line 233 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,
project * this_proj,
int rid,
int cid )
extern

draw title

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

Definition at line 107 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 589 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 559 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 164 of file w_data.c.

Variable Documentation

◆ activec

int activec
extern

Definition at line 73 of file w_curve.c.

◆ activeg

int activeg
extern

Definition at line 72 of file w_curve.c.

◆ activer

int activer
extern

Definition at line 74 of file w_curve.c.

◆ amajt

int amajt

Definition at line 95 of file curve.h.

◆ amint

int amint
extern

Definition at line 82 of file curve.c.

◆ ax

double ax
extern

Definition at line 70 of file curve.c.

◆ axischoice

GtkWidget* axischoice
extern

Definition at line 90 of file tab-4.c.

◆ ay

double ay

Definition at line 84 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 88 of file curve.c.

◆ cxy

double cxy[2]
extern

Definition at line 71 of file curve.c.

◆ dashed1

const double dashed1[]
extern

Definition at line 97 of file curve.c.

◆ dogrid

gboolean dogrid
extern

Definition at line 80 of file curve.c.

◆ DXDRAW

double DXDRAW
extern

Definition at line 66 of file curve.c.

◆ dxlog

int dxlog
extern

Definition at line 75 of file curve.c.

◆ DYDRAW

double DYDRAW

Definition at line 80 of file curve.h.

◆ dylog

int dylog

Definition at line 89 of file curve.h.

◆ etime

gint32 etime
extern

Definition at line 63 of file curve.c.

◆ labpos

int labpos

Definition at line 96 of file curve.h.

◆ layout

PangoLayout* layout
extern

Definition at line 79 of file curve.c.

◆ len1

int len1
extern

Definition at line 98 of file curve.c.

◆ lenp

int lenp
extern

Definition at line 125 of file curve.c.

◆ majt

GtkWidget* majt
extern

Definition at line 103 of file tab-4.c.

◆ mticks

double mticks
extern

Definition at line 72 of file curve.c.

◆ ndash

int ndash
extern

Definition at line 106 of file curve.h.

◆ nglyph

int nglyph
extern

Definition at line 107 of file curve.h.

◆ nmi

GtkWidget* nmi[2]
extern

Definition at line 106 of file tab-4.c.

◆ nticks

int nticks
extern

Definition at line 73 of file curve.c.

◆ originp

int originp
extern

Definition at line 77 of file curve.c.

◆ pdashed

const double pdashed[]
extern

Definition at line 124 of file curve.c.

◆ resol

int resol[2]
extern

Definition at line 64 of file curve.c.

◆ sca

char* sca
extern

Definition at line 76 of file curve.c.

◆ tickpos

int tickpos
extern

Definition at line 83 of file curve.c.

◆ vmax

GtkWidget * vmax

Definition at line 58 of file curve.h.

◆ vmin

GtkWidget* vmin
extern

Definition at line 104 of file tab-4.c.

◆ x_max

double x_max

Definition at line 82 of file curve.h.

◆ x_min

double x_min
extern

Definition at line 68 of file curve.c.

◆ x_shift

int x_shift
extern

Definition at line 81 of file curve.c.

◆ XDRAW

double XDRAW
extern

Definition at line 65 of file curve.c.

◆ xlog

int xlog
extern

Definition at line 74 of file curve.c.

◆ xmarge

int xmarge
extern

Definition at line 86 of file curve.c.

◆ xmax

double xmax
extern

Definition at line 67 of file curve.c.

◆ xyp

GtkWidget* xyp[2]
extern

Definition at line 87 of file cedit.c.

◆ y_max

double y_max
extern

Definition at line 69 of file curve.c.

◆ y_min

double y_min

Definition at line 83 of file curve.h.

◆ y_shift

int y_shift

Definition at line 94 of file curve.h.

◆ YDRAW

double YDRAW

Definition at line 79 of file curve.h.

◆ ylog

int ylog

Definition at line 88 of file curve.h.

◆ ymarge

int ymarge
extern

Definition at line 87 of file curve.c.

◆ ymax

double ymax

Definition at line 81 of file curve.h.