atomes 1.1.15
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
w_advance.c File Reference

Functions to create the OpenGL parameters edition window. More...

#include "global.h"
#include "interface.h"
#include "glview.h"
#include "glwindow.h"
+ Include dependency graph for w_advance.c:

Go to the source code of this file.

Macros

#define TEMPLATES   7
 

Functions

void set_quality (int q, glwin *view)
 set OpenGL quality
 
GtkWidget * adv_box (GtkWidget *box, char *lab, int size, float xalign)
 create a box with markup label
 
G_MODULE_EXPORT void toggled_delete_ligth (GtkToggleButton *but, gpointer data)
 toggle delete light callback GTK3
 
G_MODULE_EXPORT void run_light_source_to_be_removed (GtkDialog *win, gint response_id, gpointer data)
 remove light source(s) - running the dialog
 
int * light_source_to_be_removed (int val, image *img, opengl_edition *ogl_edit)
 remove light source(s) - creating the dialog
 
void print_light_source (Light source, int i)
 print light source data
 
Light init_light_source (int type, float val, float vbl)
 initialize a light source
 
Light copy_light_source (Light old_sp)
 create a copy of a light source
 
Lightcopy_light_sources (int dima, int dimb, Light *old_sp)
 create a copy of a list of light sources
 
void show_active_light_data (opengl_edition *ogl_win, int lid, int tid)
 show active light data
 
void update_light_data (int li, opengl_edition *ogl_win)
 update light data
 
G_MODULE_EXPORT void show_light_param (GtkComboBox *box, gpointer data)
 update light parameters based on light id in combo box
 
void create_lights_combo (image *this_image, opengl_edition *ogl_win)
 create light combo box
 
void add_remove_lights (int val, gpointer data)
 add or remove lights
 
G_MODULE_EXPORT void set_nlights_spin (GtkSpinButton *res, gpointer data)
 change the number of light(s) - spin button
 
G_MODULE_EXPORT void set_nlights (GtkEntry *res, gpointer data)
 change the number of light(s) - entry
 
G_MODULE_EXPORT void update_light_param (GtkEntry *res, gpointer data)
 update light parameter
 
void set_data_pos (vec3_t *vect, int pos, double v)
 modify a vector component
 
G_MODULE_EXPORT void set_object_pos (GtkEntry *res, gpointer data)
 set object position
 
G_MODULE_EXPORT void set_light_type (GtkComboBox *box, gpointer data)
 set light type callback
 
G_MODULE_EXPORT void set_light_fix (GtkComboBox *box, gpointer data)
 set light fix callback
 
G_MODULE_EXPORT void show_this_light (GtkToggleButton *but, gpointer data)
 show / hide this light callback GTK3
 
GtkWidget * create_setting_pos (int pid, int lid, float *values, opengl_edition *ogl_win)
 create OpenGL setting entries table
 
GtkWidget * lights_tab (glwin *view, opengl_edition *ogl_edit)
 OpenGL light(s) parameters tab.
 
G_MODULE_EXPORT void set_use_template_toggle (GtkToggleButton *but, gpointer data)
 use or not OpenGL material template callback GTK3
 
G_MODULE_EXPORT void set_template (GtkComboBox *box, gpointer data)
 change the OpenGL material template
 
G_MODULE_EXPORT void set_l_model (GtkComboBox *box, gpointer data)
 change OpenGL lightning model
 
void param_has_changed (gpointer data, double val)
 update OpenGL material parameter
 
G_MODULE_EXPORT void update_mat_param (GtkEntry *res, gpointer data)
 update OpenGL material parameter - entry
 
