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

Functions to move atom(s) and group of atom(s)
Functions to move randomly atom(s) and group of atom(s)
Functions to create the motion widgets of the model edition window. More...

#include "atom_edit.h"
+ Include dependency graph for atom_move.c:

Go to the source code of this file.

Functions

double ** save_coordinates (project *this_proj, int status)
 save atomic coordinates
 
void reset_coordinates (project *this_proj, int status)
 reset transformation and restore saved atomic coordinates
 
vec3_t get_bary (project *this_proj, int status)
 get barycenter of atomic coordinates
 
void init_coordinates (project *this_proj, int status, gboolean win, gboolean init)
 preserve atomic coordinates
 
void translate (project *this_proj, int status, int axis, vec3_t trans)
 translate
 
void rotate_quat (project *this_proj, vec4_t q, int status, int axis)
 rotate using quaternion
 
void rotate (project *this_proj, int status, int axis, int raxis, float param)
 rotate
 
void random_move_this_atom (project *this_proj, int aid)
 random move atom
 
void random_rotate_this_object (project *this_proj, atomic_object *object, double ratio, double msd)
 random rotate an object
 
void random_translate_this_object (project *this_proj, atomic_object *object, double ratio, double msd)
 random translate an object
 
void random_move_this_object (project *this_proj, atomic_object *object, int move, double msd)
 random move object
 
void trigger_refresh (project *this_proj, atom_search *asearch)
 refresh search tree model
 
gboolean rebuild_selection (project *this_proj, atom_search *asearch, int filter)
 rebuild selection (split fragments linked thru PBC)
 
gboolean random_move_objects (project *this_proj, atom_search *asearch, int numo, int filter, int obj)
 random move object(s)
 
void random_move (project *this_proj, atom_search *asearch)
 random move
 
void translate_this_atom (project *this_proj, int aid, int axis, vec3_t trans)
 translate atom
 
void translate_this_object (project *this_proj, atomic_object *object, int axis, vec3_t trans)
 translate object
 
void rotate_this_object (project *this_proj, atomic_object *object, int axis, int rax, float ang)
 rotate object
 
gboolean move_objects (project *this_proj, atom_search *asearch, int action, int axis, vec3_t trans, float ang)
 move objects, return reconstruction status
 
atom_searchduplicate_atom_search (atom_search *asearch)
 duplicate atom search data structure
 
void move_selection (project *this_proj, int action, int axis, vec3_t trans, float ang)
 move atom selection
 
void update_coordinates (project *this_proj, int status, int axis, int action)
 update atomic coordinates on motion
 
G_MODULE_EXPORT void repeat_move (GtkSpinButton *res, gpointer data)
 repeat motion callback
 
void update_range_and_entry (project *this_proj, int i, int j, int k)
 update motion range
 
float get_limit (int mot, glwin *view)
 get motion limit
 
void range_has_changed (gpointer data, double v)
 motion
 
G_MODULE_EXPORT void set_move (GtkEntry *res, gpointer data)
 motion callback - entry
 
G_MODULE_EXPORT void range_move (GtkRange *range, gpointer data)
 motion callback - range
 
G_MODULE_EXPORT gboolean scroll_range_move (GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
 motion callback - scroll
 
G_MODULE_EXPORT void set_axis_for_motion (GtkComboBox *box, gpointer data)
 set motion axis (eye or model)
 
G_MODULE_EXPORT void set_show_motion_axis (GtkToggleButton *but, gpointer data)
 set show / hide motion axis toggle callback GTK3
 
void check_motion_interactors (project *this_proj, atom_search *asearch)
 add motion check button
 
GtkWidget * create_axis_entries (atom_search *asearch, project *this_proj, int mot, int axd)
 create axis entries
 
GtkWidget * add_motion_interaction (atom_search *asearch, int axd, project *this_proj)
 add motion interaction widgets
 

Variables

gboolean * was_moved_atom
 

Detailed Description

Functions to move atom(s) and group of atom(s)
Functions to move randomly atom(s) and group of atom(s)
Functions to create the motion widgets of the model 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 atom_move.c.

Function Documentation

◆ add_motion_interaction()

GtkWidget * add_motion_interaction ( atom_search * asearch,
int axd,
project * this_proj )

add motion interaction widgets

Parameters
asearchthe target atom search
axdtranslation (0) or rotation (1)
this_projthe target project

Definition at line 1230 of file atom_move.c.

◆ check_motion_interactors()

void check_motion_interactors ( project * this_proj,
atom_search * asearch )

add motion check button

Parameters
this_projthe target project
asearchthe target atom search

Definition at line 1160 of file atom_move.c.

◆ create_axis_entries()

GtkWidget * create_axis_entries ( atom_search * asearch,
project * this_proj,
int mot,
int axd )

create axis entries

Parameters
asearchthe target atom search
this_projthe target project
mottranslation (0) or rotation (1)
axdaxis (0 = x, 1 = y, 2 = z)

Definition at line 1190 of file atom_move.c.

◆ duplicate_atom_search()

atom_search * duplicate_atom_search ( atom_search * asearch)
extern

duplicate atom search data structure

Parameters
asearch

Definition at line 1970 of file atom_action.c.

◆ get_bary()

vec3_t get_bary ( project * this_proj,
int status )

get barycenter of atomic coordinates

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)

