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 : Alain Dumesny (MMM yyyy) 00022 **=======================================================================*/ 00023 00024 #ifndef _SO_QT_COLOR_PATCH_ 00025 #define _SO_QT_COLOR_PATCH_ 00026 00027 #include <Inventor/Qt/OivQtCompat.h> 00028 #include <Inventor/Qt/SoQtGLWidget.h> 00029 #include <Inventor/SbColor.h> 00030 00031 00033 // 00034 // Class: SoQtColorPatch 00035 // 00036 // This class simply draws a 3D looking patch of color. 00037 // 00039 00040 { 00041 00042 Q_OBJECT 00043 00044 public: 00045 00046 SoQtColorPatch(QWidget *parent = NULL, 00047 const char *name = NULL, 00048 SbBool buildInsideParent = TRUE); 00049 00050 ~SoQtColorPatch(); 00051 00052 // 00053 // set/get routines to specify the patch top color 00054 // 00055 void setColor(const SbColor &rgb); 00056 const SbColor & getColor() { return color; } 00057 00058 private: 00059 00060 // This constructor takes a boolean whether to build the widget now. 00061 // Subclasses can pass FALSE, then call SoQtSlider::buildWidget() 00062 // when they are ready for it to be built. 00063 SoEXTENDER 00064 SoQtColorPatch( 00065 QWidget *parent, 00066 const char *name, 00067 SbBool buildInsideParent, 00068 SbBool buildNow); 00069 00070 private: 00071 00072 // redefine to do ColorPatch specific things 00073 virtual void redraw(); 00074 virtual void sizeChanged(const SbVec2s &newSize); 00075 00076 // local variables 00077 SbColor color; 00078 00079 // this is called by both constructors 00080 void constructorCommon(SbBool buildNow); 00081 }; 00082 00083 #endif // _SO_QT_COLOR_PATCH_ 00084 00085 00086