Compare commits

...

120 Commits

Author SHA1 Message Date
Adrien Bourmault 79cae53525 src/graphics, src/parsing: drawing model initial state 2024-01-12 17:23:06 +01:00
Adrien Bourmault 5f2abbda15 WIP: src/graphics, src/parsing: get multiplicity 2024-01-12 11:17:40 +01:00
Adrien Bourmault 3bb99b5a26
src/graphics: corrected aspect ratio and optimized matrices 2024-01-11 23:43:39 +01:00
Adrien Bourmault 0da55ac88b
Use parsed model to define dimension and space size of GLArea 2024-01-11 22:27:52 +01:00
Adrien Bourmault d50ce9afe1
WIP: simple opening of XML file 2024-01-11 18:10:16 +01:00
Adrien Bourmault 52e6c59d76
Clean-up debug printing 2024-01-11 18:09:51 +01:00
Adrien Bourmault 53c2fd9209 src/graphics, src/ui: now capable of generating multiple GLArea and their stack 2024-01-10 18:27:46 +01:00
Adrien Bourmault ff35840a26 src/graphics, src/ui: reworked GLArea generation and setup 2024-01-10 11:51:53 +01:00
Adrien Bourmault 9bb7cefc2f
WIP: no image but no more segfault 2023-12-20 18:01:27 +01:00
Adrien Bourmault 02880d3dde
WIP: GLArea managed by graphical stack, but nothing is displayed 2023-12-20 14:13:04 +01:00
Adrien Bourmault 319b84b099
WIP: GLAreas stacks are now managed 2023-12-20 13:34:44 +01:00
Adrien Bourmault 9325a7cb6f
WIP: total rewrite graphic stack allocation 2023-12-19 21:46:51 +01:00
Adrien Bourmault 6a2f3afe89
src/ui/main.c: suppression d'espaces inutiles 2023-12-19 16:26:57 +01:00
Adrien Bourmault cddf16516f
src/ui/glarea.c->graphics.c: renommage pour clarté 2023-12-19 16:26:26 +01:00
Adrien Bourmault e4e6410c0b
WIP: working on glarea allocator 2023-12-19 11:45:59 +01:00
Adrien Bourmault 8e07cc7499
Makefile: no more automated guix shell
Users/contributors have to run guix shell -m manifest in order
to build the project
2023-12-18 23:05:59 +01:00
Adrien Bourmault 0261a4c2e8
WIP: cleanup 2023-12-12 18:42:01 +01:00
Jean Sirmai 89ffa7fb82
O K P R I N T I N G + O K D R A W I N G ( + C O M M E N T S ) 2023-12-12 18:37:32 +01:00
Jean Sirmai d538e1a0ef
Ok console; Ok graphisme (sauf inversion N/S) pour de petits nombres aléatoires 2023-12-12 18:36:31 +01:00
Jean Sirmai 5c224b20cf
create_arrow() creating in arrows_ptr and drawing 2023-12-12 16:55:09 +01:00
Jean Sirmai 5c8ed2ce06
REF: OK POUR DES PETITES VALEURS (RANDOM) - VERTEX & LIGNES GROUPÉES 2023-12-12 16:54:48 +01:00
Jean Sirmai 246e73111f
OK (space & arrows) pour de petits nombres. Nettoyage en cours. 2023-12-12 16:54:41 +01:00
Jean Sirmai 551c5a5df2
Forme quasi stable 2023-12-12 16:54:12 +01:00
Jean Sirmai 6698c51c6d
Fixed segfault/abort/double free with realloc in *_arrow() 2023-12-12 16:54:05 +01:00
Jean Sirmai 979cd8f947
set_arrow() OK (printf + drawing) with no more than two calls < to check ++ 2023-12-12 16:53:58 +01:00
Jean Sirmai f9722f51b1
SUCCESS IN PASSING A STRONG RANDOM GRAPHIC TEST 2023-12-12 16:53:49 +01:00
Jean Sirmai c3c2ca9f9a
function set_arrow() ready to be used 2023-12-12 16:52:44 +01:00
Jean Sirmai 0ebd025bd8
create_arrow(): fonctionnel mais quelques bugs 2023-12-12 16:51:59 +01:00
Jean Sirmai d4c7e1bba5
réécriture de grid_write_ridges (x,y,z) et déplacement de show_user_choices() 6 flèches au centre
main_test_graphics() et arrows simplifiés mais pb. calcul arrows_nb à partir de arrows[] cf. lignes 140, 170 et 647
2023-12-12 16:51:01 +01:00
Jean Sirmai 2732ec3289
src/graphics/*: Reworked modularity, buffer allocation and reallocation of lines buffer
Acked-by: Adrien 'neox' Bourmault <neox@a-lec.org>
2023-12-12 16:50:57 +01:00
Jean Sirmai 5549f334b8
First 3D representation
Space units are 3D, arrows are 3D, space can be 3D/2D/1D.
Every dimension length can be defined independently.

At this time, arrows are drawn after a statically-defined array.

Signed-off-by: Jean Sirmai <jean@a-lec.org>
Acked-by: neox <neox@a-lec.org>
2023-12-12 16:50:27 +01:00
Adrien Bourmault eaa39dc29f
Nettoyage 2023-06-27 18:07:37 +02:00
Jean Sirmai b36730db97
Fusion travail perso dans dev/graphics 2023-06-27 15:43:23 +02:00
Jean Sirmai 4f766689ee
WIP: is okay mais pas encore bien structuré 2023-06-27 15:20:39 +02:00
Jean Sirmai ecd3ed98fc
WIP: des couleurs, certes... 2023-06-23 23:48:14 +02:00
Jean Sirmai a6927dbaa5
WIP: pref_3D_xor_2D_space and pref_mark_unit_space_zero seem OK (check) 2023-06-23 16:55:58 +02:00
Jean Sirmai 28c45295c6
WIP: Restructuration graphics/graphics in progress. Is OK. 2023-06-23 12:52:44 +02:00
Jean Sirmai 4d5aa2c993
WIP: Bon. C'est blindé d'erreurs mais ça le fait en 3D + 1 p'tite flèche. A nettoyer ++ 2023-06-15 21:29:15 +02:00
Jean Sirmai e9d45b3e88
WIP: un p'tit coup d'espace 3D (sans les flèches) 2023-06-15 20:48:40 +02:00
Jean Sirmai a0cce217b2
WIP: Réorganisation de graphics.c création de space_2D.c et arrow_2D.c 2023-06-15 19:50:49 +02:00
Jean Sirmai 1c5f45d505
Is OK. Avant restructuration. (découpage de graphics.c en "control_graphics.c" + space_2D.c + _3D.c + etc) 2023-06-15 11:40:55 +02:00
Jean Sirmai 4dada5b292
Premières couleurs ! Success ! 2023-06-14 17:51:19 +02:00
Jean Sirmai f12c22b73b
Couleurs (premier essai > que du noir et blanc) 2023-06-14 16:01:52 +02:00
Jean Sirmai efe117076f
Première représentation 3D d'un modèle 1D 2023-06-09 15:03:28 +02:00
Jean Sirmai 2a9ed561fb
Added include/parsing.h 2023-04-18 11:16:52 +02:00
Jean Sirmai 4a46e62cbc
Added parsing/, currently parses states 2023-04-18 11:13:18 +02:00
Adrien Bourmault abea32cd88
WIP: gl_area params allocated 2023-02-26 14:57:50 +01:00
Adrien Bourmault b2e25470ed
WIP: solved segfault but need to improve gl_area_array 2023-02-25 21:23:37 +01:00
Adrien Bourmault 0396f8039b
WIP: NOT WORKING: read_file() 2023-02-23 21:54:22 +01:00
Adrien Bourmault df294bd780
WIP: close sidebar when closing 2023-02-23 20:07:38 +01:00
Adrien Bourmault 0a7c9d28d3
WIP: clean error for alloc problems 2023-02-23 20:03:36 +01:00
Adrien Bourmault 4e291bc179
WIP: clean 2023-02-23 19:55:53 +01:00
Adrien Bourmault d761711ede
WIP: allocation dynamique des paramètres de GLArea 2023-02-23 19:51:02 +01:00
Adrien Bourmault ada9f32d7a
Amélioration layout run_controls 2023-02-09 12:43:00 +01:00
Adrien Bourmault 9969c6233c
Amélioration layout 2023-02-09 12:39:14 +01:00
Adrien Bourmault 086c3d97b6
Nettoyage 2023-02-08 16:10:59 +01:00
Adrien Bourmault 65b068f0ee
WIP: Adding stacks for lib in runmode 2023-02-01 19:13:34 +01:00
Adrien Bourmault e4edaf39ca
WIP: Adding stacks for lib in runmode 2023-02-01 19:12:57 +01:00
Adrien Bourmault 9ae1c49522
WIP: Adding stacks for lib in runmode 2023-02-01 19:06:39 +01:00
Adrien Bourmault 5031635e6e
WIP: correcting UI 2023-02-01 18:08:37 +01:00
Adrien Bourmault eb851fb88f
Notification plus claire 2023-01-27 01:28:54 +01:00
Adrien Bourmault a4da61a914
Logo Gem-graph 2023-01-26 22:16:40 +01:00
Adrien Bourmault e96f339cf4
Cleanup 2023-01-26 02:04:56 +01:00
Adrien Bourmault 9f3d83af65
Cleanup & refactor 2023-01-26 01:59:19 +01:00
Adrien Bourmault a8ecb75b2d
Cleanup & refactor 2023-01-26 01:58:23 +01:00
Adrien Bourmault ef901d4a48
Cleanup & refactor 2023-01-26 01:56:54 +01:00
Adrien Bourmault 8aae05fefc
Cleanup and added events 2023-01-26 01:38:51 +01:00
Adrien Bourmault 3c762e71b8
Cleanup 2023-01-26 01:24:42 +01:00
Adrien Bourmault fbea0f51a9
dev/gtk4 fusionné 2023-01-26 01:14:24 +01:00
Adrien Bourmault 23dbd119a0
Maj copyright 2023-01-26 01:09:52 +01:00
Adrien Bourmault f3c70222d0
Maj auteurs 2023-01-26 01:09:38 +01:00
Adrien Bourmault 64fa82a741
GLArea dans la place 2023-01-26 01:07:07 +01:00
Adrien Bourmault 0a494a6b21
Notifications fonctionnelles 2023-01-25 23:14:55 +01:00
Adrien Bourmault 70348674cd
Cleanup 2023-01-25 22:47:17 +01:00
Adrien Bourmault 9f3cb07837
WIP: Notification widget 2023-01-25 20:48:36 +01:00
Adrien Bourmault a70d4fcf21
WIP: notification 2023-01-25 20:20:25 +01:00
Adrien Bourmault aa4395c1ae
Changed mode names 2023-01-25 19:30:40 +01:00
Adrien Bourmault 91026f87be
Changed function naming style 2023-01-25 19:27:51 +01:00
Adrien Bourmault 9c42fae1f2
Mode changing via menu ! 2023-01-25 19:08:19 +01:00
Adrien Bourmault bf6db3fa34
Mode changing ! 2023-01-25 19:05:38 +01:00
Adrien Bourmault 4d65a51e09
Obtained open/close with changing mode 2023-01-25 18:48:01 +01:00
Adrien Bourmault c736e15ecd
WIP: new actions (2) 2023-01-25 15:25:24 +01:00
Adrien Bourmault 555478c783
WIP: new actions 2023-01-25 15:25:04 +01:00
Adrien Bourmault 4a29b20acb
Réorganisation dossiers (2) 2023-01-25 12:31:29 +01:00
Adrien Bourmault 1b17dcf5b1
Réorganisation des répertoires 2023-01-25 12:24:52 +01:00
Adrien Bourmault 11c9405080
WIP: widgets bound 2023-01-24 22:59:37 +01:00
Adrien Bourmault 227c448052
Base window visible 2023-01-24 21:54:29 +01:00
Adrien Bourmault 4766fbc9bb
WIP: obtained a window 2023-01-24 21:06:32 +01:00
Adrien Bourmault 4b6383bf0c
WIP: obtained a window 2023-01-24 21:06:05 +01:00
Adrien Bourmault dce3310970
WIP: C transition, beginning from gemgl 2023-01-23 18:52:57 +01:00
Adrien Bourmault cd0a733dec
WIP: begin transition to C lang (2) 2023-01-23 18:44:38 +01:00
Adrien Bourmault b9303dea47
WIP: begin transition to C lang 2023-01-23 18:44:16 +01:00
Adrien Bourmault b1fcff56af
Typo 2022-08-02 11:25:06 +02:00
Adrien Bourmault 392242dff0
Implemented home state and open action activating modes 2022-08-02 11:02:29 +02:00
Adrien Bourmault a866f117b1
Created home mode at startup 2022-08-02 10:29:48 +02:00
Adrien Bourmault 4acc10e72d
Added Open/Close/Save options and toast notifications 2022-07-29 17:59:05 +02:00
Adrien Bourmault ccaf200dbe
Mode icon + default run mode 2022-07-29 10:59:57 +02:00
Adrien Bourmault 95aa86fbd0
Cleaned up code and concepts in UI 2022-07-29 00:23:29 +02:00
Adrien Bourmault d00e036a7e
Implemented work mode with GtkStacks 2022-07-28 23:27:24 +02:00
Adrien Bourmault b33e9806c7
WIP: gtk4 template 2022-07-28 01:55:44 +02:00
Adrien Bourmault e06b241d01
WIP: icônes 2022-06-30 23:52:12 +02:00
Adrien Bourmault ddc7a362be
Menus et actions 2022-06-30 16:43:59 +02:00
Adrien Bourmault 8f92aab835
Ignorer les binaires 2022-06-30 16:43:22 +02:00
Adrien Bourmault b5f40e4767
Revert "essais de copier-coller-modifier en partant du fichier XML gem-graph.ui"
This reverts commit fffaaa8df0.
2022-06-30 15:05:29 +02:00
Adrien Bourmault 22924dfac7
Ignorer les binaires 2022-06-30 15:00:26 +02:00
Adrien Bourmault 14ad614ade
Ignorer les binaires 2022-06-30 11:50:11 +02:00
Jean Sirmai fffaaa8df0
essais de copier-coller-modifier en partant du fichier XML gem-graph.ui 2022-06-29 14:19:42 +02:00
Adrien Bourmault 6cd611a5b4
WIP: reboot for an UI 2022-06-24 20:02:09 +02:00
Adrien Bourmault 16cfd64e9b
WIP: reboot for an UI 2022-06-24 20:01:35 +02:00
Adrien Bourmault 1aee371bee
WIP: new draft for an UI 2022-06-24 19:19:34 +02:00
Adrien Bourmault 6ce4bb1a2d
WIP: new draft for an UI 2022-06-24 19:17:14 +02:00
Adrien Bourmault 0a62d6c3ba
WIP: new draft for an UI 2022-06-24 18:19:11 +02:00
Adrien Bourmault 0b96e3c5c1
Reboot de l'UI du client 2022-06-24 17:36:21 +02:00
Adrien Bourmault de7f61e156
Fusion de dev/XMLS schéma final 0.2.1 2021-12-07 20:01:44 +01:00
Adrien Bourmault 5b9a7dbdfe Merge branch 'dev/parsing' into 'devel'
Parsing du modèle utilisateur

See merge request gem-graph/gem-graph-client!7
2021-12-07 18:45:15 +00:00
Adrien Bourmault 929fc53e2c Parsing du modèle utilisateur 2021-12-07 18:45:15 +00:00
Adrien Bourmault 0b140a54c6 Merge branch 'dev/ui' into 'devel'
premier jet d'interface graphique

See merge request gem-graph/gem-graph-client!9
2021-11-30 14:35:48 +00:00
Adrien Bourmault fd24472805 premier jet d'interface graphique 2021-11-30 14:35:48 +00:00
Adrien Bourmault e0bb902ab8 Merge branch 'dev/XMLS' into 'devel'
Mise à jour du modèle XML version 0.2

See merge request gem-graph/gem-graph-client!8
2021-11-11 15:22:42 +00:00
Adrien Bourmault 221d95f4dc Mise à jour du modèle XML version 0.2 2021-11-11 15:22:42 +00:00
40 changed files with 6717 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
**/tags.*
bin/*
build/*

661
LICENSE Normal file
View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

132
Makefile Normal file
View File

@ -0,0 +1,132 @@
##
## Gem-graph OpenGL experiments
##
## Desc: Makefile
##
## Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
## Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
##
## This file is part of Gem-graph.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
.PHONY: all clean install run build_system
.DELETE_ON_ERROR: $(BINDIR)/gem-graph-client
.DEFAULT_GOAL := all
#
# Color codes
#
CL='\033[0;32m'
CL2='\033[1;36m'
CL3='\033[0m'
NC='\033[1;37m'
#
# Variables & constants
#
NTHREADS= $(shell nproc)
CC=gcc
WARNINGS= -Wall
DEBUG= -ggdb -fno-omit-frame-pointer -fdiagnostics-color=always -fsanitize=bounds -fstack-check
#-fsanitize=address \
#-fsanitize=pointer-compare -fsanitize=pointer-subtract \
#-fsanitize=leak -fsanitize=undefined -fsanitize=null -fsanitize=bounds
OPTIMIZE= -O3
INCLUDE= $(shell pkg-config --cflags glib-2.0 libxml-2.0 gtk4)
LIBS= $(shell pkg-config --libs glib-2.0 libxml-2.0 gtk4) -lGL -lGLU -lm -lepoxy -lX11 -lGLEW
BINDIR=bin
BUILDDIR=build
SRCDIR=src
#vpath %.c $(SRCDIR)
SOURCES= $(shell find $(SRCDIR) -type f -name "*.c")
BUILDBINS=$(patsubst %.c,$(BUILDDIR)/%.o,$(SOURCES))
BUILDDEPS=$(patsubst %.c,$(BUILDDIR)/%.d,$(SOURCES))
-include /etc/os-release
#
# Directories
#
$(BUILDDIR):
@mkdir -p $@
@echo -e ${CL2}[$@] ${CL}folder generated.${CL3}
$(BINDIR):
@mkdir -p $@
@echo -e ${CL2}[$@] ${CL}folder generated.${CL3}
#
# Dependencies
#
-include $(BUILDDEPS)
$(BUILDDIR)/%.d: %.c | $(BUILDDIR)
@mkdir -p $(shell dirname $@)
@$(CC) -MM -MT $(@:%.d=%.o) -MF $@ $<
@echo -e ${CL2}[$@] ${CL}dependencies generated.${CL3}
#
# Compilation
#
$(BINDIR)/gem-graph-client: $(BUILDBINS) | $(BINDIR)
@$(CC) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) $^ $(INCLUDE) $(LIBS)
@echo -e ${CL2}[$@] ${CL}built.${CL3}
$(BUILDDIR)/%.o: %.c | $(BUILDDIR)
@mkdir -p $(shell dirname $@)
@$(CC) $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(INCLUDE) -c $< -o $@
@echo -e ${CL2}[$@] ${CL}compiled.${CL3}
#
# Virtual recipes
#
clean:
@rm -rf $(BINDIR)
@rm -rf $(BUILDDIR)
@echo -e ${CL2}[$@] ${CL}done.${CL3}
install:
echo "Installing is not supported"
build_system:
@echo -e ${CL2}[$@] ${CL}building...${CL3}
@make $(BINDIR)/gem-graph-client -j $(NTHREADS)
@echo -e ${CL2}[$@] ${CL}done.${CL3}
run: build_system
@echo -e ${CL2}[$@] ${CL}executing...${CL3}
@$(BINDIR)/gem-graph-client
@echo -e ${CL2}[$@] ${CL}done.${CL3}
debug: build_system
@echo -e ${CL2}[$@] ${CL}executing...${CL3}
@gdb $(BINDIR)/gem-graph-client
@echo -e ${CL2}[$@] ${CL}done.${CL3}
valgrind: build_system
@echo -e ${CL2}[$@] ${CL}executing...${CL3}
@valgrind $(BINDIR)/gem-graph-client
@echo -e ${CL2}[$@] ${CL}done.${CL3}
all: build_system
@echo -e ${CL2}[$@] ${CL}done.${CL3}

46
TODO (next version).txt Normal file
View File

@ -0,0 +1,46 @@
L'utilisation d'OpenGL fait que la première version de Gem-graph sera tout naturellement en 3D. Le modèle de marche aléatoire de dimères sera aussi facile à y réaliser que dans un modèle 1D (on pourrait même se servir d'une seule règle au lieu de deux !) (mais deux règles permettront un meilleur rendu).
Modifier la forme des flèches ?
Pour cette première version, la forme "central star" + "cône" a l'avantage de la simplicité.
La "central star" de chaque cube est commune aux six flèches possibles qui sont orientées chacune vers une face différente.
Dans la version actuelle, elle est redessinée si plusieurs flèches sont dans le même cube.
Ce dessin est peu coûteux (deux lignes superposées pour chaque nouvelle flèche)
et ce cas (plusieurs flèches dans le même cube) sera peu fréquent dans les premiers modèles développés. Mais... TODO
Le plus simple serait un trait allant du centre d'un cube au centre d'une de ses faces. Ce serait peu lisible pour des objets mais pourrait avoir un intérêt pour les tags (balises) éventuellement associés aux objets ou situations. Ces tags seraient machine-readable. Nécessairement. Seraient-ils human-readable aussi ? Ce serait idéal ! A inventer ou essayer, en tout cas.
Un seul trait aurait sûrement un intérêt dans la représentation de voisinages de Moore 3D (Je préfère ne pas imaginer ça pour l'instant ! Il va falloir choisir de ne représenter ou de ne visualiser qu'une partie des connexions à la fois...).
Le premier objectif des versions à venir est l'extension du voisinage. Un voisinage type von Neumann 3D - le plus simple possible si on le veut symétrique par rapport aux axes de l'espace - est tout à fait indiqué pour cette première version. Mais les versions à venir devraient travailler en priorité avec des voisinages type Moore 3D approximativement spériques de rayon proche de celui de l'espace local.
Par ailleurs, Gem-graph ne peut avoir sa puissance théorique maximale que s'il peut utiliser un voisinage étendu à tout l'espace. Mais cette puissance est vraisemblablement inutile, sauf pour les démonstrations mathématiques d'équivalence avec les automates cellulaires, par exemple, ou d'autres formalismes.
Par ailleurs, il est d'ores et déjà possible d'utiliser pleinement le "poids" (weight) ou la "charge" (load) des flèches.
! WARNING ! J'ai inversé pôle Nord et pôle Sud. Et c'est à corriger, je pense. 👀️
Ce sera une convention, bien sûr. Mais comment la choisir ? J'ai imaginé superposer repère orthonormé et repère géodésique.
Si je regarde un repère orthonormé 3D:
les +x sont à ma droite, les -x à ma gauche (Est - Ouest)
les +y en haut, les -y en bas (Zénith - Nadir) et... si l'axe des z vient vers moi,
les +z sont derrière moi et les -z devant. Donc les -z sont au Nord (que je regarde) et les +z sont au Sud.
Les vertex situés aux intersections des "grilles" (X-X, Y-Y et Z-Z) sont-ils utiles ?
Ils le seraient si ses cubes individuels étaient coloriés ou soulignés pour mettre en valeur des flèches qu'ils contiennent ou d'autres particularités.
Mais tant qu'il n'est pas possible de rendre sélectivement transparentes les parois de cubes individuels (ou de tel ou tel objet dessiné par les flèches), cette fonction est inutilisable et les vertex situés aux intersections des grilles sont donc inutiles.
On pourrait ne garder que ceux situés sur les faces de l'espace qui, eux, servent à tracer les grilles X-X, Y-Y et Z-Z.
Le nombre de vertex de l'espace serait alors de 12 par cube-unité (soit 12 * x * y * z) plus les vertex intersections des seules faces de l'espace (soit (x * y + x * z + y * z) * 2).
A raison, bien sûr de trois nombres par vertex plus les couleurs.
Je comprends (maintenant seulement !) que si des régions du buffer lignes (idem pour le buffer triangles) sont laissées vides (occupées par des zéros) elles seront néanmoins redessinées en permanence et que le seul moyen d'éviter cela est de réallouer la taille du buffer à chaque délétion ou chaque ajout de flèche.
Néanmoins, lorsque le nombre de flèches présent dans l'espace est invariant, - cas de mes premiers modèles - il peut être avantageux de travailler dans un buffer de taille fixe. Il faut, pour cela, fixer une "densité maximale de flèches dans l'espace" nécessairement arbitraire.
Bien que ce nombre reste toujours arbitraire, on peut estimer que certaines de ses valeurs seront plus utiles/utilisables que d'autres :
- un espace totalement vide ou totalement saturé ne pourrait rien représenter
- un espace trop vide ou trop plein (à définir - c'est intuitif) aurait peu de chances de représenter des phénomènes intéressants. La marche aléatoire d'un seul ou de quelques dimères dans un grand espace, par exemple, servira plus de test pour le bon fonctionnement de Gem-graph que de modèle d'étude.
- on peut considérer un espace rempli de flèches aux 2/3 comme équivalent à un espace repli au tiers (1/3) mais où les flèches seraient écrites "en creux" et, par conséquent, moins lisibles. Inutile, donc, de remplir plus de la moitié de l'espace.
D'expérience,
- les densités de l'ordre du tiers (1/3 des unités de l'espace occupées par au moins une flèche) suffisent à représenter un nombre de phénomènes tel qu'il n'est pas nécessaire, au moins dans un premier temps, de prévoir davantage (mais des réalloc sont toujours possibles) et les densités trop fortes sont peu lisibles.
Un buffer lignes pourrait donc avoir une taille fixe qui serait calculée selon les paramètres suivants :
- x * y * z = nombre de cubes
- nombre de flèches moyen par cube = 2 (il s'agit d'un nombre "moyen" qui surestime très probablement le nombre de flèches utilisé par la plupart des modèles)
- dessin d'une flèche seule dans un cube = 3 + 4 traits (soit 14 nombres)
Faut-il coder cette option ?

0
data/.gitkeep Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,365 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="50mm"
height="50mm"
viewBox="0 0 50 50.000001"
version="1.1"
id="svg5"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="gemgraph.svg"
inkscape:export-filename="gemgraph.png"
inkscape:export-xdpi="400"
inkscape:export-ydpi="400"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="3.0541689"
inkscape:cx="100.02721"
inkscape:cy="105.42966"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="layer10"
inkscape:snap-grids="false"
showguides="false"
inkscape:lockguides="false"
inkscape:showpageshadow="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid679"
originx="-13.661108"
originy="-56.524582" />
</sodipodi:namedview>
<defs
id="defs2">
<marker
style="overflow:visible"
id="marker58350"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:isstock="true">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58348" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Send"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Send"
inkscape:isstock="true">
<path
transform="matrix(-0.3,0,0,-0.3,0.69,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.625;stroke-linejoin:round"
id="path58039" />
</marker>
<marker
style="overflow:visible"
id="Tail"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Tail"
inkscape:isstock="true">
<g
transform="scale(-1.2)"
id="g58054">
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -3.8048674,-3.9585227 0.54352094,0"
id="path58042" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -1.2866832,-3.9585227 3.0617053,0"
id="path58044" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M 1.3053582,-3.9585227 5.6537466,0"
id="path58046" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -3.8048674,4.1775838 0.54352094,0.21974226"
id="path58048" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -1.2866832,4.1775838 3.0617053,0.21974226"
id="path58050" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M 1.3053582,4.1775838 5.6537466,0.21974226"
id="path58052" />
</g>
</marker>
<marker
style="overflow:visible"
id="Arrow2Mend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Mend"
inkscape:isstock="true">
<path
transform="scale(-0.6)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.625;stroke-linejoin:round"
id="path58033" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend"
inkscape:isstock="true">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.625;stroke-linejoin:round"
id="path58027" />
</marker>
<marker
style="overflow:visible"
id="marker58284"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend"
inkscape:isstock="true">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58282" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Mend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:isstock="true">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58015" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Lend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend"
inkscape:isstock="true">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58009" />
</marker>
<linearGradient
id="linearGradient7798"
inkscape:swatch="solid">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop7796" />
</linearGradient>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath66549">
<path
id="path66551"
style="fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.264583"
d="m 12.135176,56.807902 v 0.259416 c 0.01208,-0.02305 0.02657,-0.04746 0.04496,-0.07545 0.02382,-0.03625 0.05508,-0.0677 0.08785,-0.09612 0.04746,-0.04115 0.07941,-0.06765 0.106453,-0.08785 z m 0.507463,0 c -0.168135,0.07167 -0.157367,0.05207 -0.302307,0.181901 -0.02701,0.02418 -0.0531,0.05092 -0.07235,0.08165 -0.05643,0.0901 -0.06755,0.146106 -0.09818,0.240298 -0.001,0.0031 -0.0021,0.0062 -0.0031,0.0093 h 0.351916 c 0.02605,-0.04031 0.05222,-0.08064 0.07906,-0.120404 0.06558,-0.09715 0.163785,-0.031 0.09818,0.06614 -0.0121,0.01791 -0.02376,0.03618 -0.03566,0.05426 h 0.30334 V 56.8079 Z" />
</clipPath>
</defs>
<g
inkscape:groupmode="layer"
id="layer8"
inkscape:label="bg"
transform="translate(-9.5102355,-2.9755927)" />
<g
inkscape:label="cellules"
inkscape:groupmode="layer"
id="layer1"
style="display:inline"
transform="translate(-13.661107,-56.524581)" />
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="flechouille"
style="display:inline"
transform="translate(-9.5102355,-2.9755927)" />
<g
inkscape:groupmode="layer"
id="layer9"
inkscape:label="flesh1"
style="display:inline"
transform="translate(-9.5102355,-2.9755927)" />
<g
inkscape:groupmode="layer"
id="layer10"
inkscape:label="flesh2"
style="display:inline"
transform="translate(-9.5102355,-2.9755927)">
<g
id="g1446"
transform="matrix(0.84217281,0,0,0.84217281,7.5579735,3.4031577)">
<path
id="path2376-7"
style="display:inline;fill:#dab82f;fill-opacity:1;fill-rule:evenodd;stroke:#dab82f;stroke-width:0.287;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
d="m 15.159701,73.562323 5.757321,9.910713 11.461618,-0.03061 5.7043,-9.941324 -5.757322,-9.910714 -11.461618,0.03061 z"
transform="translate(-4.1508714,-53.548988)" />
<path
id="path2376-5"
style="display:inline;fill:#267cc9;fill-opacity:1;fill-rule:evenodd;stroke:#267cc9;stroke-width:0.286544;stroke-opacity:1;paint-order:stroke fill markers"
d="m 33.391148,83.983564 5.757406,9.911184 11.461794,-0.03061 5.703866,-9.941795 -5.756889,-9.91067 -11.461794,0.03061 z"
transform="translate(-4.1508714,-53.548988)" />
<path
sodipodi:type="star"
style="display:inline;fill:#ab231d;fill-opacity:1;fill-rule:evenodd;stroke:#ab231d;stroke-width:1.0016;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path2376"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="115"
sodipodi:cy="270"
sodipodi:r1="40.000004"
sodipodi:r2="24.287724"
sodipodi:arg1="1.5707963"
sodipodi:arg2="2.0943951"
inkscape:rounded="0"
inkscape:randomized="0"
transform="matrix(-7.6531787e-4,-0.28654272,0.28654047,-7.6530994e-4,-54.816109,74.056392)"
d="M 115,310 80.358981,290 80.35898,250 115,230 l 34.64102,20 0,40 z" />
<path
style="display:inline;fill:#dab82f;fill-opacity:1;stroke-width:1.7821;stroke-linecap:round;stroke-linejoin:round;paint-order:markers fill stroke"
id="path9871-0"
d="m 51.290209,24.661378 c 0.06813,-0.04434 0.139313,-0.08468 0.204411,-0.133017 0.707337,-0.526066 1.498335,-1.309612 2.004042,-1.97973 0.190982,-0.253076 0.347139,-0.522019 0.520708,-0.78303 0.262052,-0.519889 0.73164,-1.405151 0.304733,-1.863066 -0.126982,-0.136211 -0.31387,-0.243171 -0.524876,-0.260859 -0.881172,-0.07387 -2.050603,0.390377 -2.875777,0.638065 -2.450135,0.963662 -3.02362,1.142939 -5.737462,2.489326 -1.376626,0.682974 -4.725927,2.618726 -5.961425,3.338002 -2.57716,1.500361 -4.032983,2.387408 -6.588687,3.923362 -1.06058,0.649361 -2.126691,1.289981 -3.181743,1.948085 -1.726092,1.076694 -4.368744,2.780718 -6.076145,3.907225 -1.640185,1.082159 -3.570122,2.385172 -5.184891,3.523455 -0.725214,0.511217 -1.43886,1.037148 -2.15829,1.55572 -1.569214,1.184763 -3.17984,2.337107 -4.649971,3.630536 -0.442991,0.389746 -1.13435,1.046979 -1.5078105,1.529963 -0.1256906,0.162547 -0.2101781,0.343099 -0.3152668,0.514649 -0.014617,0.126926 -0.071886,0.263059 -0.04395,0.380762 0.065172,0.274572 0.3432357,0.351886 0.6241883,0.387038 0.765085,0.09573 1.588825,-0.237386 2.351599,-0.483667 0,0 1.098777,-0.634118 1.098777,-0.634118 v 0 c -0.460546,-0.06551 -0.235661,-0.05087 -0.78717,-0.04303 -0.258754,0.0037 -0.861893,0.0742 -1.002051,-0.174211 -0.04078,-0.07231 -0.02257,-0.169313 -0.03384,-0.25397 0.05833,-0.140035 0.0957,-0.285357 0.174963,-0.420098 0.286693,-0.48741 0.727263,-0.96086 1.139644,-1.368373 1.255548,-1.240725 2.682963,-2.332271 4.083015,-3.431188 1.867358,-1.398946 2.316281,-1.756661 4.28181,-3.136316 3.809841,-2.674227 7.747857,-5.170674 11.725022,-7.600607 3.297314,-1.983176 6.593331,-3.978976 9.980197,-5.805686 0.47592,-0.256683 3.340325,-1.776424 4.44246,-2.231104 0.634904,-0.261931 1.282421,-0.481284 1.923634,-0.721924 0.667965,-0.184859 1.824649,-0.567396 2.555436,-0.574512 0.703097,-0.0069 0.903359,0.49255 0.750227,1.070925 -0.06335,0.239271 -0.201987,0.470062 -0.30298,0.705094 -0.176227,0.255075 -0.332792,0.519792 -0.528675,0.765222 -0.678963,0.850686 -1.556495,1.575428 -2.508582,2.164606 0,0 1.804748,-0.573529 1.804749,-0.57353 z" />
<path
style="display:inline;fill:#267cc9;fill-opacity:1;stroke-width:1.7821;stroke-linecap:round;stroke-linejoin:round;paint-order:markers fill stroke"
id="path9871"
d="m 24.514377,8.0196868 c -0.0036,-0.081211 -0.0022,-0.1630167 -0.01083,-0.243639 C 24.409395,6.8995742 24.135879,5.8203088 23.815259,5.0444224 23.694173,4.7514037 23.541736,4.4803339 23.404975,4.1982902 23.090092,3.7085914 22.565777,2.8546038 21.954532,2.9899458 c -0.181817,0.040256 -0.368845,0.1469716 -0.491202,0.3197861 -0.510979,0.7216783 -0.704672,1.964892 -0.910181,2.8015689 -0.413577,2.6001459 -0.550253,3.185249 -0.767964,6.2068872 -0.110433,1.532761 -0.142966,5.401081 -0.150478,6.83068 -0.01566,2.982045 0.0095,4.686638 0.03541,7.668267 0.02105,1.243406 0.03176,2.487138 0.06315,3.730218 0.05137,2.033723 0.177927,5.175584 0.281704,7.218491 0.09969,1.962482 0.242567,4.28672 0.403514,6.255797 0.07228,0.884338 0.163116,1.766179 0.244673,2.649267 0.224119,1.953425 0.399286,3.92607 0.767327,5.849295 0.110902,0.57952 0.326172,1.508815 0.552701,2.075764 0.07624,0.190806 0.188902,0.355258 0.283353,0.532886 0.101912,0.07706 0.190146,0.19548 0.305737,0.231163 0.269645,0.08324 0.477417,-0.11708 0.65033,-0.341292 0.470873,-0.610573 0.602057,-1.489378 0.777101,-2.271579 0,0 0.01147,-1.268575 0.01147,-1.268575 v 0 c -0.290245,0.363527 -0.163449,0.177222 -0.436687,0.656349 -0.128197,0.224795 -0.373619,0.780238 -0.658791,0.774886 -0.083,-0.0016 -0.157329,-0.06651 -0.235993,-0.09977 -0.09104,-0.121334 -0.197268,-0.227315 -0.273122,-0.364002 -0.27439,-0.494442 -0.458636,-1.114368 -0.600384,-1.676536 -0.43157,-1.711593 -0.647363,-3.495526 -0.883397,-5.259626 -0.257297,-2.319026 -0.33759,-2.887396 -0.528428,-5.281207 -0.369909,-4.639995 -0.521582,-9.300167 -0.596074,-13.960303 -0.03472,-3.847605 -0.08097,-7.700501 0.06458,-11.545828 0.02046,-0.540341 0.165246,-3.779702 0.33302,-4.9600775 0.09665,-0.6799791 0.236378,-1.3492097 0.354567,-2.0238137 0.179832,-0.6693367 0.437452,-1.860086 0.802311,-2.4933138 0.351034,-0.6092367 0.882958,-0.5282521 1.303523,-0.1027019 0.173984,0.17605 0.302446,0.4126537 0.453671,0.6189815 0.130299,0.28132 0.278888,0.5505961 0.390898,0.843955 0.388235,1.0168237 0.567157,2.1407899 0.591434,3.2601689 0,0 0.422065,-1.8460517 0.422065,-1.8460527 z" />
<path
id="path9871-7"
style="fill:#ab231d;fill-opacity:1;stroke-width:1.67983;stroke-linecap:round;stroke-linejoin:round;paint-order:markers fill stroke"
d="m 9.6198192,12.493488 c 0.0021,0.0955 0.01985,0.196647 0.04313,0.296052 0.169013,0.721871 0.7272528,1.351126 1.1903648,1.954689 l 0.907948,0.774254 c -0.09495,-0.437207 -0.03367,-0.229673 -0.221731,-0.723924 -0.08825,-0.231887 -0.347154,-0.751369 -0.179067,-0.962064 0.04894,-0.06131 0.13833,-0.0779 0.20761,-0.11684 0.139903,0.0049 0.277457,-0.01026 0.419684,0.01526 0.51448,0.09269 1.067539,0.328738 1.554457,0.561815 1.482484,0.709638 2.892894,1.624786 4.30063,2.512815 1.820048,1.207114 2.276321,1.489975 4.112009,2.792092 3.558173,2.523941 7.005007,5.223746 10.407573,7.981457 2.793876,2.296977 5.598396,4.588321 8.286818,7.019151 0.377771,0.341584 2.629473,2.406246 3.383831,3.244765 0.434564,0.483043 0.836502,0.991944 1.254784,1.487902 0.378985,0.539021 1.089008,1.450834 1.335407,2.106854 0.237064,0.631165 -0.127672,0.981342 -0.676668,1.039902 -0.227119,0.02422 -0.471269,-0.02225 -0.707106,-0.03338 -0.277854,-0.07211 -0.55767,-0.122855 -0.833676,-0.215907 -0.956645,-0.322674 -1.86982,-0.867162 -2.690805,-1.524784 0,0 1.087633,1.431204 1.087636,1.431204 0.06064,0.04632 0.118569,0.09642 0.181643,0.138651 0.686101,0.458548 1.621751,0.905156 2.365754,1.133087 0.280982,0.08607 0.564393,0.135259 0.846488,0.202951 0.53438,0.05944 1.451736,0.181845 1.706172,-0.358405 0.07569,-0.160694 0.10688,-0.365543 0.05275,-0.561668 C 47.729441,41.87038 46.944316,40.974466 46.459476,40.31515 44.823107,38.435042 44.480179,37.979463 42.427148,35.991805 41.385719,34.983552 38.615865,32.623384 37.589538,31.754615 35.448693,29.942431 34.205092,28.932363 32.040613,27.151606 31.132069,26.41668 30.229432,25.673595 29.315172,24.946624 27.819404,23.757286 25.481303,21.95537 23.948731,20.799802 22.476492,19.68972 20.718672,18.39374 19.2064,17.325633 c -0.679178,-0.479702 -1.367442,-0.943701 -2.051061,-1.415692 -1.537365,-1.011265 -3.060173,-2.071033 -4.658647,-2.956102 -0.481666,-0.266694 -1.275778,-0.666531 -1.814969,-0.838895 -0.181463,-0.05801 -0.36498,-0.07249 -0.54744,-0.108848 -0.114229,0.0299 -0.2505028,0.02423 -0.3428048,0.08938 -0.134559,0.095 -0.17514,0.238823 -0.171655,0.397998 z" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="G"
style="display:none"
transform="translate(-13.661107,-56.524581)">
<path
style="fill:#280b0b;fill-rule:evenodd;stroke-width:1.17527;paint-order:stroke fill markers"
id="path5061"
d="m 47.194037,73.534828 c -0.152935,-0.02949 -0.303017,-0.07937 -0.458813,-0.08853 -0.679709,-0.03995 -1.768198,0.04518 -2.38881,0.11554 -1.223064,0.138665 -2.765059,0.390668 -3.937257,0.684792 -0.839978,0.210771 -1.660405,0.485814 -2.490608,0.728716 -0.884544,0.345283 -1.788596,0.648962 -2.653642,1.035841 -0.909546,0.406787 -1.800807,0.853166 -2.663731,1.342296 -2.412915,1.367704 -4.486744,2.51416 -6.405435,4.408919 -1.866912,1.843619 -1.990901,2.396542 -3.238075,4.575011 -0.561878,1.750705 -1.088708,2.71144 -0.869682,4.565477 0.159213,1.34766 0.874773,2.787172 1.786272,3.822154 1.216923,1.381785 1.925136,1.542456 3.563057,2.363074 0.716128,0.18719 1.414128,0.45402 2.148385,0.56157 1.476245,0.21625 3.235625,0.10133 4.696908,-0.14504 1.121152,-0.18903 2.97206,-0.68308 4.011344,-1.196472 1.272067,-0.62838 2.47331,-1.377211 3.709964,-2.065815 0.35181,-0.337103 0.758836,-0.629743 1.055436,-1.011317 0.72856,-0.937278 0.897486,-2.100108 0.141797,-3.080578 -0.595431,-0.772532 -1.342216,-1.055858 -2.19073,-1.515049 -1.235002,-0.55263 -2.558697,-0.827258 -3.893906,-1.051661 -0.275889,-0.04638 -0.552772,-0.08735 -0.829558,-0.128686 -0.131541,-0.01964 -0.282401,-0.120898 -0.39539,-0.05429 -0.895481,0.527899 -1.693943,1.190186 -2.540911,1.785276 0.284581,-2.67e-4 0.56979,0.01702 0.853743,-8.46e-4 0.506251,-0.03178 1.009926,-0.09368 1.514041,-0.147908 1.126082,-0.121137 2.736584,-0.297869 3.82806,-0.538812 0.754661,-0.166597 1.489563,-0.404875 2.234347,-0.60731 0,0 0.920256,-0.654146 0.920256,-0.654146 v 0 c -0.434883,-0.01503 -0.869794,-0.06071 -1.304655,-0.04507 -0.581879,0.02095 -1.159157,0.106441 -1.739228,0.154544 -1.18152,0.09798 -2.372701,0.217893 -3.559116,0.102923 -0.916483,0.5683 -1.884337,1.068757 -2.74944,1.704899 -0.141003,0.10369 0.351958,-0.06499 0.53043,-0.07318 1.681682,-0.07713 3.345531,0.304805 4.880908,0.931638 0.799,0.46379 1.416078,0.69572 1.942346,1.458546 0.592972,0.859518 0.458921,1.949721 -0.173001,2.750154 -0.276772,0.350576 -0.658067,0.615269 -0.987097,0.922899 0.245124,-0.103658 0.98509,-0.404324 0.73537,-0.310969 -0.632522,0.236462 -1.240205,0.533554 -1.884228,0.74046 -2.149245,0.690501 -4.511087,1.07065 -6.77952,0.758774 -0.721485,-0.0992 -1.411354,-0.346295 -2.11703,-0.519443 -1.640635,-0.805623 -2.245832,-0.913379 -3.477641,-2.270221 -0.96095,-1.05849 -1.587822,-2.272955 -1.78689,-3.664295 -0.259956,-1.816874 0.168031,-2.613401 0.657162,-4.361084 0.425327,-0.759815 0.774863,-1.562071 1.275982,-2.279451 1.429152,-2.045916 2.143593,-2.436091 4.081957,-4.040224 0.316886,-0.262247 0.59847,-0.570258 0.955512,-0.781482 2.025704,-1.198385 3.09556,-1.525226 5.269798,-2.384256 0.818076,-0.241442 1.624513,-0.521413 2.454228,-0.724331 2.130308,-0.520981 4.327258,-0.63021 6.515425,-0.60327 0,0 1.751669,-1.169825 1.751669,-1.169825 z" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="MA flèche."
style="display:none"
transform="translate(-13.661107,-56.524581)">
<path
style="fill:#280b0b;fill-rule:evenodd;stroke-width:0.714375;paint-order:stroke fill markers"
id="path5381"
d="m 43.971768,67.441733 c 0.05775,-0.05692 0.128513,-0.10313 0.173233,-0.170768 0.162618,-0.245951 0.183602,-0.539006 0.142486,-0.828781 -0.09153,-0.64507 -0.379521,-1.25381 -0.74368,-1.786699 -0.278135,-0.407003 -0.621742,-0.765165 -0.932614,-1.147747 -0.450882,-0.405614 -0.862005,-0.860351 -1.352645,-1.216845 -1.287082,-0.935183 -2.942582,-1.738318 -4.427165,-2.263733 -0.917008,-0.324543 -1.849646,-0.624866 -2.806599,-0.799441 -1.090528,-0.198943 -2.202138,-0.296621 -3.310485,-0.316486 -1.191779,-0.02135 -2.380459,0.128775 -3.570687,0.193161 -2.978677,0.600305 -4.348873,0.689899 -7.132609,2.001306 -2.3177,1.091861 -4.55482,2.649093 -6.378025,4.451165 -2.382225,2.354611 -2.702801,3.298848 -4.3978662,6.138915 -0.4674116,1.161381 -1.0514803,2.282373 -1.4022345,3.484142 -1.0595501,3.630274 -1.0911387,7.625418 -0.1579766,11.283489 0.7927453,3.107624 1.3487625,3.662474 2.9042413,6.375218 0.712228,0.809061 1.317105,1.727083 2.136684,2.427181 2.53145,2.162405 5.947581,3.105748 9.228512,3.024735 1.241056,-0.03064 2.463828,-0.306895 3.695742,-0.460343 0,0 0.09928,-0.07358 0.09928,-0.07358 v 0 c -2.671283,0.166076 -3.99527,0.424982 -6.652684,-0.114218 -2.190671,-0.444487 -4.12383,-1.265971 -5.870705,-2.680129 C 12.373736,94.280457 11.718647,93.395442 10.969984,92.612026 9.2992188,89.965113 8.7163994,89.46231 7.8613245,86.364388 6.8532454,82.712133 6.8825493,78.773096 7.9329999,75.133609 8.2780046,73.938275 8.8494477,72.82027 9.3076717,71.663601 c 1.6956393,-2.839193 2.0162173,-3.782898 4.3989143,-6.136438 1.768459,-1.746817 3.932715,-3.27863 6.188337,-4.330804 2.846376,-1.32774 4.023184,-1.364813 7.059864,-1.953508 1.151167,-0.03817 2.302893,-0.166849 3.453505,-0.11452 1.059299,0.04818 2.118246,0.187725 3.153987,0.415039 0.920022,0.201917 1.816873,0.512402 2.689336,0.867391 1.484852,0.604155 2.847912,1.409907 4.055237,2.464565 0.44142,0.385604 0.798965,0.8578 1.198449,1.286703 0.260638,0.401082 0.559003,0.780034 0.781915,1.203248 0.34776,0.66026 0.651515,1.57521 0.414351,2.331429 -0.03269,0.104254 -0.148834,0.23331 -0.227269,0.325612 0,0 1.49747,-0.580585 1.49747,-0.580585 z" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="flèches test 2"
style="display:none"
transform="translate(-13.661107,-56.524581)">
<path
id="path5852"
style="fill:#00aad4;fill-rule:evenodd;stroke-width:0.7248;paint-order:stroke fill markers"
d="m 50.580764,54.861594 c -0.383603,-0.005 -0.77888,0.07138 -1.287258,0.111107 -1.874245,0.651097 -2.342838,0.725278 -4.327901,1.972487 -0.689613,0.433284 -1.31721,0.977789 -1.9451,1.51257 -1.517796,1.292717 -3.049527,2.833153 -4.398698,4.323768 -0.817769,0.903499 -1.592527,1.852438 -2.389002,2.778641 -0.83879,1.143696 -1.708346,2.261386 -2.516643,3.431315 -1.755545,2.540987 -3.421721,5.256226 -4.944401,7.971089 -1.407287,2.509125 -2.971334,5.531485 -4.117061,8.208285 -0.56369,1.316968 -1.03426,2.680022 -1.551327,4.019909 -1.100202,3.23337 -2.105667,6.531425 -2.63188,9.94513 -0.125572,0.814615 -0.20428,1.637865 -0.265617,2.461345 -0.132345,1.77678 -0.07198,1.98397 0.0217,3.64009 0.117922,0.57137 0.195279,1.52028 0.671277,1.96681 0.446437,0.4188 1.168872,0.36164 1.665531,0.16898 2.315055,-0.89821 2.133343,-0.86017 3.599263,-1.96681 0.477516,-0.4782 1.302372,-1.28394 1.734779,-1.80351 0.226247,-0.27184 0.418581,-0.57572 0.627869,-0.86351 l -0.0739,0.0233 c -0.413872,0.35083 -0.827506,0.70116 -1.241268,1.05213 -1.661328,1.4092 -0.790098,0.71713 -2.559017,2.03244 -0.253318,0.16511 -0.531689,0.29319 -0.784965,0.45837 -0.151864,0.0688 -0.315908,0.17757 -0.464571,0.17673 -1.059091,-0.006 -1.307301,-1.01867 -1.614889,-1.91461 -0.08572,-0.50496 -0.203668,-1.0043 -0.256832,-1.51464 -0.14601,-1.40156 -0.127626,-2.93146 -0.01499,-4.326867 0.161498,-2.000666 0.496653,-4.072306 0.965833,-6.008418 0.300623,-1.240554 0.691436,-2.452568 1.037146,-3.678846 0.48515,-1.327261 0.924648,-2.675572 1.455208,-3.98167 1.094955,-2.695487 2.533233,-5.627015 3.928958,-8.139554 1.493179,-2.687981 3.273555,-5.522076 5.042069,-8.001579 0.847561,-1.188299 1.764798,-2.314033 2.647384,-3.471106 0.812311,-0.930299 1.598216,-1.889649 2.437061,-2.791042 1.363729,-1.465421 3.131672,-3.158582 4.686536,-4.401283 0.699849,-0.559345 1.438171,-1.057997 2.170411,-1.564761 0.273775,-0.189476 0.545915,-0.389927 0.845942,-0.522965 0.485113,-0.215112 0.998426,-0.3443 1.497584,-0.51625 0.941832,-0.07425 1.493787,-0.27229 2.369365,0.22066 0.330827,0.186259 0.61255,0.474774 0.862478,0.777214 0.591928,0.716287 0.964321,1.598652 1.199412,2.521809 0.133739,0.525175 0.180231,1.072899 0.270266,1.609204 0.02093,0.554861 0.07791,1.109422 0.06253,1.664497 -0.01431,0.51627 -0.08052,1.029877 -0.151413,1.540475 -0.178186,1.282975 -0.494784,2.565691 -1.061434,3.70985 l 1.534274,-0.550352 c 0.378547,-1.66502 0.630994,-3.377803 0.664043,-5.096848 0.01085,-0.564105 -0.02061,-1.128287 -0.03101,-1.692402 -0.07658,-0.548011 -0.113464,-1.104384 -0.22996,-1.643828 -0.201898,-0.934899 -0.529145,-1.875623 -1.086238,-2.632913 -0.236541,-0.321543 -0.505868,-0.633 -0.833541,-0.836126 -0.462113,-0.286472 -0.834409,-0.373258 -1.218015,-0.378272 z" />
<path
id="path5902"
style="fill:#ff7f2a;fill-rule:evenodd;stroke-width:0.630357;paint-order:stroke fill markers"
d="m 13.900892,75.502767 c -0.05938,-0.0011 -0.118877,-7.94e-4 -0.177767,0.0047 -0.546328,0.04895 -1.249165,0.180549 -1.757516,0.290939 -0.845372,0.18357 -1.788657,0.431675 -2.6019081,0.679029 -0.4679362,0.142327 -0.9264012,0.302768 -1.3895792,0.454234 -1.2701296,0.491239 -2.0021941,0.723643 -3.1998046,1.490866 -0.3019258,0.193421 -0.560388,0.439545 -0.7358724,0.711584 -0.1580843,0.245068 -0.3012541,0.530953 -0.2397786,0.800986 0.2152168,0.945341 1.3861531,1.46838 2.2065834,2.019515 0.7993292,0.371985 1.5672252,0.787799 2.3977864,1.115695 2.2003001,0.868648 4.8312781,1.604237 7.1747561,2.142503 1.519507,0.349012 3.054567,0.659889 4.601786,0.92501 3.380123,0.579186 7.532289,1.051276 10.940416,1.472776 4.454605,0.423484 6.247098,0.645314 10.670151,0.870749 1.566847,0.07986 3.137151,0.120047 4.706689,0.155546 1.51878,0.03435 5.183235,0.06461 6.89002,0.0078 0.694232,-0.02312 1.384985,-0.09093 2.077392,-0.136424 1.447961,-0.287345 2.13329,-0.294275 3.30264,-1.414383 0.18696,-0.179086 0.01169,-0.477136 -0.113689,-0.686263 -0.244393,-0.407673 -1.289336,-1.133631 -1.753381,-1.307415 -0.147785,-0.05535 -0.301603,-0.09826 -0.457853,-0.136424 0.117697,0.07253 0.209759,0.182218 0.31161,0.276468 0.41097,0.380302 0.460653,0.423897 0.774113,0.809768 0.354991,0.436996 0.263464,0.289899 0.429432,0.594281 0.02671,0.07295 0.131913,0.262882 0.09508,0.378788 -0.0263,0.08272 -0.06853,0.15966 -0.109553,0.236161 -0.0052,0.0098 -0.01839,0.01262 -0.02739,0.01913 -0.0021,0.0013 -0.0039,0.0034 -0.0062,0.0057 -0.01868,0.06898 -0.04505,0.136785 -0.08526,0.194821 -0.03005,0.04335 -0.132156,0.06317 -0.248047,0.0739 -0.0057,0.01267 -0.0074,0.02077 -0.01447,0.03514 -0.0073,0.01474 -0.0191,0.02668 -0.03256,0.03772 0.30294,-0.07243 0.582663,-0.185004 0.419097,-0.107487 -0.222115,0.10527 -0.466,0.175705 -0.714168,0.239263 -0.0016,0.0063 -0.0024,0.01283 -0.0041,0.01913 -0.0053,0.01998 -0.03155,0.0088 -0.05685,-0.0026 -0.03115,0.0078 -0.06122,0.01725 -0.0925,0.02479 -0.03724,0.0098 -0.07731,0.01995 -0.125574,0.03152 -0.19191,0.04552 -0.385082,0.0889 -0.571539,0.143145 -0.810416,0.116102 -1.614191,0.26588 -2.431378,0.348298 -2.489295,0.251063 -4.874469,0.309967 -7.390762,0.279053 -5.148701,-0.0634 -10.277188,-0.49431 -15.375823,-1.025924 C 29.348294,87.336754 27.499973,87.146283 25.674346,86.860686 22.561469,86.373715 19.221058,85.666071 16.196372,84.887162 13.754903,84.258443 11.500339,83.607301 9.2474422,82.646472 8.4506797,82.306665 7.7209261,81.879236 6.9576595,81.495637 6.2836925,80.980139 5.1531914,80.335643 4.9324601,79.508164 c -0.03267,-0.122478 -0.034864,-0.234384 -0.014986,-0.338481 0.00359,-0.18151 0.019971,-0.176255 0.1038696,-0.344684 0.1640695,-0.263128 0.1096889,-0.203168 0.2930054,-0.407209 0.058642,-0.06527 0.1161214,-0.131353 0.1788004,-0.192752 0.00122,-0.0013 0.00288,-0.0019 0.00414,-0.0031 0.00567,-0.0062 0.011636,-0.0122 0.017571,-0.0181 0.021439,-0.02133 0.046669,-0.03796 0.07028,-0.05685 0.046792,-0.03742 0.093938,-0.07475 0.1431435,-0.108003 0.04413,-0.04101 0.091399,-0.06514 0.147278,-0.0894 0.00386,-0.0016 0.00767,-0.003 0.011369,-0.0041 0.00925,-0.01048 0.016378,-0.02249 0.030489,-0.02945 0.400263,-0.197601 0.8454358,-0.333861 1.2681397,-0.500745 0.4377661,-0.137829 0.8711104,-0.28508 1.3136149,-0.413411 0.8224134,-0.238509 1.5586414,-0.41729 2.4070884,-0.576194 0.643359,-0.120489 1.0135,-0.15648 1.64021,-0.238744 0.149614,-0.01963 0.299098,-0.04061 0.448552,-0.06098 l 1.08417,-0.620633 c -0.05928,2.65e-4 -0.118909,-0.0016 -0.178284,-0.0026 z m 40.756684,9.512083 c 0.01352,0.0136 0.02625,0.02775 0.03979,0.04134 0.09605,0.02021 0.191669,0.04322 0.286805,0.06821 -0.108259,-0.03947 -0.217215,-0.07534 -0.326596,-0.109553 z m 1.517737,0.823722 c 0.05162,0.0471 0.105056,0.09224 0.15503,0.141075 -0.05709,-0.05467 -0.109723,-0.103076 -0.15503,-0.141075 z m 0.192754,0.177765 c 0.266166,0.266372 0.494906,0.571302 0.749824,0.848011 0.0038,0.0059 0.02831,0.04017 0.04083,0.05684 5.29e-4,-0.01278 2.64e-4,-0.0231 -0.0016,-0.02687 -0.03487,-0.06838 -0.105976,-0.11117 -0.153995,-0.171048 -0.06281,-0.07832 -0.118954,-0.161891 -0.178285,-0.242879 -0.0928,-0.09506 -0.284781,-0.296784 -0.456819,-0.464056 z" />
<path
id="path5906"
style="fill:#a02c2c;fill-rule:evenodd;stroke-width:0.766506;paint-order:stroke fill markers"
d="m 13.647225,55.974874 c -0.95397,-0.01873 -1.910408,0.767466 -2.43551,1.246436 -0.192447,0.17554 -0.235527,0.430342 -0.303857,0.671793 -0.0066,0.03381 -0.01307,0.06767 -0.02067,0.101285 -0.0106,0.04686 -0.02224,0.09341 -0.03359,0.140044 -3.7e-4,0.0021 -6.61e-4,0.0035 -10e-4,0.0057 -0.0084,0.439891 -0.05294,0.881558 -0.01188,1.319298 0.05798,0.61827 0.17734,1.231119 0.31626,1.838647 0.388904,1.700753 0.881911,3.078107 1.507402,4.734595 1.020323,2.702136 1.28219,3.183617 2.500622,5.936588 0.509506,1.13588 1.00614,2.27624 1.528589,3.407545 1.193103,2.583527 2.186784,4.670462 3.608049,7.174756 1.451115,2.556889 3.045887,5.018278 4.714956,7.469312 0.77166,1.133171 1.580192,2.246479 2.370399,3.369818 1.861506,2.766793 3.829529,5.484683 5.991882,8.080639 0.85168,1.02247 2.162622,2.50383 3.179651,3.46026 0.404535,0.38038 0.856139,0.72111 1.28416,1.08159 0.910823,0.46467 1.211078,0.75697 2.260844,0.82062 0.310859,0.0188 0.631605,-0.0131 0.930693,-0.0935 0.52552,-0.14139 1.271103,-0.69238 1.86862,-1.19631 -0.138748,0.0484 -0.279945,0.0932 -0.374656,0.12764 -0.652457,0.23725 -1.453875,0.23139 -2.117182,0.0765 -0.464331,-0.10843 -0.888111,-0.31729 -1.33222,-0.47594 -0.498075,-0.31356 -1.023741,-0.59668 -1.493964,-0.94102 -1.280417,-0.93765 -2.500635,-2.11906 -3.568258,-3.22358 -2.376549,-2.458682 -4.482979,-5.102705 -6.552573,-7.760246 -0.79016,-1.123278 -1.598782,-2.236711 -2.370397,-3.369821 -1.539602,-2.260899 -3.394751,-5.104876 -4.714441,-7.468793 -1.34098,-2.402054 -2.405407,-4.745826 -3.470589,-7.24762 -0.489842,-1.150493 -0.939118,-2.314046 -1.4087,-3.471106 -0.396297,-1.091861 -1.781844,-4.87394 -2.181262,-6.102469 -0.524561,-1.613445 -1.041168,-3.307059 -1.25677,-5.00848 -0.05184,-0.246809 -0.09613,-0.495335 -0.130742,-0.745176 -0.02412,-0.20098 -0.04591,-0.403381 -0.03721,-0.606163 5.29e-4,-0.01212 0.0029,-0.0223 0.0062,-0.03101 -0.0038,-0.04418 -0.0066,-0.08848 -0.0072,-0.132808 -0.0044,-0.309292 0.0018,-0.31641 0.02015,-0.626835 0.0098,-0.127135 0.01693,-0.254481 0.02946,-0.381373 0.0041,-0.04165 0.01307,-0.08286 0.02067,-0.124023 0.04812,-0.261715 0.109155,-0.52102 0.182934,-0.776698 0.008,-0.02789 0.02109,-0.04671 0.03566,-0.05788 0.0057,-0.01455 0.0063,-0.03066 0.01292,-0.04496 0.05643,-0.122801 0.03556,-0.09066 0.08733,-0.159163 0.03115,-0.04102 0.06116,-0.08289 0.09663,-0.120407 0.04364,-0.04617 0.09613,-0.08346 0.149862,-0.116789 0.02179,-0.01352 0.04231,-0.01945 0.05943,-0.01963 0.0015,0 0.0027,-3.2e-5 0.0041,0 0.04213,-0.0095 0.08446,-0.01667 0.126607,-0.01601 1.322397,0.01995 2.355981,0.916221 3.315043,1.563211 0.38241,0.332304 0.78279,0.649592 1.147217,0.996839 0.586986,0.559316 1.33994,1.391389 1.807125,2.048455 0.323479,0.454951 0.558248,0.961326 0.778764,1.459857 L 21.22868,61.99003 C 21.087885,61.792482 20.900241,61.520524 20.742922,61.349241 20.537811,61.125919 20.31145,60.918269 20.096966,60.701737 19.289824,59.886868 18.98196,59.543531 18.095021,58.7494 c -0.379237,-0.339553 -0.777873,-0.662101 -1.166854,-0.993222 -0.860053,-0.609714 -1.916495,-1.605227 -3.09025,-1.766816 -0.06345,-0.0087 -0.127088,-0.01323 -0.190686,-0.01447 z m 29.255579,49.569066 c 0.260734,-0.0909 0.504876,-0.19892 0.359667,-0.30644 -0.0013,-10e-4 -0.0024,-0.002 -0.0036,-0.003 -0.110098,0.0989 -0.228145,0.20115 -0.356049,0.30903 z m 0.35605,-0.30902 c 0.31151,-0.27976 0.545616,-0.51105 0.60048,-0.58033 0.250232,-0.31599 0.125283,-0.75577 0.188103,-1.13378 -0.0084,-0.94374 0.02339,-1.95697 -0.159163,-2.88975 -0.09373,-0.47891 -0.281665,-0.939138 -0.422714,-1.408697 l -0.0801,0.03979 c -0.126992,0.601723 -0.276707,1.200297 -0.380857,1.805057 -0.0958,0.5563 -0.145746,1.11722 -0.218591,1.67587 -0.08769,0.4993 -0.175353,0.9988 -0.263033,1.4981 -0.887127,2.85991 -0.465799,0.11039 0.735872,0.99374 z" />
<path
style="fill:#a0a0a0;stroke:none;stroke-width:0.158245"
d=""
id="path7782"
transform="scale(0.26458333)" />
<path
style="fill:#a0a0a0;stroke:none;stroke-width:0.158245"
d=""
id="path7821"
transform="scale(0.26458333)" />
<path
style="fill:#a02c2c;fill-opacity:1;stroke:none;stroke-width:0.0296006"
d="m 11.641617,57.15 c -0.01479,-0.06852 0.01315,0.06065 5e-5,0 z"
id="path37999"
inkscape:transform-center-x="-0.04769897"
inkscape:transform-center-y="0.93565869"
sodipodi:nodetypes="ccc" />
<path
id="path49005"
clip-path="url(#clipPath66549)"
style="fill:none;stroke:#000000;stroke-width:0.999999px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
transform="scale(0.26458333)"
d="m 48.041016,215.17773 -2,1 c 0.655801,-0.2448 1.293277,-0.56448 1.974609,-0.72656 0.15617,-0.037 0.61754,-0.062 0.466797,-0.11719 -0.146608,-0.0536 -0.294262,-0.10416 -0.441406,-0.15625 z" />
</g>
<g
inkscape:groupmode="layer"
id="layer7"
inkscape:label="flèches test 4"
style="display:none"
transform="translate(-11.57442,-3.1941091)">
<g
inkscape:groupmode="layer"
id="layer6"
inkscape:label="flèches test 3"
transform="translate(-2.0866871,-53.330472)"
style="display:none">
<path
id="path175"
style="display:inline;fill:#ecb41a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.276002;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;paint-order:stroke fill markers"
d="m 32.00153,53.857243 c -0.258918,0.187592 -0.491347,0.445564 -0.814943,0.730945 -0.980303,1.452359 -1.262744,1.745197 -2.06597,3.725697 -0.279042,0.688027 -0.469685,1.433302 -0.664623,2.171008 -0.471228,1.783256 -0.847366,3.769946 -1.122296,5.625953 -0.16664,1.124973 -0.28533,2.26451 -0.428145,3.396858 -0.07947,1.325979 -0.190498,2.6467 -0.238494,3.978261 -0.104239,2.892032 -0.07519,5.877645 0.04972,8.791302 0.115473,2.692852 0.342338,5.871054 0.703594,8.56628 0.177742,1.326038 0.437237,2.64212 0.655846,3.96305 0.626331,3.113934 1.343351,6.231873 2.429959,9.202203 0.259296,0.7088 0.553609,1.40106 0.859643,2.08483 0.66032,1.47534 0.788067,1.60951 1.548841,2.87626 0.319777,0.39431 0.771533,1.10831 1.278415,1.22475 0.475396,0.10922 0.934952,-0.29687 1.186242,-0.69769 1.17125,-1.86848 1.065634,-1.74756 1.580563,-3.35734 0.118114,-0.61772 0.330708,-1.66871 0.401189,-2.29672 0.03688,-0.32861 0.03756,-0.66569 0.05636,-0.99846 l -0.03965,0.0553 c -0.129196,0.48495 -0.258445,0.96936 -0.387511,1.45436 -0.518219,1.94732 -0.22667,0.96334 -0.856492,2.88993 -0.100004,0.25744 -0.232366,0.49804 -0.332303,0.75551 -0.07267,0.1304 -0.136648,0.29861 -0.236522,0.37218 -0.711541,0.52415 -1.304568,-0.15512 -1.888137,-0.71209 -0.270231,-0.35771 -0.559664,-0.69484 -0.810367,-1.07307 -0.688511,-1.03872 -1.321063,-2.26136 -1.833828,-3.42435 -0.73517,-1.66747 -1.384002,-3.477933 -1.88598,-5.247829 -0.321641,-1.134052 -0.570873,-2.290511 -0.856313,-3.435762 -0.234654,-1.294978 -0.508744,-2.583854 -0.704077,-3.884722 -0.403125,-2.684697 -0.675899,-5.728052 -0.800553,-8.41784 -0.133358,-2.877601 -0.136039,-6.014513 0.0027,-8.864256 0.06653,-1.365738 0.206096,-2.716648 0.309248,-4.075109 0.151683,-1.143505 0.273455,-2.296866 0.455092,-3.430695 0.295292,-1.843294 0.765193,-4.069073 1.282319,-5.831168 0.232762,-0.793122 0.516858,-1.557324 0.793463,-2.324918 0.103415,-0.287001 0.201119,-0.581884 0.345897,-0.837227 0.234096,-0.412868 0.52329,-0.771664 0.784981,-1.157312 0.599228,-0.529215 0.885266,-0.96192 1.679219,-1.00818 0.299986,-0.01746 0.610201,0.07067 0.904998,0.185744 0.698194,0.272526 1.319419,0.786403 1.865917,1.401201 0.310896,0.349751 0.572889,0.760957 0.859219,1.141364 0.247886,0.429633 0.519783,0.841026 0.743456,1.288956 0.208031,0.416619 0.380194,0.857047 0.54795,1.297426 0.421489,1.106561 0.750209,2.282038 0.853123,3.472489 l 0.795167,-1.202681 C 38.560014,60.722067 38.007072,59.237524 37.304616,57.857572 37.074102,57.404738 36.815239,56.972971 36.570499,56.530743 36.288243,56.134335 36.029034,55.711472 35.723666,55.34179 35.194441,54.701105 34.57884,54.118394 33.886686,53.795952 33.592797,53.659047 33.28121,53.546508 32.976229,53.54903 c -0.430119,0.0037 -0.715939,0.120634 -0.974863,0.308219 z" />
<path
id="path175-3"
style="display:inline;fill:#ecb41a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.276002;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;paint-order:stroke fill markers"
d="m 60.009276,61.920503 c 0.01058,0.319558 -0.05067,0.661348 -0.07767,1.091961 -0.54614,1.664954 -0.604269,2.06763 -1.676186,3.916561 -0.372383,0.642321 -0.844197,1.249916 -1.307397,1.856263 -1.119689,1.465726 -2.458387,2.981084 -3.755914,4.336359 -0.786465,0.821465 -1.613838,1.613984 -2.420738,2.421151 -0.9987,0.875864 -1.973894,1.773432 -2.9963,2.627857 -2.220582,1.85573 -4.596817,3.663556 -6.974993,5.351535 -2.197971,1.560036 -4.847638,3.329698 -7.198197,4.697039 -1.156467,0.672721 -2.3552,1.274757 -3.532692,1.912063 -2.843851,1.414703 -5.746478,2.760222 -8.759134,3.72328 -0.718902,0.22981 -1.446209,0.421816 -2.173999,0.599357 -1.570321,0.38307 -1.75464,0.364432 -3.221788,0.540244 -0.507564,-0.01081 -1.348589,0.07016 -1.751387,-0.258843 -0.377788,-0.308555 -0.338805,-0.920586 -0.176276,-1.364869 0.757758,-2.070954 0.727003,-1.913376 1.682861,-3.307248 0.415528,-0.472086 1.115373,-1.284486 1.568238,-1.725255 0.236964,-0.230636 0.502816,-0.43787 0.754152,-0.656775 l -0.01937,0.06523 c -0.303853,0.399426 -0.607247,0.798563 -0.91122,1.197917 -1.220474,1.60345 -0.621977,0.769772 -1.757641,2.448668 -0.142037,0.236858 -0.250926,0.488952 -0.393033,0.725772 -0.0584,0.137387 -0.152092,0.291048 -0.148961,0.415056 0.02227,0.883475 0.922493,0.935397 1.720303,1.054842 0.44827,-0.0059 0.892059,0.01602 1.344565,-0.01787 1.242709,-0.09307 2.596387,-0.343115 3.829493,-0.65121 1.767988,-0.441758 3.595986,-1.039398 5.301892,-1.728169 1.093051,-0.441326 2.1594,-0.953589 3.239098,-1.430377 1.166831,-0.608719 2.353023,-1.182544 3.500393,-1.825935 2.367917,-1.327811 4.939216,-2.978518 7.140395,-4.529424 2.354876,-1.659196 4.834457,-3.580627 7.000477,-5.437679 1.038041,-0.890022 2.019582,-1.828645 3.029418,-2.743134 0.810275,-0.821014 1.646678,-1.624444 2.430943,-2.463187 1.274999,-1.363564 2.745064,-3.099596 3.819894,-4.588603 0.483781,-0.670206 0.913238,-1.363229 1.34997,-2.052415 0.163296,-0.257679 0.336321,-0.51568 0.449249,-0.786618 0.182593,-0.438088 0.28868,-0.886545 0.432846,-1.329741 0.0506,-0.797861 0.217005,-1.289145 -0.233303,-1.944678 -0.170159,-0.247674 -0.429999,-0.438681 -0.701668,-0.600987 -0.643407,-0.384413 -1.430268,-0.560027 -2.251027,-0.614728 -0.466919,-0.03112 -0.952396,0.01408 -1.428468,0.02116 -0.491382,0.06764 -0.983081,0.105123 -1.474069,0.203107 -0.456664,0.09114 -0.910141,0.225214 -1.360877,0.362738 -1.132561,0.345596 -2.262675,0.80673 -3.266153,1.455418 l 0.462438,-1.365607 c 1.467466,-0.571463 2.979212,-1.044997 4.500021,-1.336291 0.499057,-0.09559 0.998857,-0.155862 1.49826,-0.233708 0.486213,-0.02012 0.979191,-0.07466 1.458465,-0.06013 0.830616,0.02518 1.668402,0.154148 2.347536,0.503179 0.288358,0.148201 0.568319,0.325324 0.753341,0.567785 0.260826,0.342031 0.343721,0.639513 0.354313,0.959072 z" />
</g>
<path
id="path173"
style="display:inline;fill:#ecc73b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.84;paint-order:stroke fill markers"
d="M 6.4723148,7.5892923 C 6.7534122,7.4434529 7.0822553,7.3723636 7.4770761,7.224129 c 1.697985,-0.056717 2.079947,-0.1569007 4.1461889,0.324266 0.717816,0.1671598 1.443223,0.4650624 2.164179,0.7534185 1.742755,0.6970373 3.614807,1.6293987 5.327999,2.5804805 1.038411,0.576478 2.066862,1.212863 3.100442,1.819198 1.16933,0.801894 2.348909,1.56724 3.508303,2.405801 2.518104,1.821286 5.053862,3.844547 7.483385,5.920169 2.245407,1.91833 4.853213,4.277218 6.985854,6.454407 1.049246,1.071162 2.051803,2.221277 3.077601,3.331814 2.366352,2.734145 4.69376,5.565882 6.722515,8.68598 0.48413,0.744548 0.937752,1.514709 1.37867,2.29146 0.951324,1.675971 1.006241,1.899255 1.732519,3.541178 0.187323,0.597919 0.585973,1.547389 0.448674,2.155712 -0.128776,0.570544 -0.69017,0.780522 -1.149789,0.776017 C 50.261133,48.24287 50.413708,48.21302 48.798676,47.677536 48.216042,47.388845 47.219353,46.909861 46.650183,46.564439 46.352386,46.383717 46.064259,46.159435 45.771334,45.957 l 0.06581,-0.0046 c 0.474417,0.188444 0.948414,0.376497 1.422811,0.565121 1.904792,0.757358 0.928431,0.405746 2.86764,1.032436 0.266535,0.06718 0.5338,0.08921 0.80034,0.156474 0.145287,0.01099 0.318778,0.05628 0.428249,8.32e-4 0.779886,-0.394957 0.47686,-1.469125 0.273811,-2.451778 -0.179223,-0.521626 -0.331914,-1.04964 -0.537765,-1.564529 -0.565357,-1.414006 -1.313863,-2.89222 -2.067422,-4.20526 C 47.944387,37.603129 46.701526,35.71548 45.424716,34.008625 44.606605,32.914966 43.735548,31.882152 42.890972,30.818919 41.894839,29.708931 40.922323,28.56171 39.902787,27.488924 37.798693,25.274939 35.327472,22.957999 33.088969,21.032108 30.694163,18.971739 28.016908,16.875076 25.518755,15.118234 24.321515,14.276269 23.102835,13.520635 21.894709,12.72185 20.847459,12.117356 19.805768,11.474963 18.752792,10.908277 17.04094,9.9869966 14.920944,8.9931907 13.17482,8.358322 12.388884,8.0725646 11.603664,7.8598557 10.819048,7.6370367 10.525682,7.5537377 10.228261,7.4591603 9.9426121,7.4402711 9.4807411,7.40973 9.0393041,7.4729575 8.5877861,7.4894763 7.8560251,7.7634778 7.3529581,7.7740793 6.9426329,8.5742834 6.7875965,8.8766355 6.7179792,9.260199 6.6784977,9.6455802 c -0.0934,0.9127558 0.055234,1.9060448 0.3249413,2.8884758 0.1534301,0.558896 0.3821871,1.107616 0.5732671,1.661256 0.251071,0.546254 0.475352,1.105469 0.75335,1.638595 0.258573,0.495851 0.554226,0.970047 0.8519,1.439599 0.748,1.179823 1.5981669,2.308533 2.5665869,3.210875 l -1.398321,0.02958 C 9.2706181,19.036937 8.2612701,17.467218 7.4110661,15.8108 7.1320575,15.26725 6.8842985,14.708075 6.6210075,14.156703 6.4143548,13.596648 6.1743522,13.043058 6.0013187,12.476653 5.7014477,11.495018 5.4914111,10.461673 5.5393623,9.5219204 5.5597232,9.1229023 5.6091666,8.7216258 5.7537675,8.4040629 5.9576941,7.9562001 6.1911602,7.7351624 6.4722685,7.5893371 Z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,394 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="50mm"
height="50mm"
viewBox="0 0 50 50.000001"
version="1.1"
id="svg5"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="gemgraph_desaturé.svg"
inkscape:export-filename="gemgraph_désaturé.png"
inkscape:export-xdpi="400"
inkscape:export-ydpi="400"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="3.0541689"
inkscape:cx="92.496522"
inkscape:cy="105.42966"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="layer10"
inkscape:snap-grids="false"
showguides="false"
inkscape:lockguides="false"
inkscape:showpageshadow="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid679"
originx="-13.661108"
originy="-56.524582" />
</sodipodi:namedview>
<defs
id="defs2">
<marker
style="overflow:visible"
id="marker58350"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:isstock="true">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58348" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Send"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Send"
inkscape:isstock="true">
<path
transform="matrix(-0.3,0,0,-0.3,0.69,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.625;stroke-linejoin:round"
id="path58039" />
</marker>
<marker
style="overflow:visible"
id="Tail"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Tail"
inkscape:isstock="true">
<g
transform="scale(-1.2)"
id="g58054">
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -3.8048674,-3.9585227 0.54352094,0"
id="path58042" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -1.2866832,-3.9585227 3.0617053,0"
id="path58044" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M 1.3053582,-3.9585227 5.6537466,0"
id="path58046" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -3.8048674,4.1775838 0.54352094,0.21974226"
id="path58048" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M -1.2866832,4.1775838 3.0617053,0.21974226"
id="path58050" />
<path
style="fill:none;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.8;stroke-linecap:round"
d="M 1.3053582,4.1775838 5.6537466,0.21974226"
id="path58052" />
</g>
</marker>
<marker
style="overflow:visible"
id="Arrow2Mend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Mend"
inkscape:isstock="true">
<path
transform="scale(-0.6)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.625;stroke-linejoin:round"
id="path58033" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Lend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow2Lend"
inkscape:isstock="true">
<path
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:0.625;stroke-linejoin:round"
id="path58027" />
</marker>
<marker
style="overflow:visible"
id="marker58284"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend"
inkscape:isstock="true">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58282" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Mend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:isstock="true">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58015" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Lend"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lend"
inkscape:isstock="true">
<path
transform="matrix(-0.8,0,0,-0.8,-10,0)"
style="fill:context-stroke;fill-rule:evenodd;stroke:context-stroke;stroke-width:1pt"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path58009" />
</marker>
<linearGradient
id="linearGradient7798"
inkscape:swatch="solid">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop7796" />
</linearGradient>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath66549">
<path
id="path66551"
style="fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.264583"
d="m 12.135176,56.807902 v 0.259416 c 0.01208,-0.02305 0.02657,-0.04746 0.04496,-0.07545 0.02382,-0.03625 0.05508,-0.0677 0.08785,-0.09612 0.04746,-0.04115 0.07941,-0.06765 0.106453,-0.08785 z m 0.507463,0 c -0.168135,0.07167 -0.157367,0.05207 -0.302307,0.181901 -0.02701,0.02418 -0.0531,0.05092 -0.07235,0.08165 -0.05643,0.0901 -0.06755,0.146106 -0.09818,0.240298 -0.001,0.0031 -0.0021,0.0062 -0.0031,0.0093 h 0.351916 c 0.02605,-0.04031 0.05222,-0.08064 0.07906,-0.120404 0.06558,-0.09715 0.163785,-0.031 0.09818,0.06614 -0.0121,0.01791 -0.02376,0.03618 -0.03566,0.05426 h 0.30334 V 56.8079 Z" />
</clipPath>
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Brilliance"
id="filter13546"
x="0"
y="0"
width="1"
height="1">
<feColorMatrix
type="hueRotate"
values="0"
result="color1"
id="feColorMatrix13542" />
<feColorMatrix
type="saturate"
values="0.458052"
result="fbSourceGraphic"
id="feColorMatrix13544" />
<feColorMatrix
result="fbSourceGraphicAlpha"
in="fbSourceGraphic"
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
id="feColorMatrix13888" />
<feColorMatrix
id="feColorMatrix13890"
values="1 -2.77556e-17 -2.77556e-17 0 0.18 -2.77556e-17 1 -2.77556e-17 0 0.18 -2.77556e-17 -2.77556e-17 1 0 0.18 0 0 0 1 0 "
in="fbSourceGraphic" />
</filter>
</defs>
<g
inkscape:groupmode="layer"
id="layer8"
inkscape:label="bg"
transform="translate(-9.5102355,-2.9755927)" />
<g
inkscape:label="cellules"
inkscape:groupmode="layer"
id="layer1"
style="display:inline"
transform="translate(-13.661107,-56.524581)" />
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="flechouille"
style="display:inline"
transform="translate(-9.5102355,-2.9755927)" />
<g
inkscape:groupmode="layer"
id="layer9"
inkscape:label="flesh1"
style="display:inline"
transform="translate(-9.5102355,-2.9755927)" />
<g
inkscape:groupmode="layer"
id="layer10"
inkscape:label="flesh2"
style="display:inline"
transform="translate(-9.5102355,-2.9755927)">
<g
id="g1446"
transform="matrix(0.84217281,0,0,0.84217281,7.5579735,3.4031577)"
style="filter:url(#filter13546)">
<path
id="path2376-7"
style="display:inline;fill:#dab82f;fill-opacity:1;fill-rule:evenodd;stroke:#dab82f;stroke-width:0.287;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
d="m 15.159701,73.562323 5.757321,9.910713 11.461618,-0.03061 5.7043,-9.941324 -5.757322,-9.910714 -11.461618,0.03061 z"
transform="translate(-4.1508714,-53.548988)" />
<path
id="path2376-5"
style="display:inline;fill:#267cc9;fill-opacity:1;fill-rule:evenodd;stroke:#267cc9;stroke-width:0.286544;stroke-opacity:1;paint-order:stroke fill markers"
d="m 33.391148,83.983564 5.757406,9.911184 11.461794,-0.03061 5.703866,-9.941795 -5.756889,-9.91067 -11.461794,0.03061 z"
transform="translate(-4.1508714,-53.548988)" />
<path
sodipodi:type="star"
style="display:inline;fill:#ab231d;fill-opacity:1;fill-rule:evenodd;stroke:#ab231d;stroke-width:1.0016;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path2376"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="115"
sodipodi:cy="270"
sodipodi:r1="40.000004"
sodipodi:r2="24.287724"
sodipodi:arg1="1.5707963"
sodipodi:arg2="2.0943951"
inkscape:rounded="0"
inkscape:randomized="0"
transform="matrix(-7.6531787e-4,-0.28654272,0.28654047,-7.6530994e-4,-54.816109,74.056392)"
d="M 115,310 80.358981,290 80.35898,250 115,230 l 34.64102,20 0,40 z" />
<path
style="display:inline;fill:#dab82f;fill-opacity:1;stroke-width:1.7821;stroke-linecap:round;stroke-linejoin:round;paint-order:markers fill stroke"
id="path9871-0"
d="m 51.290209,24.661378 c 0.06813,-0.04434 0.139313,-0.08468 0.204411,-0.133017 0.707337,-0.526066 1.498335,-1.309612 2.004042,-1.97973 0.190982,-0.253076 0.347139,-0.522019 0.520708,-0.78303 0.262052,-0.519889 0.73164,-1.405151 0.304733,-1.863066 -0.126982,-0.136211 -0.31387,-0.243171 -0.524876,-0.260859 -0.881172,-0.07387 -2.050603,0.390377 -2.875777,0.638065 -2.450135,0.963662 -3.02362,1.142939 -5.737462,2.489326 -1.376626,0.682974 -4.725927,2.618726 -5.961425,3.338002 -2.57716,1.500361 -4.032983,2.387408 -6.588687,3.923362 -1.06058,0.649361 -2.126691,1.289981 -3.181743,1.948085 -1.726092,1.076694 -4.368744,2.780718 -6.076145,3.907225 -1.640185,1.082159 -3.570122,2.385172 -5.184891,3.523455 -0.725214,0.511217 -1.43886,1.037148 -2.15829,1.55572 -1.569214,1.184763 -3.17984,2.337107 -4.649971,3.630536 -0.442991,0.389746 -1.13435,1.046979 -1.5078105,1.529963 -0.1256906,0.162547 -0.2101781,0.343099 -0.3152668,0.514649 -0.014617,0.126926 -0.071886,0.263059 -0.04395,0.380762 0.065172,0.274572 0.3432357,0.351886 0.6241883,0.387038 0.765085,0.09573 1.588825,-0.237386 2.351599,-0.483667 0,0 1.098777,-0.634118 1.098777,-0.634118 v 0 c -0.460546,-0.06551 -0.235661,-0.05087 -0.78717,-0.04303 -0.258754,0.0037 -0.861893,0.0742 -1.002051,-0.174211 -0.04078,-0.07231 -0.02257,-0.169313 -0.03384,-0.25397 0.05833,-0.140035 0.0957,-0.285357 0.174963,-0.420098 0.286693,-0.48741 0.727263,-0.96086 1.139644,-1.368373 1.255548,-1.240725 2.682963,-2.332271 4.083015,-3.431188 1.867358,-1.398946 2.316281,-1.756661 4.28181,-3.136316 3.809841,-2.674227 7.747857,-5.170674 11.725022,-7.600607 3.297314,-1.983176 6.593331,-3.978976 9.980197,-5.805686 0.47592,-0.256683 3.340325,-1.776424 4.44246,-2.231104 0.634904,-0.261931 1.282421,-0.481284 1.923634,-0.721924 0.667965,-0.184859 1.824649,-0.567396 2.555436,-0.574512 0.703097,-0.0069 0.903359,0.49255 0.750227,1.070925 -0.06335,0.239271 -0.201987,0.470062 -0.30298,0.705094 -0.176227,0.255075 -0.332792,0.519792 -0.528675,0.765222 -0.678963,0.850686 -1.556495,1.575428 -2.508582,2.164606 0,0 1.804748,-0.573529 1.804749,-0.57353 z" />
<path
style="display:inline;fill:#267cc9;fill-opacity:1;stroke-width:1.7821;stroke-linecap:round;stroke-linejoin:round;paint-order:markers fill stroke"
id="path9871"
d="m 24.514377,8.0196868 c -0.0036,-0.081211 -0.0022,-0.1630167 -0.01083,-0.243639 C 24.409395,6.8995742 24.135879,5.8203088 23.815259,5.0444224 23.694173,4.7514037 23.541736,4.4803339 23.404975,4.1982902 23.090092,3.7085914 22.565777,2.8546038 21.954532,2.9899458 c -0.181817,0.040256 -0.368845,0.1469716 -0.491202,0.3197861 -0.510979,0.7216783 -0.704672,1.964892 -0.910181,2.8015689 -0.413577,2.6001459 -0.550253,3.185249 -0.767964,6.2068872 -0.110433,1.532761 -0.142966,5.401081 -0.150478,6.83068 -0.01566,2.982045 0.0095,4.686638 0.03541,7.668267 0.02105,1.243406 0.03176,2.487138 0.06315,3.730218 0.05137,2.033723 0.177927,5.175584 0.281704,7.218491 0.09969,1.962482 0.242567,4.28672 0.403514,6.255797 0.07228,0.884338 0.163116,1.766179 0.244673,2.649267 0.224119,1.953425 0.399286,3.92607 0.767327,5.849295 0.110902,0.57952 0.326172,1.508815 0.552701,2.075764 0.07624,0.190806 0.188902,0.355258 0.283353,0.532886 0.101912,0.07706 0.190146,0.19548 0.305737,0.231163 0.269645,0.08324 0.477417,-0.11708 0.65033,-0.341292 0.470873,-0.610573 0.602057,-1.489378 0.777101,-2.271579 0,0 0.01147,-1.268575 0.01147,-1.268575 v 0 c -0.290245,0.363527 -0.163449,0.177222 -0.436687,0.656349 -0.128197,0.224795 -0.373619,0.780238 -0.658791,0.774886 -0.083,-0.0016 -0.157329,-0.06651 -0.235993,-0.09977 -0.09104,-0.121334 -0.197268,-0.227315 -0.273122,-0.364002 -0.27439,-0.494442 -0.458636,-1.114368 -0.600384,-1.676536 -0.43157,-1.711593 -0.647363,-3.495526 -0.883397,-5.259626 -0.257297,-2.319026 -0.33759,-2.887396 -0.528428,-5.281207 -0.369909,-4.639995 -0.521582,-9.300167 -0.596074,-13.960303 -0.03472,-3.847605 -0.08097,-7.700501 0.06458,-11.545828 0.02046,-0.540341 0.165246,-3.779702 0.33302,-4.9600775 0.09665,-0.6799791 0.236378,-1.3492097 0.354567,-2.0238137 0.179832,-0.6693367 0.437452,-1.860086 0.802311,-2.4933138 0.351034,-0.6092367 0.882958,-0.5282521 1.303523,-0.1027019 0.173984,0.17605 0.302446,0.4126537 0.453671,0.6189815 0.130299,0.28132 0.278888,0.5505961 0.390898,0.843955 0.388235,1.0168237 0.567157,2.1407899 0.591434,3.2601689 0,0 0.422065,-1.8460517 0.422065,-1.8460527 z" />
<path
id="path9871-7"
style="fill:#ab231d;fill-opacity:1;stroke-width:1.67983;stroke-linecap:round;stroke-linejoin:round;paint-order:markers fill stroke"
d="m 9.6198192,12.493488 c 0.0021,0.0955 0.01985,0.196647 0.04313,0.296052 0.169013,0.721871 0.7272528,1.351126 1.1903648,1.954689 l 0.907948,0.774254 c -0.09495,-0.437207 -0.03367,-0.229673 -0.221731,-0.723924 -0.08825,-0.231887 -0.347154,-0.751369 -0.179067,-0.962064 0.04894,-0.06131 0.13833,-0.0779 0.20761,-0.11684 0.139903,0.0049 0.277457,-0.01026 0.419684,0.01526 0.51448,0.09269 1.067539,0.328738 1.554457,0.561815 1.482484,0.709638 2.892894,1.624786 4.30063,2.512815 1.820048,1.207114 2.276321,1.489975 4.112009,2.792092 3.558173,2.523941 7.005007,5.223746 10.407573,7.981457 2.793876,2.296977 5.598396,4.588321 8.286818,7.019151 0.377771,0.341584 2.629473,2.406246 3.383831,3.244765 0.434564,0.483043 0.836502,0.991944 1.254784,1.487902 0.378985,0.539021 1.089008,1.450834 1.335407,2.106854 0.237064,0.631165 -0.127672,0.981342 -0.676668,1.039902 -0.227119,0.02422 -0.471269,-0.02225 -0.707106,-0.03338 -0.277854,-0.07211 -0.55767,-0.122855 -0.833676,-0.215907 -0.956645,-0.322674 -1.86982,-0.867162 -2.690805,-1.524784 0,0 1.087633,1.431204 1.087636,1.431204 0.06064,0.04632 0.118569,0.09642 0.181643,0.138651 0.686101,0.458548 1.621751,0.905156 2.365754,1.133087 0.280982,0.08607 0.564393,0.135259 0.846488,0.202951 0.53438,0.05944 1.451736,0.181845 1.706172,-0.358405 0.07569,-0.160694 0.10688,-0.365543 0.05275,-0.561668 C 47.729441,41.87038 46.944316,40.974466 46.459476,40.31515 44.823107,38.435042 44.480179,37.979463 42.427148,35.991805 41.385719,34.983552 38.615865,32.623384 37.589538,31.754615 35.448693,29.942431 34.205092,28.932363 32.040613,27.151606 31.132069,26.41668 30.229432,25.673595 29.315172,24.946624 27.819404,23.757286 25.481303,21.95537 23.948731,20.799802 22.476492,19.68972 20.718672,18.39374 19.2064,17.325633 c -0.679178,-0.479702 -1.367442,-0.943701 -2.051061,-1.415692 -1.537365,-1.011265 -3.060173,-2.071033 -4.658647,-2.956102 -0.481666,-0.266694 -1.275778,-0.666531 -1.814969,-0.838895 -0.181463,-0.05801 -0.36498,-0.07249 -0.54744,-0.108848 -0.114229,0.0299 -0.2505028,0.02423 -0.3428048,0.08938 -0.134559,0.095 -0.17514,0.238823 -0.171655,0.397998 z" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="G"
style="display:none"
transform="translate(-13.661107,-56.524581)">
<path
style="fill:#280b0b;fill-rule:evenodd;stroke-width:1.17527;paint-order:stroke fill markers"
id="path5061"
d="m 47.194037,73.534828 c -0.152935,-0.02949 -0.303017,-0.07937 -0.458813,-0.08853 -0.679709,-0.03995 -1.768198,0.04518 -2.38881,0.11554 -1.223064,0.138665 -2.765059,0.390668 -3.937257,0.684792 -0.839978,0.210771 -1.660405,0.485814 -2.490608,0.728716 -0.884544,0.345283 -1.788596,0.648962 -2.653642,1.035841 -0.909546,0.406787 -1.800807,0.853166 -2.663731,1.342296 -2.412915,1.367704 -4.486744,2.51416 -6.405435,4.408919 -1.866912,1.843619 -1.990901,2.396542 -3.238075,4.575011 -0.561878,1.750705 -1.088708,2.71144 -0.869682,4.565477 0.159213,1.34766 0.874773,2.787172 1.786272,3.822154 1.216923,1.381785 1.925136,1.542456 3.563057,2.363074 0.716128,0.18719 1.414128,0.45402 2.148385,0.56157 1.476245,0.21625 3.235625,0.10133 4.696908,-0.14504 1.121152,-0.18903 2.97206,-0.68308 4.011344,-1.196472 1.272067,-0.62838 2.47331,-1.377211 3.709964,-2.065815 0.35181,-0.337103 0.758836,-0.629743 1.055436,-1.011317 0.72856,-0.937278 0.897486,-2.100108 0.141797,-3.080578 -0.595431,-0.772532 -1.342216,-1.055858 -2.19073,-1.515049 -1.235002,-0.55263 -2.558697,-0.827258 -3.893906,-1.051661 -0.275889,-0.04638 -0.552772,-0.08735 -0.829558,-0.128686 -0.131541,-0.01964 -0.282401,-0.120898 -0.39539,-0.05429 -0.895481,0.527899 -1.693943,1.190186 -2.540911,1.785276 0.284581,-2.67e-4 0.56979,0.01702 0.853743,-8.46e-4 0.506251,-0.03178 1.009926,-0.09368 1.514041,-0.147908 1.126082,-0.121137 2.736584,-0.297869 3.82806,-0.538812 0.754661,-0.166597 1.489563,-0.404875 2.234347,-0.60731 0,0 0.920256,-0.654146 0.920256,-0.654146 v 0 c -0.434883,-0.01503 -0.869794,-0.06071 -1.304655,-0.04507 -0.581879,0.02095 -1.159157,0.106441 -1.739228,0.154544 -1.18152,0.09798 -2.372701,0.217893 -3.559116,0.102923 -0.916483,0.5683 -1.884337,1.068757 -2.74944,1.704899 -0.141003,0.10369 0.351958,-0.06499 0.53043,-0.07318 1.681682,-0.07713 3.345531,0.304805 4.880908,0.931638 0.799,0.46379 1.416078,0.69572 1.942346,1.458546 0.592972,0.859518 0.458921,1.949721 -0.173001,2.750154 -0.276772,0.350576 -0.658067,0.615269 -0.987097,0.922899 0.245124,-0.103658 0.98509,-0.404324 0.73537,-0.310969 -0.632522,0.236462 -1.240205,0.533554 -1.884228,0.74046 -2.149245,0.690501 -4.511087,1.07065 -6.77952,0.758774 -0.721485,-0.0992 -1.411354,-0.346295 -2.11703,-0.519443 -1.640635,-0.805623 -2.245832,-0.913379 -3.477641,-2.270221 -0.96095,-1.05849 -1.587822,-2.272955 -1.78689,-3.664295 -0.259956,-1.816874 0.168031,-2.613401 0.657162,-4.361084 0.425327,-0.759815 0.774863,-1.562071 1.275982,-2.279451 1.429152,-2.045916 2.143593,-2.436091 4.081957,-4.040224 0.316886,-0.262247 0.59847,-0.570258 0.955512,-0.781482 2.025704,-1.198385 3.09556,-1.525226 5.269798,-2.384256 0.818076,-0.241442 1.624513,-0.521413 2.454228,-0.724331 2.130308,-0.520981 4.327258,-0.63021 6.515425,-0.60327 0,0 1.751669,-1.169825 1.751669,-1.169825 z" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="MA flèche."
style="display:none"
transform="translate(-13.661107,-56.524581)">
<path
style="fill:#280b0b;fill-rule:evenodd;stroke-width:0.714375;paint-order:stroke fill markers"
id="path5381"
d="m 43.971768,67.441733 c 0.05775,-0.05692 0.128513,-0.10313 0.173233,-0.170768 0.162618,-0.245951 0.183602,-0.539006 0.142486,-0.828781 -0.09153,-0.64507 -0.379521,-1.25381 -0.74368,-1.786699 -0.278135,-0.407003 -0.621742,-0.765165 -0.932614,-1.147747 -0.450882,-0.405614 -0.862005,-0.860351 -1.352645,-1.216845 -1.287082,-0.935183 -2.942582,-1.738318 -4.427165,-2.263733 -0.917008,-0.324543 -1.849646,-0.624866 -2.806599,-0.799441 -1.090528,-0.198943 -2.202138,-0.296621 -3.310485,-0.316486 -1.191779,-0.02135 -2.380459,0.128775 -3.570687,0.193161 -2.978677,0.600305 -4.348873,0.689899 -7.132609,2.001306 -2.3177,1.091861 -4.55482,2.649093 -6.378025,4.451165 -2.382225,2.354611 -2.702801,3.298848 -4.3978662,6.138915 -0.4674116,1.161381 -1.0514803,2.282373 -1.4022345,3.484142 -1.0595501,3.630274 -1.0911387,7.625418 -0.1579766,11.283489 0.7927453,3.107624 1.3487625,3.662474 2.9042413,6.375218 0.712228,0.809061 1.317105,1.727083 2.136684,2.427181 2.53145,2.162405 5.947581,3.105748 9.228512,3.024735 1.241056,-0.03064 2.463828,-0.306895 3.695742,-0.460343 0,0 0.09928,-0.07358 0.09928,-0.07358 v 0 c -2.671283,0.166076 -3.99527,0.424982 -6.652684,-0.114218 -2.190671,-0.444487 -4.12383,-1.265971 -5.870705,-2.680129 C 12.373736,94.280457 11.718647,93.395442 10.969984,92.612026 9.2992188,89.965113 8.7163994,89.46231 7.8613245,86.364388 6.8532454,82.712133 6.8825493,78.773096 7.9329999,75.133609 8.2780046,73.938275 8.8494477,72.82027 9.3076717,71.663601 c 1.6956393,-2.839193 2.0162173,-3.782898 4.3989143,-6.136438 1.768459,-1.746817 3.932715,-3.27863 6.188337,-4.330804 2.846376,-1.32774 4.023184,-1.364813 7.059864,-1.953508 1.151167,-0.03817 2.302893,-0.166849 3.453505,-0.11452 1.059299,0.04818 2.118246,0.187725 3.153987,0.415039 0.920022,0.201917 1.816873,0.512402 2.689336,0.867391 1.484852,0.604155 2.847912,1.409907 4.055237,2.464565 0.44142,0.385604 0.798965,0.8578 1.198449,1.286703 0.260638,0.401082 0.559003,0.780034 0.781915,1.203248 0.34776,0.66026 0.651515,1.57521 0.414351,2.331429 -0.03269,0.104254 -0.148834,0.23331 -0.227269,0.325612 0,0 1.49747,-0.580585 1.49747,-0.580585 z" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="flèches test 2"
style="display:none"
transform="translate(-13.661107,-56.524581)">
<path
id="path5852"
style="fill:#00aad4;fill-rule:evenodd;stroke-width:0.7248;paint-order:stroke fill markers"
d="m 50.580764,54.861594 c -0.383603,-0.005 -0.77888,0.07138 -1.287258,0.111107 -1.874245,0.651097 -2.342838,0.725278 -4.327901,1.972487 -0.689613,0.433284 -1.31721,0.977789 -1.9451,1.51257 -1.517796,1.292717 -3.049527,2.833153 -4.398698,4.323768 -0.817769,0.903499 -1.592527,1.852438 -2.389002,2.778641 -0.83879,1.143696 -1.708346,2.261386 -2.516643,3.431315 -1.755545,2.540987 -3.421721,5.256226 -4.944401,7.971089 -1.407287,2.509125 -2.971334,5.531485 -4.117061,8.208285 -0.56369,1.316968 -1.03426,2.680022 -1.551327,4.019909 -1.100202,3.23337 -2.105667,6.531425 -2.63188,9.94513 -0.125572,0.814615 -0.20428,1.637865 -0.265617,2.461345 -0.132345,1.77678 -0.07198,1.98397 0.0217,3.64009 0.117922,0.57137 0.195279,1.52028 0.671277,1.96681 0.446437,0.4188 1.168872,0.36164 1.665531,0.16898 2.315055,-0.89821 2.133343,-0.86017 3.599263,-1.96681 0.477516,-0.4782 1.302372,-1.28394 1.734779,-1.80351 0.226247,-0.27184 0.418581,-0.57572 0.627869,-0.86351 l -0.0739,0.0233 c -0.413872,0.35083 -0.827506,0.70116 -1.241268,1.05213 -1.661328,1.4092 -0.790098,0.71713 -2.559017,2.03244 -0.253318,0.16511 -0.531689,0.29319 -0.784965,0.45837 -0.151864,0.0688 -0.315908,0.17757 -0.464571,0.17673 -1.059091,-0.006 -1.307301,-1.01867 -1.614889,-1.91461 -0.08572,-0.50496 -0.203668,-1.0043 -0.256832,-1.51464 -0.14601,-1.40156 -0.127626,-2.93146 -0.01499,-4.326867 0.161498,-2.000666 0.496653,-4.072306 0.965833,-6.008418 0.300623,-1.240554 0.691436,-2.452568 1.037146,-3.678846 0.48515,-1.327261 0.924648,-2.675572 1.455208,-3.98167 1.094955,-2.695487 2.533233,-5.627015 3.928958,-8.139554 1.493179,-2.687981 3.273555,-5.522076 5.042069,-8.001579 0.847561,-1.188299 1.764798,-2.314033 2.647384,-3.471106 0.812311,-0.930299 1.598216,-1.889649 2.437061,-2.791042 1.363729,-1.465421 3.131672,-3.158582 4.686536,-4.401283 0.699849,-0.559345 1.438171,-1.057997 2.170411,-1.564761 0.273775,-0.189476 0.545915,-0.389927 0.845942,-0.522965 0.485113,-0.215112 0.998426,-0.3443 1.497584,-0.51625 0.941832,-0.07425 1.493787,-0.27229 2.369365,0.22066 0.330827,0.186259 0.61255,0.474774 0.862478,0.777214 0.591928,0.716287 0.964321,1.598652 1.199412,2.521809 0.133739,0.525175 0.180231,1.072899 0.270266,1.609204 0.02093,0.554861 0.07791,1.109422 0.06253,1.664497 -0.01431,0.51627 -0.08052,1.029877 -0.151413,1.540475 -0.178186,1.282975 -0.494784,2.565691 -1.061434,3.70985 l 1.534274,-0.550352 c 0.378547,-1.66502 0.630994,-3.377803 0.664043,-5.096848 0.01085,-0.564105 -0.02061,-1.128287 -0.03101,-1.692402 -0.07658,-0.548011 -0.113464,-1.104384 -0.22996,-1.643828 -0.201898,-0.934899 -0.529145,-1.875623 -1.086238,-2.632913 -0.236541,-0.321543 -0.505868,-0.633 -0.833541,-0.836126 -0.462113,-0.286472 -0.834409,-0.373258 -1.218015,-0.378272 z" />
<path
id="path5902"
style="fill:#ff7f2a;fill-rule:evenodd;stroke-width:0.630357;paint-order:stroke fill markers"
d="m 13.900892,75.502767 c -0.05938,-0.0011 -0.118877,-7.94e-4 -0.177767,0.0047 -0.546328,0.04895 -1.249165,0.180549 -1.757516,0.290939 -0.845372,0.18357 -1.788657,0.431675 -2.6019081,0.679029 -0.4679362,0.142327 -0.9264012,0.302768 -1.3895792,0.454234 -1.2701296,0.491239 -2.0021941,0.723643 -3.1998046,1.490866 -0.3019258,0.193421 -0.560388,0.439545 -0.7358724,0.711584 -0.1580843,0.245068 -0.3012541,0.530953 -0.2397786,0.800986 0.2152168,0.945341 1.3861531,1.46838 2.2065834,2.019515 0.7993292,0.371985 1.5672252,0.787799 2.3977864,1.115695 2.2003001,0.868648 4.8312781,1.604237 7.1747561,2.142503 1.519507,0.349012 3.054567,0.659889 4.601786,0.92501 3.380123,0.579186 7.532289,1.051276 10.940416,1.472776 4.454605,0.423484 6.247098,0.645314 10.670151,0.870749 1.566847,0.07986 3.137151,0.120047 4.706689,0.155546 1.51878,0.03435 5.183235,0.06461 6.89002,0.0078 0.694232,-0.02312 1.384985,-0.09093 2.077392,-0.136424 1.447961,-0.287345 2.13329,-0.294275 3.30264,-1.414383 0.18696,-0.179086 0.01169,-0.477136 -0.113689,-0.686263 -0.244393,-0.407673 -1.289336,-1.133631 -1.753381,-1.307415 -0.147785,-0.05535 -0.301603,-0.09826 -0.457853,-0.136424 0.117697,0.07253 0.209759,0.182218 0.31161,0.276468 0.41097,0.380302 0.460653,0.423897 0.774113,0.809768 0.354991,0.436996 0.263464,0.289899 0.429432,0.594281 0.02671,0.07295 0.131913,0.262882 0.09508,0.378788 -0.0263,0.08272 -0.06853,0.15966 -0.109553,0.236161 -0.0052,0.0098 -0.01839,0.01262 -0.02739,0.01913 -0.0021,0.0013 -0.0039,0.0034 -0.0062,0.0057 -0.01868,0.06898 -0.04505,0.136785 -0.08526,0.194821 -0.03005,0.04335 -0.132156,0.06317 -0.248047,0.0739 -0.0057,0.01267 -0.0074,0.02077 -0.01447,0.03514 -0.0073,0.01474 -0.0191,0.02668 -0.03256,0.03772 0.30294,-0.07243 0.582663,-0.185004 0.419097,-0.107487 -0.222115,0.10527 -0.466,0.175705 -0.714168,0.239263 -0.0016,0.0063 -0.0024,0.01283 -0.0041,0.01913 -0.0053,0.01998 -0.03155,0.0088 -0.05685,-0.0026 -0.03115,0.0078 -0.06122,0.01725 -0.0925,0.02479 -0.03724,0.0098 -0.07731,0.01995 -0.125574,0.03152 -0.19191,0.04552 -0.385082,0.0889 -0.571539,0.143145 -0.810416,0.116102 -1.614191,0.26588 -2.431378,0.348298 -2.489295,0.251063 -4.874469,0.309967 -7.390762,0.279053 -5.148701,-0.0634 -10.277188,-0.49431 -15.375823,-1.025924 C 29.348294,87.336754 27.499973,87.146283 25.674346,86.860686 22.561469,86.373715 19.221058,85.666071 16.196372,84.887162 13.754903,84.258443 11.500339,83.607301 9.2474422,82.646472 8.4506797,82.306665 7.7209261,81.879236 6.9576595,81.495637 6.2836925,80.980139 5.1531914,80.335643 4.9324601,79.508164 c -0.03267,-0.122478 -0.034864,-0.234384 -0.014986,-0.338481 0.00359,-0.18151 0.019971,-0.176255 0.1038696,-0.344684 0.1640695,-0.263128 0.1096889,-0.203168 0.2930054,-0.407209 0.058642,-0.06527 0.1161214,-0.131353 0.1788004,-0.192752 0.00122,-0.0013 0.00288,-0.0019 0.00414,-0.0031 0.00567,-0.0062 0.011636,-0.0122 0.017571,-0.0181 0.021439,-0.02133 0.046669,-0.03796 0.07028,-0.05685 0.046792,-0.03742 0.093938,-0.07475 0.1431435,-0.108003 0.04413,-0.04101 0.091399,-0.06514 0.147278,-0.0894 0.00386,-0.0016 0.00767,-0.003 0.011369,-0.0041 0.00925,-0.01048 0.016378,-0.02249 0.030489,-0.02945 0.400263,-0.197601 0.8454358,-0.333861 1.2681397,-0.500745 0.4377661,-0.137829 0.8711104,-0.28508 1.3136149,-0.413411 0.8224134,-0.238509 1.5586414,-0.41729 2.4070884,-0.576194 0.643359,-0.120489 1.0135,-0.15648 1.64021,-0.238744 0.149614,-0.01963 0.299098,-0.04061 0.448552,-0.06098 l 1.08417,-0.620633 c -0.05928,2.65e-4 -0.118909,-0.0016 -0.178284,-0.0026 z m 40.756684,9.512083 c 0.01352,0.0136 0.02625,0.02775 0.03979,0.04134 0.09605,0.02021 0.191669,0.04322 0.286805,0.06821 -0.108259,-0.03947 -0.217215,-0.07534 -0.326596,-0.109553 z m 1.517737,0.823722 c 0.05162,0.0471 0.105056,0.09224 0.15503,0.141075 -0.05709,-0.05467 -0.109723,-0.103076 -0.15503,-0.141075 z m 0.192754,0.177765 c 0.266166,0.266372 0.494906,0.571302 0.749824,0.848011 0.0038,0.0059 0.02831,0.04017 0.04083,0.05684 5.29e-4,-0.01278 2.64e-4,-0.0231 -0.0016,-0.02687 -0.03487,-0.06838 -0.105976,-0.11117 -0.153995,-0.171048 -0.06281,-0.07832 -0.118954,-0.161891 -0.178285,-0.242879 -0.0928,-0.09506 -0.284781,-0.296784 -0.456819,-0.464056 z" />
<path
id="path5906"
style="fill:#a02c2c;fill-rule:evenodd;stroke-width:0.766506;paint-order:stroke fill markers"
d="m 13.647225,55.974874 c -0.95397,-0.01873 -1.910408,0.767466 -2.43551,1.246436 -0.192447,0.17554 -0.235527,0.430342 -0.303857,0.671793 -0.0066,0.03381 -0.01307,0.06767 -0.02067,0.101285 -0.0106,0.04686 -0.02224,0.09341 -0.03359,0.140044 -3.7e-4,0.0021 -6.61e-4,0.0035 -10e-4,0.0057 -0.0084,0.439891 -0.05294,0.881558 -0.01188,1.319298 0.05798,0.61827 0.17734,1.231119 0.31626,1.838647 0.388904,1.700753 0.881911,3.078107 1.507402,4.734595 1.020323,2.702136 1.28219,3.183617 2.500622,5.936588 0.509506,1.13588 1.00614,2.27624 1.528589,3.407545 1.193103,2.583527 2.186784,4.670462 3.608049,7.174756 1.451115,2.556889 3.045887,5.018278 4.714956,7.469312 0.77166,1.133171 1.580192,2.246479 2.370399,3.369818 1.861506,2.766793 3.829529,5.484683 5.991882,8.080639 0.85168,1.02247 2.162622,2.50383 3.179651,3.46026 0.404535,0.38038 0.856139,0.72111 1.28416,1.08159 0.910823,0.46467 1.211078,0.75697 2.260844,0.82062 0.310859,0.0188 0.631605,-0.0131 0.930693,-0.0935 0.52552,-0.14139 1.271103,-0.69238 1.86862,-1.19631 -0.138748,0.0484 -0.279945,0.0932 -0.374656,0.12764 -0.652457,0.23725 -1.453875,0.23139 -2.117182,0.0765 -0.464331,-0.10843 -0.888111,-0.31729 -1.33222,-0.47594 -0.498075,-0.31356 -1.023741,-0.59668 -1.493964,-0.94102 -1.280417,-0.93765 -2.500635,-2.11906 -3.568258,-3.22358 -2.376549,-2.458682 -4.482979,-5.102705 -6.552573,-7.760246 -0.79016,-1.123278 -1.598782,-2.236711 -2.370397,-3.369821 -1.539602,-2.260899 -3.394751,-5.104876 -4.714441,-7.468793 -1.34098,-2.402054 -2.405407,-4.745826 -3.470589,-7.24762 -0.489842,-1.150493 -0.939118,-2.314046 -1.4087,-3.471106 -0.396297,-1.091861 -1.781844,-4.87394 -2.181262,-6.102469 -0.524561,-1.613445 -1.041168,-3.307059 -1.25677,-5.00848 -0.05184,-0.246809 -0.09613,-0.495335 -0.130742,-0.745176 -0.02412,-0.20098 -0.04591,-0.403381 -0.03721,-0.606163 5.29e-4,-0.01212 0.0029,-0.0223 0.0062,-0.03101 -0.0038,-0.04418 -0.0066,-0.08848 -0.0072,-0.132808 -0.0044,-0.309292 0.0018,-0.31641 0.02015,-0.626835 0.0098,-0.127135 0.01693,-0.254481 0.02946,-0.381373 0.0041,-0.04165 0.01307,-0.08286 0.02067,-0.124023 0.04812,-0.261715 0.109155,-0.52102 0.182934,-0.776698 0.008,-0.02789 0.02109,-0.04671 0.03566,-0.05788 0.0057,-0.01455 0.0063,-0.03066 0.01292,-0.04496 0.05643,-0.122801 0.03556,-0.09066 0.08733,-0.159163 0.03115,-0.04102 0.06116,-0.08289 0.09663,-0.120407 0.04364,-0.04617 0.09613,-0.08346 0.149862,-0.116789 0.02179,-0.01352 0.04231,-0.01945 0.05943,-0.01963 0.0015,0 0.0027,-3.2e-5 0.0041,0 0.04213,-0.0095 0.08446,-0.01667 0.126607,-0.01601 1.322397,0.01995 2.355981,0.916221 3.315043,1.563211 0.38241,0.332304 0.78279,0.649592 1.147217,0.996839 0.586986,0.559316 1.33994,1.391389 1.807125,2.048455 0.323479,0.454951 0.558248,0.961326 0.778764,1.459857 L 21.22868,61.99003 C 21.087885,61.792482 20.900241,61.520524 20.742922,61.349241 20.537811,61.125919 20.31145,60.918269 20.096966,60.701737 19.289824,59.886868 18.98196,59.543531 18.095021,58.7494 c -0.379237,-0.339553 -0.777873,-0.662101 -1.166854,-0.993222 -0.860053,-0.609714 -1.916495,-1.605227 -3.09025,-1.766816 -0.06345,-0.0087 -0.127088,-0.01323 -0.190686,-0.01447 z m 29.255579,49.569066 c 0.260734,-0.0909 0.504876,-0.19892 0.359667,-0.30644 -0.0013,-10e-4 -0.0024,-0.002 -0.0036,-0.003 -0.110098,0.0989 -0.228145,0.20115 -0.356049,0.30903 z m 0.35605,-0.30902 c 0.31151,-0.27976 0.545616,-0.51105 0.60048,-0.58033 0.250232,-0.31599 0.125283,-0.75577 0.188103,-1.13378 -0.0084,-0.94374 0.02339,-1.95697 -0.159163,-2.88975 -0.09373,-0.47891 -0.281665,-0.939138 -0.422714,-1.408697 l -0.0801,0.03979 c -0.126992,0.601723 -0.276707,1.200297 -0.380857,1.805057 -0.0958,0.5563 -0.145746,1.11722 -0.218591,1.67587 -0.08769,0.4993 -0.175353,0.9988 -0.263033,1.4981 -0.887127,2.85991 -0.465799,0.11039 0.735872,0.99374 z" />
<path
style="fill:#a0a0a0;stroke:none;stroke-width:0.158245"
d=""
id="path7782"
transform="scale(0.26458333)" />
<path
style="fill:#a0a0a0;stroke:none;stroke-width:0.158245"
d=""
id="path7821"
transform="scale(0.26458333)" />
<path
style="fill:#a02c2c;fill-opacity:1;stroke:none;stroke-width:0.0296006"
d="m 11.641617,57.15 c -0.01479,-0.06852 0.01315,0.06065 5e-5,0 z"
id="path37999"
inkscape:transform-center-x="-0.04769897"
inkscape:transform-center-y="0.93565869"
sodipodi:nodetypes="ccc" />
<path
id="path49005"
clip-path="url(#clipPath66549)"
style="fill:none;stroke:#000000;stroke-width:0.999999px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
transform="scale(0.26458333)"
d="m 48.041016,215.17773 -2,1 c 0.655801,-0.2448 1.293277,-0.56448 1.974609,-0.72656 0.15617,-0.037 0.61754,-0.062 0.466797,-0.11719 -0.146608,-0.0536 -0.294262,-0.10416 -0.441406,-0.15625 z" />
</g>
<g
inkscape:groupmode="layer"
id="layer7"
inkscape:label="flèches test 4"
style="display:none"
transform="translate(-11.57442,-3.1941091)">
<g
inkscape:groupmode="layer"
id="layer6"
inkscape:label="flèches test 3"
transform="translate(-2.0866871,-53.330472)"
style="display:none">
<path
id="path175"
style="display:inline;fill:#ecb41a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.276002;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;paint-order:stroke fill markers"
d="m 32.00153,53.857243 c -0.258918,0.187592 -0.491347,0.445564 -0.814943,0.730945 -0.980303,1.452359 -1.262744,1.745197 -2.06597,3.725697 -0.279042,0.688027 -0.469685,1.433302 -0.664623,2.171008 -0.471228,1.783256 -0.847366,3.769946 -1.122296,5.625953 -0.16664,1.124973 -0.28533,2.26451 -0.428145,3.396858 -0.07947,1.325979 -0.190498,2.6467 -0.238494,3.978261 -0.104239,2.892032 -0.07519,5.877645 0.04972,8.791302 0.115473,2.692852 0.342338,5.871054 0.703594,8.56628 0.177742,1.326038 0.437237,2.64212 0.655846,3.96305 0.626331,3.113934 1.343351,6.231873 2.429959,9.202203 0.259296,0.7088 0.553609,1.40106 0.859643,2.08483 0.66032,1.47534 0.788067,1.60951 1.548841,2.87626 0.319777,0.39431 0.771533,1.10831 1.278415,1.22475 0.475396,0.10922 0.934952,-0.29687 1.186242,-0.69769 1.17125,-1.86848 1.065634,-1.74756 1.580563,-3.35734 0.118114,-0.61772 0.330708,-1.66871 0.401189,-2.29672 0.03688,-0.32861 0.03756,-0.66569 0.05636,-0.99846 l -0.03965,0.0553 c -0.129196,0.48495 -0.258445,0.96936 -0.387511,1.45436 -0.518219,1.94732 -0.22667,0.96334 -0.856492,2.88993 -0.100004,0.25744 -0.232366,0.49804 -0.332303,0.75551 -0.07267,0.1304 -0.136648,0.29861 -0.236522,0.37218 -0.711541,0.52415 -1.304568,-0.15512 -1.888137,-0.71209 -0.270231,-0.35771 -0.559664,-0.69484 -0.810367,-1.07307 -0.688511,-1.03872 -1.321063,-2.26136 -1.833828,-3.42435 -0.73517,-1.66747 -1.384002,-3.477933 -1.88598,-5.247829 -0.321641,-1.134052 -0.570873,-2.290511 -0.856313,-3.435762 -0.234654,-1.294978 -0.508744,-2.583854 -0.704077,-3.884722 -0.403125,-2.684697 -0.675899,-5.728052 -0.800553,-8.41784 -0.133358,-2.877601 -0.136039,-6.014513 0.0027,-8.864256 0.06653,-1.365738 0.206096,-2.716648 0.309248,-4.075109 0.151683,-1.143505 0.273455,-2.296866 0.455092,-3.430695 0.295292,-1.843294 0.765193,-4.069073 1.282319,-5.831168 0.232762,-0.793122 0.516858,-1.557324 0.793463,-2.324918 0.103415,-0.287001 0.201119,-0.581884 0.345897,-0.837227 0.234096,-0.412868 0.52329,-0.771664 0.784981,-1.157312 0.599228,-0.529215 0.885266,-0.96192 1.679219,-1.00818 0.299986,-0.01746 0.610201,0.07067 0.904998,0.185744 0.698194,0.272526 1.319419,0.786403 1.865917,1.401201 0.310896,0.349751 0.572889,0.760957 0.859219,1.141364 0.247886,0.429633 0.519783,0.841026 0.743456,1.288956 0.208031,0.416619 0.380194,0.857047 0.54795,1.297426 0.421489,1.106561 0.750209,2.282038 0.853123,3.472489 l 0.795167,-1.202681 C 38.560014,60.722067 38.007072,59.237524 37.304616,57.857572 37.074102,57.404738 36.815239,56.972971 36.570499,56.530743 36.288243,56.134335 36.029034,55.711472 35.723666,55.34179 35.194441,54.701105 34.57884,54.118394 33.886686,53.795952 33.592797,53.659047 33.28121,53.546508 32.976229,53.54903 c -0.430119,0.0037 -0.715939,0.120634 -0.974863,0.308219 z" />
<path
id="path175-3"
style="display:inline;fill:#ecb41a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.276002;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;paint-order:stroke fill markers"
d="m 60.009276,61.920503 c 0.01058,0.319558 -0.05067,0.661348 -0.07767,1.091961 -0.54614,1.664954 -0.604269,2.06763 -1.676186,3.916561 -0.372383,0.642321 -0.844197,1.249916 -1.307397,1.856263 -1.119689,1.465726 -2.458387,2.981084 -3.755914,4.336359 -0.786465,0.821465 -1.613838,1.613984 -2.420738,2.421151 -0.9987,0.875864 -1.973894,1.773432 -2.9963,2.627857 -2.220582,1.85573 -4.596817,3.663556 -6.974993,5.351535 -2.197971,1.560036 -4.847638,3.329698 -7.198197,4.697039 -1.156467,0.672721 -2.3552,1.274757 -3.532692,1.912063 -2.843851,1.414703 -5.746478,2.760222 -8.759134,3.72328 -0.718902,0.22981 -1.446209,0.421816 -2.173999,0.599357 -1.570321,0.38307 -1.75464,0.364432 -3.221788,0.540244 -0.507564,-0.01081 -1.348589,0.07016 -1.751387,-0.258843 -0.377788,-0.308555 -0.338805,-0.920586 -0.176276,-1.364869 0.757758,-2.070954 0.727003,-1.913376 1.682861,-3.307248 0.415528,-0.472086 1.115373,-1.284486 1.568238,-1.725255 0.236964,-0.230636 0.502816,-0.43787 0.754152,-0.656775 l -0.01937,0.06523 c -0.303853,0.399426 -0.607247,0.798563 -0.91122,1.197917 -1.220474,1.60345 -0.621977,0.769772 -1.757641,2.448668 -0.142037,0.236858 -0.250926,0.488952 -0.393033,0.725772 -0.0584,0.137387 -0.152092,0.291048 -0.148961,0.415056 0.02227,0.883475 0.922493,0.935397 1.720303,1.054842 0.44827,-0.0059 0.892059,0.01602 1.344565,-0.01787 1.242709,-0.09307 2.596387,-0.343115 3.829493,-0.65121 1.767988,-0.441758 3.595986,-1.039398 5.301892,-1.728169 1.093051,-0.441326 2.1594,-0.953589 3.239098,-1.430377 1.166831,-0.608719 2.353023,-1.182544 3.500393,-1.825935 2.367917,-1.327811 4.939216,-2.978518 7.140395,-4.529424 2.354876,-1.659196 4.834457,-3.580627 7.000477,-5.437679 1.038041,-0.890022 2.019582,-1.828645 3.029418,-2.743134 0.810275,-0.821014 1.646678,-1.624444 2.430943,-2.463187 1.274999,-1.363564 2.745064,-3.099596 3.819894,-4.588603 0.483781,-0.670206 0.913238,-1.363229 1.34997,-2.052415 0.163296,-0.257679 0.336321,-0.51568 0.449249,-0.786618 0.182593,-0.438088 0.28868,-0.886545 0.432846,-1.329741 0.0506,-0.797861 0.217005,-1.289145 -0.233303,-1.944678 -0.170159,-0.247674 -0.429999,-0.438681 -0.701668,-0.600987 -0.643407,-0.384413 -1.430268,-0.560027 -2.251027,-0.614728 -0.466919,-0.03112 -0.952396,0.01408 -1.428468,0.02116 -0.491382,0.06764 -0.983081,0.105123 -1.474069,0.203107 -0.456664,0.09114 -0.910141,0.225214 -1.360877,0.362738 -1.132561,0.345596 -2.262675,0.80673 -3.266153,1.455418 l 0.462438,-1.365607 c 1.467466,-0.571463 2.979212,-1.044997 4.500021,-1.336291 0.499057,-0.09559 0.998857,-0.155862 1.49826,-0.233708 0.486213,-0.02012 0.979191,-0.07466 1.458465,-0.06013 0.830616,0.02518 1.668402,0.154148 2.347536,0.503179 0.288358,0.148201 0.568319,0.325324 0.753341,0.567785 0.260826,0.342031 0.343721,0.639513 0.354313,0.959072 z" />
</g>
<path
id="path173"
style="display:inline;fill:#ecc73b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.84;paint-order:stroke fill markers"
d="M 6.4723148,7.5892923 C 6.7534122,7.4434529 7.0822553,7.3723636 7.4770761,7.224129 c 1.697985,-0.056717 2.079947,-0.1569007 4.1461889,0.324266 0.717816,0.1671598 1.443223,0.4650624 2.164179,0.7534185 1.742755,0.6970373 3.614807,1.6293987 5.327999,2.5804805 1.038411,0.576478 2.066862,1.212863 3.100442,1.819198 1.16933,0.801894 2.348909,1.56724 3.508303,2.405801 2.518104,1.821286 5.053862,3.844547 7.483385,5.920169 2.245407,1.91833 4.853213,4.277218 6.985854,6.454407 1.049246,1.071162 2.051803,2.221277 3.077601,3.331814 2.366352,2.734145 4.69376,5.565882 6.722515,8.68598 0.48413,0.744548 0.937752,1.514709 1.37867,2.29146 0.951324,1.675971 1.006241,1.899255 1.732519,3.541178 0.187323,0.597919 0.585973,1.547389 0.448674,2.155712 -0.128776,0.570544 -0.69017,0.780522 -1.149789,0.776017 C 50.261133,48.24287 50.413708,48.21302 48.798676,47.677536 48.216042,47.388845 47.219353,46.909861 46.650183,46.564439 46.352386,46.383717 46.064259,46.159435 45.771334,45.957 l 0.06581,-0.0046 c 0.474417,0.188444 0.948414,0.376497 1.422811,0.565121 1.904792,0.757358 0.928431,0.405746 2.86764,1.032436 0.266535,0.06718 0.5338,0.08921 0.80034,0.156474 0.145287,0.01099 0.318778,0.05628 0.428249,8.32e-4 0.779886,-0.394957 0.47686,-1.469125 0.273811,-2.451778 -0.179223,-0.521626 -0.331914,-1.04964 -0.537765,-1.564529 -0.565357,-1.414006 -1.313863,-2.89222 -2.067422,-4.20526 C 47.944387,37.603129 46.701526,35.71548 45.424716,34.008625 44.606605,32.914966 43.735548,31.882152 42.890972,30.818919 41.894839,29.708931 40.922323,28.56171 39.902787,27.488924 37.798693,25.274939 35.327472,22.957999 33.088969,21.032108 30.694163,18.971739 28.016908,16.875076 25.518755,15.118234 24.321515,14.276269 23.102835,13.520635 21.894709,12.72185 20.847459,12.117356 19.805768,11.474963 18.752792,10.908277 17.04094,9.9869966 14.920944,8.9931907 13.17482,8.358322 12.388884,8.0725646 11.603664,7.8598557 10.819048,7.6370367 10.525682,7.5537377 10.228261,7.4591603 9.9426121,7.4402711 9.4807411,7.40973 9.0393041,7.4729575 8.5877861,7.4894763 7.8560251,7.7634778 7.3529581,7.7740793 6.9426329,8.5742834 6.7875965,8.8766355 6.7179792,9.260199 6.6784977,9.6455802 c -0.0934,0.9127558 0.055234,1.9060448 0.3249413,2.8884758 0.1534301,0.558896 0.3821871,1.107616 0.5732671,1.661256 0.251071,0.546254 0.475352,1.105469 0.75335,1.638595 0.258573,0.495851 0.554226,0.970047 0.8519,1.439599 0.748,1.179823 1.5981669,2.308533 2.5665869,3.210875 l -1.398321,0.02958 C 9.2706181,19.036937 8.2612701,17.467218 7.4110661,15.8108 7.1320575,15.26725 6.8842985,14.708075 6.6210075,14.156703 6.4143548,13.596648 6.1743522,13.043058 6.0013187,12.476653 5.7014477,11.495018 5.4914111,10.461673 5.5393623,9.5219204 5.5597232,9.1229023 5.6091666,8.7216258 5.7537675,8.4040629 5.9576941,7.9562001 6.1911602,7.7351624 6.4722685,7.5893371 Z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<gem-graph-model version="0.2.1">
<identity>
<name>Modèle de test</name>
<owner>Léontine Patinette</owner>
<owner_id>2</owner_id>
<date>1630000000</date>
<version>1.0</version>
<g_ref id="Cause" date="1630000000" author="toujours" lang="en">Ref</g_ref>
</identity>
<parameters id="texte" date="0" author="Léontine Trottine.">
<simulation>
<max_thread>0</max_thread>
<max_cycles>9</max_cycles>
</simulation>
<space-param>
<!-- loop_on_zero="true" anything moved before zero reenters at the end of space-->
<!-- loop_on_zero="false" anything moved before zero is lost-->
<!-- loop_on_max="true" anything moved beyond max reenters at the zero of space-->
<!-- loop_on_max="false" anything moved beyond max is lost-->
<dimension x="29"/>
<!-- Site_multiplicity = number of sites in a space unit. -->
<!-- Each site points towards a neighbouring space unit. -->
<!-- Several arrows can be stacked in the same site. -->
<site_multiplicity>3</site_multiplicity>
</space-param>
</parameters>
<!-- Model objects definition -->
<objects id="only dimers in this model" date="1630000000" author="inanimés,... âme ?">
<object id="a dimer" date="1630000000" author="Alphonse">
<arrow site="1" weight="1" x="0"/>
<arrow site="2" weight="1" x="1"/>
</object>
</objects>
<!-- Saved space description (initial space is sequence 0) -->
<savedstates id="texte" date="1630000000" author="Qui courrait dans l'herbe'">
<state id="initial" date="1630000000" author="Une souris verte">
<arrow site="0" weight="1" x="0"/>
<arrow site="1" weight="1" x="1"/>
<arrow site="0" weight="1" x="10"/>
<arrow site="1" weight="1" x="11"/>
<arrow site="0" weight="1" x="20"/>
<arrow site="1" weight="1" x="21"/>
<!-- Three dimers 1-1 are drawn in the global space
at locations (0,1) (10,11) and (20,21) -->
</state>
</savedstates>
<!-- Model transitions definition (rules) -->
<!-- In this version : <xs:sequence minOccurs="0" maxOccurs="unbounded">-->
<!-- Transitions should be edited by hand and written in a 'human-readable' format -->
<conditions id="random walk of dimers" date="1630000000" author="Zazard le lézard !">
<condition site="1" weight="1" node_id="1" parent="0" x="0"/>
<condition site="2" weight="1" node_id="2" parent="1" x="1"/>
<!-- as soon as conditions 1 and 2 are satisfied, a dimer is identified at atation (0,1). -->
<condition site="1" weight="0" node_id="3" parent="2" x="2"/>
<!-- as soon as condition 3 is satisfied,
the neighbouring space unit to East of the dimer is empty
and the dimer identified by conditions (1,2) can be moved to East. -->
<condition site="2" weight="0" node_id="4" parent="2" x="-1"/>
<!-- as soon as condition 4 is satisfied,
the neighbouring space unit to West of the dimer is empty
and the dimer identified by conditions (1,2) can be moved to West. -->
</conditions>
<transitions>
<transition id="move_a_dimer_to_east" date="1630000000" author="Pas moi..."
parent="3" probability="1">
<arrow site="1" weight="0" x="0"/>
<arrow site="2" weight="0" x="1"/>
<arrow site="1" weight="1" x="1"/>
<arrow site="2" weight="1" x="2"/>
</transition>
<transition id="move_a_dimer_to_west" date="1630000000" author="Ni moi !"
parent="4" probability="1">
<arrow site="1" weight="0" x="0"/>
<arrow site="2" weight="0" x="1"/>
<arrow site="2" weight="1" x="0"/>
<arrow site="1" weight="1" x="1"/>
</transition>
</transitions>
</gem-graph-model>

View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<gem-graph-model version="0.2.1">
<identity>
<name>Test 21-03-2023</name>
<owner>J</owner>
<owner_id>J</owner_id>
<date>time_stamp</date>
<version>1.0</version>
<g_ref id="Cause" date="time_stamp" author="J" lang="en">Ref</g_ref>
</identity>
<parameters id="texte" date="0" author="J">
<simulation>
<max_thread>0</max_thread>
<max_cycles>9</max_cycles>
</simulation>
<space-param>
<!-- loop_on_zero="true" anything moved before zero reenters at the end of space-->
<!-- loop_on_zero="false" anything moved before zero is lost-->
<!-- loop_on_max="true" anything moved beyond max reenters at the zero of space-->
<!-- loop_on_max="false" anything moved beyond max is lost-->
<dimension x="22" y="4" z="8"/>
<!-- Site_multiplicity = number of sites in a space unit. -->
<!-- Each site points towards a neighbouring space unit. -->
<!-- Several arrows can be stacked in the same site. -->
<site_multiplicity>3</site_multiplicity>
</space-param>
</parameters>
<!-- Model objects definition -->
<objects id="only dimers in this model" date="time_stamp" author="J">
<object id="a dimer" date="time_stamp" author="J">
<arrow site="1" weight="1" x="0"/>
<arrow site="2" weight="1" x="1"/>
</object>
</objects>
<!-- Saved space description (initial space is sequence 0) -->
<savedstates id="texte" date="time_stamp" author="J">
<state id="initial" date="time_stamp" author="J">
<arrow site="1" weight="1" x="0"/>
<arrow site="2" weight="1" x="1"/>
<arrow site="1" weight="1" x="10"/>
<arrow site="2" weight="1" x="11"/>
<arrow site="1" weight="1" x="20"/>
<arrow site="2" weight="1" x="21"/>
<!-- Three dimers 1-1 are drawn in the global space
at locations (0,1) (10,11) and (20,21) -->
</state>
</savedstates>
<!-- Model transitions definition (rules) -->
<!-- In this version : <xs:sequence minOccurs="0" maxOccurs="unbounded">-->
<!-- Transitions should be edited by hand and written in a 'human-readable' format -->
<conditions_tree>
<condition_anonym site="1" weight="1" x="0">
<condition_anonym site="2" weight="1" x="1">
<condition_anonym site="1" weight="0" x="2">
<transition_anonym id="move_a_dimer_to_east"
date="time_stamp"
author="J"
probability="0.5"/>
<arrow site="1" weight="0" x="0"/>
<arrow site="2" weight="0" x="1"/>
<arrow site="1" weight="1" x="1"/>
<arrow site="2" weight="1" x="2"/>
</condition_anonym>
<condition_anonym site="2" weight="0" x="-1">
<transition_anonym id="move_a_dimer_to_west"
date="time_stamp"
author="J"
probability="0.5"/>
<arrow site="1" weight="0" x="0"/>
<arrow site="2" weight="0" x="1"/>
<arrow site="2" weight="1" x="0"/>
<arrow site="1" weight="1" x="1"/>
</condition_anonym>
</condition_anonym>
</condition_anonym>
</conditions_tree>
<conditionslist id="random walk of dimers" date="time_stamp" author="J">
<condition site="1" weight="1" node_id="1" parent="0" x="0"/>
<condition site="2" weight="1" node_id="2" parent="1" x="1"/>
<!-- as soon as conditions 1 and 2 are satisfied, a dimer is identified at atation (0,1). -->
<condition site="1" weight="0" node_id="3" parent="2" x="2"/>
<!-- as soon as condition 3 is satisfied,
the neighbouring space unit to East of the dimer is empty
and the dimer identified by conditions (1,2) can be moved to East. -->
<condition site="2" weight="0" node_id="4" parent="2" x="-1"/>
<!-- as soon as condition 4 is satisfied,
the neighbouring space unit to West of the dimer is empty
and the dimer identified by conditions (1,2) can be moved to West. -->
</conditionslist>
<transitionslist>
<transition id="move_a_dimer_to_east" date="time_stamp" author="J"
parent="3" probability="1">
<arrow site="1" weight="0" x="0"/>
<arrow site="2" weight="0" x="1"/>
<arrow site="1" weight="1" x="1"/>
<arrow site="2" weight="1" x="2"/>
</transition>
<transition id="move_a_dimer_to_west" date="time_stamp" author="J"
parent="4" probability="1">
<arrow site="1" weight="0" x="0"/>
<arrow site="2" weight="0" x="1"/>
<arrow site="2" weight="1" x="0"/>
<arrow site="1" weight="1" x="1"/>
</transition>
</transitionslist>
</gem-graph-model>

View File

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="node_id" type="xs:integer"/>
<xs:attribute name="parent" type="xs:integer"/>
<xs:attribute name="date" type="xs:integer"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="lang" type="xs:string"/>
<xs:attribute name="owner" type="xs:string"/>
<xs:attribute name="owner_id" type="xs:integer"/>
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="version" type="xs:float"/>
<xs:attribute name="probability" type="xs:integer"/>
<xs:attribute name="site" type="xs:integer" default="0"/>
<xs:attribute name="weight" type="xs:integer" default="0"/>
<xs:attribute name="u" type="xs:integer"/>
<xs:attribute name="v" type="xs:integer"/>
<xs:attribute name="w" type="xs:integer"/>
<xs:attribute name="x" type="xs:integer"/>
<xs:attribute name="y" type="xs:integer"/>
<xs:attribute name="z" type="xs:integer"/>
<xs:attribute name="t" type="xs:integer"/>
<xs:attributeGroup name="id_date_author">
<xs:attribute ref="id"/>
<xs:attribute ref="date"/>
<xs:attribute ref="author"/>
</xs:attributeGroup>
<xs:element name="g_ref">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="id_date_author"/>
<xs:attribute ref="lang" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="quote" substitutionGroup="g_ref"/>
<xs:element name="dimension">
<xs:complexType>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="optional"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="arrow">
<xs:complexType>
<xs:attribute ref="site" use="required"/>
<xs:attribute ref="weight" use="required"/>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="optional"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="condition">
<xs:complexType>
<xs:attribute ref="site" use="required"/>
<xs:attribute ref="weight" use="required"/>
<xs:attribute ref="node_id" use="required"/>
<xs:attribute ref="parent" use="required"/>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="optional"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="state">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="arrow"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="object" substitutionGroup="state"/>
<xs:element name="transition">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element minOccurs="0" ref="quote"/>
<xs:element ref="arrow"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
<xs:attribute ref="parent" use="required"/>
<xs:attribute ref="probability" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="gem-graph-model">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="identity">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="name" type="xs:string"/>
<xs:element name="owner" type="xs:string"/>
<xs:element name="owner_id" type="xs:integer"/>
<xs:element name="date" type="xs:integer"/>
<xs:element name="version" type="xs:float"/>
<xs:element ref="g_ref" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="parameters">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="simulation">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="max_thread" type="xs:integer"/>
<xs:element name="max_cycles" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="space-param">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element ref="dimension"/>
<xs:element name="site_multiplicity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="objects">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="object"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="savedstates">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="state"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="conditions">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element minOccurs="0" ref="quote"/>
<xs:element ref="condition"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="transitions">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="transition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute ref="version" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="node_id" type="xs:integer"/>
<xs:attribute name="parent" type="xs:integer"/>
<xs:attribute name="date" type="xs:integer"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="lang" type="xs:string"/>
<xs:attribute name="owner" type="xs:string"/>
<xs:attribute name="owner_id" type="xs:integer"/>
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="version" type="xs:float"/>
<xs:attribute name="probability" type="xs:integer"/>
<xs:attribute name="site" type="xs:integer" default="0"/>
<xs:attribute name="weight" type="xs:integer" default="0"/>
<xs:attribute name="u" type="xs:integer"/>
<xs:attribute name="v" type="xs:integer"/>
<xs:attribute name="w" type="xs:integer"/>
<xs:attribute name="x" type="xs:integer"/>
<xs:attribute name="y" type="xs:integer"/>
<xs:attribute name="z" type="xs:integer"/>
<xs:attribute name="t" type="xs:integer"/>
<xs:attributeGroup name="id_date_author">
<xs:attribute ref="id"/>
<xs:attribute ref="date"/>
<xs:attribute ref="author"/>
</xs:attributeGroup>
<xs:element name="g_ref">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="id_date_author"/>
<xs:attribute ref="lang" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="quote" substitutionGroup="g_ref"/>
<xs:element name="dimension">
<xs:complexType>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="optional"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="arrow">
<xs:complexType>
<xs:attribute ref="site" use="required"/>
<xs:attribute ref="weight" use="required"/>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="required"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="condition">
<xs:complexType>
<xs:attribute ref="site" use="required"/>
<xs:attribute ref="weight" use="required"/>
<xs:attribute ref="node_id" use="required"/>
<xs:attribute ref="parent" use="required"/>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="required"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="condition_anonym">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="condition_anonym"/>
</xs:sequence>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="arrow"/>
</xs:sequence>
<xs:attribute ref="site" use="required"/>
<xs:attribute ref="weight" use="required"/>
<xs:attribute ref="u" use="optional"/>
<xs:attribute ref="v" use="optional"/>
<xs:attribute ref="w" use="optional"/>
<xs:attribute ref="x" use="required"/>
<xs:attribute ref="y" use="optional"/>
<xs:attribute ref="z" use="optional"/>
<xs:attribute ref="t" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="state">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="arrow"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="object" substitutionGroup="state"/>
<xs:element name="transition">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element minOccurs="0" ref="quote"/>
<xs:element ref="arrow"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
<xs:attribute ref="parent" use="required"/>
<xs:attribute ref="probability" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="transition_anonym">
<xs:complexType>
<xs:attributeGroup ref="id_date_author"/>
<xs:attribute ref="probability" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="gem-graph-model">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="identity">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="name" type="xs:string"/>
<xs:element name="owner" type="xs:string"/>
<xs:element name="owner_id" type="xs:integer"/>
<xs:element name="date" type="xs:integer"/>
<xs:element name="version" type="xs:float"/>
<xs:element ref="g_ref" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="parameters">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="simulation">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="max_thread" type="xs:integer"/>
<xs:element name="max_cycles" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="space-param">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element ref="dimension"/>
<xs:element name="site_multiplicity" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="objects">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element ref="object"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="savedstates">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="state"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="conditionslist">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element minOccurs="0" ref="quote"/>
<xs:element ref="condition"/>
</xs:sequence>
<xs:attributeGroup ref="id_date_author"/>
</xs:complexType>
</xs:element>
<xs:element name="transitionslist">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="transition"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="conditionstree">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="condition_anonym"/>
</xs:sequence>
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element ref="transition_anonym"/>
</xs:sequence>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="arrow"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute ref="version" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

32
description_modes.txt Normal file
View File

@ -0,0 +1,32 @@
Home:
- Pas de sidebar (inutile)
- Récemment ouverts
- Permettre d'ouvrir directement sans validation (par un "ne pas redemander")
- Logo en grand au centre
Edit:
- Sidebar présente
- Bibliothèques (par stack)
- objets
- conditions/transitions (liées)
- états sauvegardés
- Zone principale
- vue état globale 3D (en haut ou en bas) avec zoom sur localité
- vue édition (avec split) -> vue 3D aussi ? vue schématique ?
- conditions/transitions
- objets
- états
Run:
- Sidebar
- Contrôles
- Vitesse
- Pas à pas
- Avance/Recul/Run/Pause (avec vue buffer)
- Bibliothèques (par stack)
- objets
- conditions/transitions (liées)
- états sauvegardés
- Zone principale
- Vue globale 3D (en haut ou bas)
- Mesures (stats par exemple)

View File

@ -0,0 +1,143 @@
static GLuint *buffer_lines_origin = NULL;
---
long get_buffer_lines_size() {return buffer_lines_size / 2;}
void inc_buffer_lines_size(long inc) {buffer_lines_size += inc * 2;}
void dec_buffer_lines_size(long dec) {buffer_lines_size -= dec * 2;}
void xxx_draw_line (GLuint *lines_origin, int a, int b, long lines_index)
{
// https://docs.gtk.org/glib/func.realloc.html
printf("xxx_draw_line %ld\n", lines_index);
buffer_lines_origin = g_realloc(lines_origin, sizeof(GLuint) * 2);
*(lines_origin + lines_index + 0) = a; // lines_index ++;
*(lines_origin + lines_index + 1) = b; // lines_index ++;
}
/* (gdb) help
List of classes of commands:
aliases -- User-defined aliases of other commands.
breakpoints -- Making program stop at certain points.
data -- Examining data.
files -- Specifying and examining files.
internals -- Maintenance commands.
obscure -- Obscure features.
running -- Running the program.
stack -- Examining the stack.
status -- Status inquiries.
support -- Support facilities.
text-user-interface -- TUI is the GDB text based interface.
tracepoints -- Tracing of program execution without stopping the program.
user-defined -- User-defined commands.
*/
-------------------------------------------------------------------------------------------
GLuint arrows[] = {
1, 0, 0, 0, 0,
/* 1, 1, 1, 0, 0, */
/* 1, 2, 2, 1, 1, */
/* 1, 3, 2, 2, 1, */
/* 1, 4, 3, 0, 1, */
/* 1, 5, 3, 0, 2, */
/* 1, 1, 3, 0, 2, */
/* 1, 0, 2, 0, 2, */
/* 1, 5, 2, 1, 1, */
// load, site, x, y, z
};
static void get_model_data_and_user_preferences(){
model_space_size_x = 1; // 0 < model_space_size_x
model_space_size_y = 1; // 0 < model_space_size_y
model_space_size_z = 1; // 0 < model_space_size_z
// XXX ONLY space drawed, no arrows yet
model_arrows_nb = sizeof(arrows); // assert : l'emplacement des flèches est contraint
// par model_space_size_x, y, z et le nombre de sites
central_stars_nb = 0; // à calculer TODO
// ! WARNING ! Pour l'instant égal au nombre de flèches ! (central stars réécrites)
central_stars_nb = model_arrows_nb;
// pref_mark_unit_space = 0; // 0 = no marks, 1 = 1st, 2 = last, 3 = both
// pref_style_lines_planes = 0; // 0 = arrows as lines, 1 = as planes, 2 = mix
// pref_style_mix_colors = 0; // TODO
pref_show_grid = 0; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc
// xyz, 0, x, y, z, xy, xz, yz, xyz
pref_test_diagonal = 1;
}
-------------------------------------------------------------------------------------------
in buffers.c (line 283)
static void draw_line (GLuint *lines_origin, int a, int b)
{
xxx_draw_line (lines_origin, a, b, lines_index);
lines_index += 2;
// *(lines_origin + lines_index) = a; lines_index ++;
// *(lines_origin + lines_index) = b; lines_index ++;
}
---------------------------------------------------------------------------
[ n] load site x y z ---- < arrows array > ------------------------------------------------------------
[ 0] = 1, 0, 0, 0, 0
[ 1] = 0, 0, 0, 217808480, 32708
[ 2] = 217809344, 32708, 217807968, 32708, 217810080
[ 3] = 32708, -69297984, 32707, 229965808, 32708
[ 4] = 229944176, 32708, 217808608, 32708, 229970384
[ 5] = 32708, 217808576, 32708, 217809024, 32708
[ 6] = 217808992, 32708, -69297888, 32707, 229954976
[ 7] = 32708, 217808512, 32708, 229949456, 32708
[ 8] = 229942736, 32708, 0, 0, 0
[ 9] = 0, 0, 0, 226977440, 32708
[10] = 217810048, 32708, 217808352, 32708, 217808704
[11] = 32708, -69297600, 32707, 217808448, 32708
[12] = 217807808, 32708, 217808896, 32708, 217809312
[13] = 32708, 217807872, 32708, 225561296, 32708
[14] = 217814880, 32708, 217814944, 32708, 217807776
[15] = 32708, 229974752, 32708, 217811040, 32708
[16] = 229947200, 32708, 0, 0, 33506144
[17] = 0, 0, 0, 0, 0
[18] = 33204048, 0, 0, 0, 33587952
[19] = 0, 30217696, 0, 30245088, 0
[ n] load site x y z ---- < arrows array > ------------------------------------------------------------
[ 0] = 1, 0, 0, 0, 0
[ 1] = 0, 0, 0, 2105314912, 32683
[ 2] = 2105315776, 32683, 2105314400, 32683, 2105316512
[ 3] = 32683, 2019551424, 32683, 2117545968, 32683
[ 4] = 2117524336, 32683, 2105315040, 32683, 2117550544
[ 5] = 32683, 2105315008, 32683, 2105315456, 32683
[ 6] = 2105315424, 32683, 2019551520, 32683, 2117535136
[ 7] = 32683, 2105314944, 32683, 2117529616, 32683
[ 8] = 2117522896, 32683, 0, 0, 0
[ 9] = 0, 0, 0, 2114557600, 32683
[10] = 2105316480, 32683, 2105314784, 32683, 2105315136
[11] = 32683, 2019551808, 32683, 2105314880, 32683
[12] = 2105314240, 32683, 2105315328, 32683, 2105315744
[13] = 32683, 2105314304, 32683, 2113141456, 32683
[14] = 2105321312, 32683, 2105321376, 32683, 2105314208
[15] = 32683, 2117554912, 32683, 2105317472, 32683
[16] = 2117527360, 32683, 0, 0, 16032608
[17] = 0, 0, 0, 0, 0
[18] = 15766240, 0, 0, 0, 15950576
[19] = 0, 12654048, 0, 12681440, 0