Definition at line 170 of file atom_move.c.

◆ get_limit()

float get_limit ( int mot,
glwin * view )

get motion limit

Parameters
mottranslation (0) or rotation (1)
viewthe target glwin

Definition at line 995 of file atom_move.c.

◆ init_coordinates()

void init_coordinates ( project * this_proj,
int status,
gboolean win,
gboolean init )

preserve atomic coordinates

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
winis the model edition window opened ?
initpreserve atomic coordinates

Definition at line 197 of file atom_move.c.

◆ move_objects()

gboolean move_objects ( project * this_proj,
atom_search * asearch,
int action,
int axis,
vec3_t trans,
float ang )

move objects, return reconstruction status

Parameters
this_projthe target project
asearchthe target atom search
action0 = translation, 1 = rotation
axis0 = model, 1 = eye
transthe translation vector, if any
angthe rotation angle, if any

Definition at line 837 of file atom_move.c.

◆ move_selection()

void move_selection ( project * this_proj,
int action,
int axis,
vec3_t trans,
float ang )

move atom selection

Parameters
this_projthe target project
action0 = translation, 1 = rotation
axis0 = model, 1 = eye
transthe translation vector, if any
angthe rotation angle, if any

Definition at line 881 of file atom_move.c.

◆ random_move()

void random_move ( project * this_proj,
atom_search * asearch )

random move

Parameters
this_projthe target project
asearchthe target atom search

Definition at line 657 of file atom_move.c.

◆ random_move_objects()

gboolean random_move_objects ( project * this_proj,
atom_search * asearch,
int numo,
int filter,
int obj )

random move object(s)

Parameters
this_projthe target project
asearchthe target atom search
numothe number of object(s) to move
filterthe filter (0 = species, 1 = partial coord, 2 = total coord, 3 = fragment, 4 = molecule)
objthe object (0 = atom(s), 1 = group of atoms)

Definition at line 614 of file atom_move.c.

◆ random_move_this_atom()

void random_move_this_atom ( project * this_proj,
int aid )

random move atom

Parameters
this_projthe target project
aidthe atom id

Definition at line 328 of file atom_move.c.

◆ random_move_this_object()

void random_move_this_object ( project * this_proj,
atomic_object * object,
int move,
double msd )

random move object

Parameters
this_projthe target project
objectthe object to move
movethe number of times to repeat the motion
msdthe MSD

Definition at line 472 of file atom_move.c.

◆ random_rotate_this_object()

void random_rotate_this_object ( project * this_proj,
atomic_object * object,
double ratio,
double msd )

random rotate an object

Parameters
this_projthe target project
objectthe object to rotate
ratioratio translation / rotation
msdthe MSD

Definition at line 367 of file atom_move.c.

◆ random_translate_this_object()

void random_translate_this_object ( project * this_proj,
atomic_object * object,
double ratio,
double msd )

random translate an object

Parameters
this_projthe target project
objectthe object to translate
ratioratio translation / rotation
msdthe MSD

Definition at line 420 of file atom_move.c.

◆ range_has_changed()

void range_has_changed ( gpointer data,
double v )

motion

Parameters
datathe associated data pointer
vthe value for motion

Definition at line 1016 of file atom_move.c.

◆ range_move()

G_MODULE_EXPORT void range_move ( GtkRange * range,
gpointer data )

motion callback - range

Parameters
rangethe GtkRange sending the signal
datathe associated data pointer

Definition at line 1061 of file atom_move.c.

◆ rebuild_selection()

