本文整理汇总了C++中OSG_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ OSG_ASSERT函数的具体用法?C++ OSG_ASSERT怎么用?C++ OSG_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OSG_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OSG_ASSERT
void RenderActionTask::waitForBarrier(void)
{
OSG_ASSERT(_uiTypeTask == HandleGLFinish);
OSG_ASSERT(_pBarrier != NULL );
_pBarrier->enter();
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
}
示例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;
}
}
示例8: OSG_ASSERT
void RenderAction::readdPartitionByIndex(UInt32 uiPartIdx)
{
OSG_ASSERT(uiPartIdx < _vRenderPartitions[_currentBuffer].size());
_vRenderPartitions[_currentBuffer].push_back(
_vRenderPartitions[_currentBuffer][uiPartIdx]);
}
示例9: OSG_ASSERT
void
ColladaNode::NodeLoaderState::popNodePath(void)
{
OSG_ASSERT(_nodePath.empty() == false);
_nodePath.pop_back();
}
示例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);
}
示例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;
}
示例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());
}
示例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();
}
}
}
示例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);
}
示例15: editMField
void ShaderProgram::addParent(FieldContainer * const pParent,
UInt16 uiParentFieldId)
{
editMField(ParentsFieldMask, _mfParents);
OSG_ASSERT(pParent != NULL);
_mfParents.push_back(pParent, uiParentFieldId);
}