surfaces_points

surfaces_points — Define a structure to store a set of triangles defining a surface.

Functions

Types and Values

Description

This structure is used to store and draw polyedges as a set of XYZ points and a set of link to them.

Functions

visu_surface_point_new ()

void
visu_surface_point_new (VisuSurfacePoint *pt,
                        const double at[3],
                        const double normal[3]);

Initialise pt with at and normal .

Parameters

pt

a location to a VisuSurfacePoint structure.

[out caller-allocates]

at

coordinates.

[array fixed-size=3]

normal

normal.

[array fixed-size=3]

Since: 3.8


visu_surface_points_init ()

void
visu_surface_points_init (VisuSurfacePoints *points,
                          int bufferSize);

Initialise a VisuSurfacePoints structure. It must be done before any use.

Parameters

points

a pointer on a set of points (not initialised) ;

 

bufferSize

the number of additional data to coordinates and normals.

 

visu_surface_points_addPoly ()

void
visu_surface_points_addPoly (VisuSurfacePoints *points,
                             const GArray *vertices,
                             const GArray *polys);

Add a new surface in points with the given definition of vertices and polys .

Parameters

points

a VisuSurfacePoints object.

 

vertices

a set of VisuSurfacePoint.

[element-type VisuSurfacePoint]

polys

a set of VisuSurfacePoly.

[element-type VisuSurfacePoly]

Since: 3.8


visu_surface_points_free ()

void
visu_surface_points_free (VisuSurfacePoints *points);

Free all allocated arrays of the given set of points. The point structure itself is not freed.

Parameters

points

a set of points.

 

visu_surface_points_remove ()

void
visu_surface_points_remove (VisuSurfacePoints *points,
                            guint pos);

Remove the points belonging to surface number pos .

Parameters

points

a set of points ;

 

pos

an integer between 0 and points->nsurf.

 

visu_surface_points_translate ()

void
visu_surface_points_translate (VisuSurfacePoints *points,
                               float xyz[3]);

In devel...

Parameters

points

a set of points.

 

xyz

a given translation in cartesian coordinates.

 

visu_surface_points_transform ()

void
visu_surface_points_transform (VisuSurfacePoints *points,
                               float trans[3][3]);

Apply trans matrix to all vertices coordinates stored by points .

Parameters

points

a set of points.

 

trans

a matrix.

 

Since: 3.7


visu_surface_points_hide ()

gboolean
visu_surface_points_hide (VisuSurfacePoints *points,
                          const VisuSurfaceResource *resource,
                          VisuSurfacePoints *edges,
                          const VisuPlaneSet *planes);

Apply the masking properties of planes on points , creating additional vertices and polygons to smooth the edges of the cut surface in edges .

Parameters

points

a VisuSurfacePoints object.

 

resource

a VisuSurfaceResource object.

 

edges

a VisuSurfacePoints location.

[out caller-allocates]

planes

a VisuPlaneSet object.

 

Returns

TRUE if some polygons of points have changed visibility.

Since: 3.8


visu_surface_points_check ()

void
visu_surface_points_check (VisuSurfacePoints *points);

A debug routines to check that all pointers and size are relevant. It should not be used outside a debug area because it can be slow.

Parameters

points

a set of points.

 

Types and Values

VISU_SURFACE_POINTS_OFFSET_NORMAL

#define VISU_SURFACE_POINTS_OFFSET_NORMAL 3

The offset to read the normal values in poly_points.


VISU_SURFACE_POINTS_OFFSET_TRANSLATION

#define VISU_SURFACE_POINTS_OFFSET_TRANSLATION 6

The offset to read the translation values in poly_points.


VISU_SURFACE_POINTS_OFFSET_USER

#define VISU_SURFACE_POINTS_OFFSET_USER 9

The offset to read the user values in poly_points.


struct VisuSurfacePoints

struct VisuSurfacePoints {
  /* Number of different surfaces. */
  guint nsurf;
  /* This is the size of additional data on each points in addition to
     (x,y,z) coordinates, normal and translation. Then poly_points is
     allocated to (num_points * (9 + bufferSize)). */
  guint bufferSize;

  /* Number of polygons */
  guint num_polys, num_points;

  /* Number of polygons per surface. */
  guint *num_polys_surf;

  /* Give the number of the surface when the number of the
     polygon is given. */
  int *poly_surf_index;

  /* Return the number of vertices when the id of
     the polygon is given. */
  guint *poly_num_vertices;

  /* Return the id in poly_points_data of the vertice j of polygon i. */
  guint **poly_vertices;

  /* Vectors giving points and normal of the vertice i. */
  float **poly_points_data;
};

This structure stores geometric description of surfaces. Several surfaces are stored in a single structure for improved performances.

Members

guint nsurf;

number of surfaces encoded in this structure ;

 

guint bufferSize;

number of stored float in addition to coordinates and normals ;

 

guint num_polys;

number of polygoins stored in this structure ;

 

guint num_points;

number of vertices stored in this structure ;

 

guint *num_polys_surf;

number of visible polygons stored in this structure per surface ;

 

int *poly_surf_index;

gives the id of the surface for each polygon, this value ranges from - nsurf to + nsurf. abs(id - 1) gives the index of the surface the polygon is attached to. If values are negative, then the polygon is currently not used ;

 

guint *poly_num_vertices;

gives the number of vertices used by each polygons ;

 

guint **poly_vertices;

returns the id j of the vertices of polygon i ;

 

float **poly_points_data;

vectors giving additional data of vertex i.

 

struct VisuSurfacePoint

struct VisuSurfacePoint {
  double at[3];
  double normal[3];
};

Structure used to access a point coordinates and normal in a VisuSurface.

Members

double at[3];

coordinates of the point.

 

double normal[3];

normal vector at the point.

 

Since: 3.8


VISU_SURFACE_POINTS_MAX_VERTICES

#define VISU_SURFACE_POINTS_MAX_VERTICES 10

Size used in VisuSurfacePoly structure.

Since: 3.8


struct VisuSurfacePoly

struct VisuSurfacePoly {
  guint nvertices;
  guint indices[VISU_SURFACE_POINTS_MAX_VERTICES];
};

Structure used to access a polygon definition in a VisuSurface.

Members

guint nvertices;

number of vrtice for this polygon.

 

guint indices[VISU_SURFACE_POINTS_MAX_VERTICES];

point indices for the various vertices.

 

Since: 3.8