77
gdb.txt Normal file
View File

@ -0,0 +1,77 @@
The program is not being run.
Temporary breakpoint 1 at 0x404740: file src/main.c, line 42.
Starting program: /home/jean/Gem-Graph/gem-graph-client/bin/gem-graph-client
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libthread_db.so.1".
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffce58) at src/main.c:42
42 app = gem_graph_client_application_new("org.alec.gemgraph",
Continuing.
[New Thread 0x7fffef5ff640 (LWP 21368)]
[New Thread 0x7fffee2f5640 (LWP 21369)]
[New Thread 0x7fffecfeb640 (LWP 21370)]
[Thread 0x7fffecfeb640 (LWP 21370) exited]
[New Thread 0x7fffecfeb640 (LWP 21371)]
[New Thread 0x7fffe49b5640 (LWP 21372)]
[New Thread 0x7fffe41b4640 (LWP 21373)]
[New Thread 0x7fffe2eaa640 (LWP 21374)]
[New Thread 0x7fffe1ba0640 (LWP 21375)]
[New Thread 0x7fffe0896640 (LWP 21376)]
[New Thread 0x7fffdf58c640 (LWP 21377)]
[New Thread 0x7fffde282640 (LWP 21378)]
[New Thread 0x7fffdcf78640 (LWP 21379)]
[New Thread 0x7fffdbc6e640 (LWP 21380)]
[Thread 0x7fffe49b5640 (LWP 21372) exited]
[Thread 0x7fffde282640 (LWP 21378) exited]
[Thread 0x7fffdf58c640 (LWP 21377) exited]
[Thread 0x7fffe0896640 (LWP 21376) exited]
[Thread 0x7fffe1ba0640 (LWP 21375) exited]
[Thread 0x7fffe41b4640 (LWP 21373) exited]
[Thread 0x7fffdbc6e640 (LWP 21380) exited]
[Thread 0x7fffdcf78640 (LWP 21379) exited]
[Thread 0x7fffe2eaa640 (LWP 21374) exited]
[Thread 0x7fffecfeb640 (LWP 21371) exited]
[New Thread 0x7fffecfeb640 (LWP 21381)]
[New Thread 0x7fffdbc6e640 (LWP 21382)]
[New Thread 0x7fffdcf78640 (LWP 21383)]
[New Thread 0x7fffde282640 (LWP 21384)]
[New Thread 0x7fffe33ff640 (LWP 21385)]
[New Thread 0x7fffe20f5640 (LWP 21386)]
[New Thread 0x7fffe0deb640 (LWP 21387)]
[New Thread 0x7fffe05ea640 (LWP 21388)]
[New Thread 0x7fffdda81640 (LWP 21389)]
[New Thread 0x7fffdb46d640 (LWP 21390)]
[New Thread 0x7fffd965a640 (LWP 21391)]
[New Thread 0x7fffd8350640 (LWP 21392)]
[New Thread 0x7fffd7046640 (LWP 21393)]
[New Thread 0x7fffd5d3c640 (LWP 21394)]
[New Thread 0x7fffd4a32640 (LWP 21395)]
[New Thread 0x7fffd3728640 (LWP 21396)]
[New Thread 0x7fffd241e640 (LWP 21397)]
[New Thread 0x7fffd1c1d640 (LWP 21398)]
[Thread 0x7fffd241e640 (LWP 21397) exited]
[Thread 0x7fffd1c1d640 (LWP 21398) exited]
[New Thread 0x7fffd1c1d640 (LWP 21399)]
[New Thread 0x7fffd241e640 (LWP 21400)]
[Thread 0x7fffd1c1d640 (LWP 21399) exited]
[Thread 0x7fffd241e640 (LWP 21400) exited]
[New Thread 0x7fffd241e640 (LWP 21401)]
[New Thread 0x7fffd1c1d640 (LWP 21402)]
[Thread 0x7fffd7046640 (LWP 21393) exited]
Thread 1 "gem-graph-clien" received signal SIGINT, Interrupt.
0x00007ffff5ab4d4b in __memmove_sse2_unaligned_erms () from /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so.6
Breakpoint 2 at 0x4088a5: file src/graphics/graphics.c, line 697.
Continuing.
[Thread 0x7fffd5d3c640 (LWP 21394) exited]
Thread 1 "gem-graph-clien" received signal SIGINT, Interrupt.
0x00007ffff5b77dca in __memset_avx2_unaligned_erms () from /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so.6
Breakpoint 3 at 0x408320: file src/graphics/graphics.c, line 873.
Continuing.
Thread 1 "gem-graph-clien" received signal SIGINT, Interrupt.
0x00007ffff5ab4e3e in __memmove_sse2_unaligned_erms () from /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so.6
Quit
quit

0
help/.gitkeep Normal file
View File

119
include/base.h Normal file
View File

@ -0,0 +1,119 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: Base header
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glib-2.0/glib.h>
#define G_APPLICATION_DEFAULT_FLAGS 0
// Graphical axis
enum
{
X_AXIS,
Y_AXIS,
Z_AXIS,
N_AXIS
};
// Gem-graph modes
enum
{
HOME_MODE,
RUN_MODE,
EDIT_MODE,
PRESENTATION_MODE,
N_MODE
};
/*
* Structure describing an arrow
*/
struct arrow_t {
uint load;
uint site;
uint x;
uint y;
uint z;
};
/*
* Read a file from filename into a provided buffer
*
* @param filename, file name
* contents, target ptr
*
* @return void
*/
static inline char *read_file(char *filename)
{
int fd;
int filesize;
char *contents;
fd = open(filename, O_RDONLY);
if(fd < 0) {
printf("Couldn't read file: %s\n",filename);
return NULL;
}
filesize = lseek(fd, 0, SEEK_END) + 1 ;
contents = g_malloc(filesize * sizeof(char));
assert (contents);
lseek(fd, 0, SEEK_SET);
read(fd,contents,filesize);
contents[filesize-1] = '\0';
close(fd);
return contents;
}
/* I'm standing on Earth (any planet or star or spinning spheroid, in fact)
* and looking towards its North pole
*
* X - X = EAST - WEST = rouge - cyan
* Y - Y = ZENITH - NADIR = vert - magenta
* Z - Z = NORTH - SOUTH = bleu - jaune
*/
#define EAST 0 // + x rouge
#define WEST 1 // - x cyan
#define ZENITH 2 // + y vert
#define NADIR 3 // - y magenta
#define SOUTH 4 // + z bleu
#define NORTH 5 // - z jaune

314
include/graphics.h Normal file
View File

@ -0,0 +1,314 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: OpenGL utils header
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "base.h"
#include <unistd.h>
#include <stdbool.h>
#include <epoxy/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>
#include <cglm/cglm.h>
#define VERTEX_SHADER_FILE "src/graphics/shaders/shader.vert"
#define FRAG_SHADER_FILE "src/graphics/shaders/shader.frag"
#define GL_TARGET_MAJOR_VERSION 0
#define GL_TARGET_MINOR_VERSION 4
/*
* Structure describing a gl_area and its parameters, used to create a table
* of Gem-graph client current gl_areas
*/
struct graphic_stack_t {
int id;
int mode;
float rotation_angles[N_AXIS]; // Rotation angles on each axis
GLuint vao; // init_buffers
GLuint position_buffer; // shutdown, draw
GLuint color_buffer; // shutdown, draw
GLuint program; // shutdown, init_shaders, draw
GLuint m; // init_shaders, draw
GLuint v; // init_shaders, draw
GLuint p; // init_shaders, draw
struct arrow_t *arrows_ptr;
long arrows_nb;
GLfloat *buffer_vertex_origin;
GLfloat *buffer_colors_origin;
GLuint *buffer_lines_origin;
GLuint *buffer_plans_origin;
long buffer_vertex_size;
long buffer_colors_size;
long buffer_lines_size;
long buffer_plans_size;
long buffer_vertex_0_arrow;
long buffer_colors_0_arrow;
long buffer_lines_0_arrow;
long buffer_plans_0_arrow;
};
/*
* Dynamic array of ptrs to dynamically allocated gl_area_entry
*/
extern struct graphic_stack_t *graphic_stack;
/*
* Initializes a gl_area
*
* @param gl_area, ptr to the gl_area widget
*
* @return true if initialized
*/
int graphics_init(void *error_buffer);
/*
* Draws the current buffer to a gl_area
*
* @param gl_area, ptr to the gl_area widget
*
* @return void
*/
void graphics_draw(const int stack_id);
/*
* Shutdowns a gl_area
*
* @param gl_area, ptr to the gl_area widget
*
* @return true if success
*/
bool graphics_shutdown(const int stack_id, void *error_buffer);
/*
* Initializes the shaders of a gl_area and link them to a program
*
* @param gl_area, ptr to the gl_area widget
*
* @return true if initialized
*/
bool graphics_init_shaders(const int stack_id);
/* Initializes the buffer of a gl_area
* Calls according to the user preferences
* @param gl_area, ptr to the gl_area widget
* @return void
*/
void graphics_init_buffers(const int stack_id);
/*
* Draws a vertex (x, y, z)
* if (console) prints (x, y, z) values to console
*
* @param GLfloat x, GLfloat y, GLfloat z
*
* @return void
*/
void graphics_draw_vertex (const int stack_id,
GLfloat x,
GLfloat y,
GLfloat z);
/*
* Draws the color (r, g, b) associated to a vertex
* if (console) prints (r, g, b) values to console
*
* @param GLfloat r, GLfloat g, GLfloat b
*
* @return void
*/
void graphics_draw_color (const int stack_id, GLfloat r, GLfloat g, GLfloat b);
/*
* Writes values to describe a line from a to b into the line buffer
*
* @param coords GLuint (a,b)
*
* @return void
*/
void graphics_draw_line (const int stack_id, GLuint a, GLuint b);
/*
* Writes values to describe an (a,b,c) plan (triangle) into the plan buffer
*
* @param coords GLuint (a,b,c)
*
* @return void
*/
void graphics_draw_plan (const int stack_id, GLuint a, GLuint b, GLuint c);
/*
* Created and compile a shader
*
* @param type, shader type
* src, source code of shader
*
* @return shader id
*/
static inline GLuint create_shader(const int stack_id, int type, const char *src)
{
GLuint shader;
int status;
shader = glCreateShader(type);
glShaderSource(shader, 1, &src, NULL);
glCompileShader(shader);
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if(status == GL_FALSE) {
int log_len;
char *buffer;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_len);
buffer = g_malloc(log_len + 1);
assert (buffer);
glGetShaderInfoLog(shader, log_len, NULL, buffer);
g_warning("Compile failure in %s shader:\n%s",
type == GL_VERTEX_SHADER ? "vertex" : "fragment",
buffer);
g_free(buffer);
glDeleteShader(shader);
return 0;
}
return shader;
}
static inline void print_stack(int stack_id)
{
static int n = 0;
printf("\n[n=%d]***************", n);
printf("id = %d\tmode = %d\n",
graphic_stack[stack_id].id,
graphic_stack[stack_id].mode);
printf("rotation_angles = ");
for (int i = 0; i < N_AXIS; i++) {
printf("%f\t", graphic_stack[stack_id].rotation_angles[i]); // Rotation angles on each axis
}
printf("\n");
printf("vao = %d\n", graphic_stack[stack_id].vao);
printf("position_buffer = %d\n", graphic_stack[stack_id].position_buffer);
printf("color_buffer = %d\n", graphic_stack[stack_id].color_buffer);
printf("program = %d\n", graphic_stack[stack_id].program);
printf("m = %d\n", graphic_stack[stack_id].m);
printf("v = %d\n", graphic_stack[stack_id].v);
printf("p = %d\n", graphic_stack[stack_id].p);
printf("arrows_ptr = %p\n", graphic_stack[stack_id].arrows_ptr);
printf("arrows_nb = %ld\n", graphic_stack[stack_id].arrows_nb);
printf("buffer_vertex_origin = %p\n", graphic_stack[stack_id].buffer_vertex_origin);
printf("buffer_colors_origin = %p\n", graphic_stack[stack_id].buffer_colors_origin);
printf("buffer_lines_origin = %p\n", graphic_stack[stack_id].buffer_lines_origin);
printf("buffer_plans_origin = %p\n", graphic_stack[stack_id].buffer_plans_origin);
printf("buffer_vertex_size = %ld\n", graphic_stack[stack_id].buffer_vertex_size);
printf("buffer_colors_size = %ld\n", graphic_stack[stack_id].buffer_colors_size);
printf("buffer_lines_size = %ld\n", graphic_stack[stack_id].buffer_lines_size);
printf("buffer_plans_size = %ld\n", graphic_stack[stack_id].buffer_plans_size);
printf("buffer_vertex_0_arrow = %p\n", graphic_stack[stack_id].buffer_vertex_0_arrow);
printf("buffer_colors_0_arrow = %p\n", graphic_stack[stack_id].buffer_colors_0_arrow);
printf("buffer_lines_0_arrow = %p\n", graphic_stack[stack_id].buffer_lines_0_arrow);
printf("buffer_plans_0_arrow = %p\n", graphic_stack[stack_id].buffer_plans_0_arrow);
printf("********************\n");
n++;
}
void graphics_model_setup (const int stack_id);
int draw_one_arrow_vertex (const int stack_id,
int space_X,
int space_Y,
int space_Z,
int weight,
int site,
int x,
int y,
int z);
int draw_one_arrow_line(const int stack_id,
int offset_vertex);
/*
* Writes grid ridges to vertex and color buffers
*
* @param coords long (x,y,z), step_x, step_y, step_z
*
* @return void
*/
int draw_space_ridges_vertex (const int stack_id,
long offset_vertex,
long x,
long y,
long z);
int draw_space_ridges_lines (const int stack_id);
/*
* Writes grid lines on space faces
*
* @param coords long (x,y,z)
*
* @return void
*/
long draw_grids_on_space_faces_vertex (const int stack_id,
long x,
long y,
long z);
long draw_grids_on_space_faces_lines (const int stack_id,
long offset_vertex,
long x,
long y,
long z);
int set_arrow (int stack_id,
int arrows_nb,
int space_X,
int space_Y,
int space_Z,
int requested_weight,
int site,
int arrow_x,
int arrow_y,
int arrow_z);

