Files Classes Functions Hierarchy
#include <pointgrid3Dbilineardraw.h>
Public Member Functions | |
| pointgrid3Dbilineardraw (pointgrid3D const &pg_) | |
| Construct with point turned on. | |
| point3< double > const & | operator() (uintc r, uintc k) const |
| Patch pointer. | |
| void | update () |
| Update the graphics by writing to the graphics container. | |
Public Attributes | |
| uint | row |
| The current row position. | |
| uint | col |
| The current column position. | |
| pointgrid3D const & | pg |
| The object being drawn. | |
| gobjQuadric | quadric |
| The sphere at the points. | |
| bool | pointsdisplay |
| Turn the points on. | |
| uint | pointsperpatch |
| The number of points drawn to represent a surface. | |
| meshpatch | mp |
| bi-linear mesh patch. | |
This is to visualize the patches.
Definition at line 18 of file pointgrid3Dbilineardraw.h.
| pointgrid3Dbilineardraw::pointgrid3Dbilineardraw | ( | pointgrid3D const & | pg_ | ) |
Construct with point turned on.
Definition at line 6 of file pointgrid3Dbilineardraw.cpp.
00009 : row(0), col(0), pg(pg_), mp(1,1) 00010 { 00011 pointsdisplay=true; 00012 pointsperpatch=2000; 00013 00014 quadric.radius = 0.02; 00015 quadric.slices=20; 00016 quadric.loops=6; 00017 00018 }
Patch pointer.
By setting row and col this returns the corner points of that patch.
Definition at line 47 of file pointgrid3Dbilineardraw.h.
References col, pointgrid3D::M, pointgrid3D::N, pg, pointgrid3D::pt, and row.
00048 { 00049 assert( r<=1); 00050 assert( k<=1); 00051 00052 assert(row<pg.M); 00053 assert(col<pg.N); 00054 00055 uint index = row + col*pg.N; 00056 index += k; 00057 index += r*pg.N; 00058 00059 return pg.pt[index]; 00060 }
| void pointgrid3Dbilineardraw::update | ( | ) |
Update the graphics by writing to the graphics container.
Definition at line 21 of file pointgrid3Dbilineardraw.cpp.
References col, meshpatch::eval(), pointgrid3D::M, mp, pointgrid3D::N, gobjContainer::nuke(), pg, pointsperpatch, gobjContainer::push(), r, and row.
Referenced by meshpatchtest::test02().
00022 { 00023 nuke(); 00024 00025 push( new gobjglPushAttrib(GL_LIGHTING) ); 00026 push( new gobjglPushAttrib(GL_CURRENT_BIT) ); 00027 00028 push(new gobjglDisable(GL_LIGHTING) ); 00029 00030 //push( new gobjglColor3ub(255,165,0) ); 00031 00032 random11<double> r; 00033 00034 point3<double> p; 00035 00036 push( new gobjglBegin(GL_POINTS) ); 00037 00038 row=0; 00039 col=0; 00040 for (uint k=0; k+1<pg.N; ++k) 00041 { 00042 for (uint i=0; i+1<pg.M; ++i) 00043 { 00044 //cout << SHOW(row) << " " << SHOW(col) << endl; 00045 00046 push( new gobjglColor3ub(rand()%256,rand()%165,rand()%256) ); 00047 00048 for (uint a=0; a<pointsperpatch; ++a) 00049 { 00050 mp.eval(p,r(),r(),*this); 00051 push( new gobjglVertex3f(p) ); 00052 } 00053 ++col; 00054 } 00055 ++row; 00056 col=0; 00057 } 00058 00059 /* 00060 for (uint i=0; i<pointsperpatch; ++i) 00061 { 00062 mp.eval(p,r(),r(),*this); 00063 push( new gobjglVertex3f(p) ); 00064 } 00065 00066 ++col; 00067 00068 for (uint i=0; i<pointsperpatch; ++i) 00069 { 00070 mp.eval(p,r(),r(),*this); 00071 push( new gobjglVertex3f(p) ); 00072 } 00073 */ 00074 00075 00076 00077 push( new gobjglEnd() ); 00078 00079 push( new gobjglPopAttrib() ); 00080 push( new gobjglPopAttrib() ); 00081 }
The current column position.
Definition at line 25 of file pointgrid3Dbilineardraw.h.
Referenced by operator()(), and update().
bi-linear mesh patch.
Definition at line 40 of file pointgrid3Dbilineardraw.h.
Referenced by update().
The object being drawn.
Definition at line 28 of file pointgrid3Dbilineardraw.h.
Referenced by operator()(), and update().
The number of points drawn to represent a surface.
Definition at line 37 of file pointgrid3Dbilineardraw.h.
Referenced by update().
The current row position.
Definition at line 23 of file pointgrid3Dbilineardraw.h.
Referenced by operator()(), and update().
1.5.8