H2Lib  3.0
Functions
visualize

This module contains functions to visualize bounding boxes of a given cluster, directional cluster, block, directional block further functions to visualize a given two or three dimensional triangulation or a surface triangulation with freeglut. As well as functions to visualize and animate a computed solution of the Helmholtz equation. On top of this, every window content can be saved as an image ppm or with the additional library libpng as png. More...

Functions

void visualize_dblock_bbox (pcdblock b, pclustergeometry grc, pclustergeometry gcc, bool c, int argc, char **argv)
 Function for visualize one or more level of a dblock object. More...
 
void visualize_block_bbox (pcblock b, pclustergeometry grc, pclustergeometry gcc, bool c, int argc, char **argv)
 Function for visualize one or more level of a block object. More...
 
void visualize_dblock_certain_bbox (pcdblock b, pclustergeometry grc, pclustergeometry gcc, int argc, char **argv)
 Function for visualize a certain leaf of a dblock object. More...
 
void visualize_block_certain_bbox (pcblock b, pclustergeometry grc, pclustergeometry gcc, int argc, char **argv)
 Function for visualize a certain leaf of a block object. More...
 
void visualize_block_level_certain_bbox (pcblock b, pclustergeometry grc, pclustergeometry gcc, uint l1, uint l2, int argc, char **argv)
 Function for visualize a certain leaf block of a block, only leaf blocks, whose level are between l1 and l2, are selectible. More...
 
void visualize_dblock_level_certain_bbox (pcdblock b, pclustergeometry grc, pclustergeometry gcc, uint l1, uint l2, int argc, char **argv)
 Function for visualize a certain leaf block of a dblock, only leaf blocks, whose level are between l1 and l2, are selectible. More...
 
void visualize_dcluster_bbox (pcdcluster t, pclustergeometry gt, bool c, int argc, char **argv)
 Function for visualize dcluster objects. More...
 
void visualize_cluster_bbox (pccluster t, pclustergeometry gt, bool c, int argc, char **argv)
 Function for visualize cluster objects. More...
 
void visualize_tri2d (pctri2d tri, int argc, char **argv)
 Function for visualize a complete two dimensional triangulation tri2d. More...
 
void visualize_certain_triangle (pctri2d tri, int argc, char **argv)
 Function for visualize a certain triangle chosen out of the complete triangulation tri2d. More...
 
void visualize_tet3d (pctet3d tet, int argc, char **argv)
 Function for visualize a complete three dimensional triangulation tet3d. More...
 
void visualize_certain_tetrahedra (pctet3d tet, int argc, char **argv)
 Function for visualize a certain tetrahedron chosen out of the complete triangulation tet3d. More...
 
void visualize_surface3d (pcsurface3d gr, int argc, char **argv)
 Function for visualize a complete surface triangulation surface3d. More...
 
void visualize_certain_surface_triangle (pcsurface3d gr, int argc, char **argv)
 Function for visualize a certain triangle chosen out of the complete surface triangulation surface3d. More...
 
void visualize_boundaryvalue_surface_triangle (pcsurface3d sur, pcavector val, int argc, char **argv)
 Function for visualize a boundary values for a surface3d object. More...
 
void visualize_helmholtz_solution_surface (pcsurface3d sur, int argc, char **argv)
 Function for visualize one or more solutions of the helmholtz equation for a surface3d object. More...
 
void animate_helmholtz_solution (pcsurface3d sur, int argc, char **argv)
 Animates solutions of the helmholtz equation in time for a surface3d object. More...
 

Detailed Description

This module contains functions to visualize bounding boxes of a given cluster, directional cluster, block, directional block further functions to visualize a given two or three dimensional triangulation or a surface triangulation with freeglut. As well as functions to visualize and animate a computed solution of the Helmholtz equation. On top of this, every window content can be saved as an image ppm or with the additional library libpng as png.

Function Documentation