G_MODULE_EXPORT gboolean scroll_scale_param (GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
 update OpenGL material parameter - scroll callback
 
G_MODULE_EXPORT void scale_param (GtkRange *range, gpointer data)
 update OpenGL material parameter - range callback
 
G_MODULE_EXPORT gboolean scroll_scale_quality (GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
 update OpenGL quality - scroll callback
 
G_MODULE_EXPORT void scale_quality (GtkRange *range, gpointer data)
 update OpenGL quality - range callback
 
GtkWidget * materials_tab (glwin *view, opengl_edition *ogl_edit)
 OpenGL material parameters tab.
 
void fog_param_changed (gpointer data, GLfloat u, GtkRange *range)
 update OpenGL fog parameter
 
G_MODULE_EXPORT gboolean scroll_set_fog_param (GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
 update OpenGL fog parameter - scroll callback
 
G_MODULE_EXPORT void set_fog_param (GtkRange *range, gpointer data)
 update OpenGL fog parameter - range callback
 
G_MODULE_EXPORT void set_fog_type (GtkWidget *widg, gpointer data)
 set OpenGL fog type
 
void setup_fog_dialogs (glwin *view, int fid)
 update OpenGL fog tab based of fog type
 
G_MODULE_EXPORT void set_fog_mode (GtkWidget *widg, gpointer data)
 set fog mode callback
 
GtkWidget * fog_tab (glwin *view, opengl_edition *ogl_edit)
 OpenGL fog parameters tab.
 
void close_advanced_opengl (gpointer data)
 close OpenGL rendering window free data
 
G_MODULE_EXPORT gboolean close_advanced (GtkWidget *widg, GdkEvent *event, gpointer data)
 close OpenGL rendering advanced window callback GTK3
 
G_MODULE_EXPORT void opengl_advanced (GtkWidget *widg, gpointer data)
 create OpenGL rendering advanced window
 

Variables

gchar * material_template [TEMPLATES]
 
GLfloat template_parameters [TEMPLATES][5]
 
float mat_min_max [5][2]
 
gchar * settings [3][10]
 
gchar * lpos [3] = {"x", "y", "z"}
 
gchar * cpos [3] = {"r", "g", "b"}
 
GtkWidget * d_close
 
int status
 
int * light_list
 
GtkWidget ** light_but
 

Detailed Description

Functions to create the OpenGL parameters edition window.

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 w_advance.c.

Macro Definition Documentation

◆ TEMPLATES

#define TEMPLATES   7

Definition at line 93 of file w_advance.c.

Function Documentation

◆ add_remove_lights()

void add_remove_lights ( int val,
gpointer data )

add or remove lights

Parameters
valtotal number of light(s)
datathe associated data pointer

Definition at line 530 of file w_advance.c.

◆ adv_box()

GtkWidget * adv_box ( GtkWidget * box,
char * lab,
int size,
float xalign )

create a box with markup label

Parameters
boxthe GtkWidget sending the signal
lablabel
sizesize
xalignx alignement

Definition at line 150 of file w_advance.c.

◆ close_advanced()

G_MODULE_EXPORT gboolean close_advanced ( GtkWidget * widg,
GdkEvent * event,
gpointer data )

close OpenGL rendering advanced window callback GTK3

Parameters
widgthe GtkWidget sending the signal
eventthe GdkEvent triggering the signal
datathe associated data pointer

Definition at line 1462 of file w_advance.c.

◆ close_advanced_opengl()

void close_advanced_opengl ( gpointer data)

close OpenGL rendering window free data

Parameters
datathe associated data pointer

Definition at line 1434 of file w_advance.c.

◆ copy_light_source()

Light copy_light_source ( Light old_sp)

create a copy of a light source

Parameters
old_spthe light source to copy

Definition at line 368 of file w_advance.c.

◆ copy_light_sources()

Light * copy_light_sources ( int dima,
int dimb,
Light * old_sp )

create a copy of a list of light sources

Parameters
dimanew list size
dimbold list size to duplicate
old_spold light sources

Definition at line 391 of file w_advance.c.

◆ create_lights_combo()

void create_lights_combo ( image * this_image,
opengl_edition * ogl_win )

create light combo box

Parameters
this_imagethe target image parameters
ogl_winthe target OpenGL edition window

Definition at line 506 of file w_advance.c.

◆ create_setting_pos()

GtkWidget * create_setting_pos ( int pid,
int lid,
float * values,
opengl_edition * ogl_win )

create OpenGL setting entries table

Parameters
pidparameter id (0 = material, 1 = light direction, 2 = light position, 3 = light intensity, 4 = fog)
lidparameter label id
valuestarget parameter values
ogl_winthe target OpenGL edition window

Definition at line 827 of file w_advance.c.

◆ fog_param_changed()

void fog_param_changed ( gpointer data,
GLfloat u,
GtkRange * range )

update OpenGL fog parameter

Parameters
datathe associated data pointer
uthe new value
rangethe GtkRange to udapte if needed

Definition at line 1233 of file w_advance.c.

◆ fog_tab()

GtkWidget * fog_tab ( glwin * view,
opengl_edition * ogl_edit )

OpenGL fog parameters tab.

Parameters
viewthe target glwin
ogl_editthe target OpenGL edition window

Definition at line 1370 of file w_advance.c.

◆ init_light_source()

Light init_light_source ( int type,
float val,
float vbl )

initialize a light source

Parameters
typethe type of light
val
vbl

Definition at line 324 of file w_advance.c.

◆ light_source_to_be_removed()

int * light_source_to_be_removed ( int val,
image * img,
opengl_edition * ogl_edit )

remove light source(s) - creating the dialog

Parameters
valnumber of light(s) to remove
imgthe target image
ogl_editthe target OpenGL edition window

Definition at line 245 of file w_advance.c.

◆ lights_tab()

GtkWidget * lights_tab ( glwin * view,
opengl_edition * ogl_edit )

OpenGL light(s) parameters tab.

Parameters
viewthe target glwin
ogl_editthe target OpenGL edition window

Definition at line 868 of file w_advance.c.

◆ materials_tab()

GtkWidget * materials_tab ( glwin * view,
opengl_edition * ogl_edit )

OpenGL material parameters tab.

Parameters
viewthe target glwin
ogl_editthe target OpenGL edition window

Definition at line 1148 of file w_advance.c.

◆ opengl_advanced()

G_MODULE_EXPORT void opengl_advanced ( GtkWidget * widg,
gpointer data )

create OpenGL rendering advanced window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1477 of file w_advance.c.

◆ param_has_changed()

void param_has_changed ( gpointer data,
double val )

update OpenGL material parameter

Parameters
datathe associated data pointer
valthe new value

Definition at line 1047 of file w_advance.c.

◆ print_light_source()

void print_light_source ( Light source,
int i )

print light source data

Parameters
sourcethe light source
ithe light source id

Definition at line 285 of file w_advance.c.

◆ run_light_source_to_be_removed()

G_MODULE_EXPORT void run_light_source_to_be_removed ( GtkDialog * win,
gint response_id,
gpointer data )

remove light source(s) - running the dialog

Parameters
winthe GtkDialog sending the signal
response_idthe response id
datathe associated data pointer

Definition at line 216 of file w_advance.c.

◆ scale_param()

G_MODULE_EXPORT void scale_param ( GtkRange * range,
gpointer data )

update OpenGL material parameter - range callback

Parameters
rangethe GtkRange sending the signal
datathe associated data pointer

Definition at line 1100 of file w_advance.c.

◆ scale_quality()

G_MODULE_EXPORT void scale_quality ( GtkRange * range,
gpointer data )

update OpenGL quality - range callback

Parameters
rangethe GtkRange sending the signal
datathe associated data pointer

Definition at line 1132 of file w_advance.c.

◆ scroll_scale_param()

G_MODULE_EXPORT gboolean scroll_scale_param ( GtkRange * range,
GtkScrollType scroll,
gdouble value,
gpointer data )

update OpenGL material parameter - scroll callback

Parameters
rangethe GtkRange sending the signal
scrollthe associated scroll type
valuethe range value
datathe associated data pointer

Definition at line 1086 of file w_advance.c.

◆ scroll_scale_quality()

G_MODULE_EXPORT gboolean scroll_scale_quality ( GtkRange * range,
GtkScrollType scroll,
gdouble value,
gpointer data )

update OpenGL quality - scroll callback

Parameters
rangethe GtkRange sending the signal
scrollthe associated scroll type
valuethe range value
datathe associated data pointer

Definition at line 1115 of file w_advance.c.

◆ scroll_set_fog_param()

G_MODULE_EXPORT gboolean scroll_set_fog_param ( GtkRange * range,
GtkScrollType scroll,
gdouble value,
gpointer data )

update OpenGL fog parameter - scroll callback

Parameters
rangethe GtkRange sending the signal
scrollthe associated scroll type
valuethe range value
datathe associated data pointer

Definition at line 1280 of file w_advance.c.

◆ set_data_pos()

void set_data_pos ( vec3_t * vect,
int pos,
double v )

modify a vector component

Parameters
vectvector to adjust
posposition to adjust
vnew value

Definition at line 689 of file w_advance.c.

◆ set_fog_mode()

G_MODULE_EXPORT void set_fog_mode ( GtkWidget * widg,
gpointer data )

set fog mode callback

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1355 of file w_advance.c.

◆ set_fog_param()

G_MODULE_EXPORT void set_fog_param ( GtkRange * range,
gpointer data )

update OpenGL fog parameter - range callback

Parameters
rangethe GtkRange sending the signal
datathe associated data pointer

Definition at line 1294 of file w_advance.c.

◆ set_fog_type()

G_MODULE_EXPORT void set_fog_type ( GtkWidget * widg,
gpointer data )

set OpenGL fog type

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1307 of file w_advance.c.

◆ set_l_model()

G_MODULE_EXPORT void set_l_model ( GtkComboBox * box,
gpointer data )

change OpenGL lightning model

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 1032 of file w_advance.c.

◆ set_light_fix()

G_MODULE_EXPORT void set_light_fix ( GtkComboBox * box,
gpointer data )

set light fix callback

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 773 of file w_advance.c.

◆ set_light_type()

G_MODULE_EXPORT void set_light_type ( GtkComboBox * box,
gpointer data )

set light type callback

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 757 of file w_advance.c.

◆ set_nlights()

G_MODULE_EXPORT void set_nlights ( GtkEntry * res,
gpointer data )

change the number of light(s) - entry

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 626 of file w_advance.c.

◆ set_nlights_spin()

G_MODULE_EXPORT void set_nlights_spin ( GtkSpinButton * res,
gpointer data )

change the number of light(s) - spin button

Parameters
resthe GtkSpinButton sending the signal
datathe associated data pointer

Definition at line 613 of file w_advance.c.

◆ set_object_pos()

G_MODULE_EXPORT void set_object_pos ( GtkEntry * res,
gpointer data )

set object position

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 713 of file w_advance.c.

◆ set_quality()

void set_quality ( int q,
glwin * view )
extern

set OpenGL quality

Parameters
qnew OpenGL quality
viewthe target glwin

Definition at line 59 of file m_quality.c.

◆ set_template()

G_MODULE_EXPORT void set_template ( GtkComboBox * box,
gpointer data )

change the OpenGL material template

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 1005 of file w_advance.c.

◆ set_use_template_toggle()

G_MODULE_EXPORT void set_use_template_toggle ( GtkToggleButton * but,
gpointer data )

use or not OpenGL material template callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 969 of file w_advance.c.

◆ setup_fog_dialogs()

void setup_fog_dialogs ( glwin * view,
int fid )

update OpenGL fog tab based of fog type

Parameters
viewthe target glwin
fidthe fog mode

Definition at line 1323 of file w_advance.c.

◆ show_active_light_data()

void show_active_light_data ( opengl_edition * ogl_win,
int lid,
int tid )

show active light data

Parameters
ogl_winthe target OpenGL edition window
lidthe light id
tidthe light type

Definition at line 421 of file w_advance.c.

◆ show_light_param()

G_MODULE_EXPORT void show_light_param ( GtkComboBox * box,
gpointer data )

update light parameters based on light id in combo box

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 492 of file w_advance.c.

◆ show_this_light()

G_MODULE_EXPORT void show_this_light ( GtkToggleButton * but,
gpointer data )

show / hide this light callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 802 of file w_advance.c.

◆ toggled_delete_ligth()

G_MODULE_EXPORT void toggled_delete_ligth ( GtkToggleButton * but,
gpointer data )

toggle delete light callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 183 of file w_advance.c.

◆ update_light_data()

void update_light_data ( int li,
opengl_edition * ogl_win )

update light data

Parameters
lithe light id
ogl_winthe target OpenGL edition window

Definition at line 456 of file w_advance.c.

◆ update_light_param()

G_MODULE_EXPORT void update_light_param ( GtkEntry * res,
gpointer data )

update light parameter

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 643 of file w_advance.c.

◆ update_mat_param()

G_MODULE_EXPORT void update_mat_param ( GtkEntry * res,
gpointer data )

update OpenGL material parameter - entry

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 1069 of file w_advance.c.

Variable Documentation

◆ cpos

gchar* cpos[3] = {"r", "g", "b"}

Definition at line 138 of file w_advance.c.

◆ d_close

GtkWidget* d_close

Definition at line 159 of file w_advance.c.

◆ light_but

GtkWidget** light_but

Definition at line 205 of file w_advance.c.

◆ light_list

int* light_list

Definition at line 204 of file w_advance.c.

◆ lpos

gchar* lpos[3] = {"x", "y", "z"}

Definition at line 137 of file w_advance.c.

◆ mat_min_max

float mat_min_max[5][2]
Initial value:
= {{0.0, 1.0},
{0.0, 1.0},
{0.0, 10.0},
{0.0, 10.0},
{0.0, 1.0}}

Definition at line 113 of file w_advance.c.

◆ material_template

gchar* material_template[TEMPLATES]
Initial value:
= {"Opaque",
"Brushed metal",
"Shiny metal",
"Plastic",
"Transparent",
"Translucent",
"Diffuse"}

Definition at line 97 of file w_advance.c.

◆ settings

gchar* settings[3][10]
Initial value:
= {{"<u>Albedo:</u>",
"<u>Metallic:</u>",
"<u>Roughness:</u>",
"<u>Ambient occlusion:</u>",
"<u>Gamma correction:</u>",
"<u>Opacity:</u>"},
{"<u>Position:</u>",
"<u>Direction:</u>",
"<u>Intensity:</u>",
"<u>Constant attenuation:</u>",
"<u>Linear attenuation:</u>",
"<u>Quadratic attenuation:</u>",
"<u>Cone angle</u>",
"<u>Inner cutoff:</u>",
"<u>Outer cutoff:</u>"
"<u>Type:</u>"},
{"Color:"}}

Definition at line 119 of file w_advance.c.

◆ status

int status

Definition at line 160 of file w_advance.c.

◆ template_parameters

GLfloat template_parameters[TEMPLATES][5]
Initial value:
={{0.50, 0.50, 0.90, 1.00, 1.00},
{0.90, 0.60, 1.00, 1.50, 1.00},
{0.80, 0.40, 1.00, 1.00, 1.00},
{0.35, 0.15, 1.00, 1.50, 1.00},
{0.50, 0.50, 0.50, 1.00, 0.50},
{0.50, 0.50, 0.50, 1.00, 0.75},
{0.35, 0.80, 1.00, 1.50, 1.00}}

Definition at line 105 of file w_advance.c.