OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LightSource.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSG_LIGHTSOURCE
15 #define OSG_LIGHTSOURCE 1
16 
17 #include <osg/NodeVisitor>
18 #include <osg/Light>
19 #include <osg/Group>
20 
21 namespace osg {
22 
25 {
26  public:
27 
28  LightSource();
29 
32  const CopyOp& copyop=CopyOp::SHALLOW_COPY):
33  Group(ls,copyop),
34  _value(ls._value),
35  _light(dynamic_cast<osg::Light*>(copyop(ls._light.get()))),
36  _referenceFrame(ls._referenceFrame) {}
37 
39 
41  {
43  ABSOLUTE_RF
44  };
45 
57  void setReferenceFrame(ReferenceFrame rf);
58 
59  ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
60 
62  void setLight(Light* light);
63 
65  inline Light* getLight() { return _light.get(); }
66 
68  inline const Light* getLight() const { return _light.get(); }
69 
71  void setStateSetModes(StateSet&,StateAttribute::GLModeValue) const;
72 
74  void setLocalStateSetModes(StateAttribute::GLModeValue value = StateAttribute::ON);
75 
77  virtual void setThreadSafeRefUnref(bool threadSafe);
78 
79  virtual BoundingSphere computeBound() const;
80 
81  protected:
82 
83  virtual ~LightSource();
84 
87 
89 };
90 
91 }
92 
93 #endif
#define OSG_EXPORT
Definition: Export.h:43
ReferenceFrame getReferenceFrame() const
Definition: LightSource.h:59
ref_ptr< Light > _light
Definition: LightSource.h:86
#define META_Node(library, name)
Definition: Node.h:59
ReferenceFrame _referenceFrame
Definition: LightSource.h:88
unsigned int GLModeValue
LightSource(const LightSource &ls, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition: LightSource.h:31
Definition: AlphaFunc.h:19
Light * getLight()
Definition: LightSource.h:65
StateAttribute::GLModeValue _value
Definition: LightSource.h:85
const Light * getLight() const
Definition: LightSource.h:68