当前位置: 首页>>代码示例>>C++>>正文


C++ RenderAction类代码示例

本文整理汇总了C++中RenderAction的典型用法代码示例。如果您正苦于以下问题:C++ RenderAction类的具体用法?C++ RenderAction怎么用?C++ RenderAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RenderAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: renderEnter

Action::ResultE ChunkOverrideGroup::renderEnter(Action *action)
{
    RenderAction *pAction = dynamic_cast<RenderAction *>(action);

    if(pAction != NULL)
    {
        pAction->pushState();

        ChunkBlock *pBlock = this->finalize(pAction->getRenderProperties());

        if(pBlock == NULL)
            return Inherited::renderEnter(action);

        MFUnrecStateChunkPtr::const_iterator chIt   = pBlock->beginChunks();
        MFUnrecStateChunkPtr::const_iterator chEnd  = pBlock->endChunks  ();
        UInt32                               uiSlot = 0;

        while(chIt != chEnd)
        {
            if(*chIt != NULL && (*chIt)->getIgnore() == false)
                pAction->addOverride(uiSlot, *chIt);
            
            ++uiSlot;
            ++chIt;
        }
    }

    return Inherited::renderEnter(action);
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:29,代码来源:OSGChunkOverrideGroup.cpp

示例2: renderLeave

ActionBase::ResultE MaterialChunkOverrideGroup::renderLeave(Action *action)
{
    RenderAction *pAction   = dynamic_cast<RenderAction *>(action);
    Material     *pMaterial = this->getMaterial();

    if(pAction != NULL && pMaterial != NULL)
    {
        pMaterial = pMaterial->finalize(pAction->getRenderProperties(),
                                        pAction->getWindow          ());

        if(pMaterial != NULL) 
        {
            ChunkMaterial *pChunkMaterial = 
                dynamic_cast<ChunkMaterial*>(pMaterial);

            if(pChunkMaterial != NULL) 
            {
                ChunkBlockUnrecPtr pBlock = this->finalize(0x0000);

                if(pBlock != NULL)
                    pBlock->clearChunks();
            }

            return Inherited::renderLeave(action);
        } 
        else 
        {
            pAction->overrideMaterial(NULL, pAction->getActNode());
        }
    }

    return Group::renderLeave(action);
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:33,代码来源:OSGMaterialChunkOverrideGroup.cpp

示例3: display

// redraw the window
void display(void)
{
    WindowPtr win = mgr->getWindow();
    
    //mgr->redraw();
    win->activate();
    win->frameInit();
    
    //RenderAction *rAct = (RenderAction*)mgr->getAction();
    
    if (multipass)
    {
        RenderAction *rAct = RenderAction::create();
        
        fbo_vp->setParent(win);
        
        rAct->setWindow(get_pointer(win));
        
        fbo_vp->render(rAct);
        
        fbo_vp->setParent(NullFC);
        
        delete rAct;
        
        //multipass = false;
    }

    win->getPort(0)->render(dynamic_cast<RenderAction *>(mgr->getAction()));
    //win->renderAllViewports(rAct);

    win->swap();
    win->frameExit();
    win->deactivate();
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:35,代码来源:testFboVP.cpp

示例4: FDEBUG_GV

ActionBase::ResultE TestMultiPartitionStage::renderLeave(Action *action)
{
#ifdef OSG_DUMP_TRAVERSAL
    FDEBUG_GV(("Leave TestMultiPartStage %p\n", &(*pCore)));
#endif

    RenderAction      *a      = 
        dynamic_cast<RenderAction *>(action);

#ifdef OSG_DEBUGX
    if(this != NULL && this->getMessage().size() != 0)
    {
        fprintf(stderr, "StartLeave MPTS %s\n",
                this->getMessage().c_str());
    }
#endif

    /*StageValidator::ValidationStatus eStatus = */ this->validateOnLeave(a);

#ifdef OSG_DEBUGX
    a->dumpPartitionList();
#endif
    
    return ActionBase::Continue;
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:25,代码来源:OSGTestMultiPartitionStage.cpp

示例5: renderActionEnterHandler

Action::ResultE MaterialDrawable::renderActionEnterHandler(Action *action)
{
    RenderAction  *a = dynamic_cast<RenderAction *>(action);

    Material      *m         = a->getMaterial();
    PrimeMaterial *pPrimeMat = NULL;

    if(m == NULL)
    {
        if(this->getMaterial() != NULL)
        {
            pPrimeMat =
                this->getMaterial()->finalize(a->getRenderProperties(),
                                              a->getWindow()          );
        }
    }
    else
    {
        pPrimeMat = m->finalize(a->getRenderProperties(),
                                a->getWindow          ());
    }

    if(pPrimeMat == NULL)
    {
        pPrimeMat = getDefaultMaterial();

        FNOTICE(("MaterialDrawable::render: no Material!?!\n"));
    }

    UInt32 uiNPasses = pPrimeMat->getNPasses();

    for(UInt32 uiPass = 0; uiPass < uiNPasses; ++uiPass)
    {
        State *st = pPrimeMat->getState(uiPass);

        if(st != NULL)
        {
            a->dropFunctor(_drawFunc,
                           st,
                           pPrimeMat->getSortKey() + uiPass);
        }
        else
        {
            FINFO(("%s: Material %p has NULL state for pass %d\n",
                   OSG_FUNCNAME_MACRO, pPrimeMat, uiPass));
        }
    }

    if(a->pushVisibility())
    {
        if(a->selectVisibles() == 0)
        {
            a->popVisibility();
            return Action::Skip;
        }
    }

    return Action::Continue;
}
开发者ID:vrsource,项目名称:OpenSGDevMaster,代码行数:59,代码来源:OSGMaterialDrawable.cpp

示例6: renderActionLeaveHandler

Action::ResultE MaterialDrawable::renderActionLeaveHandler(Action *action)
{
    RenderAction *a = dynamic_cast<RenderAction *>(action);

    a->popVisibility();

    return Action::Continue;
}
开发者ID:vrsource,项目名称:OpenSGDevMaster,代码行数:8,代码来源:OSGMaterialDrawable.cpp

示例7: renderLeave

Action::ResultE ScreenGroup::renderLeave(Action *action)
{
    RenderAction *pAction = dynamic_cast<RenderAction *>(action);

    pAction->popMatrix();

    return Action::Continue;
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:8,代码来源:OSGScreenGroup.cpp

示例8: renderLeave

Action::ResultE Group::renderLeave(Action *action)
{
    RenderAction *ra = dynamic_cast<RenderAction *>(action);

    ra->popVisibility();
    
    return Action::Continue;
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:8,代码来源:OSGGroup.cpp

示例9: renderLeave

Action::ResultE IconLabel::renderLeave(Action *action)
{
    RenderAction *pAction =
        dynamic_cast<RenderAction *>(action);

    pAction->popVisibility();

    return Action::Continue;
}
开发者ID:vossg,项目名称:OSGAddOnsGV,代码行数:9,代码来源:OSGIconLabel.cpp

示例10: renderEnter

Action::ResultE TextLabel::renderEnter(Action *action)
{
    RenderAction *pAction = 
        dynamic_cast<RenderAction *>(action);

    pAction->pushVisibility();

    return Action::Continue;
}
开发者ID:chengzg,项目名称:OSGAddOnsGV,代码行数:9,代码来源:OSGTextLabel.cpp

示例11: renderEnter

Action::ResultE StackedTransform::renderEnter(Action *action)
{
    RenderAction *pAction = dynamic_cast<RenderAction *>(action);

    pAction->pushVisibility();

    pAction->pushMatrix(this->_mTransformation);

    return Action::Continue;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:10,代码来源:OSGStackedTransform.cpp

示例12: renderLeave

Action::ResultE StackedTransform::renderLeave(Action *action)
{
    RenderAction *pAction = dynamic_cast<RenderAction *>(action);

    pAction->popVisibility();

    pAction->popMatrix();

    return Action::Continue;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:10,代码来源:OSGStackedTransform.cpp

示例13: renderEnter

ActionBase::ResultE MaterialChunkOverrideGroup::renderEnter(Action *action)
{
    RenderAction *pAction   = dynamic_cast<RenderAction *>(action);
    Material     *pMaterial = this->getMaterial();

    if(pAction != NULL && pMaterial != NULL)
    {
        pMaterial = pMaterial->finalize(pAction->getRenderProperties(),
                                        pAction->getWindow          ());

        if(pMaterial) 
        {
            ChunkMaterial *pChunkMaterial = 
                dynamic_cast<ChunkMaterial*>(pMaterial);

            if(pChunkMaterial != NULL) 
            {
                const MFUnrecStateChunkPtr *chunks = 
                    pChunkMaterial->getMFChunks();

                const MFInt32              *slots  = 
                    pChunkMaterial->getMFSlots();

                for(unsigned int i = 0; i < chunks->size(); ++i) 
                {
                    int slot = i < slots->size() ? 
                        (*slots)[i] : 
                        State::AutoSlotReplace;
                    
                    StateChunk *chunk = (*chunks)[i];
                    
                    if(chunk != NULL)
                        this->addChunk(chunk, slot);
                }

                return Inherited::renderEnter(action);
            } 
            else 
            {
                Action::ResultE r = Group::renderEnter(action);

                // ok all children are culled away so we leave
                // immediately and don't set the material!
                if(r == Action::Skip)
                    return r;

                pAction->overrideMaterial(pMaterial, pAction->getActNode());

                return r;
            }
        }
    }

    return Group::renderEnter(action);
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:55,代码来源:OSGMaterialChunkOverrideGroup.cpp

示例14: renderLeave

ActionBase::ResultE Joint::renderLeave(Action *action)
{
    RenderAction *pAction = 
        dynamic_cast<RenderAction *>(action);

    pAction->popVisibility();

    pAction->popMatrix();

    return ActionBase::Continue;
}
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:11,代码来源:OSGJoint.cpp

示例15: drop

    static void drop(DrawActionBase *action, const BoxVolume     &volume, Color3f col)
#endif
    {
        VolumeDrawWrapper * vdw = new VolumeDrawWrapper(volume, col);

        Material::DrawFunctor func;
        func = osgTypedMethodFunctor1ObjPtr(vdw, &VolumeDrawWrapper::draw);
    
        RenderAction *ra = dynamic_cast<RenderAction*>(action);
        
        ra->dropFunctor(func, getCPtr(getDefaultUnlitMaterial()));
    }
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:12,代码来源:OSGVolumeDraw.cpp


注:本文中的RenderAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。