proj home

Files   Classes   Functions   Hierarchy  

buttonpanel01 Class Reference

Display a panel of 4 buttons. More...

#include <buttonpanel01.h>

Inheritance diagram for buttonpanel01:
Collaboration diagram for buttonpanel01:

List of all members.

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< uintcolor [4]
 Color corresponds with position.
double radiussphere
 Radius in terms of ratio.
double radiusworld
 Radius in world coordinates.
zprmousezm
 Conversion programs.


Detailed Description

Display a panel of 4 buttons.

Definition at line 11 of file buttonpanel01.h.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


Member Data Documentation

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().

Position in terms of ratio.

Definition at line 19 of file buttonpanel01.h.

Referenced by buttonpanel01(), and update().

Position in world coordinates.

Definition at line 22 of file buttonpanel01.h.

Referenced by draw(), and update().

Radius in terms of ratio.

Definition at line 28 of file buttonpanel01.h.

Referenced by buttonpanel01(), and update().

Radius in world coordinates.

Definition at line 31 of file buttonpanel01.h.

Referenced by draw(), and update().

Conversion programs.

Definition at line 37 of file buttonpanel01.h.

Referenced by update().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:51 2011 for Chelton Evans Source by  doxygen 1.5.8