| | 212 | } |
|---|
| | 213 | |
|---|
| | 214 | ActionBase::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 | |
|---|
| | 250 | Action::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); |
|---|