Top | ![]() |
![]() |
![]() |
![]() |
struct | VisuSurface |
struct | VisuSurfaceClass |
#define | VISU_ERROR_ISOSURFACES |
#define | VISU_SURFACE_PROPERTY_POTENTIAL |
struct | VisuSurfaceIterPoly |
Originally written by Luc Billard for his Visualize program. This module allows loading of .surf files to draw scalar fields on top of the current display scene. .surf files are text files which specs are the following :
1st line is arbitrary
2nd line must contain 3 real (float) values: dxx dyx dyy
3rd line must contain 3 real (float) values: dzx dzy dzz
4th line must contain 3 positive integers which represents respectively the number of surfaces, the total number of polys, and the total number of points
Then, for each of these surfaces :
next line must contain the name of the surface : it is a string which should match the pattern surface_*
next line must contain 2 positive integer values: the number of polys (num_polys) and the number of points (num_points) used by the surface
each of the following num_polys lines must match the pattern [n i_1 i_2 i_3 ... i_n] where n is the number of vertices in the poly (n >= 3) and [i_1 i_2 i_3 ... i_n] are the numbering of these vertices (vertices numbered from 1 to num_points)
each of the following num_points lines must contain 6 real values for the successive (1 to num_points) points : [x y z nx ny nz], where x y z are the coordinates of the point and nx ny nz are the coordinates of the unit normal at the point
It is the responsibility of the user to guarantee that dxx, dyx, dyy, dzx, dzy, dzz match the one currently loaded in V_Sim's current context. Though if you use panelSurfaces you can ask to resize the surfaces so that they fit in the current loaded box.
GQuark
visu_surface_getErrorQuark (void
);
Internal routine for error handling.
VisuSurface * visu_surface_new (const gchar *label
,const GArray *points
,const GArray *polys
);
Create a new VisuSurface object as defined by points
and polys
.
VisuSurface * visu_surface_new_fromDefinition (const gchar *label
,const VisuSurfaceDefinition *definition
);
Same as visu_surface_new()
, mainly for language bindings.
Since: 3.8
gboolean visu_surface_loadFile (const char *file
,GList **surf
,GError **error
);
This loads a surface file and set default material properties for it. See surf file specifications.
VisuSurfaceResource *
visu_surface_getResource (VisuSurface *surf
);
This returns the resource of the surf
.
Since: 3.7
gboolean visu_surface_setResource (VisuSurface *surf
,VisuSurfaceResource *res
);
This method is used to change the resource of a surface.
gboolean visu_surface_setMask (VisuSurface *surface
,VisuPlaneSet *mask
);
Use mask
to hide portion of surface
(when maskable, depending on
their resources). Set mask
to NULL
to remove the mask.
Since: 3.8
void visu_surface_iter_poly_new (VisuSurface *surf
,VisuSurfaceIterPoly *iter
);
Setup a new iter
to iterate on drawn polygons of surf
.
Since: 3.8
void
visu_surface_iter_poly_next (VisuSurfaceIterPoly *iter
);
Iterate to the next drawn polygon.
Since: 3.8
gboolean visu_surface_iter_poly_getZ (const VisuSurfaceIterPoly *iter
,double *z
,const float mat[16]
);
Retrieve the z
value in the viewport basis of the drawn polygon
defined by iter
. If the polygon is not drawn, z
is not computed.
Return: TRUE if polygon defined by iter
is drawn and z is computed
iter |
a VisuSurfaceIterPoly structure. |
|
z |
a location to store double. |
[out] |
mat |
a transformation matrix to go into viewport basis. |
Since: 3.8
void visu_surface_iter_poly_getVertices (const VisuSurfaceIterPoly *iter
,GArray *vertices
);
Retrieve the position and normal of the point refered by iter
.
iter |
a VisuSurfaceIterPoly structure. |
|
vertices |
an array to store the vertex coordinates and normals. |
[element-type VisuSurfacePoint] |
Since: 3.8
float * visu_surface_getPropertyFloat (VisuSurface *surf
,const gchar *name
);
Some properties can be associated to the surfaces stored in surf
.
This method is used to retrieve floating point values properties.
float * visu_surface_addPropertyFloat (VisuSurface *surf
,const gchar *name
);
Some properties can be associated to the surfaces stored in surf
.
This method is add a new property.
gboolean visu_surface_getPropertyValueFloat (VisuSurface *surf
,const gchar *name
,float *value
);
This method retrieves a float value stored as a property called name
for
the surface defined by its number idSurf
.
surf |
a VisuSurface object ; |
|
name |
the name of the property to get the value from ; |
|
value |
a location to store the value. |
void
visu_surface_checkConsistency (VisuSurface *surf
);
Check if all arrays in the structures are consistent (without overflow).
#define VISU_ERROR_ISOSURFACES visu_surface_getErrorQuark()
Internal function for error handling.
#define VISU_SURFACE_PROPERTY_POTENTIAL "potential_values"
Flag used in an ASCII surf file to give informations on the value the surface is built from.
struct VisuSurfaceIterPoly { VisuSurface *surf; gboolean valid; guint i; /* Private */ VisuSurfacePoints *points; };
Structures used to iterate on polygons of surf
.
VisuSurface * |
the parent VisuSurface. |
|
gboolean |
a flag TRUE, as long as the iterator is valid. |
|
guint |
the index of the current polygon. |
|
VisuSurfacePoints * |
the storage for polygons. |
Since: 3.8
“masked”
signalvoid user_function (VisuSurface *surf, gpointer user_data)
Gets emitted when a surface is shown or hidden by a plane.
surf |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks
Since: 3.7