Files Classes Functions Hierarchy
#include <d3tessdraw.h>
Public Member Functions | |
| writemulticolorobj (d3tess const &tess_) | |
| void | draw () |
| Draw the object. | |
Definition at line 190 of file d3tessdraw.h.
| writemulticolorobj::writemulticolorobj | ( | d3tess const & | tess_ | ) | [inline] |
| void writemulticolorobj::draw | ( | ) | [virtual] |
Draw the object.
Implements gobj.
Definition at line 614 of file d3tessdraw.cpp.
References gobj::global, simplexD2linked::isnull(), simplexD2linked::pi, d3tess::pt, gobjContainer::push(), r, d3tess::vi, point3< T >::x, and point3< T >::y.
00615 { 00616 gobjContainer & x = * gobjContainer::global; 00617 00618 x.push( new gobjglPushAttrib(GL_CURRENT_BIT) ); 00619 x.push( new gobjglPushAttrib(GL_LIGHTING_BIT) ); 00620 00621 x.push( new gobjglDisable(GL_LIGHTING) ); 00622 00623 x.push( new gobjglBegin(GL_TRIANGLES) ); 00624 00625 float const blendratio = 0.5; 00626 00627 random11<double> r; 00628 00629 vector< pt3 > const & pt(tess.pt); 00630 vector<simplexD2linked> const & vi(tess.vi); 00631 00632 uintc imax = tess.vi.size(); 00633 for (uint i=1; i<imax; ++i) 00634 { 00635 simplexD2linked const & t(vi[i]); 00636 00637 if (t.isnull()) 00638 continue; 00639 00640 x.push( new gobjglColor4f(r(),r(),r(),blendratio) ); 00641 00642 pt3c & P0(pt[t.pi[0]]); 00643 pt3c & P1(pt[t.pi[1]]); 00644 pt3c & P2(pt[t.pi[2]]); 00645 00646 x.push( new gobjglVertex2f(P0.x,P0.y) ); 00647 x.push( new gobjglVertex2f(P1.x,P1.y) ); 00648 x.push( new gobjglVertex2f(P2.x,P2.y) ); 00649 00650 } 00651 00652 x.push( new gobjglEnd() ); 00653 00654 x.push( new gobjglPopAttrib() ); 00655 x.push( new gobjglPopAttrib() ); 00656 }
1.5.8