• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OSG_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OSG_ASSERT

void RenderActionTask::waitForBarrier(void)
{
    OSG_ASSERT(_uiTypeTask == HandleGLFinish);
    OSG_ASSERT(_pBarrier   != NULL          );

    _pBarrier->enter();
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGRenderActionTask.cpp


示例2: getSkin

Action::ResultE
CPUSkinningAlgorithm::renderEnter(Action *action)
{
    Action::ResultE  res     = Action::Continue;
    SkinnedGeometry *skinGeo = getSkin    ();
    Skeleton        *skel    = getSkeleton();
    RenderAction    *ract    =
        boost::polymorphic_downcast<RenderAction *>(action); 

    OSG_ASSERT(skinGeo != NULL);
    OSG_ASSERT(skel    != NULL);

    CPUSkinningDataAttachmentUnrecPtr data = getCPUSkinningData(skinGeo);

    if(data == NULL)
    {
        data = CPUSkinningDataAttachment::create();
        skinGeo->addAttachment(data);
    }

    skel->renderEnter(action, skinGeo);

    if(data->getDataValid() == false)
    {
        transformGeometry(skinGeo, skel, data);

        data->setDataValid(true);
    }

    renderGeometry(ract, skinGeo, data);

    return res;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:33,代码来源:OSGCPUSkinningAlgorithm.cpp


示例3: OSG_ASSERT

void CallbackDrawTask::execute(HardwareContext *pContext, DrawEnv *pEnv)
{
    Window *pWindow = pEnv->getWindow();

    OSG_ASSERT( pWindow != NULL);
    OSG_ASSERT(_fCallback      );

    switch(_uiTypeTask)
    {
        case Callback:
        {
            Inherited::setupContext(pWindow);

            _fCallback(pContext, pEnv);

            Inherited::finalizeContext(pWindow);
            
            if(_bBarrierActive == true)
                _pBarrier->enter();
        }
        break;

        default:
            break;
    }
}
开发者ID:Langkamp,项目名称:OpenSGDevMaster_Toolbox,代码行数:26,代码来源:OSGWindowDrawTask.cpp


示例4: OSG_ASSERT

void ShaderExecutableChunk::updateVariables(DrawEnv *pEnv,
                                            UInt32   uiProgram)
{
    if(uiProgram == 0)
        return;

    const ShaderProgramVariables::MFVariablesType       *pMFVars   = NULL;
          ShaderProgramVariables::MFVariableChangedType *pMFVarChg = NULL;

    if(_sfVariables.getValue() != NULL)
    {
        pMFVars   = _sfVariables.getValue()->getMFVariables       ();
        pMFVarChg = _sfVariables.getValue()->editMFVariableChanged();
    }

    if(pMFVars == NULL || pMFVars->size() == 0 || pMFVarChg == NULL)
    {
        return;
    }

    OSG_ASSERT(pMFVars->size() == pMFVarChg->size());

    MFInt32 &vVarLocations = *this->editMFVariableLocations();

    OSG_ASSERT(pMFVars->size() == vVarLocations.size());

    MFInt32::iterator mLocIt = vVarLocations.begin();

    ShaderProgramVariables::MFVariablesType::const_iterator mVarIt  =
        pMFVars->begin();
    ShaderProgramVariables::MFVariablesType::const_iterator mVarEnd =
        pMFVars->end  ();

    ShaderProgramVariables::MFVariableChangedType::iterator mVarChgIt =
        pMFVarChg->begin();

    bool warnUnknown = true;

    for(; mVarIt != mVarEnd; ++mVarIt, ++mLocIt, ++mVarChgIt)
    {
        ShaderVariable *pVar = *mVarIt;

        if(pVar == NULL)
            continue;

        if(*mVarChgIt == false)
            continue;

        *mVarChgIt = false;

        osgUniformShaderVariableSwitch(pEnv,    pVar,
                                       *mLocIt, uiProgram, warnUnknown);
    }
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:54,代码来源:OSGShaderExecutableChunk.cpp


示例5: OSG_ASSERT

OSG_BEGIN_NAMESPACE

ColladaInstInfoTransitPtr
ColladaGeometry::ColladaGeometryInstInfo::create(
    ColladaNode *colInstParent, ColladaInstanceGeometry *colInst,
    Node        *parentN                                         )
{
    OSG_ASSERT(colInstParent != NULL);
    OSG_ASSERT(colInst       != NULL);

    return ColladaInstInfoTransitPtr(
        new ColladaGeometryInstInfo(colInstParent, colInst, parentN));
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:13,代码来源:OSGColladaGeometry.cpp


示例6: VALGRIND_CHECK_VALUE_IS_DEFINED

void ContainerChangeEntry::commitChanges(UInt32 AdditionalChangeOrigin)
{
#ifdef OSG_ENABLE_VALGRIND_CHECKS
    VALGRIND_CHECK_VALUE_IS_DEFINED(uiContainerId);
#endif
    FieldContainer *pTmp =
        FieldContainerFactory::the()->getContainer(uiContainerId);

    if(pTmp != NULL)
    {
#ifndef SILENT
        fprintf(stderr, "Commit for %u %s\n",
                uiContainerId, pTmp->getType().getCName());
#endif
        
        BitVector tmpChanges;
        //OSG_ASSERT(NULL !=  bvUncommittedChanges);

        if (NULL != bvUncommittedChanges)
        { 
#ifdef OSG_ENABLE_MEMORY_DEBUGGING
           OSG_ASSERT(*bvUncommittedChanges != 0xDEADBEEF);
#endif
           tmpChanges             = *bvUncommittedChanges; 
           whichField            |= *bvUncommittedChanges;
           *bvUncommittedChanges  = TypeTraits<BitVector>::BitsClear;

           pTmp->changed      (tmpChanges, ChangedOrigin::Commit | AdditionalChangeOrigin, 0);
        }
    }
}
开发者ID:pjcamp,项目名称:OpenSGDevMaster_Toolbox,代码行数:31,代码来源:OSGChangeList.cpp


示例7: eventHandler

static pascal OSStatus eventHandler(EventHandlerCallRef  nextHandler, 
                                    EventRef             event, 
                                    void                *userData   )
{
    ::UInt32 eventClass = GetEventClass(event);

    CSMNativeWindow *pWin = reinterpret_cast<CSMNativeWindow *>(userData);

    OSG_ASSERT(pWin != NULL);

    switch (eventClass)
    {
        // Mouse events
        case kEventClassMouse:
            return pWin->handleMouseEvent(nextHandler, event);
            
            // Key press events
        case kEventClassTextInput:
            return pWin->handleKeyEvent(nextHandler, event);
            
            // Window events
        case kEventClassWindow:
            return pWin->handleWindowEvent(nextHandler, event);
            
        default:
            return eventNotHandledErr;
    }
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:28,代码来源:OSGCSMNativeWindow.cpp


示例8: OSG_ASSERT

void RenderAction::readdPartitionByIndex(UInt32 uiPartIdx)
{
    OSG_ASSERT(uiPartIdx < _vRenderPartitions[_currentBuffer].size());

    _vRenderPartitions[_currentBuffer].push_back(
        _vRenderPartitions[_currentBuffer][uiPartIdx]);
}
开发者ID:DirkReiners,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGRenderAction.cpp


示例9: OSG_ASSERT

void
ColladaNode::NodeLoaderState::popNodePath(void)
{
    OSG_ASSERT(_nodePath.empty() == false);

    _nodePath.pop_back();
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGColladaNode.cpp


示例10: OSG_COLLADA_LOG

void
ColladaLight::createAmbientLight(ColladaLightAmbientInstInfo *colInstInfo)
{
    OSG_COLLADA_LOG(("ColladaLight::createAmbientLight\n"));

    LightLoaderState *state =
        getGlobal()->getLoaderStateAs<LightLoaderState>(_loaderStateName);
    OSG_ASSERT(state != NULL);

    ChunkOverrideGroupUnrecPtr coGroup  = ChunkOverrideGroup::create();
    NodeUnrecPtr               coGroupN = makeNodeFor(coGroup);

    coGroup->addChunk(state->getLightModelChunk());

    Node *rootN = getGlobal()->getRoot();

    while(rootN->getNChildren() > 0)
    {
        coGroupN->addChild(rootN->getChild(0));
    }

    if(getGlobal()->getOptions()->getCreateNameAttachments() == true)
    {
        setName(coGroupN, "OpenSG_AmbientLight");
    }

    rootN->addChild(coGroupN);
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:28,代码来源:OSGColladaLight.cpp


示例11: OSG_ASSERT

void SoundEmitter::update(EventDetails* const details)
{
    OSG_ASSERT(getParents().size() == 1 && "A Sound Emitter NodeCore MUST have 1 and only 1 parent.");

    Matrix wm;
    dynamic_cast<Node*>(_mfParents[0])->getToWorld(wm);
    Pnt3f Position(0, 0, 0);
    wm.mult(Pnt3f(0.0f,0.0f,0.0f),Position);

    if(getSound() != NULL)
    {
        //Remove all invalid
        for(std::set<UInt32>::iterator Itor(_EmittedSoundChannels.begin()) ; Itor != _EmittedSoundChannels.end() ;)
        {
            if(!getSound()->isValid(*Itor))
            {
                std::set<UInt32>::iterator EraseItor(Itor);
                ++Itor;
                _EmittedSoundChannels.erase(EraseItor);
            }
            else
            {

                //getSound()->setChannelVelocity(_PreviousPosition - Position * (1.0f/dynamic_cast<UpdateEventDetails* const>(details)->getElapsedTime()), *Itor);
                

                getSound()->setChannelPosition(Position, *Itor);
                ++Itor;
            }
        }
    }

    _PreviousPosition = Position;
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:34,代码来源:OSGSoundEmitter.cpp


示例12: OSG_ASSERT

//----------------------------------------------------------------------
// Returns information about a glyph.
// Author: pdaehne
//----------------------------------------------------------------------
const TextVectorGlyph &TextVectorFace::getVectorGlyph(TextGlyph::Index glyphIndex)
{
    if (glyphIndex == TextGlyph::INVALID_INDEX)
        return _emptyGlyph;

    // Try to find the glyph in the map of glyphs
    GlyphMap::const_iterator it = _glyphMap.find(glyphIndex);
    if (it != _glyphMap.end())
    {
        OSG_ASSERT(it->second != 0);
        return *(it->second);
    }

    // We did not find the glyph, so we have to create it
    auto_ptr<TextVectorGlyph> glyph = createGlyph(glyphIndex);

    // We could not create the glyph, return 0
    if (glyph.get() == 0)
        return _emptyGlyph;

    // Put the glyph into the glyph cache
    _glyphMap.insert(GlyphMap::value_type(glyphIndex, glyph.get()));

    // Return the glyph
    return *(glyph.release());
}
开发者ID:vrsource,项目名称:OpenSGDevMaster,代码行数:30,代码来源:OSGTextVectorFace.cpp


示例13: fprintf

template<ChangeList::CommitFunction func> inline
void ChangeList::doCommitChanges(UInt32 AdditionalChangeOrigin)
{
    if(_workStore.empty() == false)
    {
        fprintf(stderr, "warning non empty workstore found\n");
        return;
    }


    const unsigned loop_detection_limit(25);
    unsigned loop_count(0);
    bool  detected_loop(false);
    
    _workStore.clear();

#if 0
    std::cerr << "----------- DETECTED LOOP START -------------" << std::endl;
    dump();
#endif

    while((_uncommitedChanges.empty() == false) && !detected_loop)
    {
        _workStore.swap(_uncommitedChanges);
        _uncommitedChanges.clear();

        ChangedStore::iterator       changesIt  = _workStore.begin();
        ChangedStore::const_iterator changesEnd = _workStore.end  ();

#if 0
        std::cerr << "--------- DETECTED LOOP1 START ----------" << std::endl;
        dump();
#endif

        while(changesIt != changesEnd )
        {
            OSG_ASSERT(NULL != (*changesIt));
            
            if((*changesIt)->uiEntryDesc == ContainerChangeEntry::Change)
            {
                ((*changesIt)->*func)(AdditionalChangeOrigin);
            }
            
            ++changesIt;
        }

#if 0
        std::cerr << "-------- DETECTED LOOP2 START ----------" << std::endl;
        dump();
#endif

        _workStore.clear();
        if(loop_count++ > loop_detection_limit)
        {
           detected_loop = true;
           std::cerr << "----------- DETECTED LOOP ------------" << std::endl;
           dump();
        }        
    }
}
开发者ID:pjcamp,项目名称:OpenSGDevMaster_Toolbox,代码行数:60,代码来源:OSGChangeList.cpp


示例14: OSG_ASSERT

void OcclusionCullingTreeBuilder::add(RenderActionBase    *pAction,
                                      RenderPartitionBase *pPart,
                                      DrawFunctor         &drawFunc,
                                      State               *pState,
                                      StateOverride       *pStateOverride)
{
    OSG_ASSERT((_ract == NULL) || (_ract == pAction));

    _ract = dynamic_cast<RenderAction *>(pAction);

    OSG_ASSERT(_ract != NULL);

    OCRenderTreeNode *pNode = createNode(pAction, pPart, drawFunc,
                                         pState,  pStateOverride);

    addNode(pNode);
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:17,代码来源:OSGOcclusionCullingTreeBuilder.cpp


示例15: editMField

void ShaderProgram::addParent(FieldContainer * const pParent,
                              UInt16                 uiParentFieldId)
{
    editMField(ParentsFieldMask, _mfParents);
    
    OSG_ASSERT(pParent != NULL);

    _mfParents.push_back(pParent, uiParentFieldId);
}
开发者ID:vrsource,项目名称:OpenSGDevMaster,代码行数:9,代码来源:OSGShaderProgram.cpp


示例16: OSG_ASSERT

Action::ResultE IntersectAction::onLeaveNode(Node* node, Action* action)
{
    OSG_ASSERT(this == action && node == _actNode);

    ResultE result = Continue;

    _path.pop_back();

    return result;
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:10,代码来源:OSGIntersectAction.cpp


示例17: OSG_ASSERT

void FieldDescriptionBase::shareValuesV(
     const Field         *pSrc,
     const UInt32         fieldId,
           FCPtrConstArg  pDst,
     const TypePtrVector &cloneTypes,
     const TypePtrVector &ignoreTypes,
     const TypeIdVector  &cloneGroupIds,
     const TypeIdVector  &ignoreGroupIds) const
{
   OSG_ASSERT(false && "Must define shareValuesV");
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:11,代码来源:OSGFieldDescriptionBase.cpp


示例18: defined

void ClipPlaneChunk::deactivate(DrawEnv *, UInt32 idx)
{
#if !defined(OSG_OGL_COREONLY) || defined(OSG_CHECK_COREONLY)
    if(getEnable() == true)
    {
        glDisable( GL_CLIP_PLANE0 + idx);
    }
#else
    OSG_ASSERT(false);
#endif
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:11,代码来源:OSGClipPlaneChunk.cpp


示例19: switch

/*------------------------- event producers ----------------------------------*/
void DialogWindowBase::produceEvent(UInt32 eventId, EventDetails* const e)
{
    switch(eventId)
    {
    case DialogWindowClosingEventId:
        OSG_ASSERT(dynamic_cast<DialogWindowClosingEventDetailsType* const>(e));

        _DialogWindowClosingEvent.set_combiner(ConsumableEventCombiner(e));
        _DialogWindowClosingEvent(dynamic_cast<DialogWindowClosingEventDetailsType* const>(e), DialogWindowClosingEventId);
        break;
    case DialogWindowClosedEventId:
        OSG_ASSERT(dynamic_cast<DialogWindowClosedEventDetailsType* const>(e));

        _DialogWindowClosedEvent.set_combiner(ConsumableEventCombiner(e));
        _DialogWindowClosedEvent(dynamic_cast<DialogWindowClosedEventDetailsType* const>(e), DialogWindowClosedEventId);
        break;
    default:
        Inherited::produceEvent(eventId, e);
        break;
    }
}
开发者ID:ahuballah,项目名称:OpenSGToolbox,代码行数:22,代码来源:OSGDialogWindowBase.cpp


示例20: getParentTileOffset

Vec2i getParentTileOffset(Int32 iTileSize, Int32 iChildIndex)
{
    OSG_ASSERT(0 <= iChildIndex && iChildIndex < 4);
    
    const Int32 iHalfTileSize = iTileSize / 2;
    
    const Int32 iParentOffsetX[4] = { 0, iHalfTileSize, 0, iHalfTileSize };
    const Int32 iParentOffsetY[4] = { 0, 0, iHalfTileSize, iHalfTileSize };
    
    return Vec2i(iParentOffsetX[iChildIndex], 
                 iParentOffsetY[iChildIndex]);
}
开发者ID:chengzg,项目名称:OSGAddOnsGV,代码行数:12,代码来源:OSGBbqNode.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OSIP_TRACE函数代码示例发布时间:2022-05-30
下一篇:
C++ OSFreeMem函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap