Up: gltools - an OpenGL based on-line graphics toolbox
Next: gleps - Encapsulated Postscript Dump
Prev: glrnd - Rendering Volume Management


Subsections


glmesh - Function Drawing on Simplex Meshes

Author:Jürgen Fuhrmann
Revision: 2.19
Date: 2000/10/18 16:43:32


glmesh contains rendering routines for triangular and tetrahedreal meshes based on callback functions invoking loops over simplices of a mesh in a data structure given by the user. No extra data structure has to be generated. Sure, this causes performance drawbacks, but instead the user gains great flexibility in using this interface on his/her data strucutures.

glmesh manages plane sections and level sets for 3D tetrahedral meshes.

The basic principle is a double callback mechanism - a loop callback function gets user data and a simplex callback function as parameter which has to be fed with number, node numbers and coordinates of a simplex.

Imported packages

#ifndef GLMESH_H
#define GLMESH_H

#include "glrnd.h"

Data Types

glMeshStruct

 
typedef struct glMeshStruct *glMesh;

This structure contains all necessary mesh data and is hidden from the user.

subsection:Constructors and Destructors

glmSimplexCallback

 
typedef void (*glmSimplexCallback)
(
glMesh m,
int number_of_this_simplex,
int material_of_this_simplex,
double *function_defined_on_this_this_simplex,
int *index_in_funtion_on_this_simplex,
double **coordinates_of_the_nodes
);

glmLoopCallback

 
typedef void (*glmLoopCallback)
(
glMesh m,
void *user_data,
glmSimplexCallback call_this_on_every_simplex
);

glmCreate

 
glMesh glmCreate(
int number_of_mesh_nodes,
int number_of_mesh_simplices,
int space_dimension,
void *user_data,
glmLoopCallback loop_over_all_simplices
);

Generate an instance of glMesh. This is cheap.

glmDestroy

 
void glmDestroy(
glMesh m
);

Destroy an instance of glMesh.

Setting Data

glmSetFunction

 
void glmSetFunction(
glMesh m,
double *f,
double min,
double max
);

Set piecewise linear function to plot, its minimum and its maximum. If $\mbox{\tt min}\gt\mbox{\tt max}$, they are automatically calculated.

double *glmGetNodeFunc(glMesh m);

void *glmGetUserData(glMesh m);

glmSetFunction

 
void glmSetCellFlux(glMesh m, double *values, double min, double max);

Set piecewise constant flux to plot

glmSetVoffset

 
void glmSetVoffset(
glMesh m,
int voffset
);

Set vector offset (0 or 1)

glmColorCallback

 
typedef float* (*glmColorCallback)
(
glMesh m,
double fval,
float *rgb
);

glmSetColorCallback

 
void glmSetColorCallback(
glMesh m,
glmColorCallback col
);

Set color calculation function. glmRBColor is the default value.

glmMaterialColorCallback

 
typedef float* (*glmMaterialColorCallback)
(
glMesh m,
int imat,
float *rgb
);

glmSetMaterialColorCallback

 
void glmSetMaterialColorCallback(
glMesh m,
glmMaterialColorCallback col
);

Set material color calculation function. glmDefaultMaterialColor is the default value.

glmDrawInfo

 
void glmDrawInfo(glRenderer rnd, glMesh m);

Info call back for mesh data.

Invocation

glmDraw

 
void glmDraw(
glRenderer rnd,
glMesh m
);

The glmesh draw routines are invoked using glmDraw as a callback for glRender.

#endif

Up: gltools - an OpenGL based on-line graphics toolbox
Next: gleps - Encapsulated Postscript Dump
Prev: glrnd - Rendering Volume Management


© pdelib team 5/21/2001. This page has been generated using the LaTeX typesetting system and latex2html.