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

Functions to create the crystal builder window. More...

#include "global.h"
#include "interface.h"
#include "glview.h"
#include "cbuild_edit.h"
#include "bind.h"
#include "project.h"
#include "workspace.h"
#include "readers.h"
Include dependency graph for cbuild_edit.c:

Go to the source code of this file.

Functions

G_MODULE_EXPORT void show_sg_info (GtkButton *but, gpointer data)
void get_origin (space_group *spg)
 get space group origin matrices
int test_lattice (builder_edition *cbuilder, cell_info *cif_cell)
 test lattice parameters
int build_crystal (gboolean visible, project *this_proj, int c_step, gboolean to_wrap, gboolean show_clones, cell_info *cell, GtkWidget *widg)
 build crystal
int get_crystal_id (int spg)
 get the bravais lattice id from space group id
int get_bravais_img_id (int spg)
 get bravais image from space group id
gchar * frac_string (gchar *init)
 get pango string for fraction string
gchar * get_num_string (gchar *str)
 get description string for entry string
gchar * get_so_string (space_group *spg, int id)
 get space group setting descrption string
GtkTreeModel * so_combo_tree (space_group *spg)
 create the space group setting combo box tree model
GtkTreeModel * sg_combo_tree (int csid, int bvid)
 create the space group combo box tree model
GtkTreeModel * la_combo_tree ()
 create the lattice system combo box tree model
int get_sg_num (GtkComboBox *box)
 get space group number from active iter in tree model of combo box
void adjust_lattice_parameters (builder_edition *cbuilder)
 adjust lattice parameters depending on space group
G_MODULE_EXPORT void update_cb_vect (GtkEntry *entry, gpointer data)
 update lattice vector callback
G_MODULE_EXPORT void update_cb_box (GtkEntry *entry, gpointer data)
 update lattice box parameter callback
GtkWidget * prepare_lattice_grid (int type, builder_edition *cbuilder, glwin *glview)
 prepare the lattice parameters grid widget
G_MODULE_EXPORT void set_lattice (GtkComboBox *box, gpointer data)
 change the lattice system
G_MODULE_EXPORT void set_so (GtkComboBox *box, gpointer data)
 set space group setting
GtkWidget * sg_info (int sg, gpointer data)
 create the space group information button
int read_space_group (builder_edition *cbuilder, int spg)
 read space group N°spg data from file
int get_group_id_from_name (gchar *sg_name)
 get space group id from name
void adjust_so_combo (builder_edition *cbuilder)
 adjust the space group setting combo box to use pango markup
void adjust_bv_img (builder_edition *cbuilder)
 adjust the bravais lattice image
void adjust_lattice_constraints (builder_edition *cbuilder)
 adjust lattice constraints
G_MODULE_EXPORT void set_sg (GtkComboBox *box, gpointer data)
 change space group
void adjust_sg_combo (builder_edition *cbuilder, int cs, int bl)
 adjust the space group combo box to use pango markup
G_MODULE_EXPORT void set_bl (GtkComboBox *box, gpointer data)
 change bravais lattice
GtkWidget * create_bl_combo (int cs, gpointer data)
 create the bravais lattice combo box
G_MODULE_EXPORT void set_cs (GtkComboBox *box, gpointer data)
 change the crystal system
G_MODULE_EXPORT void set_wr (GtkToggleButton *but, gpointer data)
 wrap or not atomic coordinates after crystal building toggle callback GTK3
G_MODULE_EXPORT void set_shc (GtkToggleButton *but, gpointer data)
 show / hide clones after crystal building toggle callback GTK3
G_MODULE_EXPORT void add_cryst_cell (GtkSpinButton *res, gpointer data)
 add cell callback spin
G_MODULE_EXPORT void apply_build (GtkButton *but, gpointer data)
 build crystall callback
G_MODULE_EXPORT void close_build (GtkButton *but, gpointer data)
 close crystal builder and free associated data pointers
G_MODULE_EXPORT gboolean delete_build (GtkWidget *widg, GdkEvent *event, gpointer data)
 crystal builder delete event callback GTK3
G_MODULE_EXPORT void toggle_occ (GtkToggleButton *but, gpointer data)
 occupancy toggle callback GTK3
