Files Classes Functions Hierarchy
#include <pointgrid3Ddraw.h>
Public Member Functions | |
| pointgrid3Ddraw (pointgrid3D const &pg_) | |
| Construct with point turned on. | |
| ~pointgrid3Ddraw () | |
| Cleanup. | |
| void | update () |
| Update the graphics by writing to the graphics container. | |
Public Attributes | |
| pointgrid3D const & | pg |
| The object being drawn. | |
| gobjQuadric * | quadric |
| The sphere at the points. | |
| bool | displaypoints |
| Turn the points on. | |
| bool | displayedges |
| Display the grid lines. | |
Call update() before drawing.
Some basic functionality such as displaying the points, displaying the edges. Simple set the boolean values to true.
Definition at line 17 of file pointgrid3Ddraw.h.
| pointgrid3Ddraw::pointgrid3Ddraw | ( | pointgrid3D const & | pg_ | ) |
Construct with point turned on.
Definition at line 4 of file pointgrid3Ddraw.cpp.
References displayedges, displaypoints, gobjQuadric::loops, quadric, gobjQuadric::radius, gobjQuadric::slices, and update().
00005 : gobjContainer(true), pg(_pg) 00006 { 00007 displaypoints=true; 00008 00009 quadric = new gobjQuadric(); 00010 quadric->radius = 0.02; 00011 quadric->slices=20; 00012 quadric->loops=6; 00013 00014 displayedges=true; 00015 00016 update(); 00017 }
| pointgrid3Ddraw::~pointgrid3Ddraw | ( | ) |
Cleanup.
Definition at line 19 of file pointgrid3Ddraw.cpp.
References quadric.
00020 { 00021 delete quadric; 00022 }
| void pointgrid3Ddraw::update | ( | ) |
Update the graphics by writing to the graphics container.
Definition at line 24 of file pointgrid3Ddraw.cpp.
References displayedges, displaypoints, pointgrid3D::M, pointgrid3D::N, gobjContainer::nuke(), pg, pointgrid3D::pij(), pointgrid3D::pt, gobjContainer::push(), quadric, and r.
Referenced by pointgrid3Ddraw(), meshpatchtest::test02(), and meshpatchtest::test04().
00025 { 00026 nuke(); 00027 00028 push( new gobjglPushAttrib(GL_LIGHTING) ); 00029 push( new gobjglPushAttrib(GL_CURRENT_BIT) ); 00030 00031 if (displaypoints==true) 00032 { 00033 push(new gobjglEnable(GL_LIGHTING) ); 00034 00035 push( new gobjglColor3ub(0,255,0) ); 00036 uintc sz = pg.M*pg.N; 00037 for (uint i=0; i<sz; ++i) 00038 push( new gobjMySphereDraw(pg.pt[i],quadric) ); 00039 } 00040 00041 if (displayedges==true) 00042 { 00043 push(new gobjglDisable(GL_LIGHTING) ); 00044 00045 push( new gobjglColor3ub(255,0,0) ); 00046 00047 uintc M = pg.M; 00048 uintc N = pg.N; 00049 uint r,k; 00050 push( new gobjglBegin(GL_LINE) ); 00051 00052 for (r=0; r<M; ++r) 00053 { 00054 for (k=1; k<N; ++k) 00055 { 00056 // Draw line pij(k-1,i) to pij(k,i) 00057 push( new gobjglVertex3f(pg.pij(k-1,r )) ); 00058 push( new gobjglVertex3f(pg.pij(k,r )) ); 00059 } 00060 } 00061 00062 for (k=0; k<N; ++k) 00063 { 00064 for (r=1; r<M; ++r) 00065 { 00066 push( new gobjglVertex3f(pg.pij(k,r-1 )) ); 00067 push( new gobjglVertex3f(pg.pij(k,r )) ); 00068 } 00069 } 00070 00071 push( new gobjglEnd() ); 00072 00073 push( new gobjglPopAttrib() ); 00074 push( new gobjglPopAttrib() ); 00075 } 00076 }
Display the grid lines.
Definition at line 31 of file pointgrid3Ddraw.h.
Referenced by pointgrid3Ddraw(), and update().
Turn the points on.
Definition at line 28 of file pointgrid3Ddraw.h.
Referenced by pointgrid3Ddraw(), and update().
| pointgrid3D const& pointgrid3Ddraw::pg |
The sphere at the points.
Definition at line 25 of file pointgrid3Ddraw.h.
Referenced by pointgrid3Ddraw(), update(), and ~pointgrid3Ddraw().
1.5.8