Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::RenderAction Class Reference
[Action]

RenderAction class. More...

#include <OSGRenderAction.h>

Inheritance diagram for osg::RenderAction:

osg::RenderActionBase osg::DrawActionBase osg::Action List of all members.

Public Types

typedef std::map< Material *,
DrawTreeNode * > 
MaterialMap
typedef std::pair< LightChunk *,
Matrix
LightStore
typedef std::map< Light *,
UInt32
LightsMap
typedef std::stack< Light * > LightsStack
typedef std::stack< LightEnv * > LightEnvsStack
typedef std::map< LightEnv *,
UInt32
LightEnvsMap
typedef ArgsCollector< Action * > FunctorArgs
typedef TypedFunctor2Base<
ResultE, CPtrRefCallArg<
CNodePtr >, FunctorArgs
Functor
enum  ResultE { Continue, Skip, Quit }

Public Member Functions

virtual ~RenderAction (void)
 Destructor.
virtual Action::ResultE start (void)
virtual Action::ResultE stop (ResultE res)
void push_matrix (const Matrix &matrix)
void pop_matrix (void)
const Matrixtop_matrix (void)
void dropGeometry (Geometry *pGeo)
void dropFunctor (Material::DrawFunctor &func, Material *mat)
void dropLight (Light *pLight)
void undropLight (Light *pLight)
void dropLightEnv (LightEnv *pLightEnv)
void undropLightEnv (LightEnv *pLightEnv)
void setStateSorting (bool s)
bool getStateSorting (void)
std::vector< Light * > getActiveLights (void)
UInt32 getActiveLightsMask (void)
void setSortTrans (bool bVal)
bool getSortTrans (void)
void setZWriteTrans (bool bVal)
bool getZWriteTrans (void)
void setLocalLights (bool bVal)
bool getLocalLights (void)
void setCorrectTwoSidedLighting (bool bVal)
bool getCorrectTwoSidedLighting (void)
bool isVisible (Node *node)
bool pushVisibility (void)
 enter a new level for visibility Return false if node is not visible, true
void popVisibility (void)
ViewportgetViewport (void) const
void setViewport (Viewport *viewport)
CameragetCamera (void) const
void setCamera (Camera *cam)
const MatrixgetCameraToWorld (void)
BackgroundgetBackground (void) const
void setBackground (Background *background)
WindowgetWindow (void) const
void setWindow (Window *window)
StatCollectorgetStatistics (void)
void setStatistics (StatCollector *stat)
bool getFrustumCulling (void) const
void setFrustumCulling (bool val=true)
bool getVolumeDrawing (void) const
void setVolumeDrawing (bool val=false)
bool getAutoFrustum (void) const
void setAutoFrustum (bool val=true)
const FrustumVolumegetFrustum (void) const
void setFrustum (FrustumVolume &frust)
UInt32 selectVisibles (void)
MaterialgetMaterial (void) const
NodePtr getMaterialNode (void) const
void setMaterial (Material *pMaterial, NodePtr node)
virtual Action::ResultE stop (Action::ResultE res)
void registerEnterFunction (const FieldContainerType &type, const Functor &func)
void registerLeaveFunction (const FieldContainerType &type, const Functor &func)
virtual ResultE apply (std::vector< NodePtr >::iterator begin, std::vector< NodePtr >::iterator end)
virtual ResultE apply (NodePtr node)
NodePtr getActNode (void)
UInt32 getNNodes (void) const
const NodePtr getNode (int index)
void addNode (NodePtr node)
void useNodeList (void)
void printTable (void)
UInt32 getTravMask (void) const
void setTravMask (UInt32 val)
bool operator< (const Action &other)
 assignment
bool operator== (const Action &other)
 equal
bool operator!= (const Action &other)
 unequal

Static Public Member Functions

static RenderActioncreate (void)
 create a new DrawAction by cloning the prototype