39
include/parsing.h Normal file
View File

@ -0,0 +1,39 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: Model parsing header
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <unistd.h>
#include "../include/base.h"
bool model_init(const char *content, size_t length, const char *basename);
bool model_shutdown(void);
char model_get_dim(void);
long model_get_dim_value(const char *axis);
char model_get_multiplicity(void);
bool model_get_next_state(char *new_state_id);
bool model_get_next_arrow(struct arrow_t *new_arrow,
const char *state_id,
char dimension);

232
include/ui.h Normal file
View File

@ -0,0 +1,232 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: User interface header
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <unistd.h>
#include <gtk-4.0/gtk/gtk.h>
#include "../include/base.h"
G_BEGIN_DECLS
#define GEM_GRAPH_CLIENT_TYPE_WINDOW (gem_graph_client_window_get_type())
G_DECLARE_FINAL_TYPE (GemGraphClientWindow,
gem_graph_client_window,
GEM_GRAPH_CLIENT,
WINDOW,
GtkApplicationWindow)
G_END_DECLS
G_BEGIN_DECLS
#define GEM_GRAPH_CLIENT_TYPE_APPLICATION (gem_graph_client_application_get_type())
G_DECLARE_FINAL_TYPE (GemGraphClientApplication,
gem_graph_client_application,
GEM_GRAPH_CLIENT,
APPLICATION,
GtkApplication)
GemGraphClientApplication *gem_graph_client_application_new(const char *application_id,
GApplicationFlags flags);
G_END_DECLS
void ui_enable_action(const char *name);
void ui_disable_action(const char *name);
//
// Actions
//
void on_about_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_quit_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_preferences_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_togglesidebar_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_editmode_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_runmode_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_presentmode_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_openfile_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_closefile_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_savefile_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
void on_toast_close_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
static const GActionEntry app_actions[] = {
{ "quit", on_quit_action, NULL, NULL, NULL },
{ "about", on_about_action, NULL, NULL, NULL },
{ "preferences", on_preferences_action, NULL, NULL, NULL },
{ "togglesidebar", on_togglesidebar_action, NULL, NULL, NULL },
{ "editmode", on_editmode_action, NULL, NULL, NULL },
{ "runmode", on_runmode_action, NULL, NULL, NULL },
{ "presentmode", on_presentmode_action, NULL, NULL, NULL },
{ "openfile", on_openfile_action, NULL, NULL, NULL },
{ "closefile", on_closefile_action, NULL, NULL, NULL },
{ "savefile", on_savefile_action, NULL, NULL, NULL },
{ "toastclose", on_toast_close_action, NULL, NULL, NULL },
};
//
// Actions responses
//
void on_openfile_response(GtkNativeDialog *native,
int response,
GemGraphClientWindow *self);
void ui_model_loading(GObject *source_object,
GAsyncResult *result,
GemGraphClientWindow *self);
//
// General events
//
void on_axis_value_change(GtkAdjustment *adjustment, gpointer data);
gboolean on_glarea_render(GtkGLArea * area, GdkGLContext * context);
void on_glarea_realize(GtkWidget *widget);
void on_glarea_unrealize(GtkWidget *widget);
void on_close_window(GtkWidget *widget);
/* -------------------------------------------------------------------------- */
//
// Window primitives
//
void ui_set_stack(int mode);
void ui_send_internal_notification(const char *message);
void ui_close_internal_notification(void);
void ui_toggle_sidebar();
//
// Graphical stuff
//
/*
* Creates GLArea and indexes it
*
* @params target_mode, meaning which ui_stack we're on
* target_widget, meaning the box that will host the GLArea
*
* @returns bool, true if success
*/
bool ui_setup_glarea(int target_mode, GtkWidget *target_widget);
/*
* Look for stack entry and returns stack_id
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns stack_id
*/
long ui_get_graphic_stack(void *container_widget);
/*
* Look for stack entry and initializes OpenGL for it
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_init_graphic_stack(void *container_widget, GError *error_buffer);
/*
* Look for stack entry and shutdowns OpenGL for it
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer);
void ui_clean_stack_index(void);
/*
* Look for stack entry and triggers OpenGL for drawing
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_render_stack(GtkWidget *container_widget);
/*
* Look for every stack entry and shutdowns OpenGL for it
*
* @params void
*
* @returns bool, true if success
*/
void ui_shutdown_all_graphic_stacks(void);
/*
* Look for stack entry and triggers OpenGL for drawing
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value);

30
manifest.scm Normal file
View File

@ -0,0 +1,30 @@
;;
;; Dépendances sous GNU Guix
;;
(specifications->manifest
(list
"bash"
"coreutils"
"gcc-toolchain"
"pkg-config"
"valgrind"
"findutils"
"gdb"
"make"
"gtk"
"libxml2"
"glu"
"glew"
"glfw"
"cglm"
"libepoxy"
"pango@1.90.0"
"xorgproto"
"glib"
"mesa-headers"
"mesa"
"libadwaita"
)
)

0
po/.gitkeep Normal file
View File

285
src/graphics/arrows.c Normal file
View File

@ -0,0 +1,285 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: OpenGL utils header
*
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
* Copyright (C) 2023 Arien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../../include/base.h"
#include "../../include/graphics.h"
/* I'm standing on Earth (any planet or star or spinning spheroid, in fact)
* and looking towards its North pole
*
* X - X = EAST - WEST = rouge - cyan
* Y - Y = ZENITH - NADIR = vert - magenta
* Z - Z = NORTH - SOUTH = bleu - jaune
*/
int draw_one_arrow_vertex (const int stack_id,
int space_X_int,
int space_Y_int,
int space_Z_int,
int weight,
int site,
int arrow_x,
int arrow_y,
int arrow_z)
{
float max = fmax(space_X_int, space_Y_int);
max = fmax(max, space_Z_int);
float i = arrow_x, j = arrow_y, k = arrow_z;
float vx = (2 * i / space_X_int - 1) * space_X_int / max + (1 / max),
vy = (2 * j / space_Y_int - 1) * space_Y_int / max + (1 / max),
vz = (2 * k / space_Z_int - 1) * space_Z_int / max + (1 / max);
graphics_draw_vertex(stack_id, vx, vy, vz);
graphics_draw_color(stack_id, 0.4f, 0.4f, 0.4f);
// réduit légèrement les longueurs des flèches
// pour qu'elles s'arrêtent avant les faces des cubes
GLfloat arrow_tip_padding = (1 / max) / 10;
switch(site){
case EAST:
graphics_draw_vertex (stack_id, vx - (site % 2 - 1) * (1 / max) + (site % 2 - 1) * arrow_tip_padding, vy, vz);
graphics_draw_color (stack_id, 1.0f, 0.0f, 0.0f);
break;
case WEST:
graphics_draw_vertex (stack_id, vx - (site % 2) * (1 / max) + (site % 2) * arrow_tip_padding, vy, vz);
graphics_draw_color (stack_id, 0.0f, 1.0f, 1.0f);
break;
case ZENITH:
graphics_draw_vertex (stack_id, vx, vy - (site % 2 - 1) * (1 / max) + (site % 2 - 1) * arrow_tip_padding, vz);
graphics_draw_color(stack_id, 0.0f, 0.6f, 0.1f);
break;
case NADIR:
graphics_draw_vertex (stack_id, vx, vy - (site % 2) * (1 / max) + (site % 2) * arrow_tip_padding, vz);
graphics_draw_color(stack_id, 0.6f, 0.1f, 0.7f);
break;
case SOUTH:
graphics_draw_vertex (stack_id, vx, vy, vz - (site % 2 + 1) * (1 / max) + (site % 2 + 1) * arrow_tip_padding);
graphics_draw_color(stack_id, 0.05f, 0.4f, 1.0f);
break;
case NORTH:
graphics_draw_vertex (stack_id, vx, vy, vz - (site % 2 - 2) * (1 / max) + (site % 2 - 2) * arrow_tip_padding);
graphics_draw_color(stack_id, 1.0f, 1.0f, 0.0f);
break;
default: break;
}
return 2*3;
}
int draw_one_arrow_line(const int stack_id, int offset_vertex)
{
graphics_draw_line (stack_id, offset_vertex + 0, offset_vertex + 1);
return 2;
}
/*
* Depends on set_arrow()
* Exchanges current and required site values
* when the address of the arrow to be set is already occupied
*/
static int rewrite_arrow (const int stack_id,
int address,
int load,
int site,
int x,
int y,
int z)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
printf("WARNING in rewrite_arrow() <> address or address / 5 ? (et pourquoi ?)\n");
stack->arrows_ptr[address].load = load;
return 1;
}
/*
* Depends on set_arrow()
* Creates the arrow to be set with the required load at the required address
*/
static inline int create_arrow (int stack_id,
int arrows_nb,
int space_X,
int space_Y,
int space_Z,
int load,
int site,
int x,
int y,
int z)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
void *newptr = g_realloc(stack->arrows_ptr, (arrows_nb + 1) * sizeof(struct arrow_t));
if (newptr)
stack->arrows_ptr = newptr;
else
perror("In create arrow, can't allocate new arrow buffer !\n");
stack->arrows_ptr[arrows_nb].load = load;
stack->arrows_ptr[arrows_nb].site = site;
stack->arrows_ptr[arrows_nb].x = x;
stack->arrows_ptr[arrows_nb].y = y;
stack->arrows_ptr[arrows_nb].z = z;
draw_one_arrow_vertex(stack_id, space_X, space_Y, space_Z, load, site, x, y, z);
draw_one_arrow_line (stack_id, stack->buffer_vertex_size / 3 - 2);
arrows_nb ++;
return arrows_nb;
}
/*
* Depends on set_arrow()
* Erases the arrow at the required address
*/
static inline int erase_arrow (const int stack_id,
int arrows_nb,
int arrow_address_in_list,
GLuint site,
GLint x,
GLint y,
GLint z)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
if (arrows_nb == 0) assert (stack->buffer_lines_size ==
stack->buffer_lines_0_arrow);
if (arrows_nb == 0) {
stack->buffer_lines_size =
stack->buffer_lines_0_arrow;
return 0;
}
assert (arrows_nb);
arrows_nb --;
if (arrow_address_in_list < arrows_nb)
{
stack->arrows_ptr[arrow_address_in_list].load =
stack->arrows_ptr[arrows_nb].load;
stack->arrows_ptr[arrow_address_in_list].site =
stack->arrows_ptr[arrows_nb].site;
stack->arrows_ptr[arrow_address_in_list].x =
stack->arrows_ptr[arrows_nb].x;
stack->arrows_ptr[arrow_address_in_list].y =
stack->arrows_ptr[arrows_nb].y;
stack->arrows_ptr[arrow_address_in_list].z =
stack->arrows_ptr[arrows_nb].z;
}
for (long i = 0; i < 6; i++)
stack->buffer_vertex_origin [stack->buffer_vertex_0_arrow + arrow_address_in_list * 6 + i]
= stack->buffer_vertex_origin [stack->buffer_vertex_size - 6 + i];
for (long i = 0; i < 6; i++)
stack->buffer_colors_origin [stack->buffer_colors_0_arrow + arrow_address_in_list * 6 + i]
= stack->buffer_colors_origin [stack->buffer_colors_size - 6 + i];
stack->buffer_vertex_size -= 6; // <<< l'inverse de ce qui est fait dans : graphics_draw_vertex()
stack->buffer_colors_size -= 6; // <<< l'inverse de ce qui est fait dans : graphics_draw_colors()
stack->buffer_lines_size -= 2; // <<< l'inverse de ce qui est fait dans : graphics_draw_line()
void *new_arrows_vertex_ptr = g_realloc(stack->buffer_vertex_origin, stack->buffer_vertex_size * sizeof(GLfloat));
if (new_arrows_vertex_ptr) stack->buffer_vertex_origin = new_arrows_vertex_ptr;
else perror("In graphics.erase_arrow(), can't re_allocate for arrows vertex buffer.\n");
void *new_arrows_colors_ptr = g_realloc(stack->buffer_colors_origin, stack->buffer_colors_size * sizeof(GLfloat));
if (new_arrows_colors_ptr) stack->buffer_colors_origin = new_arrows_colors_ptr;
else perror("In graphics.erase_arrow(), can't re_allocate for arrows colors buffer.\n");
/* Il ne faut pas réécrire ce qui suit: ces lignes dessinent maintenant à partir d'autres vertex */
/* void *new_arrows_lines_ptr = g_realloc(stack->buffer_lines_origin, stack->buffer_lines_size * sizeof(GLfloat)); */
/* if (new_arrows_lines_ptr) stack->buffer_lines_origin = new_arrows_lines_ptr; */
/* else perror("In graphics.erase_arrow(), can't re_allocate for arrows lines buffer.\n"); */
return arrows_nb;
}
/*
* Creates or deletes an arrow or modify the load of an existing one
* Acts both by writing the list of arrows : (struct arrow_t *arrows_ptr, int arrows_nb)
* and by drawing in the global space
*
* @param arrows_ptr and arrows_nb before operation,
* required load and address (site, x, y, z)
*
* IF there is no arrow at the required address,
* AND IF the load is > 0, an arrow will be created.
*
* IF there is an arrow at the required address
* AND IF the load is = 0, the existing arrow will be deleted.
*
* IF there is an arrow at the required address
* AND IF the load is > 0, the load of the existing arrow will be modified.
*
* May not call any of these three functions IF :
* - Current_weight of an arrow located at the requested address == requested_weight
* - No arrow was found at the requested addres AND current_weight == requested_weight
*
* @return arrows_nb after operation
*/
int set_arrow (int stack_id,
int arrows_nb,
int space_X,
int space_Y,
int space_Z,
int requested_weight,
int site,
int arrow_x,
int arrow_y,
int arrow_z)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
int address = -1, current_weight = -1;
for (int i = 0; i < arrows_nb; i++)
if ((site == stack->arrows_ptr[i].site)
&& (arrow_x == stack->arrows_ptr[i].x)
&& (arrow_y == stack->arrows_ptr[i].y)
&& (arrow_z == stack->arrows_ptr[i].z))
{
address = i;
current_weight = stack->arrows_ptr[i].load;
break;
}
assert (address <= arrows_nb);
if (address == -1 && requested_weight > 0)
return create_arrow (stack_id, arrows_nb, space_X, space_Y, space_Z, requested_weight, site, arrow_x, arrow_y, arrow_z);
if (address >= 0 && requested_weight == 0) // address >= 0 if and only if arrows_nb > 0
return erase_arrow(stack_id, arrows_nb, address, site, arrow_x, arrow_y, arrow_z);
if (address >= 0 && current_weight != requested_weight) {
rewrite_arrow(stack_id, address, requested_weight, site, arrow_x, arrow_y, arrow_z);
return arrows_nb;
}
return arrows_nb;
}

