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

GLSurfaceWidget.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     9-15-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 // GLSurfaceWidget.h
00019 
00020 #ifndef __GL_SURFACE_WIDGET_DOT_H
00021 #define __GL_SURFACE_WIDGET_DOT_H
00022 
00023 #include <widget/SurfaceWidget.h>
00024 #include "GLItems.h"
00025 
00026 class GLSurfaceWidget : public SurfaceWidget {
00027 public:
00028    GLSurfaceWidget(WidgetItem *parent, float border = 0, bool drawBorder = false,
00029                    bool visible = true)
00030      : SurfaceWidget(parent,border,drawBorder), _visible(visible)
00031    {}
00032    GLSurfaceWidget(const GLSurfaceWidget &gsw)
00033       : SurfaceWidget(gsw), _visible(gsw._visible)
00034    {}
00035    GLSurfaceWidget &operator=(const GLSurfaceWidget &gsw)
00036    {
00037       SurfaceWidget::operator =(gsw);
00038       _visible = gsw._visible;
00039       return *this;
00040    }
00041 
00042    virtual ~GLSurfaceWidget() {}
00043 
00044    /// override from SurfaceWidget
00045    virtual SurfaceWidget *cloneSurface() const
00046    {
00047       return new GLSurfaceWidget(*this);
00048    }
00049 
00050    /// override from WidgetItem
00051    virtual void drawDef(const gutz::RenderEvent &r)
00052    {
00053       if(!_visible && !r.picking()) return;
00054       drawQuad();
00055    }
00056 
00057    /// override this to customize
00058    virtual void drawQuad();
00059 
00060    ///@name set/get Visible
00061    ///@{
00062    bool         isVisible() const           { return _visible; }
00063    virtual void setVisible(bool yes = true) { _visible = yes; }
00064    ///@}
00065 
00066 protected:
00067    GLUItem  _gluitem;
00068    bool _visible;
00069 
00070 };
00071 
00072 
00073 
00074 #endif
00075 
00076 

Send questions, comments, and bug reports to:
jmk