Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoLightElement.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : R. ALBOU (Feb 1997)
22**=======================================================================*/
23
24#ifndef _SO_LIGHT_ELEMENT_
25#define _SO_LIGHT_ELEMENT_
26
27/* include files */
28#include <Inventor/SoLists.h>
29#include <Inventor/elements/SoAccumulatedElement.h>
30#include <Inventor/SbMatrix.h>
31
32#include <Inventor/STL/vector>
33
34class SoLight;
35
48SoEXTENDER_Documented class SoLightElement : public SoAccumulatedElement {
49 SO_ELEMENT_HEADER(SoLightElement) ;
50
51 public:
55 static void add(SoState *state, SoLight *light, const SbMatrix &WCToVRCMatrix) ;
56
60 virtual void push(SoState *state) ;
61
65 static const SoNodeList& getLights(SoState *state) ;
66
71 static const SbMatrix& getMatrix(SoState *state, int index) ;
72
74 virtual void pop(SoState* state, const SoElement* prevTopElement);
75
76private:
77
79 virtual void init(SoState *state);
80
81 private:
82 typedef std::vector<SoLight*> LightList;
83
84 // Initializes the SoLightElement class
85 static void initClass() ;
86 static void exitClass() ;
87
91 static void getLights(SoState *state, LightList& lightList);
92
96 void getLights( LightList& lightList ) const;
97
99 static void getMatrix(SoState *state, SoLight* light, SbMatrix& model, SbMatrix& view);
100
101 private:
105 virtual SbBool matches(const SoElement* elt) const;
106
111 virtual SoElement* copyMatchInfo() const;
112
113 // list of light nodes
114 SoNodeList m_lights ;
115
116 // List of transform matrix from world coordinates to view reference coordinates
117 std::vector<SbMatrix> m_WCToVRCMatrix;
118 int m_startIndex;
119
121 std::vector<SbMatrix> m_viewMatrix;
122
123 virtual ~SoLightElement() ;
124} ;
125/*----------------------------------------------------------------------------*/
126
127#endif // _SO_LIGHT_ELEMENT_
128
129
4x4 matrix class.
Definition SbMatrix.h:309
Abstract base class for each state element whose value may be accumulated when it is set.
Abstract base class for all state elements.
Definition SoElement.h:102
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Stores informati...
static const SoNodeList & getLights(SoState *state)
Returns the current list of light nodes from the state.
virtual void pop(SoState *state, const SoElement *prevTopElement)
Pops element.
static void add(SoState *state, SoLight *light, const SbMatrix &WCToVRCMatrix)
Add to the current light list and to the current matrix list.
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack.
static const SbMatrix & getMatrix(SoState *state, int index)
Returns the matrix transform (WC to VRC) for the light i for an SoCallbackAction.
Abstract base class for all light source nodes.
Definition SoLight.h:124
Maintains a list of pointers to nodes.
Definition SoNodeList.h:74
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87