G_MODULE_EXPORT void toggle_overlap (GtkToggleButton *Button, gpointer data)
 adjust overlapping toggle callback GTK3
G_MODULE_EXPORT void on_rounding_changed (GtkComboBox *box, gpointer data)
 changed rounding method for occupancy
G_MODULE_EXPORT void adjust_occupancy (GtkButton *but, gpointer data)
 adjust occupancy create dialog callback
GtkWidget * builder_win (project *this_proj, gpointer data)
 create crystal builder window
void prepare_crystal_builder (gpointer data)
 create the crystal builder
G_MODULE_EXPORT void crystal_window (GtkWidget *widg, gpointer data)
 create the crystal build window callback GTK3

Variables

gchar * latt_info [7]
int nsg_bv [7] ={2, 13, 59, 68, 25, 27, 36}
int min_bv [7] ={0, 2, 15, 74, 142, 167, 194}
dint occp [5]

Detailed Description

Functions to create the crystal builder 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 cbuild_edit.c.

Function Documentation

◆ add_cryst_cell()

G_MODULE_EXPORT void add_cryst_cell ( GtkSpinButton * res,
gpointer data )

add cell callback spin

Parameters
resthe GtkSpinButton sending the signal
datathe associated data pointer

Definition at line 1041 of file cbuild_edit.c.

◆ adjust_bv_img()

void adjust_bv_img ( builder_edition * cbuilder)

adjust the bravais lattice image

Parameters
cbuilderthe target builder edition

Definition at line 831 of file cbuild_edit.c.

◆ adjust_lattice_constraints()

void adjust_lattice_constraints ( builder_edition * cbuilder)

adjust lattice constraints

Parameters
cbuilderthe target builder edition

Definition at line 850 of file cbuild_edit.c.

◆ adjust_lattice_parameters()

void adjust_lattice_parameters ( builder_edition * cbuilder)

adjust lattice parameters depending on space group

Parameters
cbuilderthe target build edition

Definition at line 456 of file cbuild_edit.c.

◆ adjust_occupancy()

G_MODULE_EXPORT void adjust_occupancy ( GtkButton * but,
gpointer data )

adjust occupancy create dialog callback

Parameters
butthe GtkButton sending the signal
datathe associated data pointer

Definition at line 1191 of file cbuild_edit.c.

◆ adjust_sg_combo()

void adjust_sg_combo ( builder_edition * cbuilder,
int cs,
int bl )

adjust the space group combo box to use pango markup

Parameters
cbuilderthe target builder edition
csthe crystal system
blthe bravais lattice

Definition at line 903 of file cbuild_edit.c.

◆ adjust_so_combo()

void adjust_so_combo ( builder_edition * cbuilder)

adjust the space group setting combo box to use pango markup

Parameters
cbuilderthe target builder edition

Definition at line 813 of file cbuild_edit.c.

◆ apply_build()

G_MODULE_EXPORT void apply_build ( GtkButton * but,
gpointer data )

build crystall callback

Parameters
butthe GtkButton sending the signal
datathe associated data pointer

Definition at line 1056 of file cbuild_edit.c.

◆ build_crystal()

int build_crystal ( gboolean visible,
project * this_proj,
int c_step,
gboolean to_wrap,
gboolean show_clones,
cell_info * cell,
GtkWidget * widg )
extern

build crystal

Parameters
visibleis the crystal builder window visible ?
this_projthe target project
c_stepthe MD step if multiple CIF configurations
to_wrapwrap or not atomic coordinates in the unit cell
show_clonesshow / hide clone(s)
cellthe cell info that contains the crystal description
widgthe GtkWidget sending the signal

Definition at line 972 of file cbuild_action.c.

◆ builder_win()

GtkWidget * builder_win ( project * this_proj,
gpointer data )

create crystal builder window

Parameters
this_projthe target project
datathe associated data pointer

Definition at line 1287 of file cbuild_edit.c.

◆ close_build()

G_MODULE_EXPORT void close_build ( GtkButton * but,
gpointer data )

close crystal builder and free associated data pointers

Parameters
butthe GtkButton sending the signal
datathe associated data pointer

Definition at line 1078 of file cbuild_edit.c.

◆ create_bl_combo()

GtkWidget * create_bl_combo ( int cs,
gpointer data )

create the bravais lattice combo box

Parameters
csthe associated crystal system
datathe associated data pointer

Definition at line 938 of file cbuild_edit.c.

◆ crystal_window()

G_MODULE_EXPORT void crystal_window ( GtkWidget * widg,
gpointer data )

create the crystal build window callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1484 of file cbuild_edit.c.

◆ delete_build()

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

crystal builder delete event callback GTK3

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

Definition at line 1108 of file cbuild_edit.c.

◆ frac_string()

gchar * frac_string ( gchar * init)

get pango string for fraction string

Parameters
initthe target fraction string

Definition at line 251 of file cbuild_edit.c.

◆ get_bravais_img_id()

int get_bravais_img_id ( int spg)

get bravais image from space group id

Parameters
spgthe target space group id

Definition at line 165 of file cbuild_edit.c.

◆ get_crystal_id()

int get_crystal_id ( int spg)

get the bravais lattice id from space group id

Parameters
spgthe target space group id

Definition at line 119 of file cbuild_edit.c.

◆ get_group_id_from_name()

int get_group_id_from_name ( gchar * sg_name)

get space group id from name

Parameters
sg_namethe space group string

Definition at line 796 of file cbuild_edit.c.

◆ get_num_string()

gchar * get_num_string ( gchar * str)

get description string for entry string

Parameters
strthe target string

Definition at line 274 of file cbuild_edit.c.

◆ get_origin()

void get_origin ( space_group * spg)
extern

get space group origin matrices

Parameters
spgthe target space group

Definition at line 161 of file cbuild_action.c.

◆ get_sg_num()

int get_sg_num ( GtkComboBox * box)

get space group number from active iter in tree model of combo box

Parameters
boxthe target GtkComboBox

Definition at line 426 of file cbuild_edit.c.

◆ get_so_string()

gchar * get_so_string ( space_group * spg,
int id )

get space group setting descrption string

Parameters
spgthe target space group
idthe space grop setting

Definition at line 297 of file cbuild_edit.c.

◆ la_combo_tree()

GtkTreeModel * la_combo_tree ( )

create the lattice system combo box tree model

Definition at line 404 of file cbuild_edit.c.

◆ on_rounding_changed()

G_MODULE_EXPORT void on_rounding_changed ( GtkComboBox * box,
gpointer data )

changed rounding method for occupancy

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 1177 of file cbuild_edit.c.

◆ prepare_crystal_builder()

void prepare_crystal_builder ( gpointer data)

create the crystal builder

Parameters
datathe associated data pointer

Definition at line 1448 of file cbuild_edit.c.

◆ prepare_lattice_grid()

GtkWidget * prepare_lattice_grid ( int type,
builder_edition * cbuilder,
glwin * glview )

prepare the lattice parameters grid widget

Parameters
typethe type of lattice system
cbuilderthe target builder edition
glviewthe target glwin

Definition at line 629 of file cbuild_edit.c.

◆ read_space_group()

int read_space_group ( builder_edition * cbuilder,
int spg )

read space group N°spg data from file

Parameters
cbuilderthe target builder edition
spgthe space group id

Definition at line 763 of file cbuild_edit.c.

◆ set_bl()

G_MODULE_EXPORT void set_bl ( GtkComboBox * box,
gpointer data )

change bravais lattice

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 921 of file cbuild_edit.c.

◆ set_cs()

G_MODULE_EXPORT void set_cs ( GtkComboBox * box,
gpointer data )

change the crystal system

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 970 of file cbuild_edit.c.

◆ set_lattice()

G_MODULE_EXPORT void set_lattice ( GtkComboBox * box,
gpointer data )

change the lattice system

Parameters
boxthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 701 of file cbuild_edit.c.

◆ set_sg()

G_MODULE_EXPORT void set_sg ( GtkComboBox * box,
gpointer data )

change space group

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 868 of file cbuild_edit.c.

◆ set_shc()

G_MODULE_EXPORT void set_shc ( GtkToggleButton * but,
gpointer data )

show / hide clones after crystal building toggle callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 1026 of file cbuild_edit.c.

◆ set_so()

G_MODULE_EXPORT void set_so ( GtkComboBox * box,
gpointer data )

