1 /*   EXTRAITS DE LA LICENCE
2 	Copyright CEA, contributeurs : Luc BILLARD, Damien
3 	CALISTE, Olivier D'Astier, laboratoire L_Sim, (2001-2005)
4 
5 	Adresses mèl :
6 	BILLARD, non joignable par mèl ;
7 	CALISTE, damien P caliste AT cea P fr.
8 	D'ASTIER, dastier AT iie P cnam P fr.
9 
10 	Ce logiciel est un programme informatique servant à visualiser des
11 	structures atomiques dans un rendu pseudo-3D.
12 
13 	Ce logiciel est régi par la licence CeCILL soumise au droit français et
14 	respectant les principes de diffusion des logiciels libres. Vous pouvez
15 	utiliser, modifier et/ou redistribuer ce programme sous les conditions
16 	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
17 	sur le site "http://www.cecill.info".
18 
19 	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
20 	pris connaissance de la licence CeCILL, et que vous en avez accepté les
21 	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
22 */
23 
24 /*   LICENCE SUM UP
25 	Copyright CEA, contributors : Luc BILLARD and Damien
26 	CALISTE and Olivier D'Astier, laboratoire L_Sim, (2001-2005)
27 
28 	E-mail addresses :
29 	BILLARD, not reachable any more ;
30 	CALISTE, damien P caliste AT cea P fr.
31 	D'ASTIER, dastier AT iie P cnam P fr.
32 
33 	This software is a computer program whose purpose is to visualize atomic
34 	configurations in 3D.
35 
36 	This software is governed by the CeCILL  license under French law and
37 	abiding by the rules of distribution of free software.  You can  use,
38 	modify and/ or redistribute the software under the terms of the CeCILL
39 	license as circulated by CEA, CNRS and INRIA at the following URL
40 	"http://www.cecill.info".
41 
42 	The fact that you are presently reading this means that you have had
43 	knowledge of the CeCILL license and that you accept its terms. You can
44 	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
45 */
46 
47 #ifndef MAP_H
48 #define MAP_H
49 
50 #include <glib-object.h>
51 
52 #include "scalarFields.h"
53 #include "plane.h"
54 #include "surfaces.h"
55 #include <coreTools/toolShade.h>
56 #include <coreTools/toolMatrix.h>
57 
58 /**
59  * VisuMapExportFormat:
60  * @VISU_MAP_EXPORT_SVG: SVG export ;
61  * @VISU_MAP_EXPORT_PDF: PDF export.
62  *
63  * Possible export for the map, see visu_map_export().
64  *
65  * Since: 3.6
66  */
67 typedef enum
68   {
69     VISU_MAP_EXPORT_SVG,
70     VISU_MAP_EXPORT_PDF
71   } VisuMapExportFormat;
72 
73 /**
74  * VISU_TYPE_MAP:
75  *
76  * return the type of #VisuMap.
77  */
78 #define VISU_TYPE_MAP	     (visu_map_get_type ())
79 /**
80  * VISU_MAP:
81  * @obj: a #GObject to cast.
82  *
83  * Cast the given @obj into #VisuMap type.
84  */
85 #define VISU_MAP(obj)	        (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_TYPE_MAP, VisuMap))
86 /**
87  * VISU_MAP_CLASS:
88  * @klass: a #GObjectClass to cast.
89  *
90  * Cast the given @klass into #VisuMapClass.
91  */
92 #define VISU_MAP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_TYPE_MAP, VisuMapClass))
93 /**
94  * VISU_IS_MAP:
95  * @obj: a #GObject to test.
96  *
97  * Test if the given @ogj is of the type of #VisuMap object.
98  */
99 #define VISU_IS_MAP(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_TYPE_MAP))
100 /**
101  * VISU_IS_MAP_CLASS:
102  * @klass: a #GObjectClass to test.
103  *
104  * Test if the given @klass is of the type of #VisuMapClass class.
105  */
106 #define VISU_IS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, VISU_TYPE_MAP))
107 /**
108  * VISU_MAP_GET_CLASS:
109  * @obj: a #GObject to get the class of.
110  *
111  * It returns the class of the given @obj.
112  */
113 #define VISU_MAP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_TYPE_MAP, VisuMapClass))
114 
115 
116 /**
117  * VisuMapPrivate:
118  *
119  * Private data for #VisuMap objects.
120  */
121 typedef struct _VisuMapPrivate VisuMapPrivate;
122 
123 /**
124  * VisuMap:
125  *
126  * Common name to refer to a #_VisuMap.
127  */
128 typedef struct _VisuMap VisuMap;
129 struct _VisuMap
130 {
131   VisuObject parent;
132 
133   VisuMapPrivate *priv;
134 };
135 
136 typedef struct _VisuMapClass VisuMapClass;
137 struct _VisuMapClass
138 {
139   VisuObjectClass parent;
140 
141   GThreadPool *computePool;
142 };
143 
144 /**
145  * visu_map_get_type:
146  *
147  * This method returns the type of #VisuMap, use
148  * VISU_TYPE_MAP instead.
149  *
150  * Since: 3.8
151  *
152  * Returns: the type of #VisuMap.
153  */
154 GType visu_map_get_type(void);
155 
156 VisuMap* visu_map_new();
157 VisuMap* visu_map_new_fromPlane(VisuPlane *plane);
158 
159 gboolean visu_map_setPlane(VisuMap *map, VisuPlane *plane);
160 gboolean visu_map_setSurface(VisuMap *map, VisuSurface *surface);
161 gboolean visu_map_setField(VisuMap *map, VisuScalarField *field);
162 gboolean visu_map_setLevel(VisuMap *map, float glPrec, float gross, float refLength);
163 gboolean visu_map_setLines(VisuMap *map, guint nIsoLines, float minmax[2]);
164 gboolean visu_map_setScaling(VisuMap *map, ToolMatrixScalingFlag scale);
165 gboolean visu_map_setScalingRange(VisuMap *map, const float *minMax);
166 
167 void visu_map_compute_sync(VisuMap *map);
168 
169 VisuPlane* visu_map_getPlane(VisuMap *map);
170 VisuScalarField* visu_map_getField(VisuMap *map);
171 gboolean visu_map_getScaledMinMax(const VisuMap *map, float minMax[2]);
172 float* visu_map_getFieldMinMax(VisuMap *map);
173 const float* visu_map_getScalingRange(const VisuMap *map);
174 
175 float visu_map_getLegendScale();
176 float visu_map_getLegendPosition(ToolXyzDir dir);
177 
178 void visu_map_draw(VisuMap *map, float prec, ToolShade *shade, float *rgb,
179                    gboolean alpha);
180 gboolean visu_map_export(VisuMap *map, const ToolShade *shade,
181                          const float *rgb, float precision,
182                          const gchar *filename, VisuMapExportFormat format,
183                          GError **error);
184 
185 #endif
186