1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 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 \*---------------------------------------------------------------------------*/
39 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
46 #include "OSGConfig.h"
48 #include "OSGDynamicStateGenerator.h"
49 #include "OSGDynamicStateGeneratorStageData.h"
50 #include "OSGRenderAction.h"
54 // Documentation for this class is emitted in the
55 // OSGDynamicStateGeneratorBase.cpp file.
56 // To modify it, please change the .fcd file (OSGDynamicStateGenerator.fcd) and
57 // regenerate the base file.
59 /***************************************************************************\
61 \***************************************************************************/
63 /***************************************************************************\
65 \***************************************************************************/
67 void DynamicStateGenerator::initMethod(InitPhase ePhase
)
69 Inherited::initMethod(ePhase
);
71 if(ePhase
== TypeObject::SystemPost
)
77 /***************************************************************************\
79 \***************************************************************************/
81 /*-------------------------------------------------------------------------*\
83 \*-------------------------------------------------------------------------*/
85 /*----------------------- constructors & destructors ----------------------*/
87 DynamicStateGenerator::DynamicStateGenerator(void) :
92 DynamicStateGenerator::DynamicStateGenerator(
93 const DynamicStateGenerator
&source
) :
98 DynamicStateGenerator::~DynamicStateGenerator(void)
102 /*----------------------------- class specific ----------------------------*/
104 void DynamicStateGenerator::changed(ConstFieldMaskArg whichField
,
108 Inherited::changed(whichField
, origin
, details
);
111 void DynamicStateGenerator::dump( UInt32
,
112 const BitVector
) const
114 SLOG
<< "Dump DynamicStateGenerator NI" << std::endl
;
117 Action::ResultE
DynamicStateGenerator::renderEnter(Action
*action
)
119 RenderAction
*pAction
=
120 dynamic_cast<RenderAction
*>(action
);
122 // pop the state and make sure we have the last word.
123 Action::ResultE returnValue
= Inherited::renderEnter(action
);
127 DynamicStateGeneratorStageData
*pData
=
128 pAction
->getData
<DynamicStateGeneratorStageData
*>(_iDataSlotId
);
132 MFUnrecStateChunkPtr::const_iterator chIt
= pData
->beginChunks();
133 MFUnrecStateChunkPtr::const_iterator chEnd
= pData
->endChunks ();
139 pAction
->addOverride(uiSlot
, *chIt
);
150 Action::ResultE
DynamicStateGenerator::renderLeave(Action
*action
)
152 return Inherited::renderLeave(action
);