295
src/graphics/displays.c Normal file
View File

@ -0,0 +1,295 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: GL functions
*
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <time.h>
#include "../../include/graphics.h"
/* Prints the arrows[] array
*
* For each arrow the following parameters are displayed :
* - rank in the array
* - load (or weight)
* - coordinates in space (site, x, y, z)
*/
void print_arrows_array (struct arrow_t *arrows, int arrows_nb, int invoked_by)
{
printf(" [rank] load | site x y z (");
switch (invoked_by) {
case 0: printf("after deletion) arrows_nb : %d", arrows_nb); break;
case 1: printf("after creation) arrows_nb : %d", arrows_nb); break;
case 2: printf("after modification) arrows_nb : %d", arrows_nb); break;
case 3: printf("address >= 0 && current_weight == requested_weight)"); break;
case 4: printf("address == -1 && requested_weight == 0)"); break;
case 5: printf("print_user_choices)"); break;
case 6: printf("print_evolution)"); break;
case 7: printf("before deletion) arrows_nb : %d", arrows_nb); break;
}
for (int i = 0; i < arrows_nb; i++)
printf("\n [%4d] = %2d | %2d, %2d, %2d, %2d", i, arrows[i].load,\
arrows[i].site, arrows[i].x, arrows[i].y, arrows[i].z);
if (arrows_nb == 0) printf("\n [NULL] ---- | ---- --- --- ---");
printf("\n");
}
/* Prints the initial user choices :
* - space dimension size and appearance (grids)
* - arrows[] array
* NB The space may be empty or saturated with arrows or any value in between
* Only one arrow per possible coordinates with a load max equal to ? TODO
*/
void print_user_choices(struct arrow_t *arrows, int max_arrows_nb, int arrows_nb,
int space_size_x, int space_size_y, int space_size_z,
int show_array, int show_space_design)
{
printf("model + user constraints :\tspace size x,y,z (%d,%d,%d)\tinitial (max) arrows nb : %d",\
space_size_x, space_size_y, space_size_z, max_arrows_nb);
if (show_space_design) printf(" (grilles alternées)");
printf("\n");
if (show_array) print_arrows_array (arrows, arrows_nb, 5);
}
/* Prints the evolution after adding / removing arrows :
* - arrows[] array
* NB The space may be empty or saturated with arrows or any value in between
* Only one arrow per possible coordinates with a load max equal to ? TODO
*
*
* print_evolution (arrows, added, mem, deleted, print_arrows_data);
*/
void print_evolution (struct arrow_t *arrows, int arrows_nb, int modified, int deleted, int show_array)
{
printf("evolution\t\t\t\t\t\t\tarrows nb > %6d\t (%d added / %d deleted) (modified : %d)\n",\
arrows_nb + modified - deleted * 2, modified - deleted, deleted, modified);
if (show_array) print_arrows_array (arrows, arrows_nb, 6);
}
/*
* Prints the arrows[] array
*
* For each arrow the following parameters are displayed :
* - rank in the array
* - weight (or load)
* - coordinates in space (site, x, y, z)
*/
void show_arrows_array_head(int one_batch_size, long nb_batches_specified, int verbose) {
printf("\n [rank] load | site x y z");
if (verbose) printf(" one batch size = %d nb_batches_specified = %ld",\
one_batch_size, nb_batches_specified);
}
void show_one_arrow_in_array(struct arrow_t *arrows, int i) {
printf("\n [%4d] = %2d | %2d, %2d, %2d, %2d",\
i, arrows[i].load, arrows[i].site, arrows[i].x, arrows[i].y, arrows[i].z);
}
void show_empty_arrows_array() {printf("\n [NULL] ---- | ---- --- --- ---");}
void show_arrows_array (struct arrow_t *arrows, int arrows_nb, int x, int y, int z)
{
show_arrows_array_head (0,0,0);
for (int i = 0; i < arrows_nb; i++)
show_one_arrow_in_array(arrows, i);
if (arrows_nb == 0) show_empty_arrows_array();
}
/*
* Prints the initial user choices :
* - space dimension size and appearance (grids)
* - arrows[] array
* NB The space may be empty or saturated with arrows or any value in between
* To assert : Only one arrow per possible coordinates with a load max equal to ?
*/
void show_user_choices(long copy_nb_arrows_specified,
int space_size_x, int space_size_y, int space_size_z,
int prefer, int arbitrary, int one_batch_size)
{
printf("\nnb arrows specified = %ld", copy_nb_arrows_specified);
printf(" space size (x,y,z) = (%d,%d,%d)", space_size_x, space_size_y, space_size_z);
printf(" arbitrary = %d one_batch_size = %d", arbitrary, one_batch_size);
if (prefer == 0) printf(" prefer = %d <> show all grids", prefer);
if (prefer == 1) printf(" prefer = %d <> show no grid", prefer);
if (prefer > 1) printf(" show grids according rule (%d)", prefer);
}
/*
* Prints the result of the function set_arrow()
* and indicates the reasons of the choice (call) this function makes (see this function)
*/
#define TEST 0
void show_user_action(struct arrow_t *arrows, int arrows_nb, int address, int requested_weight,
int current_weight, int site, int x, int y, int z)
{
if (address == -1 && requested_weight > 0) { // *(arrows + i * 5 + 0)
printf("no such arrow found (%2d,%2d,%2d,%2d)", site, x, y, z); //arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4]);
if (! TEST) printf("\n "); else printf(" ");
printf("=> CREATE"); return;}
if (address >= 0 && requested_weight == 0) {
printf("arrow (%2d,%2d,%2d,%2d) found at address %2d; current_weight = %2d;", site, x, y, z, address, current_weight); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5, current_weight);
if (! TEST) printf("\n "); else printf(" ");
printf("=> ERASE"); return;}
if (address >= 0 && current_weight != requested_weight) {
printf("arrow (%2d,%2d,%2d,%2d) found at address %2d; current_weight = %2d;", site, x, y, z, address, current_weight); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5, current_weight);
if (! TEST) printf("\n "); else printf(" ");
printf("=> MODIFY"); return;}
if (address >= 0 && current_weight == requested_weight){
printf("arrow (%2d,%2d,%2d,%2d) found at address %2d;", site, x, y, z, address); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5);
if (! TEST) printf("\n "); else printf(" ");
printf("requested_weight == current_weight => END"); return;}
if (address == -1 && requested_weight == 0) {
printf("no such arrow found (%2d,%2d,%2d,%2d)", site, x, y, z); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4]);
if (! TEST) printf("\n "); else printf(" ");
printf("=> END"); return;}
}
/*
* Prints vertex and lines buffers_states (sizes) at major one_batch_sizes and at the end of a session.
* Major one_batch_sizes are creation of grids and creation of arrows
* Arithmetic verification is provided at each one_batch_size
*/
void show_buffers_states(int space_X, int space_Y, int space_Z,
long nb_batches_specified, int one_batch_size,
int offset_after_grids, int buffer_vertex_size,
int buffer_lines_size_after_cubes, int buffer_lines_size)
{
int offset_after_arrows = buffer_vertex_size / 3, difference = offset_after_arrows - offset_after_grids;
printf("\n - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
printf("\n buffer_vertex_offset_after grids = %9d\t%9d = (x+1)*(y+1)*(z+1); <--> (x,y,z = %d,%d,%d)",\
offset_after_grids, (space_X + 1)*(space_Y + 1)*(space_Z + 1), space_X, space_Y, space_Z);
printf("\n buffer_vertex_offset_after arrows = %9d\t%9d = %d + %d; <--> %d = 12 x %d (%d cubes)",\
offset_after_arrows, offset_after_arrows, offset_after_grids,\
difference, difference, difference / 12, difference / 12);
printf("\n buffer_lines_offset after cubes = %9d\t%9d = 2 * (%dx%d + %dx%d + %dx%d); <--> 2 * (x*y + x*z + y*z)",\
buffer_lines_size_after_cubes, ((space_X+1) * (space_Y+1) + (space_X+1) * (space_Z+1) + (space_Y+1) * (space_Z+1)) * 2,
space_X+1, space_Y+1, space_X+1, space_Z+1, space_Y+1, space_Z+1);
printf("\n buffer_lines_offset after arrows = %9d\t%9d = %d + %d; <--> %d = 14 x %d (%d arrows drawned)",\
buffer_lines_size, buffer_lines_size, buffer_lines_size_after_cubes,\
buffer_lines_size - buffer_lines_size_after_cubes,\
buffer_lines_size - buffer_lines_size_after_cubes, (buffer_lines_size - buffer_lines_size_after_cubes) / 14,\
(buffer_lines_size - buffer_lines_size_after_cubes) / 14);
if (nb_batches_specified * one_batch_size == 0) printf("\n");
else printf("\n WARNING Arrows of the same address, whatever their weight, are drawn in superimposition. Check their list.");
printf("\n It happens that NOT all the specified arrows (%ld) = (%ld x %d) are drawned (%d) ! WHY ? (d = %ld)\n",\
nb_batches_specified * one_batch_size, nb_batches_specified, one_batch_size, (buffer_lines_size - buffer_lines_size_after_cubes) / 14,\
nb_batches_specified * one_batch_size - (buffer_lines_size - buffer_lines_size_after_cubes) / 14);
}
/*
* Prints the result of the function set_arrow()
* and indicates the reasons of the choice (call) this function makes (see this function)
*/
void print_user_action(struct arrow_t *arrows, int arrows_nb, int address, int requested_weight,
int current_weight, int site, int x, int y, int z)
{
if (address == -1 && requested_weight > 0) { // *(arrows + i * 5 + 0)
printf("no such arrow found (%2d,%2d,%2d,%2d)", site, x, y, z); //arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4]);
if (! TEST) printf("\n "); else printf(" ");
printf("=> CREATE"); return;}
if (address >= 0 && requested_weight == 0) {
printf("arrow (%2d,%2d,%2d,%2d) found at address %2d; current_weight = %2d;", site, x, y, z, address, current_weight); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5, current_weight);
if (! TEST) printf("\n "); else printf(" ");
printf("=> ERASE"); return;}
if (address >= 0 && current_weight != requested_weight) {
printf("arrow (%2d,%2d,%2d,%2d) found at address %2d; current_weight = %2d;", site, x, y, z, address, current_weight); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5, current_weight);
if (! TEST) printf("\n "); else printf(" ");
printf("=> MODIFY"); return;}
if (address >= 0 && current_weight == requested_weight){
printf("arrow (%2d,%2d,%2d,%2d) found at address %2d;", site, x, y, z, address); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4], address/5);
if (! TEST) printf("\n "); else printf(" ");
printf("requested_weight == current_weight => END"); return;}
if (address == -1 && requested_weight == 0) {
printf("no such arrow found (%2d,%2d,%2d,%2d)", site, x, y, z); // arrows[address + 1], arrows[address + 2], arrows[address + 3], arrows[address + 4]);
if (! TEST) printf("\n "); else printf(" ");
printf("=> END"); return;}
}
static inline void print_buffers_array_head () {printf(" [rank] load | site x y z [address] buffer-vertex-1 buffer-vertex-2 buffer-lines\n");}
static inline void print_empty_buffers_array () {printf(" [NULL] ---- | ---- --- --- --- -1 --- --- ---\n");}
static void print_one_arrow_in_buffers (struct arrow_t *arrows,
GLfloat *buffer_vertex_origin, long buffer_vertex_0_arrow,
GLfloat *buffer_lines_origin, long buffer_lines_0_arrow,
int i, int arrows_nb, int address)
{
printf(" [%4d] = %2d | %2d, %2d, %2d, %2d, (%2d) %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f %4f %4f\n",\
i,
arrows[i].load, arrows[i].site, arrows[i].x, arrows[i].y, arrows[i].z,
address,
buffer_vertex_origin [buffer_vertex_0_arrow + i * 6 + 0],
buffer_vertex_origin [buffer_vertex_0_arrow + i * 6 + 1],
buffer_vertex_origin [buffer_vertex_0_arrow + i * 6 + 2],
buffer_vertex_origin [buffer_vertex_0_arrow + i * 6 + 3],
buffer_vertex_origin [buffer_vertex_0_arrow + i * 6 + 4],
buffer_vertex_origin [buffer_vertex_0_arrow + i * 6 + 5],
buffer_lines_origin [buffer_lines_0_arrow + i * 2 + 0],
buffer_lines_origin [buffer_lines_0_arrow + i * 2 + 1]);
}
void print_vertex_and_lines_buffers (struct arrow_t *arrows_ptr, int arrows_nb,
GLfloat *buffer_vertex_origin, long buffer_vertex_0_arrow,
GLfloat *buffer_lines_origin, long buffer_lines_0_arrow,
int address, int requested_weight, int current_weight, int site, int x, int y, int z)
{
/* for (int i = 0; i < 6; i++) printf("%5.2f ", buffer_vertex_origin [buffer_vertex_0_arrow + i]); printf("\n"); */
/* for (int i = 0; i < 6; i++) printf("%5.2f ", buffer_lines_origin [buffer_lines_0_arrow + i]); printf("\n"); */
print_buffers_array_head ();
for (int i = 0; i < arrows_nb; i++)
print_one_arrow_in_buffers(arrows_ptr, buffer_vertex_origin, buffer_vertex_0_arrow,
buffer_lines_origin, buffer_lines_0_arrow, i, arrows_nb, address);
if (arrows_nb == 0) print_empty_buffers_array();
}

