fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Groups / Base / OSGLightEnv.cpp
blob302bb87585901eec8606854b68ae210a026b9bdb
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #include <cstdlib>
40 #include <cstdio>
42 #include "OSGConfig.h"
44 #include "OSGGL.h"
46 #ifdef OSG_OLD_RENDER_ACTION
47 #include "OSGRenderAction.h"
48 #endif
50 #include "OSGLightEnv.h"
52 OSG_USING_NAMESPACE
54 // Documentation for this class is emited in the
55 // OSGLightEnvBase.cpp file.
56 // To modify it, please change the .fcd file (OSGLightEnv.fcd) and
57 // regenerate the base file.
59 /*-------------------------------------------------------------------------*/
60 /* Sync */
62 void LightEnv::changed(ConstFieldMaskArg whichField,
63 UInt32 origin,
64 BitVector details)
66 Inherited::changed(whichField, origin, details);
70 /*-------------------------------------------------------------------------*/
71 /* Dump */
73 void LightEnv::dump( UInt32 uiIndent,
74 const BitVector bvFlags) const
76 Inherited::dump(uiIndent, bvFlags);
79 /*-------------------------------------------------------------------------*/
80 /* Constructors */
82 LightEnv::LightEnv(void) :
83 Inherited()
87 LightEnv::LightEnv(const LightEnv &source) :
88 Inherited(source)
92 /*-------------------------------------------------------------------------*/
93 /* Destructor */
95 LightEnv::~LightEnv(void)
100 /*-------------------------------------------------------------------------*/
101 /* Init */
103 //! initialize the static features of the class, e.g. action callbacks
105 void LightEnv::initMethod(InitPhase ePhase)
107 Inherited::initMethod(ePhase);
109 if(ePhase == TypeObject::SystemPost)
111 #ifdef OSG_OLD_RENDER_ACTION
112 RenderAction::registerEnterDefault(
113 getClassType(),
114 reinterpret_cast<Action::Callback>(&LightEnv::renderEnter));
116 RenderAction::registerLeaveDefault(
117 getClassType(),
118 reinterpret_cast<Action::Callback>(&LightEnv::renderLeave));
119 #endif
124 #ifdef OSG_OLD_RENDER_ACTION
125 Action::ResultE LightEnv::renderEnter(Action *action)
127 RenderAction *pAction = dynamic_cast<RenderAction *>(action);
129 pAction->dropLightEnv(this);
131 return Action::Continue;
134 Action::ResultE LightEnv::renderLeave(Action *action)
136 RenderAction *pAction = dynamic_cast<RenderAction *>(action);
138 pAction->undropLightEnv(this);
140 return Action::Continue;
142 #endif