atomes 1.1.14
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, 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 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 * crystal_sytems [7] = {"Triclinic", "Monoclinic", "Othorhombic", "Tetragonal", "Trigonal", "Hexagonal", "Cubic"}
 
gchar * bravais_keys [7][4]
 
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 1058 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 844 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 863 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 464 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 1195 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 915 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 821 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 1073 of file cbuild_edit.c.

◆ build_crystal()

int build_crystal ( gboolean visible,
project * this_proj,
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
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 907 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 1276 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 1092 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 954 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 1483 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 1122 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 259 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 173 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 127 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 804 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 282 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 146 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 434 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 305 of file cbuild_edit.c.

◆ la_combo_tree()

GtkTreeModel * la_combo_tree ( )

create the lattice system combo box tree model

Definition at line 412 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 637 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 771 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 937 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 979 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 709 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 880 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 1039 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 728 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 1009 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 355 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 753 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 324 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 312 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 1150 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 1176 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 616 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 599 of file cbuild_edit.c.

Variable Documentation

◆ bravais_keys

gchar* bravais_keys[7][4]
Initial value:
= {{"Primitive", NULL, NULL, NULL},
{"Primitive", "Base-centered", NULL, NULL},
{"Primitive", "Base-centered", "Body-centered", "Face-centered"},
{"Primitive", "Body-centered", NULL, NULL},
{"Hexagonal axes", "Rhombohedral axes", NULL, NULL},
{"Hexagonal", NULL, NULL, NULL},
{"Primitive", "Body-centered", "Face-centered", NULL}}

Definition at line 102 of file cbuild_edit.c.

◆ crystal_sytems

gchar* crystal_sytems[7] = {"Triclinic", "Monoclinic", "Othorhombic", "Tetragonal", "Trigonal", "Hexagonal", "Cubic"}

Definition at line 101 of file cbuild_edit.c.

◆ 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;",
"<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°",
"<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°"}

Definition at line 110 of file cbuild_edit.c.

◆ min_bv

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

Definition at line 118 of file cbuild_edit.c.

◆ nsg_bv

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

Definition at line 117 of file cbuild_edit.c.

◆ occp

dint occp[5]

Definition at line 1129 of file cbuild_edit.c.