Files Classes Functions Hierarchy
#include <buttonpanel01.h>
Public Member Functions | |
| buttonpanel01 (zprmouse *zm_) | |
| Constructor. | |
| void | draw () |
| Draw buttons. | |
| void | update () |
| Calc posw and radiusworld. | |
Public Attributes | |
| double | centerdelta |
| radius in ratio space on x-axis. | |
| point2< double > | pos [4] |
| Position in terms of ratio. | |
| point3< double > | posw [4] |
| Position in world coordinates. | |
| point3< uint > | color [4] |
| Color corresponds with position. | |
| double | radiussphere |
| Radius in terms of ratio. | |
| double | radiusworld |
| Radius in world coordinates. | |
| zprmouse * | zm |
| Conversion programs. | |
Definition at line 11 of file buttonpanel01.h.
| buttonpanel01::buttonpanel01 | ( | zprmouse * | zm_ | ) |
Constructor.
Definition at line 3 of file buttonpanel01.cpp.
References centerdelta, color, pos, radiussphere, point2< T >::x, and point2< T >::y.
00004 : zm(zm_) 00005 { 00006 radiussphere=0.025; 00007 centerdelta=0.03; 00008 00009 point2<double> center = point2<double>(0.9,0.2); 00010 00011 for (uint i=0; i<4; ++i) 00012 pos[i]=center; 00013 pos[0].y += centerdelta; 00014 pos[1].x += centerdelta; 00015 pos[2].y -= centerdelta; 00016 pos[3].x -= centerdelta; 00017 00018 for (uint i=0; i<4; ++i) 00019 color[i] = point3<uint>(239,151,255); 00020 }
| void buttonpanel01::draw | ( | ) | [virtual] |
Draw buttons.
Implements gobj.
Definition at line 42 of file buttonpanel01.cpp.
References color, posw, radiusworld, and update().
00043 { 00044 update(); 00045 00046 glPushAttrib(GL_CURRENT_BIT); 00047 00048 for (uint i=0; i<4; ++i) 00049 { 00050 glColor3ui(color[i].x,color[i].y,color[i].z); 00051 00052 glPushMatrix(); 00053 glTranslated(posw[i].x,posw[i].y,posw[i].z); 00054 glutSolidSphere(radiusworld,35,35); 00055 glPopMatrix(); 00056 } 00057 00058 glPopAttrib(); 00059 }
| void buttonpanel01::update | ( | ) |
Calc posw and radiusworld.
Definition at line 22 of file buttonpanel01.cpp.
References centerdelta, point3< T >::dot(), pos, posw, radiussphere, radiusworld, zprmouse::world(), point3< T >::z, and zm.
Referenced by draw().
00023 { 00024 assert(zm); 00025 if (zm==0) 00026 return; 00027 00028 for (uint i=0; i<4; ++i) 00029 { 00030 posw[i] = zm->world(pos[i]); 00031 posw[i].z += -1.0; 00032 // posw[i].z -= zm->zz.zFar; 00033 // posw[i].z *= 0.5; 00034 cout << "posw[" << i << "]=" << posw[i] << endl; 00035 } 00036 00037 point3<double> diff = posw[0] - posw[2]; 00038 double radius2 = diff.dot(); 00039 radiusworld = sqrt(radius2) * radiussphere * 0.5 / centerdelta; 00040 }
| double buttonpanel01::centerdelta |
radius in ratio space on x-axis.
Definition at line 16 of file buttonpanel01.h.
Referenced by buttonpanel01(), and update().
Color corresponds with position.
Definition at line 25 of file buttonpanel01.h.
Referenced by buttonpanel01(), and draw().
| point2<double> buttonpanel01::pos[4] |
Position in terms of ratio.
Definition at line 19 of file buttonpanel01.h.
Referenced by buttonpanel01(), and update().
| point3<double> buttonpanel01::posw[4] |
| double buttonpanel01::radiussphere |
Radius in terms of ratio.
Definition at line 28 of file buttonpanel01.h.
Referenced by buttonpanel01(), and update().
| double buttonpanel01::radiusworld |
1.5.8