Go to the documentation of this file.00001 #ifndef OPENTISSUE_UTILITY_GK_GL_DRAW_GRID_PLANES_H
00002 #define OPENTISSUE_UTILITY_GK_GL_DRAW_GRID_PLANES_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/utility/gl/gl_util.h>
00013
00014 namespace OpenTissue
00015 {
00016
00017 namespace gl
00018 {
00019
00020 template<typename grid_type>
00021 inline void DrawGridPlanes(grid_type const & grid,unsigned int const & k)
00022 {
00023 typedef typename grid_type::math_types math_types;
00024 typedef typename math_types::real_type real_type;
00025
00026 size_t i,j;
00027
00028 real_type kmin = grid.min_coord(2);
00029
00030 real_type imin = grid.min_coord(0);
00031 real_type imax = grid.max_coord(0);
00032 real_type jmin = grid.min_coord(1);
00033 real_type jmax = grid.max_coord(1);
00034
00035 real_type ival,jval,kval;
00036
00037 kval = kmin + k*grid.dz();
00038 glBegin(GL_LINES);
00039 jval = grid.min_coord(1);
00040 for(j=0; j<grid.J(); ++j)
00041 {
00042 glVertex3f(imin,jval,kval);
00043 glVertex3f(imax,jval,kval);
00044 jval += grid.dy();
00045 }
00046 ival = grid.min_coord(0);
00047 for(i=0; i<grid.I(); ++i)
00048 {
00049 glVertex3f(ival,jmin,kval);
00050 glVertex3f(ival,jmax,kval);
00051 ival += grid.dx();
00052 }
00053 glEnd();
00054 }
00055
00056 }
00057
00058 }
00059
00060
00061 #endif