static void setPrototype (RenderAction *pPrototype)
 prototype access after setting the prototype all new DrawActions are clones of it
static RenderActiongetPrototype (void)
static void registerEnterDefault (const FieldContainerType &type, const Action::Functor &func)
 Default registration. static, so it can be called during static init.
static void registerLeaveDefault (const FieldContainerType &type, const Action::Functor &func)
static const char * getClassname (void)
static void setPrototype (Action *proto)

Static Public Attributes

static StatElemDesc< StatTimeElemstatDrawTime
static StatElemDesc< StatIntElemstatNMaterials
static StatElemDesc< StatIntElemstatNMatrices
static StatElemDesc< StatIntElemstatNGeometries
static StatElemDesc< StatIntElemstatNTransGeometries
static StatElemDesc< StatIntOnceElemstatNTextures
static StatElemDesc< StatIntOnceElemstatNTexBytes
static StatElemDesc< StatTimeElemstatTravTime
static StatElemDesc< StatIntElemstatCullTestedNodes
static StatElemDesc< StatIntElemstatCulledNodes

Protected Types

typedef RenderActionBase Inherited
typedef std::map< Int32, DrawTreeNode * > SortKeyMap

Protected Member Functions

 RenderAction (void)
 Constructor.
 RenderAction (const RenderAction &source)
 Copy-Constructor.
void operator= (const RenderAction &source)
virtual std::vector< Functor > * getDefaultEnterFunctors (void)
 assignment
virtual std::vector< Functor > * getDefaultLeaveFunctors (void)
void dump (DrawTreeNode *pRoot, UInt32 uiIndent)
virtual void draw (DrawTreeNode *pRoot)
void updateTopMatrix (void)
 Constructor Destructor.
void activateLocalLights (DrawTreeNode *pRoot)
ResultE callEnter (NodePtr node)
ResultE callLeave (NodePtr node)
ResultE recurse (NodePtr node)
ResultE callNewList (void)
void setActNode (NodePtr node)

Static Protected Member Functions

static ResultE _defaultEnterFunction (CNodePtr &node, Action *action)
static ResultE _defaultLeaveFunction (CNodePtr &node, Action *action)

Protected Attributes

DrawTreeNodeFactory_pNodeFactory
UInt32 _uiMatrixId
MatrixStore _currMatrix
Matrix _camInverse
std::vector< MatrixStore_vMatrixStack
MaterialMap _mMatMap
SortKeyMap _pMatRoots
SortKeyMap _pTransMatRoots
DrawTreeNode_pNoStateSortRoot
DrawTreeNode_pNoStateSortTransRoot
UInt32 _uiActiveMatrix
State_pActiveState
UInt32 _uiNumMaterialChanges
UInt32 _uiNumMatrixChanges
UInt32 _uiNumGeometries
UInt32 _uiNumTransGeometries
bool _bSortTrans
bool _bZWriteTrans
bool _bLocalLights
bool _bCorrectTwoSidedLighting
std::vector< LightStore_vLights
LightsMap _lightsMap
UInt64 _lightsState
UInt64 _activeLightsState
UInt32 _activeLightsCount
UInt32 _activeLightsMask
LightsStack _lightsStack
LightEnvsStack _lightEnvsStack
LightEnvsMap _lightEnvsMap
bool _stateSorting
std::vector< FrustumVolume::PlaneSet_visibilityStack
Camera_camera
Background_background
Window_window
Viewport_viewport
StatCollector_statistics
bool _ownStat
Material_pMaterial
NodePtr _pMaterialNode
bool _frustumCulling
bool _volumeDrawing
bool _autoFrustum
FrustumVolume _frustum
Matrix _mCameraToWorld
std::vector< Functor_enterFunctors
std::vector< Functor_leaveFunctors

Static Protected Attributes

static RenderAction_pPrototype = NULL
 the prototype which is copied to create new actions
static std::vector< Functor > * _vDefaultEnterFunctors = NULL
 Default functors for instantiation.