207
src/graphics/draw.c Normal file
View File

@ -0,0 +1,207 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: GL functions
*
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Writes values to describe a vertex at (x,y,z) intoq the vertex buffer
*
* @param coords GLfloat(x,y,z)
*
* @return void
*/
#include <stdlib.h>
#include <time.h>
#include <cglm/cglm.h>
#include "../../include/base.h"
#include "../../include/ui.h"
#include "../../include/graphics.h"
void graphics_draw_vertex (const int stack_id,
GLfloat x,
GLfloat y,
GLfloat z)
{
//g_printerr("stack_id is %d\n", stack_id);
//g_printerr("stack_id is %d\n", stack_id);
//g_printerr("graphic_stack is at %p\n", graphic_stack);
//g_printerr("graphic_stack[stack_id] is at %p\n", graphic_stack + stack_id);
volatile struct graphic_stack_t *stack = &graphic_stack[stack_id];
//g_printerr("Currently stack->buffer_vertex_origin @ %p\n", stack->buffer_vertex_origin);
//assert (stack->buffer_vertex_origin);
stack->buffer_vertex_origin =
g_realloc (stack->buffer_vertex_origin,
(stack->buffer_vertex_size + 3) * sizeof(GLfloat));
//print_stack(stack_id);
stack->buffer_vertex_origin[stack->buffer_vertex_size + 0] = x;
stack->buffer_vertex_origin[stack->buffer_vertex_size + 1] = y;
stack->buffer_vertex_origin[stack->buffer_vertex_size + 2] = z;
stack->buffer_vertex_size += 3;
}
/*
* Writes values to describe a color (r,g,b) into the color buffer
*
* @param color GLfloat(r,g,b)
*
* @return void
*/
void graphics_draw_color (const int stack_id,
GLfloat r,
GLfloat g,
GLfloat b)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
stack->buffer_colors_origin = g_realloc (stack->buffer_colors_origin,
(stack->buffer_colors_size + 3) * sizeof(GLfloat));
assert (stack->buffer_colors_origin);
stack->buffer_colors_origin[stack->buffer_colors_size + 0] = r;
stack->buffer_colors_origin[stack->buffer_colors_size + 1] = g;
stack->buffer_colors_origin[stack->buffer_colors_size + 2] = b;
stack->buffer_colors_size += 3;
}
/*
* Writes values to describe a line from a to b into the line buffer
*
* @param coords GLuint (a,b)
*
* @return void
*/
void graphics_draw_line (const int stack_id,
GLuint a,
GLuint b)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
stack->buffer_lines_origin = g_realloc (stack->buffer_lines_origin,
(stack->buffer_lines_size + 2) * sizeof(GLuint));
assert (stack->buffer_lines_origin);
stack->buffer_lines_origin[stack->buffer_lines_size + 0] = a;
stack->buffer_lines_origin[stack->buffer_lines_size + 1] = b;
stack->buffer_lines_size += 2;
}
/*
* Writes values to describe an (a,b,c) plan (triangle) into the plan buffer
*
* @param coords GLuint (a,b,c)
*
* @return void
*/
void graphics_draw_plan (const int stack_id,
GLuint a,
GLuint b,
GLuint c)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
stack->buffer_plans_origin = g_realloc (stack->buffer_plans_origin,
(stack->buffer_plans_size + 3) * sizeof(GLuint));
assert (stack->buffer_plans_origin);
stack->buffer_plans_origin[stack->buffer_plans_size + 0] = a;
stack->buffer_plans_origin[stack->buffer_plans_size + 1] = b;
stack->buffer_plans_origin[stack->buffer_plans_size + 2] = c;
stack->buffer_plans_size += 3;
}
/*
* Draws the current buffer to a gl_area
*
* @param gl_area, ptr to the gl_area widget
*
* @return void
*/
void graphics_draw(const int stack_id)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
//g_printerr("[debug] graphics_draw() started\n");
//print_stack(stack_id);
GLint cur_viewport[4];
glGetIntegerv(GL_VIEWPORT, cur_viewport);
mat4 m = GLM_MAT4_IDENTITY_INIT;
glm_rotate_x(m, glm_rad(stack->rotation_angles[X_AXIS]), m);
glm_rotate_y(m, glm_rad(stack->rotation_angles[Y_AXIS]), m);
glm_rotate_z(m, glm_rad(stack->rotation_angles[Z_AXIS]), m);
mat4 v = GLM_MAT4_IDENTITY_INIT; // XXX define zoom and translations here ?
mat4 p = GLM_MAT4_IDENTITY_INIT;
//glm_ortho(-1.0f, +1.0f, -1.0f, +1.0f, -1.0f, +1.0f, p);
glm_ortho_default((float)cur_viewport[2] / (float)cur_viewport[3], p);
//glm_perspective_default((float)cur_viewport[2] / (float)cur_viewport[3], p);
/* Use our shaders */
glUseProgram(stack->program);
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* Update the "mvp" matrix we use in the shader */
glUniformMatrix4fv(stack->m, 1, GL_FALSE, (float *)m);
glUniformMatrix4fv(stack->v, 1, GL_FALSE, (float *)v);
glUniformMatrix4fv(stack->p, 1, GL_FALSE, (float *)p);
/* Use the vertices in our buffer */
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, stack->position_buffer);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0,(void*)0);
// couleurs
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, stack->color_buffer);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0,(void*)0);
//glEnable(GL_DEPTH_TEST);
glDrawElements(GL_LINES, stack->buffer_lines_size, GL_UNSIGNED_INT, stack->buffer_lines_origin);
glDrawElements(GL_TRIANGLES, stack->buffer_plans_size, GL_UNSIGNED_INT, stack->buffer_plans_origin);
/* We finished using the buffers and program */
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glUseProgram(0);
glFlush();
//g_printerr("[debug] graphics_draw() ended\n");
}

328
src/graphics/graphics.c Normal file
View File

@ -0,0 +1,328 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: GL functions
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <time.h>
#include "../../include/base.h"
#include "../../include/ui.h"
#include "../../include/parsing.h"
#include "../../include/graphics.h"
#define TEST 0
struct graphic_stack_t *graphic_stack = NULL;
size_t graphic_stack_size = 0;
int *free_stack_slot = NULL;
size_t free_stack_slot_size = 0;
/*
* Prints verbose human-readable debug messages
*
* @param source, XXX
* type, XXX
* id, XXX
* severity, XXX
* length, XXX
* msg, XXX
* data, XXX
*
* @return void
*/
static void graphics_debug_callback(GLenum source, GLenum type, GLuint id,
GLenum severity, GLsizei length,
const GLchar *msg, const void *data)
{
const char *errsource;
const char *errtype;
const char *errseverity;
const GLubyte *string;
GLenum code;
switch (source) {
case GL_DEBUG_SOURCE_API: errsource = "API"; break;
case GL_DEBUG_SOURCE_WINDOW_SYSTEM: errsource = "WINDOW SYSTEM"; break;
case GL_DEBUG_SOURCE_SHADER_COMPILER: errsource = "SHADER COMPILER"; break;
case GL_DEBUG_SOURCE_THIRD_PARTY: errsource = "THIRD PARTY"; break;
case GL_DEBUG_SOURCE_APPLICATION: errsource = "APPLICATION"; break;
case GL_DEBUG_SOURCE_OTHER: errsource = "UNKNOWN"; break;
default: errsource = "UNKNOWN"; break;
}
switch (type) {
case GL_DEBUG_TYPE_ERROR: errtype = "ERROR"; break;
case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: errtype = "DEPRECATED BEHAVIOR";break;
case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: errtype = "UNDEFINED BEHAVIOR"; break;
case GL_DEBUG_TYPE_PORTABILITY: errtype = "PORTABILITY"; break;
case GL_DEBUG_TYPE_PERFORMANCE: errtype = "PERFORMANCE"; break;
case GL_DEBUG_TYPE_OTHER: errtype = "OTHER"; break;
case GL_DEBUG_TYPE_MARKER: errtype = "MARKER"; break;
default: errtype = "UNKNOWN"; break;
}
switch (severity) {
case GL_DEBUG_SEVERITY_HIGH: errseverity = "CRITICAL"; break;
case GL_DEBUG_SEVERITY_MEDIUM: errseverity = "ERROR"; break;
case GL_DEBUG_SEVERITY_LOW: errseverity = "WARNING"; break;
case GL_DEBUG_SEVERITY_NOTIFICATION: errseverity = "INFO"; break;
default: errseverity = "UNKNOWN"; break;
}
code = glGetError();
string = gluErrorString(code);
g_printerr("[%s] %s (%s) from %s: %s\n",
errseverity, string, errtype, errsource, msg);
}
/* -------------------------------------------------------------------------- */
/*
* Initializes graphical stack
*
* @param gl_area, ptr to the gl_area widget
*
* @return id if initialized
*/
int graphics_init(void *error_buffer)
{
int cur_id = 0;
struct graphic_stack_t *stack;
/* g_printerr("[debug] graphics_init()\n"); */
if (graphic_stack == NULL) {
graphic_stack = g_malloc0(sizeof(struct graphic_stack_t));
graphic_stack_size = 1;
/* g_printerr("[debug] graphics_init(): init graphic_stack @ %p\n", graphic_stack); */
} else {
// Check if there are free slots
if (free_stack_slot_size) {
// We get the last free slot registered
cur_id = free_stack_slot[free_stack_slot_size-1];
// Unregister it (ofc)
free_stack_slot = g_realloc(free_stack_slot,
free_stack_slot_size-- *
sizeof(int));
} else {
cur_id = graphic_stack_size;
graphic_stack = g_realloc(graphic_stack,
++graphic_stack_size *
sizeof(struct graphic_stack_t));
}
}
memset(&graphic_stack[cur_id], 0, sizeof(struct graphic_stack_t));
/* g_printerr("[debug] graphics_init() : graphic_stack (@0x%p) has %ld elements\n", */
/* graphic_stack, */
/* graphic_stack_size); */
stack = &graphic_stack[cur_id];
stack->id = cur_id;
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
glEnable(GL_MULTISAMPLE);
if (!graphics_init_shaders(cur_id))
return -1;
//print_stack(cur_id);
graphics_init_buffers(cur_id);
glDebugMessageCallback(graphics_debug_callback, NULL);
//print_stack(cur_id);
return cur_id;
}
/*
* Shutdowns a gl_area
*
* @param gl_area, ptr to the gl_area widget
*
* @return true if success
*/
bool graphics_shutdown(const int id, void *error_buffer)
{
struct graphic_stack_t *stack;
if (id >= graphic_stack_size ||
graphic_stack_size == 0 ||
graphic_stack == NULL)
return false;
stack = &graphic_stack[id];
//XXX
free(stack->arrows_ptr);
stack->arrows_ptr = NULL;
stack->arrows_nb = 0;
glDeleteBuffers(1, &stack->position_buffer);
glDeleteBuffers(1, &stack->color_buffer);
glDeleteProgram(stack->program);
g_free(stack->buffer_vertex_origin);
g_free(stack->buffer_colors_origin);
g_free(stack->buffer_lines_origin);
g_free(stack->buffer_plans_origin);
if (graphic_stack_size == 1) {
free(graphic_stack);
graphic_stack = NULL;
graphic_stack_size = 0;
} else {
memset(&graphic_stack[id], 0, sizeof(struct graphic_stack_t));
free_stack_slot = g_realloc(free_stack_slot,
++free_stack_slot_size *
sizeof(int));
free_stack_slot[free_stack_slot_size-1] = id;
}
return true;
}
/* TODO
* #pragma omp parallel schedule(static, 12)
* void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) {}
*
// assert : space dimensions (x,y,z) > 0
// assert : arrows localization within space and sites
// assert : no more than one arrow per address
// notify : weights are replaced, NOT added (could be !)
*
* Init space and arrows (= initial state)
* and allows ulterior creations, suppressions or modifications of the arrows[] array
*
* draws the space()
* triggers set_arrows() that modifies the list () and draws arrows
*
* Initialisation du générateur pseudo-aléatoire
* Attention, les vertex centraux de chaque unité d'espace (cube)
* peuvent être redondants (max 6)
*/
void graphics_model_setup (const int stack_id)
{
/*------------------------------------------------------------------------*/
/* I N I T I A L D A T A S P E C I F I C A T I O N */
/*------------------------------------------------------------------------*/
struct graphic_stack_t *stack = &graphic_stack[stack_id];
char dimension;
long space_X;
long space_Y;
long space_Z;
long announced_arrows_nb;
int density_max;
char multiplicity;
dimension = model_get_dim();
g_print("[GRAPH DEBUG] dim = %d\n", dimension);
space_X = 1;
space_Y = 1;
space_Z = 1;
switch(dimension) {
case 3:
space_Z = model_get_dim_value("z");
case 2:
space_Y = model_get_dim_value("y");
// even in 1D, we must be able to see a grid
if (!space_Y)
space_Y = 1;
case 1:
space_X = model_get_dim_value("x");
if (!space_X)
space_X = 1;
default:
break;
}
g_print("[GRAPH DEBUG] x = %ld\n", space_X);
g_print("[GRAPH DEBUG] y = %ld\n", space_Y);
g_print("[GRAPH DEBUG] z = %ld\n", space_Z);
density_max = space_X * space_Y * space_Z;
stack->arrows_nb = 0;
multiplicity = model_get_multiplicity();
g_print("[GRAPH DEBUG] site_multiplicity = %ld\n", multiplicity);
/*------------------------------------------------------------------------*/
/* S P A C E D R A W I N G */
/*------------------------------------------------------------------------*/
draw_space_ridges_vertex (stack_id, stack->buffer_vertex_size,
space_X, space_Y, space_Z);
draw_space_ridges_lines (stack_id);
draw_grids_on_space_faces_vertex (stack_id, space_X, space_Y, space_Z);
draw_grids_on_space_faces_lines (stack_id, stack->buffer_lines_size,
space_X, space_Y, space_Z);
stack->buffer_vertex_0_arrow = stack->buffer_vertex_size;
stack->buffer_colors_0_arrow = stack->buffer_colors_size;
stack->buffer_lines_0_arrow = stack->buffer_lines_size;
/*------------------------------------------------------------------------*/
/* A R R O W S D R A W I N G */
/*------------------------------------------------------------------------*/
char state_id[30] = {0};
struct arrow_t arrow = {0};
assert(model_get_next_state(&state_id));
g_print("[GRAPH DEBUG] first state is = %s\n", state_id);
announced_arrows_nb = model_get_state_arrows_count(state_id);
g_print("[GRAPH DEBUG] announced_arrows_nb is = %ld\n", announced_arrows_nb);
while (model_get_next_arrow(&arrow, &state_id, dimension)) {
g_print("[GRAPH DEBUG] cur arrow has x = %d\n", arrow.x);
stack->arrows_nb =
set_arrow (stack_id, stack->arrows_nb, space_X, space_Y, space_Z,
arrow.load, // load
arrow.site, // site
arrow.x, // x
arrow.y, // y
arrow.z); // z
}
if (stack->arrows_nb != announced_arrows_nb)
g_printerr("ARGH : all the arrows have not been parsed !\n");
}

