00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00017 *** MERIGNAC, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_XT_COLOR_PATCH_ 00026 #define _SO_XT_COLOR_PATCH_ 00027 00028 #include <Inventor/Xt/SoXtGLWidget.h> 00029 #include <Inventor/SbColor.h> 00030 00031 00033 // 00034 // Class: SoXtColorPatch 00035 // 00036 // This class simply draws a 3D looking patch of color. 00037 // 00039 00040 { 00041 00042 public: 00043 00044 SoXtColorPatch( 00045 SoWidget parent = NULL, 00046 const char *name = NULL, 00047 SbBool buildInsideParent = TRUE); 00048 ~SoXtColorPatch(); 00049 00050 // 00051 // set/get routines to specify the patch top color 00052 // 00053 void setColor(const SbColor &rgb); 00054 const SbColor & getColor() { return color; } 00055 00056 private: 00057 00058 // This constructor takes a boolean whether to build the widget now. 00059 // Subclasses can pass FALSE, then call SoXtSlider::buildWidget() 00060 // when they are ready for it to be built. 00061 SoEXTENDER 00062 SoXtColorPatch( 00063 SoWidget parent, 00064 const char *name, 00065 SbBool buildInsideParent, 00066 SbBool buildNow); 00067 00068 private: 00069 00070 // redefine to do ColorPatch specific things 00071 virtual void redraw(); 00072 virtual void sizeChanged(const SbVec2s &newSize); 00073 00074 // local variables 00075 SbColor color; 00076 00077 // this is called by both constructors 00078 void constructorCommon(SbBool buildNow); 00079 }; 00080 00081 00082 #endif // _SO_XT_COLOR_PATCH_ 00083 00084 00085