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-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00069 #ifndef _SO_GRADIENT_BACKGROUND_H_ 00070 #define _SO_GRADIENT_BACKGROUND_H_ 00071 00072 #include <Inventor/fields/SoSFColor.h> 00073 #include <Inventor/fields/SoSFBool.h> 00074 00075 #include <Inventor/nodes/SoBackground.h> 00076 00077 class SoGradientBackground : public SoBackground { 00078 00079 SO_NODE_HEADER(SoGradientBackground); 00080 00081 public: 00082 // Fields: 00083 // 00089 SoSFColor color0; 00095 SoSFColor color1; 00099 SoSFBool swapColors; 00100 00104 SoGradientBackground(); 00105 00106 private: 00107 // Initializes this class for use in scene graphs. This 00108 // should be called after database initialization and before 00109 // any instance of this node is constructed. 00110 static void initClass(); 00111 static void exitClass(); 00112 00113 private: 00114 // Implement render action 00115 // We will inherit all other action methods from SoNode. 00116 // We don't need a doAction because this node has no effect 00117 // on traversal state (or at least it shouldn't :-). 00118 virtual void GLRender(SoGLRenderAction *action); 00119 00120 private: 00121 // Destructor. Protected to keep people from trying to delete 00122 // nodes, rather than using the reference count mechanism. 00123 virtual ~SoGradientBackground(); 00124 00125 // Interpolate between two colors 00126 const SbColor interpColor( float t, SbColor &c0, SbColor &c1 ) const; 00127 00128 private: 00129 }; 00130 00131 #endif //SoGradientBackground 00132 00133