void animate_helmholtz_solution ( pcsurface3d  sur,
int  argc,
char **  argv 
)

Animates solutions of the helmholtz equation in time for a surface3d object.

This function will display two windows. One visualize a xy-plane with the solution $ v(x) $ of the Helmholtz equation (switching between real, imaginary and absolute values or fade in the surface is possible ). A time depending solution $ u(x,t) $ of the wave equation is computed with a separation approach $ u(x,t) = v(x) w(t) $ and the function in time is given by

\[ w(t) := exp(-i \omega t) \quad \text{with } \omega = \frac{2.0*\pi}{\text{frame rate}}, \]

where the frame rate is a visualization depending fixed value. The solution has to be computed on a xy-plane produced by a two dimensional grid and a constant $z $ value! During the visualization the shown solution could be changed, if more than one file was given. The second window includes a color legend.

Attention
The files with the solution have to be given in a special format and the points in the right order. The First line has to have 3 values, namely:

\[ \#\: points\: in\: x\: direction (unsigned\: int) \quad \#\: points\: in\: y\: direction (unsigned\: int) \quad z\: coordinate\: of\: the\: plane\: (double) \]

All of the other lines have to be of the form:

\[ \begin{matrix} x_{1} & y_{1} & \Re{v((x_{1},y_{1},z)^{T})} & \Im{v((x_{1},y_{1},z)^{T})} & |v((x_{1},y_{1},z)^{T}) | \\ x_{1} & y_{2} & \Re{v((x_{1},y_{2},z)^{T})} & \Im{v((x_{1},y_{2},z)^{T})} & |v((x_{1},y_{2},z)^{T}) | \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ x_{2} & y_{1} & \Re{v((x_{2},y_{1},z)^{T})} & \Im{v((x_{2},y_{1},z)^{T})} & |v((x_{2},y_{1},z)^{T}) |\\ \vdots & \vdots & \vdots & \vdots & \vdots\\ \end{matrix} ,\]

where $v((x_{i}, y_{j}, z)^{T})$ is the value of the solution in $(x_{i},y_{j}, z)^{T}$. There should be no empty lines and in the end $x\cdot y$ points to visualize.
Parameters
surCorresponding surface3d object.
argcNumber of arguments given by the main function.
argvArgument content, in this case files with solution values.
void visualize_block_bbox ( pcblock  b,
pclustergeometry  grc,
pclustergeometry  gcc,
bool  c,
int  argc,
char **  argv 
)

Function for visualize one or more level of a block object.

This function will display three windows. One for selecting a block level, the others will show associated column and row clusters.

Parameters
bThe block cluster tree object to visualize.
grcClustergeometry from directional row cluster. Needed if points should be drawn too. If not, grc should be NULL.
gccClustergeometry from directional column cluster. Needed if points should be drawn too. If not, gcc should be NULL.
cBool for coloring. If c is true, different colors for every level of the given block cluster tree will be used.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_block_certain_bbox ( pcblock  b,
pclustergeometry  grc,
pclustergeometry  gcc,
int  argc,
char **  argv 
)

Function for visualize a certain leaf of a block object.

This function will display two windows. One for selecting a certain block out of all leaf blocks. The associated two clusters will be displayed in the second window.

Parameters
bThe block cluster tree object to visualize.
grcClustergeometry from directional row cluster. Needed if points should be drawn too. If not, grc should be NULL.
gccClustergeometry from directional column cluster. Needed if points should be drawn too. If not, gcc should be NULL.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_block_level_certain_bbox ( pcblock  b,
pclustergeometry  grc,
pclustergeometry  gcc,
uint  l1,
uint  l2,
int  argc,
char **  argv 
)

Function for visualize a certain leaf block of a block, only leaf blocks, whose level are between l1 and l2, are selectible.

This function will display two windows. One for selecting a certain block out of all leaf blocks, whose level are between l1 and l2. The associated two clusters will be displayed in the second window.

Parameters
bThe block cluster tree object to visualize.
grcClustergeometry from directional row cluster. Needed if points should be drawn too. If not, grc should be NULL.
gccClustergeometry from directional column cluster. Needed if points should be drawn too. If not, gcc should be NULL.
l1Uint with the block level to start drawing.
l2Uint with the block level to stop drawing.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_boundaryvalue_surface_triangle ( pcsurface3d  sur,
pcavector  val,
int  argc,
char **  argv 
)

Function for visualize a boundary values for a surface3d object.

This function will display two windows. One shows the surface grid with the boundary values by using a color gradient. The other one includes a color legend.

Attention
The dimension of the vector including boundary values has to match with the number of triangles, edges or vertices of the surface3d object.
Parameters
surThe surface3d object that should be visualized.
valavector object including boundary values.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_certain_surface_triangle ( pcsurface3d  gr,
int  argc,
char **  argv 
)

Function for visualize a certain triangle chosen out of the complete surface triangulation surface3d.

This function will display two windows. One shows a table for all triangles also including their coordinates. The other one marks the choosen triangle.

Remarks
This functions is made for small triangulations with not more than about one hundred triangles, otherwise the table could be confusing.
Parameters
grThe surface3d object that should be visualized.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_certain_tetrahedra ( pctet3d  tet,
int  argc,
char **  argv 
)

Function for visualize a certain tetrahedron chosen out of the complete triangulation tet3d.

This function will display two windows. One shows a table for all tetrahedron also including their coordinates. The other one marks the choosen tetrahedron.

Remarks
This functions is made for small triangulations with not more than about one hundret tetrahedron, otherwise the table could be confusing.
Parameters
tetThe three dimensional triangulation tet3d that should be visualized.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_certain_triangle ( pctri2d  tri,
int  argc,
char **  argv 
)

Function for visualize a certain triangle chosen out of the complete triangulation tri2d.

This function will display two windows. One shows a table for all triangles also including their coordinates. The other one marks the choosen triangle.

Remarks
This functions is made for small triangulations with not more than about one hundret triangles, otherwise the table could be confusing.
Parameters
triThe two dimensional triangulation tri2d that should be visualized.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_cluster_bbox ( pccluster  t,
pclustergeometry  gt,
bool  c,
int  argc,
char **  argv 
)

Function for visualize cluster objects.

This function will display two windows. One for selecting a cluster level and the other one to display all clusters corresponding to the choosen level.

Parameters
tThe cluster tree object to visualize.
gtClustergeometry from the cluster. Needed if points should be drawn, else gt == NULL.
cBool for color gradient. If c is true, different colors for every level of the given cluster tree will be used.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_dblock_bbox ( pcdblock  b,
pclustergeometry  grc,
pclustergeometry  gcc,
bool  c,
int  argc,
char **  argv 
)

Function for visualize one or more level of a dblock object.

This function will display three windows. One for selecting a block level, the others will show associated column and row clusters.

Parameters
bThe directional block cluster tree object to visualize.
grcClustergeometry from directional row cluster. Needed if points should be drawn too. If not, grc should be NULL.
gccClustergeometry from directional column cluster. Needed if points should be drawn too. If not, gcc should be NULL.
cBool for color gradient. If c is true, different colors for every level of the given directional block cluster tree will be used.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_dblock_certain_bbox ( pcdblock  b,
pclustergeometry  grc,
pclustergeometry  gcc,
int  argc,
char **  argv 
)

Function for visualize a certain leaf of a dblock object.

This function will display two windows. One for selecting a certain block out of all directional leaf blocks. The associated two directional clusters will be displayed in the second window.

Parameters
bThe directional block cluster tree object to visualize.
grcClustergeometry from directional row cluster. Needed if points should be drawn too. If not, grc should be NULL.
gccClustergeometry from directional column cluster. Needed if points should be drawn too. If not, gcc should be NULL.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_dblock_level_certain_bbox ( pcdblock  b,
pclustergeometry  grc,
pclustergeometry  gcc,
uint  l1,
uint  l2,
int  argc,
char **  argv 
)

Function for visualize a certain leaf block of a dblock, only leaf blocks, whose level are between l1 and l2, are selectible.

This function will display two windows. One for selecting a certain block out of all directional leaf blocks, whose level are between l1 and l2. The associated two directional clusters will be displayed in the second window.

Parameters
bThe directional block cluster tree object to visualize.
grcClustergeometry from directional row cluster. Needed if points should be drawn too. If not, grc should be NULL.
gccClustergeometry from directional column cluster. Needed if points should be drawn too. If not, gcc should be NULL.
l1Uint with the directional block level to start drawing.
l2Uint with the directional block level to stop drawing.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_dcluster_bbox ( pcdcluster  t,
pclustergeometry  gt,
bool  c,
int  argc,
char **  argv 
)

Function for visualize dcluster objects.

This function will display two windows. One for selecting a cluster level and the other one to display all clusters corresponding to the choosen level.

Parameters
tThe directional cluster tree object to visualize.
gtClustergeometry from the directional cluster. Needed if points should be drawn, else gt == NULL.
cBool for color gradient. If c is true, different colors for every level of the given directional cluster tree will be used.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_helmholtz_solution_surface ( pcsurface3d  sur,
int  argc,
char **  argv 
)

Function for visualize one or more solutions of the helmholtz equation for a surface3d object.

This function will display two windows. One shows the surface and a plane with values of a given solution $ v $. The solution has to be computed on a plane produced by a two dimensional grid and a constant $z $ value! During the visualization the shown solution could be changed, if more than one file was given. The second window includes a color legend.

Attention
The files with the solution has to be given in a special format and the points in the right order. The First line has to have 3 values, namely:

\[ \#\: points\: in\: x\: direction (unsigned\: int) \quad \#\: points\: in\: y\: direction (unsigned\: int) \quad z\: coordinate\: of\: the\: plane\: (double) \]

All of the other lines have to be of the form:

\[ \begin{matrix} x_{1} & y_{1} & \Re{v((x_{1},y_{1},z)^{T})} & \Im{v((x_{1},y_{1},z)^{T})} & |v((x_{1},y_{1},z)^{T}) | \\ x_{1} & y_{2} & \Re{v((x_{1},y_{2},z)^{T})} & \Im{v((x_{1},y_{2},z)^{T})} & |v((x_{1},y_{2},z)^{T}) | \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ x_{2} & y_{1} & \Re{v((x_{2},y_{1},z)^{T})} & \Im{v((x_{2},y_{1},z)^{T})} & |v((x_{2},y_{1},z)^{T}) |\\ \vdots & \vdots & \vdots & \vdots & \vdots\\ \end{matrix} \]

where $v((x_{i}, y_{j}, z)^{T})$ is the value of the solution in $(x_{i},y_{j}, z)^{T}$. There should be no empty lines and in the end $x\cdot y$ three-dimensional points to visualize.
Parameters
surThe surface3d object that should be visualized.
argcNumber of arguments given by the main function.
argvArgument content, in this case files called additionally.
void visualize_surface3d ( pcsurface3d  gr,
int  argc,
char **  argv 
)

Function for visualize a complete surface triangulation surface3d.

Parameters
grThe surface3d that should be visualized.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_tet3d ( pctet3d  tet,
int  argc,
char **  argv 
)

Function for visualize a complete three dimensional triangulation tet3d.

Parameters
tetThe three dimensional triangulation tet3d that should be visualized.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.
void visualize_tri2d ( pctri2d  tri,
int  argc,
char **  argv 
)

Function for visualize a complete two dimensional triangulation tri2d.

Parameters
triThe two dimensional triangulation tri2d that should be visualized.
argcNumber of arguments given by the main function.
argvArguments content, also given by the main function.