1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
42 #include "OSGConfig.h"
46 #ifdef OSG_OLD_RENDER_ACTION
47 #include "OSGRenderAction.h"
50 #include "OSGLightEnv.h"
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 /*-------------------------------------------------------------------------*/
62 void LightEnv::changed(ConstFieldMaskArg whichField
,
66 Inherited::changed(whichField
, origin
, details
);
70 /*-------------------------------------------------------------------------*/
73 void LightEnv::dump( UInt32 uiIndent
,
74 const BitVector bvFlags
) const
76 Inherited::dump(uiIndent
, bvFlags
);
79 /*-------------------------------------------------------------------------*/
82 LightEnv::LightEnv(void) :
87 LightEnv::LightEnv(const LightEnv
&source
) :
92 /*-------------------------------------------------------------------------*/
95 LightEnv::~LightEnv(void)
100 /*-------------------------------------------------------------------------*/
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(
114 reinterpret_cast<Action::Callback
>(&LightEnv::renderEnter
));
116 RenderAction::registerLeaveDefault(
118 reinterpret_cast<Action::Callback
>(&LightEnv::renderLeave
));
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
;