arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

GLWidgetState.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 // GLWidgetState.h
00019 
00020 #ifndef __GL_WIDGET_STATE_DOT_H
00021 #define __GL_WIDGET_STATE_DOT_H
00022 
00023 #include <widget/WidgetState.h>
00024 #include <GL/glew.h>
00025 
00026 class GLColorWState : public ColorWState {
00027 public:
00028    GLColorWState(const gutz::vec3f color = defColor,
00029                  const gutz::vec3f pickedColor = defPicked,
00030                  const gutz::vec3f second = defSecond)
00031                : ColorWState(color,pickedColor,second)
00032    {}
00033    GLColorWState(const GLColorWState &cws)
00034       :  ColorWState(cws)
00035    {}
00036    GLColorWState &operator=(const GLColorWState &cws)
00037    {
00038       ColorWState::operator =(cws);
00039    }
00040    virtual ColorWState* cloneColor() 
00041    {
00042       return new GLColorWState(*this); 
00043    }
00044 
00045 
00046 protected:
00047    /////////////////////////////////////////////////
00048    /// implements bind()
00049    virtual void bindWS()
00050    {
00051       if( _picked )
00052       {
00053          glColor4f( _pickedColor.x, _pickedColor.y, _pickedColor.z, _pickedColor.w );
00054       }
00055       else
00056       {
00057          glColor4f( _color.x, _color.y, _color.z, _color.w );
00058       }
00059    }
00060    /// implements release()
00061    virtual void releaseWS()
00062    {
00063       glColor4f(1,1,1,1);
00064    }
00065    /////////////////////////////////////////////////
00066 };
00067 
00068 
00069 #endif
00070 
00071 

Send questions, comments, and bug reports to:
jmk