Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

MyColorPatch.h

00001 /*
00002  *
00003  *  Copyright (C) 2000 Silicon Graphics, Inc.  All Rights Reserved. 
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  Further, this software is distributed without any warranty that it is
00016  *  free of the rightful claim of any third person regarding infringement
00017  *  or the like.  Any license provided herein, whether implied or
00018  *  otherwise, applies only to this software file.  Patent licenses, if
00019  *  any, provided herein do not apply to combinations of this program with
00020  *  other software, or any other product whatsoever.
00021  * 
00022  *  You should have received a copy of the GNU Lesser General Public
00023  *  License along with this library; if not, write to the Free Software
00024  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  *  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
00027  *  Mountain View, CA  94043, or:
00028  * 
00029  *  http://www.sgi.com 
00030  * 
00031  *  For further information regarding this notice, see: 
00032  * 
00033  *  http://oss.sgi.com/projects/GenInfo/NoticeExplan/
00034  *
00035  */
00036 
00037 //  -*- C++ -*-
00038 
00039 /*
00040  * Copyright (C) 1990,91   Silicon Graphics, Inc.
00041  *
00042  _______________________________________________________________________
00043  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
00044  |
00045  |   $Revision: 1.1 $
00046  |
00047  |   Description:
00048  |      This file contains the class description for the MyColorPatch.
00049  |
00050  |   Author(s)  : Alain Dumesny
00051  |
00052  ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
00053  _______________________________________________________________________
00054  */
00055 
00056 #ifndef  _SO_XT_COLOR_PATCH_
00057 #define  _SO_XT_COLOR_PATCH_
00058 
00059 #include <Inventor/Xt/SoXtGLWidget.h>
00060 #include <Inventor/SbColor.h>
00061 
00062 
00064 //
00065 //  Class: MyColorPatch
00066 //
00067 //      This class simply draws a 3D looking patch of color.
00068 //
00070 
00071 // C-api: prefix=SoXtColPatch
00072 class MyColorPatch : public SoXtGLWidget {
00073 
00074   public:
00075     
00076     MyColorPatch(
00077         Widget parent = NULL,
00078         const char *name = NULL, 
00079         SbBool buildInsideParent = TRUE);
00080     ~MyColorPatch();
00081     
00082     //
00083     // set/get routines to specify the patch top color
00084     //
00085     // C-api: name=setCol
00086     void                setColor(const SbColor &rgb);
00087     // C-api: name=getCol
00088     const SbColor &     getColor()      { return color; }
00089   
00090   protected:
00091 
00092     // This constructor takes a boolean whether to build the widget now.
00093     // Subclasses can pass FALSE, then call SoXtSlider::buildWidget()
00094     // when they are ready for it to be built.
00095     SoEXTENDER
00096     MyColorPatch(
00097         Widget parent,
00098         const char *name, 
00099         SbBool buildInsideParent, 
00100         SbBool buildNow);
00101     
00102   private:
00103     
00104     // redefine to do ColorPatch specific things
00105     virtual void    redraw();
00106     virtual void    sizeChanged(const SbVec2s &newSize);
00107     
00108     // local variables
00109     SbColor     color;
00110 
00111     // this is called by both constructors
00112     void constructorCommon(SbBool buildNow);
00113 };
00114 
00115 
00116 #endif  // _SO_XT_COLOR_PATCH_

Generated on Fri Oct 26 23:38:08 2001 for bicobj-intersection by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001