atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
initring.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'initring.c'
24*
25* Contains:
26*
27
28 - The functions to retrieve rings data from Fortran90
29
30*
31* List of functions:
32
33 void send_rings_opengl_ (int * id, int * st, int * ta, int * ri, int nring[* ta+1]);
34 void send_atom_rings_id_opengl_ (int * st, int * at, int * id, int * ta, int * num, int ring[* num]);
35 void allocate_all_rings_ (int * id, int * st, int * ta, int * nring);
36
37*/
38
39#include "global.h"
40#include "glwindow.h"
41
53void send_rings_opengl_ (int * id, int * st, int * ta, int * ri, int nring[* ta+1])
54{
55 int i;
56 active_glwin -> show_rpoly[* id][* st][* ta][* ri] = FALSE;
57 for (i=0; i< * ta+1; i++)
58 {
59 active_glwin -> all_rings[* id][* st][* ta][* ri][i] = nring[i] - 1;
60 }
61}
62
75void send_atom_rings_id_opengl_ (int * st, int * at, int * id, int * ta, int * num, int ring[* num])
76{
77 if (ring != NULL)
78 {
79 int i;
80 active_project -> atoms[* st][* at].rings[* id][* ta] = allocint(* num + 1);
81 active_project -> atoms[* st][* at].rings[* id][* ta][0] = * num;
82 for (i=0; i < * num; i++)
83 {
84 active_project -> atoms[* st][* at].rings[* id][* ta][i+1] = ring[i] - 1;
85 }
86 }
87}
88
99void allocate_all_rings_ (int * id, int * st, int * ta, int * nring)
100{
101 active_glwin -> all_rings[* id][* st][* ta - 1] = allocdint (* nring, * ta);
102 active_glwin -> show_rpoly[* id][* st][* ta - 1] = allocint (* nring);
103 active_glwin -> num_rings[* id][* st][* ta - 1] = * nring;
104}
atom * ta
Definition d_measures.c:70
int atoms[NUM_STYLES][2]
int ** allocdint(int xal, int yal)
allocate an int ** pointer
Definition global.c:342
int * allocint(int val)
allocate an int * pointer
Definition global.c:326
Global variable declarations Global convenience function declarations Global data structure defin...
glwin * active_glwin
Definition project.c:53
project * active_project
Definition project.c:47
Function declarations for the creation of the OpenGL window.
void allocate_all_rings_(int *id, int *st, int *ta, int *nring)
allocate data to store ring statistics results for the glwin
Definition initring.c:99
void send_atom_rings_id_opengl_(int *st, int *at, int *id, int *ta, int *num, int ring[*num])
get rings data for an atom from Fortran90
Definition initring.c:75
void send_rings_opengl_(int *id, int *st, int *ta, int *ri, int nring[*ta+1])
get single ring data for the glwin from Fortran90
Definition initring.c:53