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 : G.TALLEC (Oct 2006) 00022 **=======================================================================*/ 00023 00024 #ifndef _SO_MATERIAL_ELEMENT 00025 #define _SO_MATERIAL_ELEMENT 00026 00041 #include <Inventor/elements/SoElement.h> 00042 #include <Inventor/elements/SoSubElement.h> 00043 #include <Inventor/elements/SoReplacedElement.h> 00044 #include <Inventor/fields/SoMFColor.h> 00045 #include <Inventor/SbBasic.h> 00046 #include <Inventor/SbColor.h> 00047 #include <SoDeprecationRules.h> 00048 00049 (9600,"The DirectViz API is no longer supported.") SoMaterialElement : public SoReplacedElement 00050 { 00051 SO_ELEMENT_HEADER(SoMaterialElement); 00052 00053 public: 00054 00055 // Set properties 00056 static void setReflective(SoState *state,SoNode *node,const SoMFColor &color); 00057 static void setReflective(SoState *state,SoNode *node,SbColor &color); 00058 static void setReceiveShadow(SoState *state,SoNode *node, SbBool value); 00059 00060 // Get properties 00061 static const SbColor &getReflective(SoState *); 00062 static SbBool getReceiveShadow(SoState *); 00063 00064 static SbBool getDefaultReceiveShadow(){ 00065 return false; 00066 } 00067 00068 static SbColor getDefaultReflective() { 00069 return SbColor(0,0,0); 00070 } 00071 00072 private: 00073 00075 virtual void init(SoState *state); 00076 00078 virtual SbBool matches(const SoElement* elt) const; 00079 00081 virtual SoElement* copyMatchInfo() const; 00082 00083 private: 00084 // Initializes the SoMaterialElement class 00085 static void initClass(); 00086 static void exitClass(); 00087 00088 private: 00089 00090 //reflective color 00091 SbColor reflectiveColor; 00092 00093 //receive shadows 00094 SbBool receiveShadow; 00095 00096 // Destructor 00097 virtual ~SoMaterialElement(); 00098 00099 private: 00100 00101 virtual void setReflectiveElt(SbColor &color); 00102 00103 virtual void setReflectiveElt(const SoMFColor &color); 00104 00105 virtual void setReceiveShadowElt(SbBool value); 00106 }; 00107 00108 #endif /* _SO_MATERIAL_ELEMENT */ 00109 00110 00111