static std::vector< Functor > * _vDefaultLeaveFunctors = NULL

Static Private Attributes

static char cvsid [] = "@(#)$Id: $"

Classes

struct  MatrixStore

Detailed Description

The render action class.

Definition at line 87 of file OSGRenderAction.h.


Member Typedef Documentation

typedef std::map<Material *, DrawTreeNode * > osg::RenderAction::MaterialMap
 

Definition at line 99 of file OSGRenderAction.h.

typedef std::pair<LightChunk *, Matrix > osg::RenderAction::LightStore
 

Definition at line 100 of file OSGRenderAction.h.

typedef std::map<Light *, UInt32 > osg::RenderAction::LightsMap
 

Definition at line 101 of file OSGRenderAction.h.

typedef std::stack<Light * > osg::RenderAction::LightsStack
 

Definition at line 103 of file OSGRenderAction.h.

typedef std::stack<LightEnv * > osg::RenderAction::LightEnvsStack
 

Definition at line 104 of file OSGRenderAction.h.

typedef std::map<LightEnv *, UInt32 > osg::RenderAction::LightEnvsMap
 

Definition at line 105 of file OSGRenderAction.h.

typedef RenderActionBase osg::RenderAction::Inherited [protected]
 

Reimplemented from osg::RenderActionBase.

Definition at line 210 of file OSGRenderAction.h.

typedef std::map<Int32, DrawTreeNode *> osg::RenderAction::SortKeyMap [protected]
 

Definition at line 241 of file OSGRenderAction.h.

typedef ArgsCollector<Action *> osg::Action::FunctorArgs [inherited]
 

Definition at line 95 of file OSGAction.h.

typedef TypedFunctor2Base<ResultE, CPtrRefCallArg<CNodePtr>, FunctorArgs > osg::Action::Functor [inherited]
 

Definition at line 99 of file OSGAction.h.


Member Enumeration Documentation

enum osg::Action::ResultE [inherited]
 

Enumerator:
Continue 
Skip 
Quit 

Definition at line 87 of file OSGAction.h.

00088     {   
00089         Continue,   // continue with my children
00090         Skip,       // skip my children
00091         // really needed? Cancel, // skip my brothers, go one step up
00092         Quit        // forget it, you're done
00093     };


Constructor & Destructor Documentation

RenderAction::~RenderAction void   )  [virtual]
 

Definition at line 343 of file OSGRenderAction.cpp.

References _pNodeFactory.

00344 {
00345     delete _pNodeFactory;
00346 }

RenderAction::RenderAction void   )  [protected]
 

Definition at line 220 of file OSGRenderAction.cpp.

References osg::Action::_enterFunctors, osg::Action::_leaveFunctors, _pNodeFactory, _vDefaultEnterFunctors, and _vDefaultLeaveFunctors.

Referenced by create().

00220                                :
00221      Inherited           (),
00222     _pNodeFactory        (NULL),
00223 
00224     _uiMatrixId          (0),
00225     _currMatrix          (),
00226     _vMatrixStack        (),
00227 
00228     _mMatMap             (),
00229 
00230     _pMatRoots           (),
00231     _pTransMatRoots      (),
00232     _pNoStateSortRoot    (NULL),
00233     _pNoStateSortTransRoot(NULL),
00234 
00235     _uiActiveMatrix      (0),
00236     _pActiveState        (NULL),
00237 
00238     _uiNumMaterialChanges(0),
00239     _uiNumMatrixChanges  (0),
00240     _uiNumGeometries     (0),
00241     _uiNumTransGeometries(0),
00242 
00243     _bSortTrans              (true),
00244     _bZWriteTrans            (false),
00245     _bLocalLights            (false),
00246     _bCorrectTwoSidedLighting(false),
00247 
00248     _vLights(),
00249     _lightsMap(),
00250     _lightsState(0),
00251     _activeLightsState(0),
00252     _activeLightsCount(0),
00253     _activeLightsMask(0),
00254     
00255     _lightsStack(),
00256     _lightEnvsStack(),
00257     _lightEnvsMap(),
00258 
00259     _stateSorting(true),
00260     _visibilityStack()
00261 {
00262     if(_vDefaultEnterFunctors != NULL)
00263         _enterFunctors = *_vDefaultEnterFunctors;
00264 
00265     if(_vDefaultLeaveFunctors != NULL)
00266         _leaveFunctors = *_vDefaultLeaveFunctors;
00267 
00268     _pNodeFactory = new DrawTreeNodeFactory;
00269 }