set space group setting

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 720 of file cbuild_edit.c.

◆ set_wr()

G_MODULE_EXPORT void set_wr ( GtkToggleButton * but,
gpointer data )

wrap or not atomic coordinates after crystal building toggle callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 1000 of file cbuild_edit.c.

◆ sg_combo_tree()

GtkTreeModel * sg_combo_tree ( int csid,
int bvid )

create the space group combo box tree model

Parameters
csidthe crystal system
bvidthe bravais lattice

Definition at line 347 of file cbuild_edit.c.

◆ sg_info()

GtkWidget * sg_info ( int sg,
gpointer data )

create the space group information button

Parameters
sgspace group id
datathe associated data pointer

Definition at line 745 of file cbuild_edit.c.

◆ show_sg_info()

G_MODULE_EXPORT void show_sg_info ( GtkButton * but,
gpointer data )
extern

◆ so_combo_tree()

GtkTreeModel * so_combo_tree ( space_group * spg)

create the space group setting combo box tree model

Parameters
spgthe target space group

Definition at line 316 of file cbuild_edit.c.

◆ test_lattice()

int test_lattice ( builder_edition * cbuilder,
cell_info * cif_cell )
extern

test lattice parameters

Parameters
cbuilderthe builder edition with the lattice parameters
cif_cellthe cell information when testing CIF file

Definition at line 328 of file cbuild_action.c.

◆ toggle_occ()

G_MODULE_EXPORT void toggle_occ ( GtkToggleButton * but,
gpointer data )

occupancy toggle callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 1136 of file cbuild_edit.c.

◆ toggle_overlap()

G_MODULE_EXPORT void toggle_overlap ( GtkToggleButton * Button,
gpointer data )

adjust overlapping toggle callback GTK3

Parameters
Buttonthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 1162 of file cbuild_edit.c.

◆ update_cb_box()

G_MODULE_EXPORT void update_cb_box ( GtkEntry * entry,
gpointer data )

update lattice box parameter callback

Parameters
entrythe GtkEntry sending the signal
datathe associated data pointer

Definition at line 608 of file cbuild_edit.c.

◆ update_cb_vect()

G_MODULE_EXPORT void update_cb_vect ( GtkEntry * entry,
gpointer data )

update lattice vector callback

Parameters
entrythe GtkEntry sending the signal
datathe associated data pointer

Definition at line 591 of file cbuild_edit.c.

Variable Documentation

◆ latt_info

gchar* latt_info[7]
Initial value:
={"<i>a</i> &#x2260; <i>b</i> &#x2260; <i>c</i>\n&#x3B1; &#x2260; &#x3B2; &#x2260; &#x263;",
i18n("<i>a</i> &#x2260; <i>b</i> &#x2260; <i>c</i>\n&#x3B1; = &#x3B2; = 90° &#x2260; &#x263;\n\tor\n&#x3B1; = &#x263; = 90° &#x2260; &#x3B2;"),
"<i>a</i> &#x2260; <i>b</i> &#x2260; <i>c</i>\n&#x3B1; = &#x3B2; = &#x263; = 90°",
"<i>a</i> = <i>b</i> &#x2260; <i>c</i>\n&#x3B1; = &#x3B2; = &#x263; = 90°",
"<i>a</i> = <i>b</i> = <i>c</i>\n&#x3B1; = &#x3B2; = &#x3B3; &#x2260; 90°",
i18n("<i>a</i> = <i>b</i> &#x2260; <i>c</i>\n&#x3B1; = &#x3B2; = 90° and &#x263; = 120°"),
"<i>a</i> = <i>b</i> = <i>c</i>\n&#x3B1; = &#x3B2; = &#x263; = 90°"}
#define i18n(String)
Definition global.c:80

Definition at line 102 of file cbuild_edit.c.

◆ min_bv

int min_bv[7] ={0, 2, 15, 74, 142, 167, 194}

Definition at line 110 of file cbuild_edit.c.

◆ nsg_bv

int nsg_bv[7] ={2, 13, 59, 68, 25, 27, 36}

Definition at line 109 of file cbuild_edit.c.

◆ occp

dint occp[5]

Definition at line 1115 of file cbuild_edit.c.