1 /*   EXTRAITS DE LA LICENCE
2 	Copyright CEA, contributeurs : Luc BILLARD et Damien
3 	CALISTE, laboratoire L_Sim, (2001-2005)
4 
5 	Adresse mèl :
6 	BILLARD, non joignable par mèl ;
7 	CALISTE, damien P caliste AT cea P fr.
8 
9 	Ce logiciel est un programme informatique servant à visualiser des
10 	structures atomiques dans un rendu pseudo-3D.
11 
12 	Ce logiciel est régi par la licence CeCILL soumise au droit français et
13 	respectant les principes de diffusion des logiciels libres. Vous pouvez
14 	utiliser, modifier et/ou redistribuer ce programme sous les conditions
15 	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
16 	sur le site "http://www.cecill.info".
17 
18 	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
19 	pris connaissance de la licence CeCILL, et que vous en avez accepté les
20 	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
21 */
22 
23 /*   LICENCE SUM UP
24 	Copyright CEA, contributors : Luc BILLARD et Damien
25 	CALISTE, laboratoire L_Sim, (2001-2005)
26 
27 	E-mail address:
28 	BILLARD, not reachable any more ;
29 	CALISTE, damien P caliste AT cea P fr.
30 
31 	This software is a computer program whose purpose is to visualize atomic
32 	configurations in 3D.
33 
34 	This software is governed by the CeCILL  license under French law and
35 	abiding by the rules of distribution of free software.  You can  use,
36 	modify and/ or redistribute the software under the terms of the CeCILL
37 	license as circulated by CEA, CNRS and INRIA at the following URL
38 	"http://www.cecill.info".
39 
40 	The fact that you are presently reading this means that you have had
41 	knowledge of the CeCILL license and that you accept its terms. You can
42 	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
43 */
44 #ifndef VISU_DATA_H
45 #define VISU_DATA_H
46 
47 #include <glib.h>
48 #include <glib-object.h>
49 
50 #include "visu_tools.h"
51 #include "visu_elements.h"
52 #include "visu_nodes.h"
53 #include "extraFunctions/nodeProp.h"
54 #include "extraFunctions/stringProp.h"
55 #include "visu_box.h"
56 #include "iface_boxed.h"
57 #include "iface_pointset.h"
58 #include "coreTools/toolPhysic.h"
59 #include "coreTools/toolFileFormat.h"
60 
61 G_BEGIN_DECLS
62 
63 /**
64  * VISU_TYPE_DATA:
65  *
66  * return the type of #VisuData.
67  */
68 #define VISU_TYPE_DATA	     (visu_data_get_type ())
69 /**
70  * VISU_DATA:
71  * @obj: a #GObject to cast.
72  *
73  * Cast the given @obj into #VisuData type.
74  */
75 #define VISU_DATA(obj)	     (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_TYPE_DATA, VisuData))
76 /**
77  * VISU_DATA_CLASS:
78  * @klass: a #GObjectClass to cast.
79  *
80  * Cast the given @klass into #VisuDataClass.
81  */
82 #define VISU_DATA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_TYPE_DATA, VisuDataClass))
83 /**
84  * VISU_IS_DATA:
85  * @obj: a #GObject to test.
86  *
87  * Test if the given @ogj is of the type of #VisuData object.
88  */
89 #define VISU_IS_DATA(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_TYPE_DATA))
90 /**
91  * VISU_IS_DATA_CLASS:
92  * @klass: a #GObjectClass to test.
93  *
94  * Test if the given @klass is of the type of #VisuDataClass class.
95  */
96 #define VISU_IS_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, VISU_TYPE_DATA))
97 /**
98  * VISU_DATA_GET_CLASS:
99  * @obj: a #GObject to get the class of.
100  *
101  * It returns the class of the given @obj.
102  */
103 #define VISU_DATA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_TYPE_DATA, VisuDataClass))
104 
105 typedef struct _VisuDataPrivate VisuDataPrivate;
106 typedef struct _VisuData VisuData;
107 
108 /**
109  * VisuData:
110  *
111  * Opaque structure for #VisuData objects.
112  */
113 struct _VisuData
114 {
115   VisuNodeArray parent;
116 
117   VisuDataPrivate *priv;
118 };
119 
120 /**
121  * VisuDataClass:
122  * @parent: the parent class.
123  *
124  * A short way to identify #_VisuDataClass structure.
125  */
126 typedef struct _VisuDataClass VisuDataClass;
127 struct _VisuDataClass
128 {
129   VisuNodeArrayClass parent;
130 };
131 
132 /**
133  * visu_data_get_type:
134  *
135  * This method returns the type of #VisuData, use VISU_TYPE_DATA instead.
136  *
137  * Returns: the type of #VisuData.
138  */
139 GType visu_data_get_type(void);
140 
141 VisuData* visu_data_new(void);
142 void visu_data_freePopulation(VisuData *data);
143 
144 void visu_data_setDescription(VisuData *data, const gchar* commentary);
145 const gchar* visu_data_getDescription(const VisuData *data);
146 
147 gfloat visu_data_getAllNodeExtens(VisuData *dataObj, VisuBox *box);
148 
149 VisuNode* visu_data_addNodeFromElement(VisuData *data, VisuElement *ele,
150                                        float xyz[3], gboolean reduced);
151 VisuNode* visu_data_addNodeFromElementName(VisuData *data, const gchar *name,
152                                            float xyz[3], gboolean reduced);
153 VisuNode* visu_data_addNodeFromIndex(VisuData *data, guint position,
154                                      float xyz[3], gboolean reduced);
155 
156 VisuBox* visu_data_setTightBox(VisuData *data);
157 
158 gboolean visu_data_getNodeBoxFromNumber(VisuData *data, guint nodeId, int nodeBox[3]);
159 gboolean visu_data_getNodeBoxFromCoord(VisuData *data, float xcart[3], int nodeBox[3]);
160 
161 void visu_data_getNodeCoordinates(VisuData *data, VisuNode *node, gboolean user, float *x, float *y, float *z);
162 void visu_data_getNodePosition(const VisuData *data, const VisuNode *node, float coord[3]);
163 void visu_data_getNodeUserPosition(const VisuData *data, const VisuNode *node, float coord[3]);
164 
165 gboolean visu_data_setNewBasisFromNodes(VisuData *data, guint nO, guint nA, guint nB, guint nC);
166 gboolean visu_data_setNewBasis(VisuData *data, float matA[3][3], float O[3]);
167 gboolean visu_data_reorder(VisuData *data, const VisuData *dataRef);
168 
169 gboolean visu_data_addNodeProperties(VisuData *data, VisuNodeValues *values);
170 gboolean visu_data_removeNodeProperties(VisuData *data, const gchar *label);
171 GList* visu_data_getAllNodeProperties(VisuData *data);
172 VisuNodeValues* visu_data_getNodeProperties(VisuData *data, const gchar *label);
173 VisuNodeValuesString* visu_data_getNodeLabels(VisuData *data);
174 const gchar* visu_data_getNodeLabelAt(const VisuData *data, const VisuNode *node);
175 
176 gboolean visu_data_applyTransformationsFromCLI(VisuData *data, GError **error);
177 
178 G_END_DECLS
179 
180 #endif
181