RenderAction::RenderAction const RenderAction source  )  [protected]
 

Definition at line 275 of file OSGRenderAction.cpp.

References _pNodeFactory.

00275                                                      :
00276      Inherited           (source),
00277     _pNodeFactory        (NULL),
00278 
00279     _uiMatrixId          (source._uiMatrixId),
00280     _currMatrix          (source._currMatrix),
00281     _vMatrixStack        (source._vMatrixStack),
00282 
00283     _mMatMap             (source._mMatMap),
00284 
00285     _pMatRoots           (source._pMatRoots),
00286     _pTransMatRoots      (source._pTransMatRoots),
00287     _pNoStateSortRoot    (source._pNoStateSortRoot),
00288     _pNoStateSortTransRoot(source._pNoStateSortTransRoot),
00289 
00290     _uiActiveMatrix      (source._uiActiveMatrix),
00291     _pActiveState        (source._pActiveState),
00292 
00293     _uiNumMaterialChanges(source._uiNumMaterialChanges),
00294     _uiNumMatrixChanges  (source._uiNumMatrixChanges),
00295     _uiNumGeometries     (source._uiNumGeometries),
00296     _uiNumTransGeometries(source._uiNumTransGeometries),
00297 
00298     _bSortTrans              (source._bSortTrans),
00299     _bZWriteTrans            (source._bZWriteTrans),
00300     _bLocalLights            (source._bLocalLights),
00301     _bCorrectTwoSidedLighting(source._bCorrectTwoSidedLighting),
00302 
00303     _vLights             (source._vLights),
00304     _lightsMap           (source._lightsMap),
00305     _lightsState         (source._lightsState),
00306     _activeLightsState   (source._activeLightsState),
00307     _activeLightsCount   (source._activeLightsCount),
00308     _activeLightsMask    (source._activeLightsMask),
00309     
00310     _lightsStack         (source._lightsStack),
00311     _lightEnvsStack      (source._lightEnvsStack),
00312     _lightEnvsMap        (source._lightEnvsMap),
00313 
00314     _stateSorting        (source._stateSorting),
00315     _visibilityStack     (source._visibilityStack)
00316 {
00317     _pNodeFactory = new DrawTreeNodeFactory;
00318 }


Member Function Documentation

RenderAction * RenderAction::create void   )  [static]
 

Reimplemented from osg::Action.

Definition at line 323 of file OSGRenderAction.cpp.

References _pPrototype, and RenderAction().

Referenced by osg::SimpleSceneManager::initialize().

00324 {
00325     RenderAction *returnValue;
00326     
00327     if(_pPrototype)
00328     {
00329         returnValue = new RenderAction(*_pPrototype);
00330     }
00331     else
00332     {
00333         returnValue = new RenderAction();
00334     }
00335 
00336     return returnValue;
00337 }

void RenderAction::setPrototype RenderAction pPrototype  )  [static]
 

Definition at line 186 of file OSGRenderAction.cpp.

References _pPrototype.

00187 {
00188     _pPrototype = pPrototype;
00189 }

RenderAction * RenderAction::getPrototype void   )  [static]
 

Reimplemented from osg::Action.

Definition at line 191 of file OSGRenderAction.cpp.

References _pPrototype.

00192 {
00193     return _pPrototype;
00194 }