162
src/graphics/grid.c Normal file
View File

@ -0,0 +1,162 @@
/*
* Gem-graph
*
* Desc: OpenGL grid functions
*
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <time.h>
#include "../../include/base.h"
#include "../../include/ui.h"
#include "../../include/graphics.h"
int draw_space_ridges_vertex (const int stack_id,
long offset_vertex,
long x,
long y,
long z)
{
GLfloat max = fmax(x, y); max = fmax(max, z);
graphics_draw_vertex (stack_id, offset_vertex - x / max, offset_vertex - y / max, - z / max);
graphics_draw_vertex (stack_id, offset_vertex + x / max, offset_vertex - y / max, - z / max);
graphics_draw_vertex (stack_id, offset_vertex - x / max, offset_vertex + y / max, - z / max);
graphics_draw_vertex (stack_id, offset_vertex - x / max, offset_vertex - y / max, + z / max);
graphics_draw_vertex (stack_id, offset_vertex + x / max, offset_vertex + y / max, - z / max);
graphics_draw_vertex (stack_id, offset_vertex + x / max, offset_vertex - y / max, + z / max);
graphics_draw_vertex (stack_id, offset_vertex - x / max, offset_vertex + y / max, + z / max);
graphics_draw_vertex (stack_id, offset_vertex + x / max, + y / max, + z / max);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
graphics_draw_color (stack_id, 0.8f, 0.6f, 0.5f);
return 8;
}
int draw_space_ridges_lines (const int stack_id)
{
graphics_draw_line (stack_id, 0, 1); graphics_draw_line (stack_id, 7, 4);
graphics_draw_line (stack_id, 0, 2); graphics_draw_line (stack_id, 7, 5);
graphics_draw_line (stack_id, 0, 3); graphics_draw_line (stack_id, 7, 6);
graphics_draw_line (stack_id, 1, 4); graphics_draw_line (stack_id, 2, 4);
graphics_draw_line (stack_id, 1, 5); graphics_draw_line (stack_id, 3, 5);
graphics_draw_line (stack_id, 2, 6); graphics_draw_line (stack_id, 3, 6);
return 12;
}
long draw_grids_on_space_faces_vertex (const int stack_id,
long x,
long y,
long z)
{
float i, max = fmax(x, y); max = fmax(max, z);
for (i = 1; i < x; i++) {
graphics_draw_vertex (stack_id, (2 * i / x - 1) * x / max, - y / max, - z / max);
graphics_draw_vertex (stack_id, (2 * i / x - 1) * x / max, - y / max, z / max);
graphics_draw_vertex (stack_id, (2 * i / x - 1) * x / max, y / max, z / max);
graphics_draw_vertex (stack_id, (2 * i / x - 1) * x / max, y / max, - z / max);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
}
/* offset_vertex += (x - 1) * 4; */ /* offset_colors += (x - 1) * 4; */
for (i = 1; i < y; i++) {
graphics_draw_vertex (stack_id, - x / max, (2 * i / y - 1) * y / max, - z / max);
graphics_draw_vertex (stack_id, - x / max, (2 * i / y - 1) * y / max, z / max);
graphics_draw_vertex (stack_id, x / max, (2 * i / y - 1) * y / max, z / max);
graphics_draw_vertex (stack_id, x / max, (2 * i / y - 1) * y / max, - z / max);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
}
/* offset_vertex += (y - 1) * 4; */ /* offset_colors += (y - 1) * 4; */
for (i = 1; i < z; i++) {
graphics_draw_vertex (stack_id, - x / max, - y / max, (2 * i / z - 1) * z / max);
graphics_draw_vertex (stack_id, - x / max, y / max, (2 * i / z - 1) * z / max);
graphics_draw_vertex (stack_id, x / max, y / max, (2 * i / z - 1) * z / max);
graphics_draw_vertex (stack_id, x / max, - y / max, (2 * i / z - 1) * z / max);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
graphics_draw_color (stack_id, 0.55f, 0.55f, 0.55f);
}
return (x + y + z - 3) * 3;
}
long draw_grids_on_space_faces_lines (const int stack_id,
long offset_vertex,
long x,
long y,
long z)
{
offset_vertex = offset_vertex / 3;
for (int i = 0; i < x - 1; i ++) {
graphics_draw_line (stack_id, offset_vertex + i * 4 + 1, offset_vertex + i * 4 + 2);
graphics_draw_line (stack_id, offset_vertex + i * 4 + 2, offset_vertex + i * 4 + 3);
}
offset_vertex += (x - 1) * 4;
for (int i = 0; i < y - 1; i ++) {
graphics_draw_line (stack_id, offset_vertex + i * 4 + 2, offset_vertex + i * 4 + 3);
graphics_draw_line (stack_id, offset_vertex + i * 4 + 3, offset_vertex + i * 4 + 0);
}
offset_vertex += (y - 1) * 4;
for (int i = 0; i < z - 1; i ++) {
graphics_draw_line (stack_id, offset_vertex + i * 4 + 0, offset_vertex + i * 4 + 1);
graphics_draw_line (stack_id, offset_vertex + i * 4 + 3, offset_vertex + i * 4 + 0);
}
return (x + y + z - 3) * 4;
}

175
src/graphics/init.c Normal file
View File

@ -0,0 +1,175 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: GL functions
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* -------------------------------------------------------------------------- */
#include <stdlib.h>
#include <time.h>
#include "../../include/base.h"
#include "../../include/ui.h"
#include "../../include/graphics.h"
/* Initializes the buffer of a gl_area
* Calls according to the user preferences
* @param gl_area, ptr to the gl_area widget
* @return void
*/
void graphics_init_buffers(const int stack_id)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
//XXX
graphics_model_setup(stack_id);
GLuint vao, vertex_buffer, color_buffer;
glGenBuffers(1, &vertex_buffer);
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
glBufferData(GL_ARRAY_BUFFER,
stack->buffer_vertex_size *
sizeof(stack->buffer_vertex_origin[0]),
stack->buffer_vertex_origin,
GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
// colors
glGenBuffers(1, &color_buffer);
glBindBuffer(GL_ARRAY_BUFFER, color_buffer);
glBufferData(GL_ARRAY_BUFFER, stack->buffer_colors_size *
sizeof(stack->buffer_colors_origin[0]),
stack->buffer_colors_origin,
GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
// We only use one VAO, so we always keep it bound
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
stack->vao = vao;
stack->position_buffer = vertex_buffer;
stack->color_buffer = color_buffer;
}
/*
* Initializes the shaders of a gl_area and link them to a program
*
* @param gl_area, ptr to the gl_area widget
*
* @return true if initialized
*/
bool graphics_init_shaders(const int stack_id)
{
struct graphic_stack_t *stack = &graphic_stack[stack_id];
char *vertex_shader;
char *fragment_shader;
int status;
GLuint vertex, fragment;
GLuint program = 0;
GLuint m = 0;
GLuint v = 0;
GLuint p = 0;
// Load vertex shader file
vertex_shader = read_file(VERTEX_SHADER_FILE);
if (vertex_shader == NULL)
return false;
vertex = create_shader(stack_id, GL_VERTEX_SHADER, vertex_shader);
if(vertex == 0) {
stack->program = 0;
g_free(vertex_shader);
return false;
}
// Load fragment shader file
fragment_shader = read_file(FRAG_SHADER_FILE);
if (fragment_shader == NULL)
return false;
fragment = create_shader(stack_id, GL_FRAGMENT_SHADER, fragment_shader);
if(fragment == 0) {
glDeleteShader(vertex);
stack->program = 0;
g_free(vertex_shader);
g_free(fragment_shader);
return false;
}
// Link shaders to program
program = glCreateProgram();
glAttachShader(program, vertex);
glAttachShader(program, fragment);
glLinkProgram(program);
glGetProgramiv(program, GL_LINK_STATUS, &status);
if(status == GL_FALSE) {
int log_len;
char *buffer;
glGetProgramiv(program, GL_INFO_LOG_LENGTH, &log_len);
buffer = g_malloc(log_len + 1);
assert(buffer);
glGetProgramInfoLog(program, log_len, NULL, buffer);
g_warning("Linking failure:\n%s", buffer);
g_free(buffer);
glDeleteProgram(program);
program = 0;
glDeleteShader(vertex);
glDeleteShader(fragment);
g_free(vertex_shader);
g_free(fragment_shader);
return false;
}
/* Get the location of the "mvp" uniform */
m = glGetUniformLocation(program, "model_matrix");
v = glGetUniformLocation(program, "view_matrix");
p = glGetUniformLocation(program, "projection_matrix");
glDetachShader(program, vertex);
glDetachShader(program, fragment);
glDeleteShader(vertex);
glDeleteShader(fragment);
stack->program = program;
stack->m = m;
stack->v = v;
stack->p = p;
g_free(vertex_shader);
g_free(fragment_shader);
return true;
}

View File

@ -0,0 +1,9 @@
#version 330 core
in vec4 color;
out vec4 out_frag_color;
void main(void)
{
out_frag_color = color;
}

View File

@ -0,0 +1,20 @@
#version 330 core
uniform mat4 projection_matrix;
uniform mat4 model_matrix;
uniform mat4 view_matrix;
layout(location=0) in vec3 in_position;
layout(location=1) in vec3 in_color;
out vec4 color;
void main(void)
{
float zoom = 1.1f, chrominance = 1, luminance = 1;
gl_Position =
projection_matrix * view_matrix * model_matrix * vec4(in_position, zoom);
color = vec4 (chrominance * in_color.rgb, luminance);
}
// https://learnopengl.com/Getting-started/Shaders

47
src/main.c Normal file
View File

@ -0,0 +1,47 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: Main file
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <unistd.h>
#include <gtk-4.0/gtk/gtk.h>
#include "../include/base.h"
#include "../include/ui.h"
/* -------------------------------------------------------------------------- */
int main(int argc, char **argv)
{
g_autoptr(GemGraphClientApplication) app = NULL;
int res;
// bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
// bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
// textdomain (GETTEXT_PACKAGE);
app = gem_graph_client_application_new("org.alec.gemgraph",
G_APPLICATION_DEFAULT_FLAGS);
res = g_application_run(G_APPLICATION(app), argc, argv);
return res;
}

483
src/parsing/parsing.c Normal file
View File

@ -0,0 +1,483 @@
/*
* Gem-graph client
*
* Desc: Model parsing functions
*
* Copyright (C) 2023 Jean Sirmai <jean@a-lec.org>
* Copyright (C) 2024 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <limits.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xmlreader.h> // http://xmlsoft.org/examples/#parse1.c
// https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/general.html
#include "../../include/base.h"
#define READ_SITE 1 << 0
#define READ_WEIGHT 1 << 1
#define READ_X 1 << 2
#define READ_Y 1 << 3
#define READ_Z 1 << 4
#define SUCCESSFUL_READ_ARROW_X (READ_SITE | READ_WEIGHT | READ_X)
#define SUCCESSFUL_READ_ARROW_XY (READ_SITE | READ_WEIGHT | READ_X | READ_Y)
#define SUCCESSFUL_READ_ARROW_XYZ (READ_SITE | READ_WEIGHT | READ_X | READ_Y | READ_Z)
static xmlDocPtr model;
static xmlHashTablePtr model_hashtable;
bool model_init(const char *content, size_t length, const char *basename)
{
xmlNode *node;
/*
* this initialize the library and check potential ABI mismatches
* between the version it was compiled for and the actual shared
* library used.
*/
LIBXML_TEST_VERSION
model = xmlReadMemory(content, length, basename, NULL, 0);
if (model == NULL ) {
return false;
}
node = xmlDocGetRootElement(model);
if (node == NULL) {
g_printerr("Empty XML model !\n");
xmlFreeDoc(model);
return false;
}
if (xmlStrcmp(node->name, (xmlChar *) "gem-graph-model")) {
g_printerr("document of the wrong type, root node != gem-graph-model\n");
xmlFreeDoc(model);
return false;
}
model_hashtable = xmlHashCreate(0);
if (model_hashtable == NULL) {
g_printerr("Can't create model hash table !\n");
xmlFreeDoc(model);
return false;
}
return true;
}
bool model_shutdown(void)
{
xmlFreeDoc(model);
xmlHashFree(model_hashtable, NULL);
// Cleanup function for the XML library
xmlCleanupParser();
// This is to debug memory for regression tests
xmlMemoryDump();
return true;
}
/******************************************************************************/
static inline xmlNodePtr getNextChild(xmlNodePtr node, xmlChar *last)
{
while (node != NULL && xmlStrcmp(node->name, last)) {
// //printf(" <>--- line n°%lu <%s>\n", xmlGetLineNo(node), node->name);
node = node->next;
}
return node;
}
static inline xmlChar* splitStrAtSlash(xmlChar *toSplit)
{
toSplit = (xmlChar *)xmlStrchr(toSplit, '/');
toSplit = xmlStrsub (toSplit, 1, xmlStrlen(toSplit));
return toSplit;
}
static inline xmlChar* getFirstTag(xmlChar *path)
{
xmlChar *preop = path;
path = (xmlChar *)xmlStrchr(path, '/');
path = xmlStrsub (path, 1, xmlStrlen(path));
//printf("%s = %s + / + %s\n", preop,\
xmlStrsub (preop, 0, xmlStrlen(preop) - xmlStrlen(path) - 1), path);
return xmlStrsub (preop, 0, xmlStrlen(preop) - xmlStrlen(path) - 1);
}
static inline xmlChar* getLastTag(xmlChar *path)
{
while ((ulong)xmlStrchr (path, '/'))
path = splitStrAtSlash((xmlChar *)path);
// //printf("last tag in the path = <%s>\n", path);
return path; // which is no more the given path but only its last tag !
}
/******************************************************************************/
static xmlNodePtr model_get_node(xmlChar *path)
{
xmlNodePtr node;
xmlChar *extrait;
xmlChar *reste, *last, *affich;
// Lookup for node from path in hash table
node = xmlHashLookup(model_hashtable, path);
// Found a node in hash table
if (node) {
return node;
// no node found in hash table
} else {
reste = path;
affich = reste;
last = getLastTag(reste);
node = xmlDocGetRootElement(model);
while (xmlStrchr (reste, '/')) {
extrait = getFirstTag(reste);
reste = splitStrAtSlash((xmlChar *)reste);
node = node->xmlChildrenNode;
node = getNextChild(node, extrait);
}
if(node && xmlStrcmp(node->name, last)) {
node = node->xmlChildrenNode;
while (node && xmlStrcmp(node->name, last)) {
node = node->next;
}
xmlHashAddEntry (model_hashtable, path, node);
}
return node;
}
return NULL;
}
/******************************************************************************/
static inline long model_get_node_long_attrib(xmlNodePtr node, char *id)
{
xmlAttr *attribute;
xmlChar* value;
long ret_value;
if (node && node->properties) {
attribute = node->properties;
while(attribute && attribute->name && attribute->children) {
if (!xmlStrcmp(attribute->name, (const xmlChar *)id)) {
value = xmlNodeListGetString(node->doc, attribute->children, 1);
ret_value = strtol((char *)value, NULL, 0);
xmlFree(value);
return ret_value;
}
attribute = attribute->next;
}
}
return 0;
}
static inline bool model_get_node_str_attrib(xmlNodePtr node,
char *id,
char *dest)
{
xmlAttr *attribute;
xmlChar* value;
if (node && node->properties) {
attribute = node->properties;
while(attribute && attribute->name && attribute->children) {
if (!xmlStrcmp(attribute->name, (const xmlChar *)id)) {
value = xmlNodeListGetString(node->doc, attribute->children, 1);
strcpy(dest, value);
xmlFree(value);
return true;
}
attribute = attribute->next;
}
}
return false;
}
/******************************************************************************/
char model_get_dim(void)
{
xmlAttr *attribute;
xmlChar* value;
xmlNodePtr node = model_get_node(
(xmlChar *)"parameters/space-param/dimension");
if (xmlHasProp (node, (xmlChar *) "z")) return 3;
if (xmlHasProp (node, (xmlChar *) "y")) return 2;
if (xmlHasProp (node, (xmlChar *) "x")) return 1;
return 0;
}
long model_get_dim_value(const char *axis)
{
xmlAttr *attribute;
xmlChar *value;
long ret_value;
xmlNodePtr node = model_get_node(
(xmlChar *)"parameters/space-param/dimension");
return model_get_node_long_attrib(node, axis);
}
char model_get_multiplicity(void)
{
xmlAttr *attribute;
xmlChar* value;
xmlNodePtr node = model_get_node(
(xmlChar *)"parameters/space-param/site_multiplicity");
if (node->children)
if (node->children->content)
return (char)strtol((char *)node->children->content, NULL, 0);
return 0;
}
bool model_get_next_state(char *new_state_id)
{
static xmlNodePtr cur_node = NULL;
xmlAttr *attribute;
xmlChar *value;
if (cur_node == NULL) {
// Get first state
cur_node = model_get_node((xmlChar *)"savedstates/state");
} else {
// Get next state
if (cur_node->next)
cur_node = cur_node->next;
else
return false;
}
// Lookup in properties
if (model_get_node_str_attrib(cur_node, "id", new_state_id))
return true;
cur_node = NULL;
return false;
}
long model_get_state_arrows_count(const char *state_id)
{
xmlNodePtr cur_node = NULL;
xmlAttr *attribute;
long value = 0;
bool found = false;
char temp_char[25];
uint check = 0; // bit field checker
//printf("NEW CALL : cur_node = %p\n", cur_node);
assert(state_id);
// Get first state node
cur_node = model_get_node((xmlChar *)"savedstates/state");
// Lookup in properties
while (cur_node && cur_node->properties) {
attribute = cur_node->properties;
// Look for the id attribute
if (model_get_node_str_attrib(cur_node, "id", &temp_char)) {
if (!xmlStrcmp(temp_char, (const xmlChar *)state_id)) {
found = true;
break;
}
}
cur_node = cur_node->next;
}
// Check if the state has been found
if (!found) {
cur_node = NULL;
return -1;
}
// Count arrows
if (cur_node->children) {
cur_node = cur_node->children;
while (cur_node) {
if (!xmlStrcmp(cur_node->name, (const xmlChar *)"arrow"))
value++;
cur_node = cur_node->next;
}
} else {
return -1;
}
return value;
}
bool model_get_next_arrow(struct arrow_t *new_arrow,
const char *state_id,
char dimension)
{
static xmlNodePtr cur_node = NULL;
xmlAttr *attribute;
xmlChar *value;
bool found = false;
char temp_char[25];
uint check = 0; // bit field checker
//printf("NEW CALL : cur_node = %p\n", cur_node);
assert(new_arrow);
assert(state_id);
if (cur_node == NULL) {
// Get first state node
cur_node = model_get_node((xmlChar *)"savedstates/state");
// Lookup in properties
while (cur_node && cur_node->properties) {
attribute = cur_node->properties;
// Look for the id attribute
if (model_get_node_str_attrib(cur_node, "id", &temp_char)) {
if (!xmlStrcmp(temp_char, (const xmlChar *)state_id)) {
found = true;
break;
}
}
cur_node = cur_node->next;
}
// Check if the state has been found
if (!found) {
cur_node = NULL;
return false;
}
// Get first arrow
if (cur_node->children) {
cur_node = cur_node->children;
found = false;
while (cur_node && cur_node->name) {
if (!xmlStrcmp(cur_node->name, (const xmlChar *)"arrow")) {
found = true;
break;
}
cur_node = cur_node->next;
}
}
// Check if the state has been found
if (!found) {
cur_node = NULL;
return false;
}
} else {
// Get next arrow
found = false;
while (cur_node->next) {
cur_node = cur_node->next;
if (!xmlStrcmp(cur_node->name, (const xmlChar *)"arrow")) {
found = true;
break;
}
}
// Check if the state has been found
if (!found) {
cur_node = NULL;
return false;
}
}
//printf("DURING CALL : cur_node = %p\n", cur_node);
//printf("DURING CALL : cur_node->name = %s\n", cur_node->name);
// Lookup in properties
if (cur_node && cur_node->properties) {
attribute = cur_node->properties;
while(attribute && attribute->name && attribute->children) {
//printf("attr name : %s\n", attribute->name);
if (!xmlStrcmp(attribute->name, (const xmlChar *)"site")) {
value = xmlNodeListGetString(cur_node->doc, attribute->children, 1);
new_arrow->site = strtol((char *)value, NULL, 0);
xmlFree(value);
check |= READ_SITE;
}
if (!xmlStrcmp(attribute->name, (const xmlChar *)"weight")) {
value = xmlNodeListGetString(cur_node->doc, attribute->children, 1);
new_arrow->load = strtol((char *)value, NULL, 0);
xmlFree(value);
check |= READ_WEIGHT;
}
if (!xmlStrcmp(attribute->name, (const xmlChar *)"x")) {
value = xmlNodeListGetString(cur_node->doc, attribute->children, 1);
new_arrow->x = strtol((char *)value, NULL, 0);
xmlFree(value);
check |= READ_X;
}
if (!xmlStrcmp(attribute->name, (const xmlChar *)"y")) {
value = xmlNodeListGetString(cur_node->doc, attribute->children, 1);
new_arrow->y = strtol((char *)value, NULL, 0);
xmlFree(value);
check |= READ_Y;
}
if (!xmlStrcmp(attribute->name, (const xmlChar *)"z")) {
value = xmlNodeListGetString(cur_node->doc, attribute->children, 1);
new_arrow->z = strtol((char *)value, NULL, 0);
xmlFree(value);
check |= READ_Z;
}
attribute = attribute->next;
}
switch(dimension) {
case 3:
return (bool)(check & SUCCESSFUL_READ_ARROW_XYZ);
case 2:
return (bool)(check & SUCCESSFUL_READ_ARROW_XY);
case 1:
return (bool)(check & SUCCESSFUL_READ_ARROW_X);
}
}
cur_node = NULL;
return false;
}

