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 : R. ALBOU (Feb 1997) 00022 **=======================================================================*/ 00023 00024 #ifndef _SO_LIGHT_ELEMENT_ 00025 #define _SO_LIGHT_ELEMENT_ 00026 00027 /* include files */ 00028 #include <Inventor/SoLists.h> 00029 #include <Inventor/elements/SoAccumulatedElement.h> 00030 #include <Inventor/SbMatrix.h> 00031 00032 #include <Inventor/STL/vector> 00033 00034 class SoLight; 00035 00048 SoEXTENDER_Documented class SoLightElement : public SoAccumulatedElement { 00049 SO_ELEMENT_HEADER(SoLightElement) ; 00050 00051 public: 00055 static void add(SoState *state, SoLight *light, const SbMatrix &WCToVRCMatrix) ; 00056 00060 virtual void push(SoState *state) ; 00061 00065 static const SoNodeList& getLights(SoState *state) ; 00066 00071 static const SbMatrix& getMatrix(SoState *state, int index) ; 00072 00073 private: 00074 00076 virtual void init(SoState *state); 00077 00078 private: 00079 typedef std::vector<SoLight*> LightList; 00080 00081 // Initializes the SoLightElement class 00082 static void initClass() ; 00083 static void exitClass() ; 00084 00088 static void getLights(SoState *state, LightList& lightList); 00089 00093 void getLights( LightList& lightList ) const; 00094 00096 static void getMatrix(SoState *state, SoLight* light, SbMatrix& model, SbMatrix& view); 00097 00098 private: 00102 virtual SbBool matches(const SoElement* elt) const; 00103 00108 virtual SoElement* copyMatchInfo() const; 00109 00110 // list of light nodes 00111 SoNodeList m_lights ; 00112 00113 // List of transform matrix from world coordinates to view reference coordinates 00114 std::vector<SbMatrix> m_WCToVRCMatrix; 00115 int m_startIndex; 00116 00118 std::vector<SbMatrix> m_viewMatrix; 00119 00120 virtual ~SoLightElement() ; 00121 } ; 00122 /*----------------------------------------------------------------------------*/ 00123 00124 #endif // _SO_LIGHT_ELEMENT_ 00125 00126 00127