void RenderAction::registerEnterDefault const FieldContainerType type,
const Action::Functor func
[static]
 

Reimplemented from osg::Action.

Definition at line 141 of file OSGRenderAction.cpp.

References osg::Action::_defaultEnterFunction(), _vDefaultEnterFunctors, osg::TypeBase::getId(), and osg::osgTypedFunctionFunctor2CPtrRef().

Referenced by osg::Transform::initMethod(), osg::Switch::initMethod(), osg::Surface::initMethod(), osg::StateSortingGroup::initMethod(), osg::SpotLight::initMethod(), osg::Slices::initMethod(), osg::ProxyGroup::initMethod(), osg::PointLight::initMethod(), osg::Particles::initMethod(), osg::MaterialGroup::initMethod(), osg::LightEnv::initMethod(), osg::InverseTransform::initMethod(), osg::Group::initMethod(), osg::Geometry::initMethod(), osg::DVRVolume::initMethod(), osg::DistanceLOD::initMethod(), osg::DirectionalLight::initMethod(), osg::ComponentTransform::initMethod(), and osg::Billboard::initMethod().

00143 {
00144     if(_vDefaultEnterFunctors == NULL)
00145     {
00146         _vDefaultEnterFunctors = new std::vector<Action::Functor>;
00147     }
00148 
00149     while(type.getId() >= _vDefaultEnterFunctors->size())
00150     {
00151         _vDefaultEnterFunctors->push_back( 
00152             osgTypedFunctionFunctor2CPtrRef<
00153                 ResultE, 
00154                 CNodePtr,
00155                 Action *                   >(&Action::_defaultEnterFunction));
00156     }
00157     
00158     (*_vDefaultEnterFunctors)[type.getId()] = func;
00159 }

void RenderAction::registerLeaveDefault const FieldContainerType type,
const Action::Functor func
[static]
 

Reimplemented from osg::Action.

Definition at line 161 of file OSGRenderAction.cpp.

References osg::Action::_defaultLeaveFunction(), _vDefaultLeaveFunctors, osg::TypeBase::getId(), and osg::osgTypedFunctionFunctor2CPtrRef().

Referenced by osg::Transform::initMethod(), osg::StateSortingGroup::initMethod(), osg::SpotLight::initMethod(), osg::PointLight::initMethod(), osg::MaterialGroup::initMethod(), osg::LightEnv::initMethod(), osg::InverseTransform::initMethod(), osg::Group::initMethod(), osg::DirectionalLight::initMethod(), osg::ComponentTransform::initMethod(), and osg::Billboard::initMethod().

00163 {
00164     if(_vDefaultLeaveFunctors == NULL)
00165     {
00166         _vDefaultLeaveFunctors = new std::vector<Action::Functor>;
00167     }
00168 
00169     while(type.getId() >= _vDefaultLeaveFunctors->size())
00170     {
00171         _vDefaultLeaveFunctors->push_back( 
00172             osgTypedFunctionFunctor2CPtrRef<
00173                 ResultE, 
00174                 CNodePtr,
00175                 Action *                   >(&Action::_defaultLeaveFunction));
00176     }
00177     
00178     (*_vDefaultLeaveFunctors)[type.getId()] = func;
00179 }

Action::ResultE RenderAction::start void   )  [virtual]
 

Reimplemented from osg::DrawActionBase.

Definition at line 1344 of file OSGRenderAction.cpp.

