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 IFACE_CYLINDER_H
43 #define IFACE_CYLINDER_H
44 
45 #include <glib.h>
46 #include <glib-object.h>
47 
48 G_BEGIN_DECLS
49 
50 /**
51  * VisuPairCylinderColorId:
52  * @VISU_CYLINDER_COLOR_USER: color is chosen by the user.
53  * @VISU_CYLINDER_COLOR_ELEMENT: color is chosen according to
54  * the color of the #VisuElement the pair is linked to.
55  * @VISU_CYLINDER_COLOR_NODE: color is chosen according to
56  * the color of the #VisuNode the pair is linked to (relevant whenever
57  * nodes are colorized).
58  * @VISU_CYLINDER_N_COLOR: number of choices for the colourisation.
59  *
60  * Possible flags to colourise the cylinder pairs.
61  */
62 typedef enum {
63   VISU_CYLINDER_COLOR_USER,
64   VISU_CYLINDER_COLOR_ELEMENT,
65   VISU_CYLINDER_COLOR_NODE,
66   VISU_CYLINDER_N_COLOR
67 } VisuPairCylinderColorId;
68 
69 /**
70  * VISU_PAIR_CYLINDER_RADIUS_MIN:
71  *
72  * Minimum value for the radius of cylinder pairs.
73  */
74 #define VISU_PAIR_CYLINDER_RADIUS_MIN 0.01f
75 /**
76  * VISU_PAIR_CYLINDER_RADIUS_MAX:
77  *
78  * Maximum value for the radius of cylinder pairs.
79  */
80 #define VISU_PAIR_CYLINDER_RADIUS_MAX 3.f
81 
82 /* Cylinder interface. */
83 #define VISU_TYPE_PAIR_CYLINDER                (visu_pair_cylinder_get_type())
84 #define VISU_PAIR_CYLINDER(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), VISU_TYPE_PAIR_CYLINDER, VisuPairCylinder))
85 #define VISU_IS_PAIR_CYLINDER(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), VISU_TYPE_PAIR_CYLINDER))
86 #define VISU_PAIR_CYLINDER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), VISU_TYPE_PAIR_CYLINDER, VisuPairCylinderInterface))
87 
88 typedef struct _VisuPairCylinder VisuPairCylinder; /* dummy object */
89 typedef struct _VisuPairCylinderInterface VisuPairCylinderInterface;
90 
91 /**
92  * VisuPairCylinder:
93  *
94  * Interface object.
95  *
96  * Since: 3.8
97  */
98 
99 /**
100  * VisuPairCylinderInterface:
101  * @parent: its parent.
102  * @set_radius: a method to change the radius of drawn cylinder
103  * #VisuPairLink.
104  * @get_radius: a method to get the radius.
105  * @get_colorType: a method to get the coloring scheme.
106  * @set_colorType: a method to change the coloring scheme.
107  *
108  * Interface for class that can represent #VisuPairLink as cylinders.
109  *
110  * Since: 3.8
111  */
112 struct _VisuPairCylinderInterface
113 {
114   GTypeInterface parent;
115 
116   gfloat     (*get_radius) (VisuPairCylinder *self);
117   gboolean   (*set_radius) (VisuPairCylinder *self, gfloat val);
118 
119   VisuPairCylinderColorId (*get_colorType) (VisuPairCylinder *self);
120   gboolean                (*set_colorType) (VisuPairCylinder *self, VisuPairCylinderColorId val);
121 };
122 
123 GType visu_pair_cylinder_get_type (void);
124 
125 gfloat                  visu_pair_cylinder_getDefaultRadius();
126 VisuPairCylinderColorId visu_pair_cylinder_getDefaultColorType();
127 
128 gboolean                visu_pair_cylinder_setColorType(VisuPairCylinder *data,
129                                                         VisuPairCylinderColorId val);
130 VisuPairCylinderColorId visu_pair_cylinder_getColorType(VisuPairCylinder *data);
131 
132 gboolean   visu_pair_cylinder_setRadius(VisuPairCylinder *data, gfloat val);
133 gfloat     visu_pair_cylinder_getRadius(VisuPairCylinder *data);
134 
135 G_END_DECLS
136 
137 #endif
138