gboolean rebuild_selection ( project * this_proj,
atom_search * asearch,
int filter )

rebuild selection (split fragments linked thru PBC)

Parameters
this_projthe target project
asearchthe target atom search
filterthe filter (0 = species, 1 = partial coord, 2 = total coord, 3 = fragment, 4 = molecule)

Definition at line 521 of file atom_move.c.

◆ repeat_move()

G_MODULE_EXPORT void repeat_move ( GtkSpinButton * res,
gpointer data )

repeat motion callback

Parameters
resthe GtkSpinButton sending the signal
datathe associated data pointer

Definition at line 963 of file atom_move.c.

◆ reset_coordinates()

void reset_coordinates ( project * this_proj,
int status )

reset transformation and restore saved atomic coordinates

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)

Definition at line 143 of file atom_move.c.

◆ rotate()

void rotate ( project * this_proj,
int status,
int axis,
int raxis,
float param )

rotate

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
axis0 = model, 1 = eye
raxisrotation axis 0 = x, 1 = y, 2 = z
paramrotation angle

Definition at line 309 of file atom_move.c.

◆ rotate_quat()

void rotate_quat ( project * this_proj,
vec4_t q,
int status,
int axis )

rotate using quaternion

Parameters
this_projthe target project
qrotation quaternion
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
axis0 = model, 1 = eye

Definition at line 269 of file atom_move.c.

◆ rotate_this_object()

void rotate_this_object ( project * this_proj,
atomic_object * object,
int axis,
int rax,
float ang )

rotate object

Parameters
this_projthe target project
objectthe object to rotate
axis0 = model, 1 = eye
raxthe rotation axis
angthe rotation angle

Definition at line 784 of file atom_move.c.

◆ save_coordinates()

double ** save_coordinates ( project * this_proj,
int status )

save atomic coordinates

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)

Definition at line 91 of file atom_move.c.

◆ scroll_range_move()

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

motion callback - scroll

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

Definition at line 1076 of file atom_move.c.

◆ set_axis_for_motion()

G_MODULE_EXPORT void set_axis_for_motion ( GtkComboBox * box,
gpointer data )

set motion axis (eye or model)

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 1090 of file atom_move.c.

◆ set_move()

G_MODULE_EXPORT void set_move ( GtkEntry * res,
gpointer data )

motion callback - entry

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 1046 of file atom_move.c.

◆ set_show_motion_axis()

G_MODULE_EXPORT void set_show_motion_axis ( GtkToggleButton * but,
gpointer data )

set show / hide motion axis toggle callback GTK3

Parameters
butthe GtkToggleButton sending the signal
datathe associated data pointer

Definition at line 1124 of file atom_move.c.

◆ translate()

void translate ( project * this_proj,
int status,
int axis,
vec3_t trans )

translate

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
axis0 = model, 1 = eye
transtranslation vector

Definition at line 230 of file atom_move.c.

◆ translate_this_atom()

void translate_this_atom ( project * this_proj,
int aid,
int axis,
vec3_t trans )

translate atom

Parameters
this_projthe target project
aidatom id
axis0 = model, 1 = eye
transtranslation vector

Definition at line 713 of file atom_move.c.

◆ translate_this_object()

void translate_this_object ( project * this_proj,
atomic_object * object,
int axis,
vec3_t trans )

translate object

Parameters
this_projthe target project
objectthe object to translate
axis0 = model, 1 = eye
transthe translation vector

Definition at line 742 of file atom_move.c.

◆ trigger_refresh()

void trigger_refresh ( project * this_proj,
atom_search * asearch )

refresh search tree model

Parameters
this_projthe target project
asearchthe target atom search

Definition at line 504 of file atom_move.c.

◆ update_coordinates()

void update_coordinates ( project * this_proj,
int status,
int axis,
int action )

update atomic coordinates on motion

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
axisaxis, 0 = model, 1 = eye
action0 = translation, 1 = rotation

Definition at line 939 of file atom_move.c.

◆ update_range_and_entry()

void update_range_and_entry ( project * this_proj,
int i,
int j,
int k )

update motion range

Parameters
this_projthe target project
iselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
jaxis, 0 = model, 1 = eye
kparameter to update: x, y, z or alpha, beta, gamma

Definition at line 979 of file atom_move.c.

Variable Documentation

◆ was_moved_atom

gboolean* was_moved_atom

Definition at line 81 of file atom_move.c.