References _activeLightsCount, _activeLightsMask, _activeLightsState, osg::DrawActionBase::_background, osg::DrawActionBase::_camera, _camInverse, _currMatrix, osg::DrawTreeNode::_iCreateCount, osg::DrawTreeNode::_iDeleteCount, _lightEnvsMap, _lightEnvsStack, _lightsMap, _lightsStack, _lightsState, _mMatMap, _pActiveState, _pMatRoots, _pNodeFactory, _pNoStateSortRoot, _pNoStateSortTransRoot, _pTransMatRoots, _stateSorting, _uiActiveMatrix, _uiMatrixId, _uiNumGeometries, _uiNumMaterialChanges, _uiNumMatrixChanges, _uiNumTransGeometries, osg::DrawActionBase::_viewport, _visibilityStack, _vLights, osg::DrawActionBase::_window, osg::Background::clear(), osg::Action::Continue, osg::RenderAction::MatrixStore::first, osg::DrawTreeNodeFactory::freeAll(), osg::Viewport::getPixelBottom(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelLeft(), osg::Viewport::getPixelRight(), osg::Viewport::getPixelTop(), osg::Viewport::getPixelWidth(), osg::DrawActionBase::getStatistics(), osg::Camera::getViewing(), glErr, osg::TransformationMatrix< ValueTypeT >::invertFrom(), osg::Viewport::isFullWindow(), osg::FrustumVolume::P_NONE, osg::StatCollector::reset(), osg::Window::resizeGL(), osg::RenderAction::MatrixStore::second, osg::TransformationMatrix< ValueTypeT >::setIdentity(), osg::Camera::setupProjection(), start, and updateTopMatrix().

01345 {
01346     glErr("RenderAction: precheck");
01347     
01348     Inherited::start();
01349 
01350     if(_window != NULL)
01351     {
01352         _window->resizeGL();
01353     }
01354 
01355     _uiMatrixId = 1;
01356 
01357     _currMatrix.first = 1;
01358     _currMatrix.second.setIdentity();
01359 
01360     _visibilityStack.clear();
01361     _visibilityStack.push_back(FrustumVolume::P_NONE);
01362     
01363     bool full = false;
01364     
01365     if(_viewport != NULL)
01366     {
01367         GLint pl  = _viewport->getPixelLeft();
01368         GLint pr  = _viewport->getPixelRight();
01369         GLint pb  = _viewport->getPixelBottom();
01370         GLint pt  = _viewport->getPixelTop();
01371         GLint pw  = pr - pl + 1;
01372         GLint ph  = pt - pb + 1;
01373         
01374         full = _viewport->isFullWindow();
01375 
01376         glViewport(pl, pb, pw, ph);
01377 
01378         if (full == false)
01379         {
01380             glScissor (pl, pb, pw, ph);
01381             glEnable(GL_SCISSOR_TEST);
01382         }
01383 
01384         if(_camera != NULL)
01385         {
01386             _camera->setupProjection(this, *_viewport);
01387 
01388             // set the viewing
01389             
01390             _camera->getViewing(_currMatrix.second, 
01391                                 _viewport->getPixelWidth (),
01392                                 _viewport->getPixelHeight());
01393 
01394             _camInverse.invertFrom(_currMatrix.second);
01395             
01396             glMatrixMode(GL_MODELVIEW);
01397         }
01398 
01399         if(_background != NULL)
01400         {
01401             _background->clear(this, _viewport);
01402         }
01403     }
01404     
01405     updateTopMatrix();
01406 
01407     _mMatMap.clear();
01408 
01409     _pNodeFactory->freeAll();
01410 
01411     /*
01412     if(_pRoot != NULL)
01413     {
01414         fprintf(stderr, "CDN %d DDN %d ODN %d ",
01415                 DrawTreeNode::_iCreateCount,
01416                 DrawTreeNode::_iDeleteCount,
01417                 DrawTreeNode::_iCreateCount - DrawTreeNode::_iDeleteCount);
01418     }
01419     */
01420 
01421     DrawTreeNode::_iCreateCount = 0;
01422     DrawTreeNode::_iDeleteCount = 0;
01423 
01424     _pMatRoots.clear();
01425     _pTransMatRoots.clear();
01426     _pNoStateSortRoot = NULL;
01427     _pNoStateSortTransRoot = NULL;
01428 
01429     _pActiveState   = NULL;
01430 
01431     _uiActiveMatrix = 0;
01432 
01433     _uiNumMaterialChanges = 0;
01434     _uiNumMatrixChanges   = 0;
01435     _uiNumGeometries      = 0;
01436     _uiNumTransGeometries = 0;
01437 
01438     getStatistics()->reset();
01439 
01440     _vLights.clear();
01441     _lightsMap.clear();
01442     _lightsState       = 0;
01443     _activeLightsState = 0;
01444     _activeLightsCount = 0;
01445     _activeLightsMask  = 0;
01446 
01447     while(!_lightsStack.empty())
01448         _lightsStack.pop();
01449     while(!_lightEnvsStack.empty())
01450         _lightEnvsStack.pop();
01451     _lightEnvsMap.clear();
01452 
01453     _stateSorting = true;
01454 
01455     if(_viewport != NULL && full == false)
01456     {
01457         glDisable(GL_SCISSOR_TEST);
01458     }
01459 
01460     return Action::Continue;
01461 }

Action::ResultE RenderAction::stop ResultE  res  )  [virtual]
 