0
src/ui/.gitkeep Normal file
View File

150
src/ui/application.c Normal file
View File

@ -0,0 +1,150 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: User interface functions
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../../include/base.h"
#include "../../include/ui.h"
struct _GemGraphClientApplication
{
GtkApplication parent_instance;
};
G_DEFINE_TYPE (GemGraphClientApplication,
gem_graph_client_application,
GTK_TYPE_APPLICATION)
static GemGraphClientApplication *application;
/* -------------------------------------------------------------------------- */
void ui_enable_action(const char *name) {
g_simple_action_set_enabled(
(GSimpleAction *)g_action_map_lookup_action(
G_ACTION_MAP(application),
name),
true);
}
void ui_disable_action(const char *name) {
g_simple_action_set_enabled(
(GSimpleAction *)g_action_map_lookup_action(
G_ACTION_MAP(application),
name),
false);
}
/*
* Window actual presentation on screen
*
*/
static void gem_graph_client_application_activate(GApplication *app)
{
GtkWindow *window;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(app));
window = gtk_application_get_active_window(GTK_APPLICATION (app));
if (window == NULL)
window = g_object_new(GEM_GRAPH_CLIENT_TYPE_WINDOW,
"application", app,
NULL);
ui_set_stack(HOME_MODE);
gtk_window_present(window);
}
/*
* Action records are registered here
*
*/
static void gem_graph_client_application_init(GemGraphClientApplication *self)
{
g_action_map_add_action_entries(G_ACTION_MAP(self),
app_actions,
G_N_ELEMENTS(app_actions),
self);
// Setup shortcuts
gtk_application_set_accels_for_action(GTK_APPLICATION(self),
"app.quit",
(const char *[]) { "<primary>q", NULL });
gtk_application_set_accels_for_action(GTK_APPLICATION(self),
"app.editmode",
(const char *[]) { "<primary>e", NULL });
gtk_application_set_accels_for_action(GTK_APPLICATION(self),
"app.runmode",
(const char *[]) { "<primary>r", NULL });
gtk_application_set_accels_for_action(GTK_APPLICATION(self),
"app.presentmode",
(const char *[]) { "<primary>p", NULL });
gtk_application_set_accels_for_action(GTK_APPLICATION(self),
"app.savefile",
(const char *[]) { "<primary>s", NULL });
application = self;
//
// Disable unneeded/inoperant actions
//
ui_disable_action("savefile");
ui_disable_action("closefile");
ui_disable_action("editmode");
ui_disable_action("runmode");
ui_disable_action("presentmode");
ui_disable_action("togglesidebar");
}
void ui_send_notification(const char *message)
{
g_print("NOTIFICATION: %s\n", message);
g_application_send_notification(G_APPLICATION(application),
"notification",
g_notification_new(message)
);
}
/* -------------------------------------------------------------------------- */
static void gem_graph_client_application_class_init(
GemGraphClientApplicationClass *klass)
{
GApplicationClass *app_class = G_APPLICATION_CLASS(klass);
app_class->activate = gem_graph_client_application_activate;
}
GemGraphClientApplication *gem_graph_client_application_new(
const char *application_id,
GApplicationFlags flags)
{
g_return_val_if_fail(application_id != NULL, NULL);
return g_object_new(GEM_GRAPH_CLIENT_TYPE_APPLICATION,
"application-id", application_id,
"flags", flags,
NULL);
}

37
src/ui/bac_a_sable.ui Normal file
View File

@ -0,0 +1,37 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<interface>
<!-- interface-name gem-graph.ui -->
<requires lib="gtk" version="4.6"/>
<template class="GemGraphClientWindow" parent="GtkApplicationWindow">
<property name="icon-name">application-x-executable</property>
<property name="title">WIP</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkBox">
<child>
<object class="GtkGLArea" id="run_glarea"/>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="run_controls">
<property name="margin-bottom">50</property>
<property name="margin-top">50</property>
<property name="orientation">horizontal</property>
</object>
</child>
<child>
<object class="GtkBox" id="glarea_controls"/>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="main_titlebar"/>
</child>
<style>
<class name="devel"/>
</style>
</template>
</interface>

369
src/ui/events.c Normal file
View File

@ -0,0 +1,369 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: User interface functions
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include "../../include/base.h"
#include "../../include/graphics.h"
#include "../../include/parsing.h"
#include "../../include/ui.h"
void on_about_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
static const char *authors[] = { "Adrien Bourmault (neox@a-lec.org)",
"Jean Sirmai (jean@a-lec.org)",
"Arthur Menges (arthur.menges@a-lec.org)",
NULL};
GemGraphClientApplication *self = user_data;
GtkWindow *window = NULL;
g_assert (GEM_GRAPH_CLIENT_IS_APPLICATION(self));
window = gtk_application_get_active_window(GTK_APPLICATION (self));
gtk_show_about_dialog(window,
"program-name", "Gem-graph",
"logo-icon-name", "application-x-executable",
"authors", authors,
"version", "0.1.0",
"copyright", "Copyright © 2023 Libre en Communs",
NULL);
}
void on_quit_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
g_application_quit(G_APPLICATION(self));
}
void on_preferences_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
ui_send_internal_notification("Not implemented !");
}
void on_togglesidebar_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
ui_toggle_sidebar();
}
void on_editmode_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
ui_set_stack(EDIT_MODE);
}
void on_runmode_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
ui_set_stack(RUN_MODE);
}
void on_presentmode_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
ui_set_stack(PRESENTATION_MODE);
}
void on_openfile_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
// Create a new file selection dialog, using the "open" mode
GtkFileChooserNative *native =
gtk_file_chooser_native_new("Open File",
GTK_WINDOW(self),
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Open",
"_Cancel");
// Connect the "response" signal of the file selection dialog;
// this signal is emitted when the user selects a file, or when
// they cancel the operation
g_signal_connect (native,
"response",
G_CALLBACK(on_openfile_response),
self);
// Present the dialog to the user
gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
}
void on_closefile_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
model_shutdown();
ui_disable_action("closefile");
ui_disable_action("savefile");
ui_disable_action("runmode");
ui_disable_action("editmode");
ui_disable_action("presentmode");
ui_disable_action("togglesidebar");
ui_set_stack(HOME_MODE);
}
void on_savefile_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
}
void on_toast_close_action(GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GemGraphClientApplication *self = user_data;
g_assert(GEM_GRAPH_CLIENT_IS_APPLICATION(self));
ui_close_internal_notification();
}
/* -------------------------------------------------------------------------- */
/*
* Graphical/view related events
*/
void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
{
GtkWidget *slider = gtk_widget_get_parent(GTK_WIDGET(data));
GtkWidget *container_widget = gtk_widget_get_parent(GTK_WIDGET(slider));
const gchar *label_text = gtk_label_get_label(GTK_LABEL(data));
// THANKS ASCIIIII/Unicode/Whateverrr !
int axis = label_text[0] - 'X';
g_assert(axis >= 0 && axis < N_AXIS);
/* Update the rotation angle */
ui_update_axis_stack(container_widget,
axis,
gtk_adjustment_get_value(adjustment));
/* Update the contents of the GL drawing area */
}
gboolean on_glarea_render(GtkGLArea *area, GdkGLContext *context)
{
// Check if the widget is a glarea
if(gtk_gl_area_get_error(area) != NULL) {
ui_send_internal_notification("An OpenGL error occured !");
return false;
}
if (ui_render_stack(gtk_widget_get_parent(GTK_WIDGET(area))) == false) {
ui_send_internal_notification(
"Failed to render corresponding graphic stack !");
return false;
}
return true;
}
/* We need to set up our state when we realize the GtkGLArea widget */
void on_glarea_realize(GtkWidget *widget)
{
GError *internal_error = NULL;
// Make the GL context current to be able to call the GL API
gtk_gl_area_make_current(GTK_GL_AREA(widget));
// Check if the widget is a glarea
if(gtk_gl_area_get_error(GTK_GL_AREA(widget)) != NULL) {
ui_send_internal_notification("An OpenGL error occured !");
return;
}
// Link graphical stack to widget
if (ui_init_graphic_stack(gtk_widget_get_parent(widget),
internal_error) == false) {
ui_send_internal_notification(
"Failed to link the graphic stack to widgets !");
return;
}
gtk_gl_area_set_auto_render(GTK_GL_AREA(widget), true);
}
/* We should tear down the state when unrealizing */
void on_glarea_unrealize(GtkWidget *widget)
{
GError *internal_error = NULL;
// Make the GL context current to be able to call the GL API
gtk_gl_area_make_current(GTK_GL_AREA(widget));
// Check if the widget is a glarea
if(gtk_gl_area_get_error(GTK_GL_AREA(widget)) != NULL) {
ui_send_internal_notification("An OpenGL error occured !");
return;
}
// Destroy graphic stack
if (ui_shutdown_graphic_stack(gtk_widget_get_parent(widget),
internal_error) == false) {
ui_send_internal_notification(
"Failed to shutdown the graphic stack !");
return;
}
}
void on_close_window(GtkWidget *widget)
{
ui_shutdown_all_graphic_stacks();
ui_clean_stack_index();
}
/* -------------------------------------------------------------------------- */
/*
* Responses
*/
void on_openfile_response(GtkNativeDialog *native,
int response,
GemGraphClientWindow *self)
{
g_autoptr(GFile) file;
GtkFileChooser *chooser;
if (response == GTK_RESPONSE_ACCEPT) {
chooser = GTK_FILE_CHOOSER(native);
file = gtk_file_chooser_get_file(chooser);
// Load asynchroneously not to block control flow
g_file_load_contents_async (file,
NULL,
(GAsyncReadyCallback)ui_model_loading,
self);
}
g_object_unref(native);
}
void ui_model_loading(GObject *source_object,
GAsyncResult *result,
GemGraphClientWindow *self)
{
GFile *file = G_FILE(source_object);
char *content = NULL;
size_t length = 0;
GError *error = NULL;
char *basename = g_file_get_basename(file);
// Gives you the contents of the file as a byte array, or
// set the error argument
g_file_load_contents_finish(file,
result,
&content,
&length,
NULL,
&error);
// In case of error, print a warning to the standard error output
if (error != NULL) {
g_printerr("Unable to open “%s”: %s\n",
g_file_peek_path(file),
error->message);
ui_send_internal_notification("Unable to open file !");
g_free(error);
g_free(basename);
g_free(content);
return;
}
if (model_init(content, length, basename) == false) {
ui_send_internal_notification("Error while loading the model");
g_free(basename);
g_free(content);
return;
}
ui_enable_action("closefile");
ui_enable_action("savefile");
ui_enable_action("runmode");
ui_enable_action("editmode");
ui_enable_action("presentmode");
ui_enable_action("togglesidebar");
ui_set_stack(RUN_MODE);
g_free(basename);
g_free(content);
}

312
src/ui/gemgraph.ui Normal file
View File

@ -0,0 +1,312 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.10.2 -->
<interface>
<!-- interface-name gem-graph.ui -->
<requires lib="gtk" version="4.6"/>
<template class="GemGraphClientWindow" parent="GtkApplicationWindow">
<property name="default-height">900</property>
<property name="default-width">1400</property>
<property name="icon-name">application-x-executable</property>
<property name="title">GemGraph 0.1.0</property>
<style>
<class name="devel"/>
</style>
<child type="titlebar">
<object class="GtkHeaderBar" id="main_titlebar">
<child type="end">
<object class="GtkMenuButton" id="main_button_menu">
<property name="direction">none</property>
<property name="menu-model">main_menu</property>
</object>
</child>
<child type="start">
<object class="GtkMenuButton" id="main_button_mode">
<property name="always-show-arrow">True</property>
<property name="use-underline">True</property>
<property name="tooltip-text" translatable="yes">Change session mode</property>
<property name="icon-name">document-edit-symbolic</property>
<property name="menu-model">mode_menu</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="main_button_sidebar">
<property name="icon-name">sidebar-show-symbolic</property>
<property name="tooltip-text" translatable="yes">Display/hide sidebar</property>
<property name="action-name">app.togglesidebar</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkOverlay" id="toast_overlay">
<child>
<object class="GtkPaned" id="main_paned">
<property name="position">300</property>
<child>
<object class="GtkStack" id="side_stack">
<child>
<object class="GtkStackPage">
<property name="name">run</property>
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="control_zone">
<property name="orientation">vertical</property>
</object>
</child>
<child>
<object class="GtkStackSwitcher">
<property name="visible">True</property>
<property name="stack">runlib_stack</property>
</object>
</child>
<child>
<object class="GtkStack" id="runlib_stack">
<child>
<object class="GtkStackPage">
<property name="name">runlib_objects</property>
<property name="title" translatable="yes">Objects</property>
<property name="visible">True</property>
<property name="child">
<object class="GtkLabel" id="label_runlib_objects">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;runlib_objects&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="margin-top">50</property>
<property name="margin-bottom">50</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">runlib_conditions_and_rules</property>
<property name="title" translatable="yes">Rules &amp; Conds</property>
<property name="visible">True</property>
<property name="child">
<object class="GtkLabel" id="label_runlib_conditions_and_rules">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;runlib_conditions_and_rules&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="margin-top">50</property>
<property name="margin-bottom">50</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">runlib_states</property>
<property name="title" translatable="yes">Savedstates</property>
<property name="visible">True</property>
<property name="child">
<object class="GtkLabel" id="label_runlib_states">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;runlib_states&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="margin-top">50</property>
<property name="margin-bottom">50</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">home</property>
<property name="child">
<object class="GtkLabel" id="labelhome">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;Sidebar: home&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">presentation</property>
<property name="child">
<object class="GtkLabel" id="labelsidepresentation">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;Sidebar: presentation mode&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">edition</property>
<property name="child">
<object class="GtkLabel" id="labelsideedit">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;Sidebar: edition mode&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkStack" id="main_stack">
<child>
<object class="GtkStackPage">
<property name="name">run</property>
<property name="child">
<object class="GtkBox" id="run_glarea_box">
<property name="orientation">vertical</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">home</property>
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkImage">
<property name="vexpand">True</property>
<property name="file">data/hicolor/apps/scalable/gemgraph_désaturé.png</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="margin-bottom">50</property>
<property name="margin-top">00</property>
<property name="justify">center</property>
<property name="valign">center</property>
<property name="label" translatable="yes">&lt;b&gt;Welcome to the Gem-graph client.&lt;/b&gt;</property>
<property name="use-markup">True</property>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">presentation</property>
<property name="child">
<object class="GtkBox" id="presentation_glarea_box">
<property name="orientation">vertical</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">edition</property>
<property name="child">
<object class="GtkBox" id="edition_glarea_box">
<property name="orientation">vertical</property>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child type="overlay">
<object class="GtkRevealer" id="toast_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="transition-type">GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN</property>
<child>
<object class="GtkBox" id="toast_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="spacing">20</property>
<child>
<object class="GtkLabel" id="toast_text">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">(null)</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="toast_close_button">
<property name="icon-name">window-close-symbolic</property>
<property name="action-name">app.toastclose</property>
</object>
</child>
<style>
<class name="app-notification"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<menu id="main_menu">
<section>
<item>
<attribute name="label" translatable="yes">_Open...</attribute>
<attribute name="action">app.openfile</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Close</attribute>
<attribute name="action">app.closefile</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">app.savefile</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Preferences</attribute>
<attribute name="action">app.preferences</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About GemGraph</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
<menu id="mode_menu">
<section>
<attribute name="label" translatable="yes">Switch session mode</attribute>
<item>
<attribute name="icon">document-edit-symbolic</attribute>
<attribute name="label" translatable="yes">_Edition</attribute>
<attribute name="action">app.editmode</attribute>
<attribute name="use-icon">True</attribute>
</item>
<item>
<attribute name="icon">system-run-symbolic</attribute>
<attribute name="label" translatable="yes">_Run</attribute>
<attribute name="action">app.runmode</attribute>
<attribute name="use-icon">True</attribute>
</item>
<item>
<attribute name="icon">video-display-symbolic</attribute>
<attribute name="label" translatable="yes">_Presentation</attribute>
<attribute name="action">app.presentmode</attribute>
<attribute name="use-icon">True</attribute>
</item>
</section>
</menu>
</interface>

323
src/ui/graphics.c Normal file
View File

@ -0,0 +1,323 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: User interface functions
*
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <unistd.h>
#include <gtk-4.0/gtk/gtk.h>
#include <glib-2.0/glib.h>
#include "../../include/base.h"
#include "../../include/ui.h"
#include "../../include/graphics.h"
struct stack_index_t {
long stack_id;
void *container_widget;
void *gl_area;
};
static struct stack_index_t *stack_index = NULL;
size_t stack_index_size = 0;
/*
* Look for stack entry and returns stack_id
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns stack_id
*/
long ui_get_graphic_stack(void *container_widget)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)container_widget) {
return stack_index[i].stack_id;
}
}
return -1;
}
/*
* Look for stack entry and returns stack_id
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns stack_id
*/
long ui_is_graphic_stack_ready(void *container_widget)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)container_widget) {
return stack_index[i].stack_id;
}
}
return -1;
}
/*
* Look for stack entry and initializes OpenGL for it
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_init_graphic_stack(void *container_widget, GError *error_buffer)
{
//g_printerr("[debug] ui_init_graphic_stack()\n");
//g_printerr("[debug] ui_init_graphic_stack() : target is %p\n", container_widget);
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
//g_printerr("[debug] ui_init_graphic_stack() : i is %d\n", i);
//g_printerr("[debug] ui_init_graphic_stack() : target would be %p\n",
//stack_index[i].container_widget);
if (stack_index[i].container_widget == (void *)container_widget) {
stack_index[i].stack_id = graphics_init(&error_buffer);
//g_printerr("[debug] ui_init_graphic_stack() : stack_id is %d\n",
//stack_index[i].stack_id);
if (stack_index[i].stack_id >= 0)
return true;
else
return false;
}
}
return false;
}
/*
* Look for stack entry and shutdowns OpenGL for it
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)container_widget) {
if (graphics_shutdown(stack_index[i].stack_id,
&error_buffer) == false) {
return false;
}
stack_index[i].stack_id = 0;
return true;
}
}
return false;
}
void ui_clean_stack_index(void)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
stack_index[i].stack_id = 0;
}
return;
}
/*
* Look for stack entry and triggers OpenGL for drawing
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_render_stack(GtkWidget *container_widget)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)container_widget) {
graphics_draw(stack_index[i].stack_id);
return true;
}
}
return false;
}
/*
* Look for stack entry and triggers OpenGL for drawing
*
* @params container_widget, generally the GtkBox that contains the GLArea
*
* @returns bool, true if success
*/
bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)container_widget) {
graphic_stack[stack_index[i].stack_id].rotation_angles[axis] = value;
gtk_widget_queue_draw((GtkWidget*)(stack_index[i].gl_area));
return true;
}
}
return false;
}
/*
* Look for every stack entry and shutdowns OpenGL for it
*
* @params void
*
* @returns bool, true if success
*/
void ui_shutdown_all_graphic_stacks(void)
{
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
graphics_shutdown(stack_index[i].stack_id, NULL);
}
return;
}
/*
* Creates a slider widget
*
* @params axis, meaning which axis we're building (for label)
*
* @returns GtkWidget*, pointer to the new widget
*/
GtkWidget *create_axis_slider(int axis)
{
GtkWidget *box, *label, *slider;
GtkAdjustment *adj;
const char *text;
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
switch (axis) {
case X_AXIS:
text = "X";
break;
case Y_AXIS:
text = "Y";
break;
case Z_AXIS:
text = "Z";
break;
default:
g_assert_not_reached();
}
label = gtk_label_new(text);
gtk_box_append(GTK_BOX(box), label);
gtk_widget_show(label);
adj = gtk_adjustment_new(0.0, 0.0, 360.0, 1.0, 12.0, 0.0);
g_signal_connect(adj, "value-changed",
G_CALLBACK(on_axis_value_change),
(gpointer) label);
slider = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adj);
gtk_box_append(GTK_BOX(box), slider);
gtk_widget_set_hexpand(slider, TRUE);
gtk_widget_show(slider);
gtk_widget_show(box);
return box;
}
/*
* Creates GLArea and indexes it
*
* @params target_mode, meaning which ui_stack we're on
* target_widget, meaning the box that will host the GLArea
*
* @returns bool, true if success
*/
bool ui_setup_glarea(int target_mode, GtkWidget *target_widget)
{
GtkWidget *gl_area;
////g_printerr("[debug] ui_setup_glarea()\n");
assert(target_widget);
////g_printerr("[debug] ui_setup_glarea() : target is %p\n", target_widget);
if (stack_index == NULL) {
stack_index = g_malloc(sizeof(struct stack_index_t));
stack_index_size = 1;
} else {
// look for stack_index entry
for (int i = 0; i < stack_index_size; i++) {
if (stack_index[i].container_widget == (void *)target_widget) {
return false;
}
}
// create entry
stack_index =
g_realloc(stack_index,
++stack_index_size * sizeof(struct stack_index_t));
}
gl_area = GTK_WIDGET(gtk_gl_area_new());
assert(gl_area);
//gtk_widget_set_size_request(gl_area, 1000, 1000);
gtk_gl_area_set_auto_render(GTK_GL_AREA(gl_area), true);
gtk_widget_set_hexpand(gl_area, TRUE);
gtk_widget_set_vexpand(gl_area, TRUE);
//gtk_widget_set_halign(gl_area, GTK_ALIGN_CENTER);
//gtk_widget_set_valign(gl_area, GTK_ALIGN_CENTER);
// The main "draw" call for GtkGLArea
g_signal_connect(GTK_GL_AREA(gl_area),
"render",
G_CALLBACK(on_glarea_render), NULL);
g_signal_connect(gl_area,
"realize",
G_CALLBACK(on_glarea_realize), NULL);
g_signal_connect(gl_area,
"unrealize",
G_CALLBACK(on_glarea_unrealize), NULL);
stack_index[stack_index_size-1].container_widget =
(void*)target_widget;
stack_index[stack_index_size-1].gl_area = (void*)gl_area;
////g_printerr("[debug] ui_setup_glarea() : set target to %p\n", target_widget);
////g_printerr("[debug] ui_setup_glarea() : stack_index (@0x%p) had %ld elements\n",
//stack_index,
//stack_index_size);
gtk_box_append(GTK_BOX(target_widget), gl_area);
gtk_widget_show(GTK_WIDGET(gl_area));
// Create sliders
for(int i = 0; i < N_AXIS; i++)
gtk_box_append(GTK_BOX(target_widget), create_axis_slider(i));
return true;
}

236
src/ui/window.c Normal file
View File

@ -0,0 +1,236 @@
/*
* Gem-graph OpenGL experiments
*
* Desc: User interface functions
*
* Copyright (C) 2023 Arthur Menges <arthur.menges@a-lec.org>
* Copyright (C) 2023 Adrien Bourmault <neox@a-lec.org>
*
* This file is part of Gem-graph.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <unistd.h>
#include <gtk-4.0/gtk/gtk.h>
#include <glib-2.0/glib.h>
#include "../../include/base.h"
#include "../../include/ui.h"
/* -------------------------------------------------------------------------- */
static GemGraphClientWindow *window;
/* -------------------------------------------------------------------------- */
struct _GemGraphClientWindow
{
GtkApplicationWindow parent_instance;
/* Template widgets */
GtkHeaderBar *main_titlebar;
GtkStack *main_stack;
GtkStack *side_stack;
GtkPaned *main_paned;
GtkMenuButton *main_button_mode;
GtkToggleButton *main_button_sidebar;
GtkRevealer *toast_revealer;
GtkToggleButton *toast_close_button;
GtkLabel *toast_text;
GtkBox *control_zone;
GtkBox *run_glarea_box;
GtkBox *edition_glarea_box;
GtkBox *presentation_glarea_box;
};
G_DEFINE_FINAL_TYPE (GemGraphClientWindow,
gem_graph_client_window,
GTK_TYPE_APPLICATION_WINDOW)
static void gem_graph_client_window_class_init(GemGraphClientWindowClass *klass)
{
gchar *contents;
gsize len;
GError *err;
GBytes *bytes;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
if (g_file_get_contents("src/ui/gemgraph.ui", &contents, &len, &err) == FALSE)
g_error("error reading gemgraph.ui: %s", err->message);
bytes = g_bytes_new_take(contents, len);
gtk_widget_class_set_template(GTK_WIDGET_CLASS(klass), bytes);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
main_titlebar);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
main_stack);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
side_stack);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
main_paned);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
main_button_mode);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
main_button_sidebar);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
toast_revealer);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
toast_close_button);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
toast_text);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
control_zone);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
run_glarea_box);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
edition_glarea_box);
gtk_widget_class_bind_template_child(widget_class,
GemGraphClientWindow,
presentation_glarea_box);
}
static void gem_graph_client_window_init(GemGraphClientWindow *self)
{
gtk_widget_init_template(GTK_WIDGET(self));
window = self;
// Launch with sidebar off
ui_toggle_sidebar();
}
/* -------------------------------------------------------------------------- */
void ui_set_stack(int mode)
{
//g_printerr("[debug] ui_set_stack()\n");
if (window->main_stack == NULL) {
g_printerr("Can't find self->main_stack !\n");
return;
}
if (window->side_stack == NULL) {
g_printerr("Can't find self->side_stack !\n");
return;
}
// Switch on the first letter of the mode, because switch is soooo simple :)
switch(mode) {
case EDIT_MODE:
gtk_stack_set_visible_child_full(window->main_stack,
"edition",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_stack_set_visible_child_full(window->side_stack,
"edition",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_menu_button_set_icon_name(window->main_button_mode,
"document-edit-symbolic");
ui_setup_glarea(EDIT_MODE, GTK_WIDGET(window->edition_glarea_box));
break;
case RUN_MODE:
gtk_stack_set_visible_child_full(window->main_stack,
"run",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_stack_set_visible_child_full(window->side_stack,
"run",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_menu_button_set_icon_name(window->main_button_mode,
"system-run-symbolic");
ui_setup_glarea(RUN_MODE, GTK_WIDGET(window->run_glarea_box));
break;
case PRESENTATION_MODE:
gtk_stack_set_visible_child_full(window->main_stack,
"presentation",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_stack_set_visible_child_full(window->side_stack,
"presentation",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_menu_button_set_icon_name(window->main_button_mode,
"x-office-presentation-symbolic");
ui_setup_glarea(PRESENTATION_MODE,
GTK_WIDGET(window->presentation_glarea_box));
break;
case HOME_MODE:
gtk_stack_set_visible_child_full(window->main_stack,
"home",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_stack_set_visible_child_full(window->side_stack,
"home",
GTK_STACK_TRANSITION_TYPE_CROSSFADE);
gtk_paned_set_position(window->main_paned, 0);
gtk_menu_button_set_icon_name(window->main_button_mode,
"user-home-symbolic");
break;
default:
break;
}
}
void ui_send_internal_notification(const char *message)
{
if (window->toast_revealer == NULL) {
g_printerr("Can't find self->toast_overlay !\n");
return;
}
if (window->toast_text == NULL) {
g_printerr("Can't find self->toast_overlay !\n");
return;
}
gtk_label_set_label(window->toast_text, message);
gtk_revealer_set_reveal_child(window->toast_revealer, true);
g_printerr("%s\n", message);
}
void ui_close_internal_notification(void)
{
if (window->toast_revealer == NULL) {
g_printerr("Can't find self->toast_overlay !\n");
return;
}
if (window->toast_text == NULL) {
g_printerr("Can't find self->toast_overlay !\n");
return;
}
gtk_revealer_set_reveal_child(window->toast_revealer, false);
}
void ui_toggle_sidebar(void)
{
int position = gtk_paned_get_position(window->main_paned);
if (position != 0) {
gtk_paned_set_position(window->main_paned, 0);
} else {
gtk_paned_set_position(window->main_paned, 400);
}
}