Changeset 356

Show
Ignore:
Timestamp:
10/22/06 14:52:42 (2 years ago)
Author:
cneumann
Message:

added: SwitchRenderEnter/SwitchRenderLeave? functions for

RenderTraversalAction?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/Action/RenderTraversal/OSGRenderTraversalActionInit.cpp

    r137 r356  
    210210     
    211211    return ActionBase::Continue; 
     212} 
     213 
     214ActionBase::ResultE SwitchRenderEnter(const NodeCorePtr &pCore, 
     215                                            Action      *action) 
     216{ 
     217#ifdef OSG_DUMP_TRAVERSAL 
     218    FDEBUG_GV(("Enter Switch %p\n", &(*pCore))); 
     219#endif 
     220 
     221    Action::ResultE        returnValue = Action::Continue; 
     222    SwitchPtr              pThis       = cast_dynamic<SwitchPtr>(pCore); 
     223    RenderTraversalAction *pAction     = 
     224        dynamic_cast<RenderTraversalAction*>(action); 
     225     
     226    if((pThis->getChoice()                      >= 0                   ) && 
     227       (static_cast<UInt32>(pThis->getChoice()) <  pAction->getNNodes())    ) 
     228    { 
     229        pAction->useNodeList(); 
     230         
     231        if(pAction->isVisible(getCPtr(pAction->getNode(pThis->getChoice())))) 
     232        { 
     233            pAction->addNode(pAction->getNode(pThis->getChoice())); 
     234        } 
     235         
     236        returnValue = GroupRenderEnter(pCore, action); 
     237    } 
     238    else if(pThis->getChoice() == Switch::ALL) 
     239    { 
     240        returnValue = GroupRenderEnter(pCore, action); 
     241    } 
     242    else 
     243    { 
     244        returnValue = Action::Skip; 
     245    } 
     246     
     247    return returnValue; 
     248} 
     249 
     250Action::ResultE SwitchRenderLeave(const NodeCorePtr &pCore, 
     251                                        Action      *action) 
     252{ 
     253#ifdef OSG_DUMP_TRAVERSAL 
     254    FDEBUG_GV(("Leave Switch %p\n", &(*pCore))); 
     255#endif 
     256     
     257    return GroupRenderLeave(pCore, action); 
    212258} 
    213259 
     
    10311077#endif 
    10321078 
    1033  
     1079    RenderTraversalAction::registerEnterDefault( 
     1080        Switch::getClassType(), 
     1081        SwitchRenderEnter); 
     1082     
     1083    RenderTraversalAction::registerLeaveDefault( 
     1084        Switch::getClassType(), 
     1085        SwitchRenderLeave); 
     1086     
    10341087    RenderTraversalAction::registerEnterDefault( 
    10351088        ComponentTransform::getClassType(),