Reimplemented from osg::Action.

Definition at line 1463 of file OSGRenderAction.cpp.

References _activeLightsCount, _activeLightsMask, _bLocalLights, _bZWriteTrans, osg::DrawActionBase::_ownStat, _pActiveState, _pMatRoots, _pNoStateSortRoot, _pNoStateSortTransRoot, _pTransMatRoots, _uiNumGeometries, _uiNumMaterialChanges, _uiNumMatrixChanges, _uiNumTransGeometries, osg::DrawActionBase::_viewport, _vLights, osg::State::deactivate(), draw(), osg::StatCollector::getElem(), osg::DrawActionBase::getStatistics(), osg::StatTimeElem::getTime(), osg::ViewportBase::setDrawTime(), statDrawTime, statNGeometries, statNMaterials, statNMatrices, statNTransGeometries, osg::DrawActionBase::stop(), and osg::StatTimeElem::stop().

01464 {
01465     getStatistics()->getElem(statDrawTime)->start();
01466     
01467     UInt32 i;
01468 
01469 //    dump(_pMatRoot, 0);
01470 //    dump(_pTransMatRoot, 0);
01471 
01472     //    _pNodeFactory->printStat();    
01473 
01474     if(!_bLocalLights)
01475     {
01476         _activeLightsMask = 0;
01477         for(i = 0; i < _vLights.size(); i++)
01478         {
01479             _activeLightsMask |= (1 << i);
01480             glLoadMatrixf(_vLights[i].second.getValues());
01481             _vLights[i].first->activate(this, i);
01482         }
01483     }
01484 
01485     if(_pNoStateSortRoot != NULL)
01486     {
01487         draw(_pNoStateSortRoot);
01488     }
01489 
01490     if(_pNoStateSortTransRoot != NULL)
01491     {
01492         draw(_pNoStateSortTransRoot);
01493     }
01494 
01495     SortKeyMap::iterator matRootsIt = _pMatRoots.begin();
01496     SortKeyMap::iterator transMatRootsIt = _pTransMatRoots.begin();
01497 
01498     while(matRootsIt != _pMatRoots.end() ||
01499           transMatRootsIt != _pTransMatRoots.end())
01500     {
01501         //printf("activeLightsState1: %d\n", _activeLightsState);
01502 
01503         if(matRootsIt != _pMatRoots.end())
01504         {
01505             //printf("_pMatRoots: sortKey %d\n", (*matRootsIt).first);
01506             draw((*matRootsIt).second->getFirstChild());
01507             ++matRootsIt;
01508         }
01509         //printf("activeLightsState2: %d\n", _activeLightsState);
01510 
01511         if(transMatRootsIt != _pTransMatRoots.end())
01512         {
01513             if(!_bZWriteTrans)
01514                 glDepthMask(false);
01515         
01516             //printf("_pTransMatRoots: sortKey %d\n", (*transMatRootsIt).first);
01517