1 /*   EXTRAITS DE LA LICENCE
2 	Copyright CEA, contributeurs : Damien
3 	CALISTE, laboratoire L_Sim, (2016)
4 
5 	Adresse mèl :
6 	CALISTE, damien P caliste AT cea P fr.
7 
8 	Ce logiciel est un programme informatique servant à visualiser des
9 	structures atomiques dans un rendu pseudo-3D.
10 
11 	Ce logiciel est régi par la licence CeCILL soumise au droit français et
12 	respectant les principes de diffusion des logiciels libres. Vous pouvez
13 	utiliser, modifier et/ou redistribuer ce programme sous les conditions
14 	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
15 	sur le site "http://www.cecill.info".
16 
17 	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
18 	pris connaissance de la licence CeCILL, et que vous en avez accepté les
19 	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
20 */
21 
22 /*   LICENCE SUM UP
23 	Copyright CEA, contributors : Damien
24 	CALISTE, laboratoire L_Sim, (2016)
25 
26 	E-mail address:
27 	CALISTE, damien P caliste AT cea P fr.
28 
29 	This software is a computer program whose purpose is to visualize atomic
30 	configurations in 3D.
31 
32 	This software is governed by the CeCILL  license under French law and
33 	abiding by the rules of distribution of free software.  You can  use,
34 	modify and/ or redistribute the software under the terms of the CeCILL
35 	license as circulated by CEA, CNRS and INRIA at the following URL
36 	"http://www.cecill.info".
37 
38 	The fact that you are presently reading this means that you have had
39 	knowledge of the CeCILL license and that you accept its terms. You can
40 	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
41 */
42 #ifndef ELEMENT_ATOMIC_H
43 #define ELEMENT_ATOMIC_H
44 
45 #include <glib-object.h>
46 
47 #include "elementRenderer.h"
48 #include <coreTools/toolPhysic.h>
49 
50 G_BEGIN_DECLS
51 
52 /**
53  * VisuElementAtomicShapeId:
54  * @VISU_ELEMENT_ATOMIC_SPHERE: draw sphere ;
55  * @VISU_ELEMENT_ATOMIC_CUBE: draw cube ;
56  * @VISU_ELEMENT_ATOMIC_ELLIPSOID: draw elipsoid ;
57  * @VISU_ELEMENT_ATOMIC_POINT: draw square dot ;
58  * @VISU_ELEMENT_ATOMIC_TORUS: draw torus ;
59  * @VISU_ELEMENT_ATOMIC_N_SHAPES: number of shapes.
60  *
61  * This enum is used as identifier for shapes managed by the
62  * attomic element method.
63  */
64 typedef enum
65 {
66   VISU_ELEMENT_ATOMIC_SPHERE,
67   VISU_ELEMENT_ATOMIC_CUBE,
68   VISU_ELEMENT_ATOMIC_ELLIPSOID,
69   VISU_ELEMENT_ATOMIC_POINT,
70   VISU_ELEMENT_ATOMIC_TORUS,
71   VISU_ELEMENT_ATOMIC_N_SHAPES
72 } VisuElementAtomicShapeId;
73 
74 /**
75  * VISU_TYPE_ELEMENT_ATOMIC:
76  *
77  * return the type of #VisuElementAtomic.
78  */
79 #define VISU_TYPE_ELEMENT_ATOMIC	     (visu_element_atomic_get_type ())
80 /**
81  * VISU_ELEMENT_ATOMIC:
82  * @obj: a #GObject to cast.
83  *
84  * Cast the given @obj into #VisuElementAtomic type.
85  */
86 #define VISU_ELEMENT_ATOMIC(obj)	        (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_TYPE_ELEMENT_ATOMIC, VisuElementAtomic))
87 /**
88  * VISU_ELEMENT_ATOMIC_CLASS:
89  * @klass: a #GObjectClass to cast.
90  *
91  * Cast the given @klass into #VisuElementAtomicClass.
92  */
93 #define VISU_ELEMENT_ATOMIC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_TYPE_ELEMENT_ATOMIC, VisuElementAtomicClass))
94 /**
95  * VISU_IS_ELEMENT_ATOMIC:
96  * @obj: a #GObject to test.
97  *
98  * Test if the given @ogj is of the type of #VisuElementAtomic object.
99  */
100 #define VISU_IS_ELEMENT_ATOMIC(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_TYPE_ELEMENT_ATOMIC))
101 /**
102  * VISU_IS_ELEMENT_ATOMIC_CLASS:
103  * @klass: a #GObjectClass to test.
104  *
105  * Test if the given @klass is of the type of #VisuElementAtomicClass class.
106  */
107 #define VISU_IS_ELEMENT_ATOMIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, VISU_TYPE_ELEMENT_ATOMIC))
108 /**
109  * VISU_ELEMENT_ATOMIC_GET_CLASS:
110  * @obj: a #GObject to get the class of.
111  *
112  * It returns the class of the given @obj.
113  */
114 #define VISU_ELEMENT_ATOMIC_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_TYPE_ELEMENT_ATOMIC, VisuElementAtomicClass))
115 
116 typedef struct _VisuElementAtomicClass VisuElementAtomicClass;
117 typedef struct _VisuElementAtomic VisuElementAtomic;
118 typedef struct _VisuElementAtomicPrivate VisuElementAtomicPrivate;
119 
120 /**
121  * visu_element_atomic_get_type:
122  *
123  * This method returns the type of #VisuElementAtomic, use VISU_TYPE_ELEMENT_ATOMIC instead.
124  *
125  * Returns: the type of #VisuElementAtomic.
126  */
127 GType visu_element_atomic_get_type(void);
128 
129 /**
130  * _VisuElementAtomic:
131  * @parent: parent.
132  * @priv: private data.
133  *
134  * This structure describes a set of pairs.
135  */
136 
137 struct _VisuElementAtomic
138 {
139   VisuElementRenderer parent;
140 
141   VisuElementAtomicPrivate *priv;
142 };
143 
144 struct _VisuElementAtomicClass
145 {
146   VisuElementRendererClass parent;
147 };
148 
149 VisuElementAtomic* visu_element_atomic_new(VisuElement *element);
150 VisuElementAtomic* visu_element_atomic_getFromPool(VisuElement *element);
151 void visu_element_atomic_bindToPool(VisuElementAtomic *atomic);
152 
153 gfloat     visu_element_atomic_getRadius(const VisuElementAtomic *self);
154 gboolean   visu_element_atomic_setRadius(VisuElementAtomic *self, gfloat val);
155 ToolUnits  visu_element_atomic_getUnits (const VisuElementAtomic *self);
156 gboolean   visu_element_atomic_setUnits (VisuElementAtomic *self, ToolUnits val);
157 VisuElementAtomicShapeId visu_element_atomic_getShape (const VisuElementAtomic *self);
158 gboolean   visu_element_atomic_setShape (VisuElementAtomic *self,
159                                          VisuElementAtomicShapeId val);
160 gfloat     visu_element_atomic_getElipsoidRatio(const VisuElementAtomic *self);
161 gboolean   visu_element_atomic_setElipsoidRatio(VisuElementAtomic *self, gfloat val);
162 gfloat     visu_element_atomic_getElipsoidPhi  (const VisuElementAtomic *self);
163 gboolean   visu_element_atomic_setElipsoidPhi  (VisuElementAtomic *self, gfloat val);
164 gfloat     visu_element_atomic_getElipsoidTheta(const VisuElementAtomic *self);
165 gboolean   visu_element_atomic_setElipsoidTheta(VisuElementAtomic *self, gfloat val);
166 
167 const gchar ** visu_element_atomic_getShapeNames(gboolean asLabel);
168 
169 void visu_element_atomic_pool_finalize(void);
170 
171 G_END_DECLS
172 
173 #endif
174